mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Summoner API
This commit is contained in:
committed by
granny
parent
305d99234b
commit
f80ccb5b1e
@@ -1069,12 +1069,12 @@ index ddc252c76cedec0a0e9e268d8a874015a5ad52fe..8b0a813f9dd001c6dd108ba7aac04d13
|
||||
}
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/animal/IronGolem.java b/net/minecraft/world/entity/animal/IronGolem.java
|
||||
index ab3a3a2488628e18f71e30eab1639e9a08f63986..37b84f98e269bd28a67636929b200ee709804734 100644
|
||||
index 46921562c9c5caf7e04ee180325a638273d6bad2..223c4796f659a24062a719045e484a22d31ab2f0 100644
|
||||
--- a/net/minecraft/world/entity/animal/IronGolem.java
|
||||
+++ b/net/minecraft/world/entity/animal/IronGolem.java
|
||||
@@ -61,9 +61,28 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
|
||||
super(entityType, level);
|
||||
@@ -73,9 +73,28 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
|
||||
}
|
||||
// Purpur end - Summoner API
|
||||
|
||||
+ // Purpur start - Ridables
|
||||
+ @Override
|
||||
@@ -1101,7 +1101,7 @@ index ab3a3a2488628e18f71e30eab1639e9a08f63986..37b84f98e269bd28a67636929b200ee7
|
||||
this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.0, true));
|
||||
this.goalSelector.addGoal(2, new MoveTowardsTargetGoal(this, 0.9, 32.0F));
|
||||
this.goalSelector.addGoal(2, new MoveBackToVillageGoal(this, 0.6, false));
|
||||
@@ -71,6 +90,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
|
||||
@@ -83,6 +102,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
|
||||
this.goalSelector.addGoal(5, new OfferFlowerGoal(this));
|
||||
this.goalSelector.addGoal(7, new LookAtPlayerGoal(this, Player.class, 6.0F));
|
||||
this.goalSelector.addGoal(8, new RandomLookAroundGoal(this));
|
||||
@@ -1109,7 +1109,7 @@ index ab3a3a2488628e18f71e30eab1639e9a08f63986..37b84f98e269bd28a67636929b200ee7
|
||||
this.targetSelector.addGoal(1, new DefendVillageTargetGoal(this));
|
||||
this.targetSelector.addGoal(2, new HurtByTargetGoal(this));
|
||||
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt));
|
||||
@@ -257,12 +277,12 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
|
||||
@@ -271,12 +291,12 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
|
||||
protected InteractionResult mobInteract(Player player, InteractionHand hand) {
|
||||
ItemStack itemInHand = player.getItemInHand(hand);
|
||||
if (!itemInHand.is(Items.IRON_INGOT)) {
|
||||
@@ -1701,12 +1701,12 @@ index e686c500e4b5f3e7b0e808af8b2e43ddbd163bef..c27bb9e8a4a5e8fdc8ae28dae8203859
|
||||
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
|
||||
this.goalSelector.addGoal(3, new TemptGoal(this, 1.1, stack -> stack.is(ItemTags.SHEEP_FOOD), false));
|
||||
diff --git a/net/minecraft/world/entity/animal/SnowGolem.java b/net/minecraft/world/entity/animal/SnowGolem.java
|
||||
index 9130b51db39abc7781fecac8c881877e048e1c5f..17b41cfd9080cbb4def219cd91276e5a6d2a02a6 100644
|
||||
index 29427515b648b84248f486c156c5cd7a0995ba14..52de92b118b613217b8f92ff672c01ddf798a1fc 100644
|
||||
--- a/net/minecraft/world/entity/animal/SnowGolem.java
|
||||
+++ b/net/minecraft/world/entity/animal/SnowGolem.java
|
||||
@@ -49,12 +49,31 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
|
||||
super(entityType, level);
|
||||
@@ -61,12 +61,31 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
|
||||
}
|
||||
// Purpur end - Summoner API
|
||||
|
||||
+ // Purpur start - Ridables
|
||||
+ @Override
|
||||
@@ -1736,7 +1736,7 @@ index 9130b51db39abc7781fecac8c881877e048e1c5f..17b41cfd9080cbb4def219cd91276e5a
|
||||
this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Mob.class, 10, true, false, (entity, level) -> entity instanceof Enemy));
|
||||
}
|
||||
|
||||
@@ -99,6 +118,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
|
||||
@@ -113,6 +132,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1744,7 +1744,7 @@ index 9130b51db39abc7781fecac8c881877e048e1c5f..17b41cfd9080cbb4def219cd91276e5a
|
||||
BlockState blockState = Blocks.SNOW.defaultBlockState();
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
@@ -141,7 +161,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
|
||||
@@ -155,7 +175,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
|
||||
org.bukkit.event.player.PlayerShearEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemInHand, hand, drops);
|
||||
if (event != null) {
|
||||
if (event.isCancelled()) {
|
||||
@@ -1753,7 +1753,7 @@ index 9130b51db39abc7781fecac8c881877e048e1c5f..17b41cfd9080cbb4def219cd91276e5a
|
||||
}
|
||||
drops = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getDrops());
|
||||
// Paper end - custom shear drops
|
||||
@@ -162,7 +182,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
|
||||
@@ -176,7 +196,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
|
||||
return InteractionResult.SUCCESS;
|
||||
// Purpur end - Snowman drop and put back pumpkin
|
||||
} else {
|
||||
@@ -2797,7 +2797,7 @@ index f7e6866404af629ae0b20425202f592d76df4f3d..bc9564ee22ff9d7f6d819da9601c2d81
|
||||
this.dragonFight.updateDragon(this);
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/boss/wither/WitherBoss.java b/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
index 0ccbcd8b576b082260b17b85291a81e905e6f46f..591dbbbd1da84b0190f010b22d5163bb41cdd3c7 100644
|
||||
index 79b1f6ed312b2c4c1ec708271c38bc59f0ae0e0e..c78132da8cb476e81beac68f7c0ac4ccd27a5db0 100644
|
||||
--- a/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
+++ b/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
@@ -69,6 +69,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
|
||||
@@ -2808,10 +2808,10 @@ index 0ccbcd8b576b082260b17b85291a81e905e6f46f..591dbbbd1da84b0190f010b22d5163bb
|
||||
private boolean canPortal = false; // Paper
|
||||
public final ServerBossEvent bossEvent = (ServerBossEvent)new ServerBossEvent(
|
||||
this.getDisplayName(), BossEvent.BossBarColor.PURPLE, BossEvent.BossBarOverlay.PROGRESS
|
||||
@@ -77,9 +78,23 @@ public class WitherBoss extends Monster implements RangedAttackMob {
|
||||
private static final TargetingConditions.Selector LIVING_ENTITY_SELECTOR = (entity, level) -> !entity.getType().is(EntityTypeTags.WITHER_FRIENDS)
|
||||
@@ -78,9 +79,23 @@ public class WitherBoss extends Monster implements RangedAttackMob {
|
||||
&& entity.attackable();
|
||||
private static final TargetingConditions TARGETING_CONDITIONS = TargetingConditions.forCombat().range(20.0).selector(LIVING_ENTITY_SELECTOR);
|
||||
@Nullable private java.util.UUID summoner; // Purpur - Summoner API
|
||||
+ private org.purpurmc.purpur.controller.FlyingWithSpacebarMoveControllerWASD purpurController; // Purpur - Ridables
|
||||
|
||||
public WitherBoss(EntityType<? extends WitherBoss> entityType, Level level) {
|
||||
@@ -2832,9 +2832,9 @@ index 0ccbcd8b576b082260b17b85291a81e905e6f46f..591dbbbd1da84b0190f010b22d5163bb
|
||||
this.moveControl = new FlyingMoveControl(this, 10, false);
|
||||
this.setHealth(this.getMaxHealth());
|
||||
this.xpReward = 50;
|
||||
@@ -93,13 +108,114 @@ public class WitherBoss extends Monster implements RangedAttackMob {
|
||||
return flyingPathNavigation;
|
||||
@@ -97,6 +112,105 @@ public class WitherBoss extends Monster implements RangedAttackMob {
|
||||
}
|
||||
// Purpur end - Summoner API
|
||||
|
||||
+ // Purpur start - Ridables
|
||||
+ @Override
|
||||
@@ -2935,6 +2935,11 @@ index 0ccbcd8b576b082260b17b85291a81e905e6f46f..591dbbbd1da84b0190f010b22d5163bb
|
||||
+ }
|
||||
+ // Purpur end - Ridables
|
||||
+
|
||||
@Override
|
||||
protected PathNavigation createNavigation(Level level) {
|
||||
FlyingPathNavigation flyingPathNavigation = new FlyingPathNavigation(this, level);
|
||||
@@ -107,11 +221,13 @@ public class WitherBoss extends Monster implements RangedAttackMob {
|
||||
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables
|
||||
@@ -2947,7 +2952,7 @@ index 0ccbcd8b576b082260b17b85291a81e905e6f46f..591dbbbd1da84b0190f010b22d5163bb
|
||||
this.targetSelector.addGoal(1, new HurtByTargetGoal(this));
|
||||
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, LivingEntity.class, 0, false, false, LIVING_ENTITY_SELECTOR));
|
||||
}
|
||||
@@ -257,6 +373,15 @@ public class WitherBoss extends Monster implements RangedAttackMob {
|
||||
@@ -271,6 +387,15 @@ public class WitherBoss extends Monster implements RangedAttackMob {
|
||||
|
||||
@Override
|
||||
protected void customServerAiStep(ServerLevel level) {
|
||||
@@ -2963,7 +2968,7 @@ index 0ccbcd8b576b082260b17b85291a81e905e6f46f..591dbbbd1da84b0190f010b22d5163bb
|
||||
if (this.getInvulnerableTicks() > 0) {
|
||||
int i = this.getInvulnerableTicks() - 1;
|
||||
this.bossEvent.setProgress(1.0F - i / 220.0F);
|
||||
@@ -563,11 +688,11 @@ public class WitherBoss extends Monster implements RangedAttackMob {
|
||||
@@ -577,11 +702,11 @@ public class WitherBoss extends Monster implements RangedAttackMob {
|
||||
}
|
||||
|
||||
public int getAlternativeTarget(int head) {
|
||||
|
||||
Reference in New Issue
Block a user