Update to Minecraft 1.21.4

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-12-04 03:20:00 +11:00
parent 267ae64dd6
commit 5381ea78f7
125 changed files with 1383 additions and 1093 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/EntityEnderman.java
+++ b/net/minecraft/world/entity/monster/EntityEnderman.java
@@ -70,6 +70,11 @@
@@ -69,6 +69,11 @@
import net.minecraft.world.phys.MovingObjectPositionBlock;
import net.minecraft.world.phys.Vec3D;
@@ -12,7 +12,7 @@
public class EntityEnderman extends EntityMonster implements IEntityAngerable {
private static final MinecraftKey SPEED_MODIFIER_ATTACKING_ID = MinecraftKey.withDefaultNamespace("attacking");
@@ -113,7 +118,17 @@
@@ -112,7 +117,17 @@
@Override
public void setTarget(@Nullable EntityLiving entityliving) {
@@ -31,7 +31,7 @@
AttributeModifiable attributemodifiable = this.getAttribute(GenericAttributes.MOVEMENT_SPEED);
if (entityliving == null) {
@@ -128,6 +143,7 @@
@@ -127,6 +142,7 @@
attributemodifiable.addTransientModifier(EntityEnderman.SPEED_MODIFIER_ATTACKING);
}
}
@@ -39,7 +39,7 @@
}
@@ -466,9 +482,11 @@
@@ -465,9 +481,11 @@
if (iblockdata2 != null) {
iblockdata2 = Block.updateFromNeighbourShapes(iblockdata2, this.enderman.level(), blockposition);
if (this.canPlaceBlock(world, blockposition, iblockdata2, iblockdata, iblockdata1, blockposition1)) {
@@ -51,7 +51,7 @@
}
}
@@ -507,9 +525,11 @@
@@ -506,9 +524,11 @@
boolean flag = movingobjectpositionblock.getBlockPos().equals(blockposition);
if (iblockdata.is(TagsBlock.ENDERMAN_HOLDABLE) && flag) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/EntityPillager.java
+++ b/net/minecraft/world/entity/monster/EntityPillager.java
@@ -50,6 +50,10 @@
@@ -53,6 +53,10 @@
import net.minecraft.world.level.World;
import net.minecraft.world.level.WorldAccess;
@@ -11,7 +11,7 @@
public class EntityPillager extends EntityIllagerAbstract implements ICrossbow, InventoryCarrier {
private static final DataWatcherObject<Boolean> IS_CHARGING_CROSSBOW = DataWatcher.defineId(EntityPillager.class, DataWatcherRegistry.BOOLEAN);
@@ -198,7 +202,7 @@
@@ -206,7 +210,7 @@
ItemStack itemstack1 = this.inventory.addItem(itemstack);
if (itemstack1.isEmpty()) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/EntityRavager.java
+++ b/net/minecraft/world/entity/monster/EntityRavager.java
@@ -45,6 +45,10 @@
@@ -43,6 +43,10 @@
import net.minecraft.world.phys.AxisAlignedBB;
import net.minecraft.world.phys.Vec3D;
@@ -11,7 +11,7 @@
public class EntityRavager extends EntityRaider {
private static final Predicate<Entity> ROAR_TARGET_WITH_GRIEFING = (entity) -> {
@@ -161,6 +165,11 @@
@@ -158,6 +162,11 @@
Block block = iblockdata.getBlock();
if (block instanceof BlockLeaves) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java
+++ b/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java
@@ -207,7 +207,17 @@
@@ -209,7 +209,17 @@
World world = this.level();
if (world instanceof WorldServer worldserver) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/EntitySkeletonWither.java
+++ b/net/minecraft/world/entity/monster/EntitySkeletonWither.java
@@ -97,7 +97,7 @@
@@ -110,7 +110,7 @@
return false;
} else {
if (entity instanceof EntityLiving) {

View File

@@ -9,7 +9,7 @@
}
@Override
@@ -255,6 +255,7 @@
@@ -252,6 +252,7 @@
@Override
public boolean canAttackType(EntityTypes<?> entitytypes) {

View File

@@ -0,0 +1,38 @@
--- a/net/minecraft/world/entity/monster/creaking/Creaking.java
+++ b/net/minecraft/world/entity/monster/creaking/Creaking.java
@@ -206,7 +206,7 @@
@Override
public BehaviorController<Creaking> getBrain() {
- return super.getBrain();
+ return (BehaviorController<Creaking>) super.getBrain(); // CraftBukkit - decompile error
}
@Override
@@ -329,7 +329,7 @@
}
this.makeSound(this.getDeathSound());
- this.remove(Entity.RemovalReason.DISCARDED);
+ this.remove(Entity.RemovalReason.DISCARDED, null); // CraftBukkit - add Bukkit remove cause
}
public void creakingDeathEffects(DamageSource damagesource) {
@@ -476,7 +476,7 @@
@Override
protected SoundEffect getHurtSound(DamageSource damagesource) {
- return this.isHeartBound() ? SoundEffects.CREAKING_SWAY : super.getHurtSound(damagesource);
+ return SoundEffects.CREAKING_SWAY;
}
@Override
@@ -549,7 +549,7 @@
}
public void activate(EntityHuman entityhuman) {
- this.getBrain().setMemory(MemoryModuleType.ATTACK_TARGET, (Object) entityhuman);
+ this.getBrain().setMemory(MemoryModuleType.ATTACK_TARGET, entityhuman); // CraftBukkit - decompile error
this.gameEvent(GameEvent.ENTITY_ACTION);
this.makeSound(SoundEffects.CREAKING_ACTIVATE);
this.setIsActive(true);

View File

@@ -1,20 +0,0 @@
--- a/net/minecraft/world/entity/monster/creaking/CreakingTransient.java
+++ b/net/minecraft/world/entity/monster/creaking/CreakingTransient.java
@@ -97,7 +97,7 @@
}
}
- this.setRemoved(Entity.RemovalReason.DISCARDED);
+ this.setRemoved(Entity.RemovalReason.DISCARDED, null); // CraftBukkit - add Bukkit remove cause
return;
}
}
@@ -149,7 +149,7 @@
}
}
- this.remove(Entity.RemovalReason.DISCARDED);
+ this.remove(Entity.RemovalReason.DISCARDED, null); // CraftBukkit - add Bukkit remove cause
}
@Override

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/piglin/EntityPiglin.java
+++ b/net/minecraft/world/entity/monster/piglin/EntityPiglin.java
@@ -57,6 +57,18 @@
@@ -60,6 +60,18 @@
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.IBlockData;
@@ -19,7 +19,7 @@
public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow, InventoryCarrier {
private static final DataWatcherObject<Boolean> DATA_BABY_ID = DataWatcher.defineId(EntityPiglin.class, DataWatcherRegistry.BOOLEAN);
@@ -76,6 +88,10 @@
@@ -79,6 +91,10 @@
public boolean cannotHunt;
protected static final ImmutableList<SensorType<? extends Sensor<? super EntityPiglin>>> SENSOR_TYPES = ImmutableList.of(SensorType.NEAREST_LIVING_ENTITIES, SensorType.NEAREST_PLAYERS, SensorType.NEAREST_ITEMS, SensorType.HURT_BY, SensorType.PIGLIN_SPECIFIC_SENSOR);
protected static final ImmutableList<MemoryModuleType<?>> MEMORY_TYPES = ImmutableList.of(MemoryModuleType.LOOK_TARGET, MemoryModuleType.DOORS_TO_CLOSE, MemoryModuleType.NEAREST_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_ATTACKABLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLINS, MemoryModuleType.NEARBY_ADULT_PIGLINS, MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, MemoryModuleType.ITEM_PICKUP_COOLDOWN_TICKS, MemoryModuleType.HURT_BY, MemoryModuleType.HURT_BY_ENTITY, new MemoryModuleType[]{MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.INTERACTION_TARGET, MemoryModuleType.PATH, MemoryModuleType.ANGRY_AT, MemoryModuleType.UNIVERSAL_ANGER, MemoryModuleType.AVOID_TARGET, MemoryModuleType.ADMIRING_ITEM, MemoryModuleType.TIME_TRYING_TO_REACH_ADMIRE_ITEM, MemoryModuleType.ADMIRING_DISABLED, MemoryModuleType.DISABLE_WALK_TO_ADMIRE_ITEM, MemoryModuleType.CELEBRATE_LOCATION, MemoryModuleType.DANCING, MemoryModuleType.HUNTED_RECENTLY, MemoryModuleType.NEAREST_VISIBLE_BABY_HOGLIN, MemoryModuleType.NEAREST_VISIBLE_NEMESIS, MemoryModuleType.NEAREST_VISIBLE_ZOMBIFIED, MemoryModuleType.RIDE_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_HUNTABLE_HOGLIN, MemoryModuleType.NEAREST_TARGETABLE_PLAYER_NOT_WEARING_GOLD, MemoryModuleType.NEAREST_PLAYER_HOLDING_WANTED_ITEM, MemoryModuleType.ATE_RECENTLY, MemoryModuleType.NEAREST_REPELLENT});
@@ -30,7 +30,7 @@
public EntityPiglin(EntityTypes<? extends EntityPiglinAbstract> entitytypes, World world) {
super(entitytypes, world);
@@ -94,6 +110,14 @@
@@ -97,6 +113,14 @@
}
this.writeInventoryToTag(nbttagcompound, this.registryAccess());
@@ -45,7 +45,7 @@
}
@Override
@@ -102,6 +126,10 @@
@@ -105,6 +129,10 @@
this.setBaby(nbttagcompound.getBoolean("IsBaby"));
this.setCannotHunt(nbttagcompound.getBoolean("CannotHunt"));
this.readInventoryFromTag(nbttagcompound, this.registryAccess());
@@ -56,7 +56,7 @@
}
@VisibleForDebug
@@ -221,7 +249,7 @@
@@ -224,7 +252,7 @@
@Override
public BehaviorController<EntityPiglin> getBrain() {
@@ -65,7 +65,7 @@
}
@Override
@@ -366,7 +394,7 @@
@@ -374,7 +402,7 @@
}
protected void holdInOffHand(ItemStack itemstack) {
@@ -74,18 +74,18 @@
this.setItemSlot(EnumItemSlot.OFFHAND, itemstack);
this.setGuaranteedDrop(EnumItemSlot.OFFHAND);
} else {
@@ -392,8 +420,8 @@
if (EnchantmentManager.has(itemstack1, EnchantmentEffectComponents.PREVENT_ARMOR_CHANGE)) {
@@ -401,8 +429,8 @@
return false;
} else {
- boolean flag = PiglinAI.isLovedItem(itemstack) || itemstack.is(Items.CROSSBOW);
- boolean flag1 = PiglinAI.isLovedItem(itemstack1) || itemstack1.is(Items.CROSSBOW);
+ boolean flag = PiglinAI.isLovedItem(itemstack, this) || itemstack.is(Items.CROSSBOW); // CraftBukkit
+ boolean flag1 = PiglinAI.isLovedItem(itemstack1, this) || itemstack1.is(Items.CROSSBOW); // CraftBukkit
TagKey<Item> tagkey = this.getPreferredWeaponType();
- boolean flag = PiglinAI.isLovedItem(itemstack) || tagkey != null && itemstack.is(tagkey);
- boolean flag1 = PiglinAI.isLovedItem(itemstack1) || tagkey != null && itemstack1.is(tagkey);
+ boolean flag = PiglinAI.isLovedItem(itemstack, this) || tagkey != null && itemstack.is(tagkey); // CraftBukkit
+ boolean flag1 = PiglinAI.isLovedItem(itemstack1, this) || tagkey != null && itemstack1.is(tagkey); // CraftBukkit
return flag && !flag1 ? true : (!flag && flag1 ? false : (this.isAdult() && !itemstack.is(Items.CROSSBOW) && itemstack1.is(Items.CROSSBOW) ? false : super.canReplaceCurrentItem(itemstack, itemstack1, enumitemslot)));
return flag && !flag1 ? true : (!flag && flag1 ? false : super.canReplaceCurrentItem(itemstack, itemstack1, enumitemslot));
}
@@ -422,7 +450,7 @@
@@ -431,7 +459,7 @@
@Override
protected SoundEffect getAmbientSound() {

View File

@@ -27,7 +27,7 @@
this.getBrain().eraseMemory(MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE);
SonicBoom.setCooldown(this, 200);
}
@@ -582,12 +582,12 @@
@@ -582,11 +582,11 @@
@Override
protected NavigationAbstract createNavigation(World world) {
@@ -36,7 +36,6 @@
@Override
protected Pathfinder createPathFinder(int i) {
this.nodeEvaluator = new PathfinderNormal();
this.nodeEvaluator.setCanPassDoors(true);
- return new Pathfinder(this, this.nodeEvaluator, i) {
+ return new Pathfinder(this.nodeEvaluator, i) { // CraftBukkit - decompile error
@Override