Update to Minecraft 1.21

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-06-14 01:05:00 +10:00
parent 7c6204e1a9
commit eed041d629
255 changed files with 3585 additions and 3261 deletions

View File

@@ -1,11 +1,10 @@
--- a/net/minecraft/world/entity/animal/Bucketable.java
+++ b/net/minecraft/world/entity/animal/Bucketable.java
@@ -17,6 +17,15 @@
@@ -17,6 +17,14 @@
import net.minecraft.world.item.component.CustomData;
import net.minecraft.world.level.World;
+// CraftBukkit start
+import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata;
+import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
@@ -16,7 +15,7 @@
public interface Bucketable {
boolean fromBucket();
@@ -93,10 +102,22 @@
@@ -93,10 +101,22 @@
ItemStack itemstack = entityhuman.getItemInHand(enumhand);
if (itemstack.getItem() == Items.WATER_BUCKET && t0.isAlive()) {
@@ -31,7 +30,7 @@
+ itemstack1 = CraftItemStack.asNMSCopy(playerBucketFishEvent.getEntityBucket());
+ if (playerBucketFishEvent.isCancelled()) {
+ ((EntityPlayer) entityhuman).containerMenu.sendAllDataToRemote(); // We need to update inventory to resync client's bucket
+ ((EntityPlayer) entityhuman).connection.send(new PacketPlayOutSpawnEntity(t0)); // We need to play out these packets as the client assumes the fish is gone
+ t0.getBukkitEntity().update((EntityPlayer) entityhuman); // We need to play out these packets as the client assumes the fish is gone
+ t0.refreshEntityData((EntityPlayer) entityhuman); // Need to send data such as the display name to client
+ return Optional.of(EnumInteractionResult.FAIL);
+ }
@@ -40,7 +39,7 @@
ItemStack itemstack2 = ItemLiquidUtil.createFilledResult(itemstack, entityhuman, itemstack1, false);
entityhuman.setItemInHand(enumhand, itemstack2);
@@ -106,7 +127,7 @@
@@ -106,7 +126,7 @@
CriterionTriggers.FILLED_BUCKET.trigger((EntityPlayer) entityhuman, itemstack1);
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityBee.java
+++ b/net/minecraft/world/entity/animal/EntityBee.java
@@ -86,6 +86,12 @@
@@ -87,6 +87,12 @@
import net.minecraft.world.level.pathfinder.PathType;
import net.minecraft.world.phys.Vec3D;
@@ -13,7 +13,7 @@
public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityBird {
public static final float FLAP_DEGREES_PER_TICK = 120.32113F;
@@ -185,12 +191,19 @@
@@ -186,12 +192,19 @@
@Override
public void addAdditionalSaveData(NBTTagCompound nbttagcompound) {
@@ -35,7 +35,7 @@
nbttagcompound.put("flower_pos", GameProfileSerializer.writeBlockPos(this.getSavedFlowerPos()));
}
@@ -204,8 +217,8 @@
@@ -205,8 +218,8 @@
@Override
public void readAdditionalSaveData(NBTTagCompound nbttagcompound) {
@@ -46,16 +46,16 @@
super.readAdditionalSaveData(nbttagcompound);
this.setHasNectar(nbttagcompound.getBoolean("HasNectar"));
this.setHasStung(nbttagcompound.getBoolean("HasStung"));
@@ -232,7 +245,7 @@
@@ -243,7 +256,7 @@
}
if (b0 > 0) {
- ((EntityLiving) entity).addEffect(new MobEffect(MobEffects.POISON, b0 * 20, 0), this);
+ ((EntityLiving) entity).addEffect(new MobEffect(MobEffects.POISON, b0 * 20, 0), this, EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit
- entityliving.addEffect(new MobEffect(MobEffects.POISON, b0 * 20, 0), this);
+ entityliving.addEffect(new MobEffect(MobEffects.POISON, b0 * 20, 0), this, EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit
}
}
@@ -625,11 +638,14 @@
@@ -636,11 +649,14 @@
if (this.isInvulnerableTo(damagesource)) {
return false;
} else {
@@ -72,7 +72,7 @@
}
}
@@ -981,7 +997,7 @@
@@ -992,7 +1008,7 @@
e() {
super();
@@ -81,7 +81,7 @@
this.blacklistedTargets = Lists.newArrayList();
this.setFlags(EnumSet.of(PathfinderGoal.Type.MOVE));
}
@@ -1098,7 +1114,7 @@
@@ -1109,7 +1125,7 @@
f() {
super();
@@ -90,7 +90,7 @@
this.setFlags(EnumSet.of(PathfinderGoal.Type.MOVE));
}
@@ -1198,7 +1214,7 @@
@@ -1209,7 +1225,7 @@
}
}
@@ -99,7 +99,7 @@
EntityBee.this.level().levelEvent(2011, blockposition, 15);
EntityBee.this.level().setBlockAndUpdate(blockposition, iblockdata1);
EntityBee.this.incrementNumCropsGrownSincePollination();
@@ -1271,7 +1287,7 @@
@@ -1282,7 +1298,7 @@
@Override
protected void alertOther(EntityInsentient entityinsentient, EntityLiving entityliving) {
if (entityinsentient instanceof EntityBee && this.mob.hasLineOfSight(entityliving)) {
@@ -108,7 +108,7 @@
}
}
@@ -1280,7 +1296,7 @@
@@ -1291,7 +1307,7 @@
private static class c extends PathfinderGoalNearestAttackableTarget<EntityHuman> {
c(EntityBee entitybee) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityCat.java
+++ b/net/minecraft/world/entity/animal/EntityCat.java
@@ -182,10 +182,10 @@
@@ -181,10 +181,10 @@
@Override
public void readAdditionalSaveData(NBTTagCompound nbttagcompound) {
super.readAdditionalSaveData(nbttagcompound);
@@ -13,7 +13,7 @@
Objects.requireNonNull(iregistry);
optional.flatMap(iregistry::getHolder).ifPresent(this::setVariant);
@@ -462,7 +462,7 @@
@@ -452,7 +452,7 @@
}
private void tryToTame(EntityHuman entityhuman) {
@@ -22,7 +22,7 @@
this.tame(entityhuman);
this.setOrderedToSit(true);
this.level().broadcastEntityEvent(this, (byte) 7);
@@ -480,7 +480,7 @@
@@ -470,7 +470,7 @@
private static class PathfinderGoalTemptChance extends PathfinderGoalTempt {
@Nullable
@@ -31,7 +31,7 @@
private final EntityCat cat;
public PathfinderGoalTemptChance(EntityCat entitycat, double d0, Predicate<ItemStack> predicate, boolean flag) {
@@ -621,7 +621,15 @@
@@ -611,7 +611,15 @@
while (iterator.hasNext()) {
ItemStack itemstack = (ItemStack) iterator.next();
@@ -48,7 +48,7 @@
}
}
@@ -653,10 +661,10 @@
@@ -643,10 +651,10 @@
private final EntityCat cat;
public a(EntityCat entitycat, Class<T> oclass, float f, double d0, double d1) {

View File

@@ -21,7 +21,7 @@
private static final DataWatcherObject<BlockPosition> TREASURE_POS = DataWatcher.defineId(EntityDolphin.class, DataWatcherRegistry.BLOCK_POS);
private static final DataWatcherObject<Boolean> GOT_FISH = DataWatcher.defineId(EntityDolphin.class, DataWatcherRegistry.BOOLEAN);
private static final DataWatcherObject<Integer> MOISTNESS_LEVEL = DataWatcher.defineId(EntityDolphin.class, DataWatcherRegistry.INT);
@@ -183,7 +195,7 @@
@@ -176,7 +188,7 @@
@Override
public int getMaxAirSupply() {
@@ -30,7 +30,7 @@
}
@Override
@@ -219,11 +231,17 @@
@@ -212,11 +224,17 @@
ItemStack itemstack = entityitem.getItem();
if (this.canHoldItem(itemstack)) {
@@ -49,7 +49,7 @@
}
}
@@ -474,7 +492,7 @@
@@ -467,7 +485,7 @@
@Override
public void start() {
@@ -58,7 +58,7 @@
}
@Override
@@ -493,7 +511,7 @@
@@ -486,7 +504,7 @@
}
if (this.player.isSwimming() && this.player.level().random.nextInt(6) == 0) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityIronGolem.java
+++ b/net/minecraft/world/entity/animal/EntityIronGolem.java
@@ -97,7 +97,7 @@
@@ -98,7 +98,7 @@
@Override
protected void doPush(Entity entity) {
if (entity instanceof IMonster && !(entity instanceof EntityCreeper) && this.getRandom().nextInt(20) == 0) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityOcelot.java
+++ b/net/minecraft/world/entity/animal/EntityOcelot.java
@@ -177,7 +177,7 @@
@@ -168,7 +168,7 @@
if ((this.temptGoal == null || this.temptGoal.isRunning()) && !this.isTrusting() && this.isFood(itemstack) && entityhuman.distanceToSqr((Entity) this) < 9.0D) {
this.usePlayerItem(entityhuman, enumhand, itemstack);
if (!this.level().isClientSide) {
@@ -9,7 +9,7 @@
this.setTrusting(true);
this.spawnTrustingParticles(true);
this.level().broadcastEntityEvent(this, (byte) 41);
@@ -308,10 +308,10 @@
@@ -299,10 +299,10 @@
private final EntityOcelot ocelot;
public a(EntityOcelot entityocelot, Class<T> oclass, float f, double d0, double d1) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityPanda.java
+++ b/net/minecraft/world/entity/animal/EntityPanda.java
@@ -72,6 +72,12 @@
@@ -73,6 +73,12 @@
import net.minecraft.world.level.storage.loot.parameters.LootContextParameters;
import net.minecraft.world.phys.Vec3D;
@@ -13,7 +13,7 @@
public class EntityPanda extends EntityAnimal {
private static final DataWatcherObject<Integer> UNHAPPY_COUNTER = DataWatcher.defineId(EntityPanda.class, DataWatcherRegistry.INT);
@@ -553,14 +559,14 @@
@@ -558,14 +564,14 @@
@Override
protected void pickUpItem(EntityItem entityitem) {

View File

@@ -18,7 +18,7 @@
if (entityhuman.isCreative() || !this.isInvulnerable()) {
this.hurt(this.damageSources().playerAttack(entityhuman), Float.MAX_VALUE);
}
@@ -368,7 +368,7 @@
@@ -363,7 +363,7 @@
@Override
public boolean isPushable() {
@@ -27,7 +27,7 @@
}
@Override
@@ -383,11 +383,14 @@
@@ -378,11 +378,14 @@
if (this.isInvulnerableTo(damagesource)) {
return false;
} else {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityRabbit.java
+++ b/net/minecraft/world/entity/animal/EntityRabbit.java
@@ -66,6 +66,10 @@
@@ -67,6 +67,10 @@
import net.minecraft.world.level.pathfinder.PathEntity;
import net.minecraft.world.phys.Vec3D;
@@ -11,7 +11,7 @@
public class EntityRabbit extends EntityAnimal implements VariantHolder<EntityRabbit.Variant> {
public static final double STROLL_SPEED_MOD = 0.6D;
@@ -88,7 +92,6 @@
@@ -91,7 +95,6 @@
super(entitytypes, world);
this.jumpControl = new EntityRabbit.ControllerJumpRabbit(this);
this.moveControl = new EntityRabbit.ControllerMoveRabbit(this);
@@ -19,7 +19,7 @@
}
@Override
@@ -574,9 +577,19 @@
@@ -578,9 +581,19 @@
int i = (Integer) iblockdata.getValue(BlockCarrots.AGE);
if (i == 0) {

View File

@@ -1,21 +1,19 @@
--- a/net/minecraft/world/entity/animal/EntitySheep.java
+++ b/net/minecraft/world/entity/animal/EntitySheep.java
@@ -64,6 +64,14 @@
@@ -63,6 +63,12 @@
import net.minecraft.world.level.storage.loot.LootTable;
import net.minecraft.world.level.storage.loot.LootTables;
+// CraftBukkit start
+import net.minecraft.world.inventory.InventoryCraftResult;
+import net.minecraft.world.item.Item;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.SheepRegrowWoolEvent;
+import org.bukkit.inventory.InventoryView;
+// CraftBukkit end
+
public class EntitySheep extends EntityAnimal implements IShearable {
private static final int EAT_ANIMATION_TICKS = 40;
@@ -251,6 +259,11 @@
@@ -250,6 +256,11 @@
if (itemstack.is(Items.SHEARS)) {
if (!this.level().isClientSide && this.readyForShearing()) {
@@ -27,7 +25,7 @@
this.shear(SoundCategory.PLAYERS);
this.gameEvent(GameEvent.SHEAR, entityhuman);
itemstack.hurtAndBreak(1, entityhuman, getSlotForHand(enumhand));
@@ -270,7 +283,9 @@
@@ -269,7 +280,9 @@
int i = 1 + this.random.nextInt(3);
for (int j = 0; j < i; ++j) {
@@ -37,7 +35,7 @@
if (entityitem != null) {
entityitem.setDeltaMovement(entityitem.getDeltaMovement().add((double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (this.random.nextFloat() * 0.05F), (double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.1F)));
@@ -363,6 +378,12 @@
@@ -362,6 +375,12 @@
@Override
public void ate() {
@@ -50,31 +48,12 @@
super.ate();
this.setSheared(false);
if (this.isBaby()) {
@@ -382,7 +403,7 @@
@@ -381,7 +400,7 @@
EnumColor enumcolor = ((EntitySheep) entityanimal).getColor();
EnumColor enumcolor1 = ((EntitySheep) entityanimal1).getColor();
InventoryCrafting inventorycrafting = makeContainer(enumcolor, enumcolor1);
- Optional optional = this.level().getRecipeManager().getRecipeFor(Recipes.CRAFTING, inventorycrafting, this.level()).map((recipeholder) -> {
+ Optional<Item> optional = this.level().getRecipeManager().getRecipeFor(Recipes.CRAFTING, inventorycrafting, this.level()).map((recipeholder) -> { // CraftBukkit - decompile error
return ((RecipeCrafting) recipeholder.value()).assemble(inventorycrafting, this.level().registryAccess());
CraftingInput craftinginput = makeCraftInput(enumcolor, enumcolor1);
- Optional optional = this.level().getRecipeManager().getRecipeFor(Recipes.CRAFTING, craftinginput, this.level()).map((recipeholder) -> {
+ Optional<Item> optional = this.level().getRecipeManager().getRecipeFor(Recipes.CRAFTING, craftinginput, this.level()).map((recipeholder) -> { // CraftBukkit - decompile error
return ((RecipeCrafting) recipeholder.value()).assemble(craftinginput, this.level().registryAccess());
}).map(ItemStack::getItem);
@@ -405,10 +426,18 @@
public boolean stillValid(EntityHuman entityhuman) {
return false;
}
+
+ // CraftBukkit start
+ @Override
+ public InventoryView getBukkitView() {
+ return null; // TODO: O.O
+ }
+ // CraftBukkit end
}, 2, 1);
transientcraftingcontainer.setItem(0, new ItemStack(ItemDye.byColor(enumcolor)));
transientcraftingcontainer.setItem(1, new ItemStack(ItemDye.byColor(enumcolor1)));
+ transientcraftingcontainer.resultInventory = new InventoryCraftResult(); // CraftBukkit - add result slot for event
return transientcraftingcontainer;
}
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityWolf.java
+++ b/net/minecraft/world/entity/animal/EntityWolf.java
@@ -88,6 +88,12 @@
@@ -90,6 +90,12 @@
import net.minecraft.world.level.pathfinder.PathType;
import net.minecraft.world.phys.Vec3D;
@@ -13,7 +13,7 @@
public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable, VariantHolder<Holder<WolfVariant>> {
private static final DataWatcherObject<Boolean> DATA_INTERESTED_ID = DataWatcher.defineId(EntityWolf.class, DataWatcherRegistry.BOOLEAN);
@@ -350,18 +356,21 @@
@@ -360,11 +366,14 @@
if (this.isInvulnerableTo(damagesource)) {
return false;
} else {
@@ -30,6 +30,9 @@
}
}
@@ -374,9 +383,9 @@
}
@Override
- protected void actuallyHurt(DamageSource damagesource, float f) {
+ public boolean actuallyHurt(DamageSource damagesource, float f) { // CraftBukkit - void -> boolean
@@ -39,7 +42,7 @@
} else {
ItemStack itemstack = this.getBodyArmorItem();
int i = itemstack.getDamageValue();
@@ -380,6 +389,7 @@
@@ -395,6 +404,7 @@
}
}
@@ -47,7 +50,7 @@
}
private boolean canArmorAbsorb(DamageSource damagesource) {
@@ -401,7 +411,7 @@
@@ -405,7 +415,7 @@
protected void applyTamingSideEffects() {
if (this.isTame()) {
this.getAttribute(GenericAttributes.MAX_HEALTH).setBaseValue(40.0D);
@@ -56,7 +59,7 @@
} else {
this.getAttribute(GenericAttributes.MAX_HEALTH).setBaseValue(8.0D);
}
@@ -428,7 +438,7 @@
@@ -432,7 +442,7 @@
FoodInfo foodinfo = (FoodInfo) itemstack.get(DataComponents.FOOD);
float f = foodinfo != null ? (float) foodinfo.nutrition() : 1.0F;
@@ -65,7 +68,7 @@
return EnumInteractionResult.sidedSuccess(this.level().isClientSide());
} else {
if (item instanceof ItemDye) {
@@ -476,7 +486,7 @@
@@ -480,7 +490,7 @@
this.setOrderedToSit(!this.isOrderedToSit());
this.jumping = false;
this.navigation.stop();
@@ -74,7 +77,7 @@
return EnumInteractionResult.SUCCESS_NO_ITEM_USED;
} else {
return enuminteractionresult;
@@ -494,7 +504,8 @@
@@ -498,7 +508,8 @@
}
private void tryToTame(EntityHuman entityhuman) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/allay/Allay.java
+++ b/net/minecraft/world/entity/animal/allay/Allay.java
@@ -99,6 +99,7 @@
@@ -101,6 +101,7 @@
private float dancingAnimationTicks;
private float spinningAnimationTicks;
private float spinningAnimationTicks0;
@@ -8,7 +8,7 @@
public Allay(EntityTypes<? extends Allay> entitytypes, World world) {
super(entitytypes, world);
@@ -110,6 +111,12 @@
@@ -112,6 +113,12 @@
this.dynamicJukeboxListener = new DynamicGameEventListener<>(new Allay.a(this.vibrationUser.getPositionSource(), ((GameEvent) GameEvent.JUKEBOX_PLAY.value()).notificationRadius()));
}
@@ -21,7 +21,7 @@
@Override
protected BehaviorController.b<Allay> brainProvider() {
return BehaviorController.provider(Allay.MEMORY_TYPES, Allay.SENSOR_TYPES);
@@ -122,7 +129,7 @@
@@ -124,7 +131,7 @@
@Override
public BehaviorController<Allay> getBrain() {
@@ -30,7 +30,7 @@
}
public static AttributeProvider.Builder createAttributes() {
@@ -223,7 +230,7 @@
@@ -225,7 +232,7 @@
public void aiStep() {
super.aiStep();
if (!this.level().isClientSide && this.isAlive() && this.tickCount % 10 == 0) {
@@ -39,7 +39,7 @@
}
if (this.isDancing() && this.shouldStopDancing() && this.tickCount % 20 == 0) {
@@ -293,7 +300,12 @@
@@ -295,7 +302,12 @@
ItemStack itemstack1 = this.getItemInHand(EnumHand.MAIN_HAND);
if (this.isDancing() && this.isDuplicationItem(itemstack) && this.canDuplicate()) {
@@ -53,7 +53,7 @@
this.level().broadcastEntityEvent(this, (byte) 18);
this.level().playSound(entityhuman, (Entity) this, SoundEffects.AMETHYST_BLOCK_CHIME, SoundCategory.NEUTRAL, 2.0F, 1.0F);
this.removeInteractionItem(entityhuman, itemstack);
@@ -304,7 +316,7 @@
@@ -306,7 +318,7 @@
this.setItemInHand(EnumHand.MAIN_HAND, itemstack2);
this.removeInteractionItem(entityhuman, itemstack);
this.level().playSound(entityhuman, (Entity) this, SoundEffects.ALLAY_ITEM_GIVEN, SoundCategory.NEUTRAL, 2.0F, 1.0F);
@@ -62,7 +62,7 @@
return EnumInteractionResult.SUCCESS;
} else if (!itemstack1.isEmpty() && enumhand == EnumHand.MAIN_HAND && itemstack.isEmpty()) {
this.setItemSlot(EnumItemSlot.MAINHAND, ItemStack.EMPTY);
@@ -405,6 +417,7 @@
@@ -407,6 +419,7 @@
}
private boolean shouldStopDancing() {
@@ -70,25 +70,7 @@
return this.jukeboxPos == null || !this.jukeboxPos.closerToCenterThan(this.position(), (double) ((GameEvent) GameEvent.JUKEBOX_PLAY.value()).notificationRadius()) || !this.level().getBlockState(this.jukeboxPos).is(Blocks.JUKEBOX);
}
@@ -449,7 +462,7 @@
public void addAdditionalSaveData(NBTTagCompound nbttagcompound) {
super.addAdditionalSaveData(nbttagcompound);
this.writeInventoryToTag(nbttagcompound, this.registryAccess());
- DataResult dataresult = VibrationSystem.a.CODEC.encodeStart(DynamicOpsNBT.INSTANCE, this.vibrationData);
+ DataResult<net.minecraft.nbt.NBTBase> dataresult = VibrationSystem.a.CODEC.encodeStart(DynamicOpsNBT.INSTANCE, this.vibrationData); // CraftBukkit - decompile error
Logger logger = Allay.LOGGER;
Objects.requireNonNull(logger);
@@ -465,7 +478,7 @@
super.readAdditionalSaveData(nbttagcompound);
this.readInventoryFromTag(nbttagcompound, this.registryAccess());
if (nbttagcompound.contains("listener", 10)) {
- DataResult dataresult = VibrationSystem.a.CODEC.parse(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.getCompound("listener")));
+ DataResult<VibrationSystem.a> dataresult = VibrationSystem.a.CODEC.parse(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.getCompound("listener"))); // CraftBukkit - decompile error
Logger logger = Allay.LOGGER;
Objects.requireNonNull(logger);
@@ -498,7 +511,7 @@
@@ -500,7 +513,7 @@
return Allay.DUPLICATION_ITEM.test(itemstack);
}
@@ -97,7 +79,7 @@
Allay allay = (Allay) EntityTypes.ALLAY.create(this.level());
if (allay != null) {
@@ -506,9 +519,9 @@
@@ -508,9 +521,9 @@
allay.setPersistenceRequired();
allay.resetDuplicationCooldown();
this.resetDuplicationCooldown();

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/armadillo/Armadillo.java
+++ b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
@@ -131,14 +131,16 @@
@@ -132,14 +132,16 @@
@Override
protected void customServerAiStep() {
this.level().getProfiler().push("armadilloBrain");
@@ -18,7 +18,7 @@
this.gameEvent(GameEvent.ENTITY_PLACE);
this.scuteTime = this.pickNextScuteDropTime();
}
@@ -285,8 +287,13 @@
@@ -286,8 +288,13 @@
}
@Override
@@ -34,15 +34,15 @@
if (!this.isNoAi() && !this.isDeadOrDying()) {
if (damagesource.getEntity() instanceof EntityLiving) {
this.getBrain().setMemoryWithExpiry(MemoryModuleType.DANGER_DETECTED_RECENTLY, true, 80L);
@@ -298,6 +305,7 @@
@@ -299,6 +306,7 @@
}
}
+ return hurt; // CraftBukkit
}
public boolean shouldPanic() {
@@ -329,7 +337,9 @@
@Override
@@ -326,7 +334,9 @@
if (this.isBaby()) {
return false;
} else {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java
+++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
@@ -67,9 +67,16 @@
@@ -68,9 +68,16 @@
public class Axolotl extends EntityAnimal implements LerpingModel, VariantHolder<Axolotl.Variant>, Bucketable {
@@ -18,7 +18,7 @@
private static final DataWatcherObject<Integer> DATA_VARIANT = DataWatcher.defineId(Axolotl.class, DataWatcherRegistry.INT);
private static final DataWatcherObject<Boolean> DATA_PLAYING_DEAD = DataWatcher.defineId(Axolotl.class, DataWatcherRegistry.BOOLEAN);
private static final DataWatcherObject<Boolean> FROM_BUCKET = DataWatcher.defineId(Axolotl.class, DataWatcherRegistry.BOOLEAN);
@@ -186,7 +193,7 @@
@@ -187,7 +194,7 @@
@Override
public int getMaxAirSupply() {
@@ -27,7 +27,7 @@
}
@Override
@@ -397,7 +404,7 @@
@@ -391,7 +398,7 @@
int i = mobeffect != null ? mobeffect.getDuration() : 0;
int j = Math.min(2400, 100 + i);
@@ -36,7 +36,7 @@
}
entityhuman.removeEffect(MobEffects.DIG_SLOWDOWN);
@@ -447,7 +454,7 @@
@@ -441,7 +448,7 @@
@Override
public BehaviorController<Axolotl> getBrain() {

View File

@@ -9,7 +9,7 @@
behaviorcontroller.tick((WorldServer) this.level(), this);
this.level().getProfiler().pop();
@@ -451,9 +451,15 @@
@@ -452,9 +452,15 @@
}
@Override

View File

@@ -20,7 +20,7 @@
}
@Override
@@ -232,9 +236,15 @@
@@ -232,10 +236,16 @@
}
frog.setPersistenceRequired();
@@ -30,6 +30,7 @@
+ return;
+ }
+ // CraftBukkit end
frog.fudgePositionAfterSizeChange(this.getDimensions(this.getPose()));
this.playSound(SoundEffects.TADPOLE_GROW_UP, 0.15F, 1.0F);
- worldserver.addFreshEntityWithPassengers(frog);
- this.discard();

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java
+++ b/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java
@@ -79,6 +79,18 @@
@@ -81,6 +81,18 @@
import net.minecraft.world.phys.Vec3D;
import net.minecraft.world.ticks.ContainerSingleItem;
@@ -19,7 +19,7 @@
public abstract class EntityHorseAbstract extends EntityAnimal implements IInventoryListener, HasCustomInventoryScreen, OwnableEntity, IJumpable, ISaddleable {
public static final int EQUIPMENT_SLOT_OFFSET = 400;
@@ -156,7 +168,53 @@
@@ -158,7 +170,53 @@
public boolean stillValid(EntityHuman entityhuman) {
return entityhuman.getVehicle() == EntityHorseAbstract.this || entityhuman.canInteractWithEntity((Entity) EntityHorseAbstract.this, 4.0D);
}
@@ -73,7 +73,7 @@
protected EntityHorseAbstract(EntityTypes<? extends EntityHorseAbstract> entitytypes, World world) {
super(entitytypes, world);
@@ -346,7 +404,7 @@
@@ -353,7 +411,7 @@
public void createInventory() {
InventorySubcontainer inventorysubcontainer = this.inventory;
@@ -82,7 +82,7 @@
if (inventorysubcontainer != null) {
inventorysubcontainer.removeListener(this);
int i = Math.min(inventorysubcontainer.getContainerSize(), this.inventory.getContainerSize());
@@ -450,7 +508,7 @@
@@ -457,7 +515,7 @@
}
public int getMaxTemper() {
@@ -91,7 +91,7 @@
}
@Override
@@ -521,7 +579,7 @@
@@ -528,7 +586,7 @@
}
if (this.getHealth() < this.getMaxHealth() && f > 0.0F) {
@@ -100,7 +100,7 @@
flag = true;
}
@@ -595,7 +653,7 @@
@@ -602,7 +660,7 @@
super.aiStep();
if (!this.level().isClientSide && this.isAlive()) {
if (this.random.nextInt(900) == 0 && this.deathTime == 0) {
@@ -109,7 +109,7 @@
}
if (this.canEatGrass()) {
@@ -857,6 +915,7 @@
@@ -864,6 +922,7 @@
if (this.getOwnerUUID() != null) {
nbttagcompound.putUUID("Owner", this.getOwnerUUID());
}
@@ -117,7 +117,7 @@
if (!this.inventory.getItem(0).isEmpty()) {
nbttagcompound.put("SaddleItem", this.inventory.getItem(0).save(this.registryAccess()));
@@ -884,6 +943,11 @@
@@ -891,6 +950,11 @@
if (uuid != null) {
this.setOwnerUUID(uuid);
}
@@ -129,7 +129,7 @@
if (nbttagcompound.contains("SaddleItem", 10)) {
ItemStack itemstack = (ItemStack) ItemStack.parse(this.registryAccess(), nbttagcompound.getCompound("SaddleItem")).orElse(ItemStack.EMPTY);
@@ -986,6 +1050,17 @@
@@ -993,6 +1057,17 @@
@Override
public void handleStartJump(int i) {