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/ai/behavior/BehaviorCareer.java
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorCareer.java
@@ -13,6 +13,12 @@
@@ -12,6 +12,12 @@
import net.minecraft.world.entity.npc.EntityVillager;
import net.minecraft.world.entity.npc.VillagerProfession;
@@ -13,7 +13,7 @@
public class BehaviorCareer extends Behavior<EntityVillager> {
public BehaviorCareer() {
@@ -29,7 +35,7 @@
@@ -28,7 +34,7 @@
GlobalPos globalpos = (GlobalPos) entityvillager.getBrain().getMemory(MemoryModuleType.POTENTIAL_JOB_SITE).get();
entityvillager.getBrain().eraseMemory(MemoryModuleType.POTENTIAL_JOB_SITE);
@@ -22,7 +22,7 @@
worldserver.broadcastEntityEvent(entityvillager, (byte) 14);
if (entityvillager.getVillagerData().getProfession() == VillagerProfession.NONE) {
MinecraftServer minecraftserver = worldserver.getServer();
@@ -41,7 +47,14 @@
@@ -40,7 +46,14 @@
return villagerprofession.getJobPoiType() == villageplacetype;
}).findFirst();
}).ifPresent((villagerprofession) -> {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java
@@ -80,8 +80,8 @@
@@ -79,8 +79,8 @@
protected void start(WorldServer worldserver, EntityVillager entityvillager, long i) {
if (i > this.nextOkStartTime && this.aboveFarmlandPos != null) {
@@ -11,7 +11,7 @@
}
}
@@ -101,7 +101,11 @@
@@ -100,7 +100,11 @@
Block block1 = worldserver.getBlockState(this.aboveFarmlandPos.below()).getBlock();
if (block instanceof BlockCrops && ((BlockCrops) block).isMaxAge(iblockdata)) {
@@ -24,7 +24,7 @@
}
if (iblockdata.isAir() && block1 instanceof BlockSoil && entityvillager.hasFarmSeeds()) {
@@ -112,19 +116,28 @@
@@ -111,19 +115,28 @@
boolean flag = false;
if (!itemstack.isEmpty()) {
@@ -57,7 +57,7 @@
}
if (flag) {
@@ -143,8 +156,8 @@
@@ -142,8 +155,8 @@
this.aboveFarmlandPos = this.getValidFarmland(worldserver);
if (this.aboveFarmlandPos != null) {
this.nextOkStartTime = i + 20L;

View File

@@ -14,7 +14,7 @@
blockdoor.setOpen(entityliving, worldserver, iblockdata, blockposition, true);
}
@@ -82,6 +89,13 @@
@@ -84,6 +91,13 @@
BlockDoor blockdoor1 = (BlockDoor) iblockdata1.getBlock();
if (!blockdoor1.isOpen(iblockdata1)) {
@@ -28,7 +28,7 @@
blockdoor1.setOpen(entityliving, worldserver, iblockdata1, blockposition1, true);
this.rememberDoorToClose(worldserver, entityliving, blockposition1);
}
@@ -130,7 +144,7 @@
@@ -134,7 +148,7 @@
private static boolean areOtherMobsComingThroughDoor(WorldServer worldserver, EntityLiving entityliving, BlockPosition blockposition) {
BehaviorController<?> behaviorcontroller = entityliving.getBrain();
@@ -36,8 +36,8 @@
+ return !behaviorcontroller.hasMemoryValue(MemoryModuleType.NEAREST_LIVING_ENTITIES) ? false : (behaviorcontroller.getMemory(MemoryModuleType.NEAREST_LIVING_ENTITIES).get()).stream().filter((entityliving1) -> { // CraftBukkit - decompile error
return entityliving1.getType() == entityliving.getType();
}).filter((entityliving1) -> {
return blockposition.closerThan((IPosition) entityliving1.position(), 2.0D);
@@ -172,7 +186,7 @@
return blockposition.closerToCenterThan(entityliving1.position(), 2.0D);
@@ -176,7 +190,7 @@
if (behaviorcontroller.getMemory(MemoryModuleType.DOORS_TO_CLOSE).isPresent()) {
((Set) behaviorcontroller.getMemory(MemoryModuleType.DOORS_TO_CLOSE).get()).add(globalpos);
} else {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java
@@ -72,6 +72,12 @@
@@ -71,6 +71,12 @@
}
if (this.breakTime == this.getDoorBreakTime() && this.isValidDifficulty(this.mob.level.getDifficulty())) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalPanic.java
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalPanic.java
@@ -11,6 +11,10 @@
@@ -10,6 +10,10 @@
import net.minecraft.world.level.IBlockAccess;
import net.minecraft.world.phys.Vec3D;
@@ -11,7 +11,7 @@
public class PathfinderGoalPanic extends PathfinderGoal {
public static final int WATER_CHECK_DISTANCE_VERTICAL = 1;
@@ -77,6 +81,12 @@
@@ -80,6 +84,12 @@
@Override
public boolean canContinueToUse() {
@@ -24,10 +24,10 @@
return !this.mob.getNavigation().isDone();
}
@@ -86,6 +96,6 @@
@@ -89,6 +99,6 @@
return !iblockaccess.getBlockState(blockposition).getCollisionShape(iblockaccess, blockposition).isEmpty() ? null : (BlockPosition) BlockPosition.findClosestMatch(entity.blockPosition(), i, 1, (blockposition1) -> {
return iblockaccess.getFluidState(blockposition1).is((Tag) TagsFluid.WATER);
return iblockaccess.getFluidState(blockposition1).is(TagsFluid.WATER);
- }).orElse((Object) null);
+ }).orElse(null); // CraftBukkit - decompile error
}