Update to Minecraft 1.18.2

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2022-03-01 02:00:00 +11:00
parent bd40300a4f
commit 9ee989ea81
184 changed files with 1785 additions and 1785 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/EntityEnderman.java
+++ b/net/minecraft/world/entity/monster/EntityEnderman.java
@@ -110,7 +110,17 @@
@@ -109,7 +109,17 @@
@Override
public void setTarget(@Nullable EntityLiving entityliving) {
@@ -19,7 +19,7 @@
AttributeModifiable attributemodifiable = this.getAttribute(GenericAttributes.MOVEMENT_SPEED);
if (entityliving == null) {
@@ -125,6 +135,7 @@
@@ -124,6 +134,7 @@
attributemodifiable.addTransientModifier(EntityEnderman.SPEED_MODIFIER_ATTACKING);
}
}
@@ -27,7 +27,7 @@
}
@@ -471,9 +482,13 @@
@@ -470,9 +481,13 @@
if (iblockdata2 != null) {
iblockdata2 = Block.updateFromNeighbourShapes(iblockdata2, this.enderman.level, blockposition);
if (this.canPlaceBlock(world, blockposition, iblockdata2, iblockdata, iblockdata1, blockposition1)) {
@@ -41,10 +41,10 @@
}
}
@@ -512,9 +527,13 @@
@@ -511,9 +526,13 @@
boolean flag = movingobjectpositionblock.getBlockPos().equals(blockposition);
if (iblockdata.is((Tag) TagsBlock.ENDERMAN_HOLDABLE) && flag) {
if (iblockdata.is(TagsBlock.ENDERMAN_HOLDABLE) && flag) {
- world.removeBlock(blockposition, false);
- world.gameEvent(this.enderman, GameEvent.BLOCK_DESTROY, blockposition);
- this.enderman.setCarriedBlock(iblockdata.getBlock().defaultBlockState());

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/EntitySilverfish.java
+++ b/net/minecraft/world/entity/monster/EntitySilverfish.java
@@ -173,6 +173,11 @@
@@ -175,6 +175,11 @@
Block block = iblockdata.getBlock();
if (block instanceof BlockMonsterEggs) {
@@ -12,7 +12,7 @@
if (world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
world.destroyBlock(blockposition1, true, this.silverfish);
} else {
@@ -242,6 +247,11 @@
@@ -244,6 +249,11 @@
IBlockData iblockdata = world.getBlockState(blockposition);
if (BlockMonsterEggs.isCompatibleHostBlock(iblockdata)) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/EntitySlime.java
+++ b/net/minecraft/world/entity/monster/EntitySlime.java
@@ -45,6 +45,14 @@
@@ -43,6 +43,14 @@
import net.minecraft.world.level.storage.loot.LootTables;
import net.minecraft.world.phys.Vec3D;
@@ -15,7 +15,7 @@
public class EntitySlime extends EntityInsentient implements IMonster {
private static final DataWatcherObject<Integer> ID_SIZE = DataWatcher.defineId(EntitySlime.class, DataWatcherRegistry.INT);
@@ -186,7 +194,7 @@
@@ -184,7 +192,7 @@
@Override
public EntityTypes<? extends EntitySlime> getType() {
@@ -24,7 +24,7 @@
}
@Override
@@ -200,6 +208,19 @@
@@ -198,6 +206,19 @@
int j = i / 2;
int k = 2 + this.random.nextInt(3);
@@ -44,7 +44,7 @@
for (int l = 0; l < k; ++l) {
float f1 = ((float) (l % 2) - 0.5F) * f;
float f2 = ((float) (l / 2) - 0.5F) * f;
@@ -214,8 +235,18 @@
@@ -212,8 +233,18 @@
entityslime.setInvulnerable(this.isInvulnerable());
entityslime.setSize(j, true);
entityslime.moveTo(this.getX() + (double) f1, this.getY() + 0.5D, this.getZ() + (double) f2, this.random.nextFloat() * 360.0F, 0.0F);

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/world/entity/monster/EntityStrider.java
+++ b/net/minecraft/world/entity/monster/EntityStrider.java
@@ -321,7 +321,13 @@
@@ -320,7 +320,13 @@
IBlockData iblockdata1 = this.getBlockStateOn();
boolean flag = iblockdata.is((Tag) TagsBlock.STRIDER_WARM_BLOCKS) || iblockdata1.is((Tag) TagsBlock.STRIDER_WARM_BLOCKS) || this.getFluidHeight(TagsFluid.LAVA) > 0.0D;
boolean flag = iblockdata.is(TagsBlock.STRIDER_WARM_BLOCKS) || iblockdata1.is(TagsBlock.STRIDER_WARM_BLOCKS) || this.getFluidHeight(TagsFluid.LAVA) > 0.0D;
- this.setSuffocating(!flag);
+ // CraftBukkit start

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/world/entity/monster/EntityZombieVillager.java
+++ b/net/minecraft/world/entity/monster/EntityZombieVillager.java
@@ -47,6 +47,13 @@
@@ -48,6 +48,13 @@
import net.minecraft.world.level.gameevent.GameEvent;
import org.apache.logging.log4j.Logger;
import org.slf4j.Logger;
+// CraftBukkit start
+import net.minecraft.server.MinecraftServer;
@@ -13,8 +13,8 @@
+
public class EntityZombieVillager extends EntityZombie implements VillagerDataHolder {
public static final DataWatcherObject<Boolean> DATA_CONVERTING_ID = DataWatcher.defineId(EntityZombieVillager.class, DataWatcherRegistry.BOOLEAN);
@@ -63,6 +70,7 @@
private static final Logger LOGGER = LogUtils.getLogger();
@@ -65,6 +72,7 @@
@Nullable
private NBTTagCompound tradeOffers;
private int villagerXp;
@@ -22,7 +22,7 @@
public EntityZombieVillager(EntityTypes<? extends EntityZombieVillager> entitytypes, World world) {
super(entitytypes, world);
@@ -79,7 +87,7 @@
@@ -83,7 +91,7 @@
@Override
public void addAdditionalSaveData(NBTTagCompound nbttagcompound) {
super.addAdditionalSaveData(nbttagcompound);
@@ -31,7 +31,7 @@
Logger logger = EntityZombieVillager.LOGGER;
Objects.requireNonNull(logger);
@@ -135,6 +143,10 @@
@@ -139,6 +147,10 @@
public void tick() {
if (!this.level.isClientSide && this.isAlive() && this.isConverting()) {
int i = this.getConversionProgress();
@@ -42,7 +42,7 @@
this.villagerConversionTime -= i;
if (this.villagerConversionTime <= 0) {
@@ -143,6 +155,7 @@
@@ -147,6 +159,7 @@
}
super.tick();
@@ -50,7 +50,7 @@
}
@Override
@@ -187,8 +200,11 @@
@@ -191,8 +204,11 @@
this.conversionStarter = uuid;
this.villagerConversionTime = i;
this.getEntityData().set(EntityZombieVillager.DATA_CONVERTING_ID, true);
@@ -64,7 +64,7 @@
this.level.broadcastEntityEvent(this, (byte) 16);
}
@@ -205,7 +221,13 @@
@@ -209,7 +225,13 @@
}
private void finishConversion(WorldServer worldserver) {
@@ -79,7 +79,7 @@
EnumItemSlot[] aenumitemslot = EnumItemSlot.values();
int i = aenumitemslot.length;
@@ -220,7 +242,9 @@
@@ -224,7 +246,9 @@
double d0 = (double) this.getEquipmentDropChance(enumitemslot);
if (d0 > 1.0D) {
@@ -89,7 +89,7 @@
}
}
}
@@ -246,7 +270,7 @@
@@ -250,7 +274,7 @@
}
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/piglin/PiglinAI.java
+++ b/net/minecraft/world/entity/monster/piglin/PiglinAI.java
@@ -72,6 +72,13 @@
@@ -71,6 +71,13 @@
import net.minecraft.world.level.storage.loot.parameters.LootContextParameters;
import net.minecraft.world.phys.Vec3D;
@@ -14,7 +14,7 @@
public class PiglinAI {
public static final int REPELLENT_DETECTION_RANGE_HORIZONTAL = 8;
@@ -187,13 +194,13 @@
@@ -186,13 +193,13 @@
protected static void updateActivity(EntityPiglin entitypiglin) {
BehaviorController<EntityPiglin> behaviorcontroller = entitypiglin.getBrain();
@@ -31,7 +31,7 @@
Objects.requireNonNull(entitypiglin);
optional.ifPresent(entitypiglin::playSound);
@@ -225,23 +232,27 @@
@@ -224,23 +231,27 @@
stopWalking(entitypiglin);
ItemStack itemstack;
@@ -63,7 +63,7 @@
if (!flag) {
putInInventory(entitypiglin, itemstack);
@@ -277,9 +288,14 @@
@@ -276,9 +287,14 @@
boolean flag1;
if (entitypiglin.isAdult()) {
@@ -80,7 +80,7 @@
} else if (!flag1) {
boolean flag2 = entitypiglin.equipItemIfPossible(itemstack);
@@ -292,7 +308,7 @@
@@ -291,7 +307,7 @@
if (!flag1) {
ItemStack itemstack1 = entitypiglin.getMainHandItem();
@@ -89,7 +89,7 @@
putInInventory(entitypiglin, itemstack1);
} else {
throwItems(entitypiglin, Collections.singletonList(itemstack1));
@@ -369,7 +385,7 @@
@@ -368,7 +384,7 @@
return false;
} else if (isAdmiringDisabled(entitypiglin) && entitypiglin.getBrain().hasMemoryValue(MemoryModuleType.ATTACK_TARGET)) {
return false;
@@ -98,7 +98,7 @@
return isNotHoldingLovedItemInOffHand(entitypiglin);
} else {
boolean flag = entitypiglin.canAddToInventory(itemstack);
@@ -378,6 +394,12 @@
@@ -377,6 +393,12 @@
}
}
@@ -109,9 +109,9 @@
+ // CraftBukkit end
+
protected static boolean isLovedItem(ItemStack itemstack) {
return itemstack.is((Tag) TagsItem.PIGLIN_LOVED);
return itemstack.is(TagsItem.PIGLIN_LOVED);
}
@@ -473,7 +495,7 @@
@@ -472,7 +494,7 @@
}
protected static boolean canAdmire(EntityPiglin entitypiglin, ItemStack itemstack) {
@@ -120,7 +120,7 @@
}
protected static void wasHurtBy(EntityPiglin entitypiglin, EntityLiving entityliving) {
@@ -740,6 +762,12 @@
@@ -739,6 +761,12 @@
return entitypiglin.getBrain().hasMemoryValue(MemoryModuleType.ADMIRING_ITEM);
}
@@ -133,7 +133,7 @@
private static boolean isBarterCurrency(ItemStack itemstack) {
return itemstack.is(PiglinAI.BARTERING_ITEM);
}
@@ -777,7 +805,7 @@
@@ -776,7 +804,7 @@
}
private static boolean isNotHoldingLovedItemInOffHand(EntityPiglin entitypiglin) {