Update to Minecraft 1.20.5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-04-24 01:15:00 +10:00
parent 4deda9501f
commit 65bc2541a3
524 changed files with 7788 additions and 6181 deletions

View File

@@ -4,4 +4,4 @@
+// mc-dev import
package net.minecraft.world.entity.ai.attributes;
import net.minecraft.core.IRegistry;
import net.minecraft.core.Holder;

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java
@@ -26,6 +26,11 @@
@@ -27,6 +27,11 @@
import net.minecraft.world.level.block.state.IBlockData;
import net.minecraft.world.level.gameevent.GameEvent;
@@ -12,7 +12,7 @@
public class BehaviorFarm extends Behavior<EntityVillager> {
private static final int HARVEST_DURATION = 200;
@@ -81,8 +86,8 @@
@@ -82,8 +87,8 @@
protected void start(WorldServer worldserver, EntityVillager entityvillager, long i) {
if (i > this.nextOkStartTime && this.aboveFarmlandPos != null) {
@@ -23,7 +23,7 @@
}
}
@@ -102,7 +107,9 @@
@@ -103,7 +108,9 @@
Block block1 = worldserver.getBlockState(this.aboveFarmlandPos.below()).getBlock();
if (block instanceof BlockCrops && ((BlockCrops) block).isMaxAge(iblockdata)) {
@@ -33,19 +33,19 @@
}
if (iblockdata.isAir() && block1 instanceof BlockSoil && entityvillager.hasFarmSeeds()) {
@@ -119,9 +126,11 @@
@@ -120,9 +127,11 @@
ItemBlock itemblock = (ItemBlock) item;
IBlockData iblockdata1 = itemblock.getBlock().defaultBlockState();
+ if (CraftEventFactory.callEntityChangeBlockEvent(entityvillager, this.aboveFarmlandPos, iblockdata1)) { // CraftBukkit
worldserver.setBlockAndUpdate(this.aboveFarmlandPos, iblockdata1);
worldserver.gameEvent(GameEvent.BLOCK_PLACE, this.aboveFarmlandPos, GameEvent.a.of(entityvillager, iblockdata1));
worldserver.gameEvent((Holder) GameEvent.BLOCK_PLACE, this.aboveFarmlandPos, GameEvent.a.of(entityvillager, iblockdata1));
flag = true;
+ } // CraftBukkit
}
}
@@ -141,8 +150,8 @@
@@ -142,8 +151,8 @@
this.aboveFarmlandPos = this.getValidFarmland(worldserver);
if (this.aboveFarmlandPos != null) {
this.nextOkStartTime = i + 20L;

View File

@@ -11,8 +11,8 @@
+
public class BehaviorMakeLove extends Behavior<EntityVillager> {
private static final int INTERACT_DIST_SQR = 5;
@@ -116,11 +121,17 @@
private long birthTimestamp;
@@ -114,11 +119,17 @@
if (entityvillager2 == null) {
return Optional.empty();
} else {
@@ -33,7 +33,7 @@
worldserver.broadcastEntityEvent(entityvillager2, (byte) 12);
return Optional.of(entityvillager2);
}
@@ -129,6 +140,6 @@
@@ -127,6 +138,6 @@
private void giveBedToChild(WorldServer worldserver, EntityVillager entityvillager, BlockPosition blockposition) {
GlobalPos globalpos = GlobalPos.of(worldserver.dimension(), blockposition);

View File

@@ -8,8 +8,8 @@
+ entityliving.getBrain().setMemory(MemoryModuleType.LOOK_TARGET, (new BehaviorPositionEntity(entityliving1, true))); // CraftBukkit - decompile error
}
private static void setWalkAndLookTargetMemoriesToEachOther(EntityLiving entityliving, EntityLiving entityliving1, float f) {
@@ -81,8 +81,8 @@
private static void setWalkAndLookTargetMemoriesToEachOther(EntityLiving entityliving, EntityLiving entityliving1, float f, int i) {
@@ -79,8 +79,8 @@
public static void setWalkAndLookTargetMemories(EntityLiving entityliving, BehaviorPosition behaviorposition, float f, int i) {
MemoryTarget memorytarget = new MemoryTarget(behaviorposition, f, i);
@@ -20,7 +20,7 @@
}
public static void throwItem(EntityLiving entityliving, ItemStack itemstack, Vec3D vec3d) {
@@ -92,6 +92,7 @@
@@ -90,6 +90,7 @@
}
public static void throwItem(EntityLiving entityliving, ItemStack itemstack, Vec3D vec3d, Vec3D vec3d1, float f) {
@@ -28,7 +28,7 @@
double d0 = entityliving.getEyeY() - (double) f;
EntityItem entityitem = new EntityItem(entityliving.level(), entityliving.getX(), d0, entityliving.getZ(), itemstack);
@@ -101,12 +102,19 @@
@@ -99,12 +100,19 @@
vec3d2 = vec3d2.normalize().multiply(vec3d1.x, vec3d1.y, vec3d1.z);
entityitem.setDeltaMovement(vec3d2);
entityitem.setDefaultPickUpDelay();

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/ai/behavior/PrepareRamNearestTarget.java
+++ b/net/minecraft/world/entity/ai/behavior/PrepareRamNearestTarget.java
@@ -30,6 +30,13 @@
@@ -31,6 +31,13 @@
import net.minecraft.world.level.pathfinder.PathfinderNormal;
import net.minecraft.world.phys.Vec3D;
@@ -14,7 +14,7 @@
public class PrepareRamNearestTarget<E extends EntityCreature> extends Behavior<E> {
public static final int TIME_OUT_DURATION = 160;
@@ -62,6 +69,13 @@
@@ -63,6 +70,13 @@
return this.ramTargeting.test(entitycreature, entityliving);
});
}).ifPresent((entityliving) -> {
@@ -28,7 +28,7 @@
this.chooseRamPosition(entitycreature, entityliving);
});
}
@@ -71,7 +85,7 @@
@@ -72,7 +86,7 @@
if (!behaviorcontroller.hasMemoryValue(MemoryModuleType.RAM_TARGET)) {
worldserver.broadcastEntityEvent(e0, (byte) 59);
@@ -37,7 +37,7 @@
}
}
@@ -82,8 +96,8 @@
@@ -83,8 +97,8 @@
protected void tick(WorldServer worldserver, E e0, long i) {
if (!this.ramCandidate.isEmpty()) {
@@ -48,7 +48,7 @@
boolean flag = !((PrepareRamNearestTarget.a) this.ramCandidate.get()).getTarget().blockPosition().equals(((PrepareRamNearestTarget.a) this.ramCandidate.get()).getTargetPosition());
if (flag) {
@@ -100,7 +114,7 @@
@@ -101,7 +115,7 @@
}
if (i - (Long) this.reachedRamPositionTimestamp.get() >= (long) this.ramPrepareTime) {
@@ -57,7 +57,7 @@
worldserver.playSound((EntityHuman) null, (Entity) e0, (SoundEffect) this.getPrepareRamSound.apply(e0), SoundCategory.NEUTRAL, 1.0F, e0.getVoicePitch());
this.ramCandidate = Optional.empty();
}
@@ -152,7 +166,7 @@
@@ -153,7 +167,7 @@
}
NavigationAbstract navigationabstract = entitycreature.getNavigation();

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.java
+++ b/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.java
@@ -38,6 +38,12 @@
@@ -39,6 +39,12 @@
if (worldserver.getBlockState(blockposition2).isAir()) {
IBlockData iblockdata = block.defaultBlockState();
@@ -11,5 +11,5 @@
+ }
+ // CraftBukkit end
worldserver.setBlock(blockposition2, iblockdata, 3);
worldserver.gameEvent(GameEvent.BLOCK_PLACE, blockposition2, GameEvent.a.of(entityliving, iblockdata));
worldserver.gameEvent((Holder) GameEvent.BLOCK_PLACE, blockposition2, GameEvent.a.of(entityliving, iblockdata));
worldserver.playSound((EntityHuman) null, (Entity) entityliving, SoundEffects.FROG_LAY_SPAWN, SoundCategory.BLOCKS, 1.0F, 1.0F);

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalFollowOwner.java
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalFollowOwner.java
@@ -14,6 +14,12 @@
@@ -15,6 +15,12 @@
import net.minecraft.world.level.pathfinder.PathType;
import net.minecraft.world.level.pathfinder.PathfinderNormal;
@@ -13,7 +13,7 @@
public class PathfinderGoalFollowOwner extends PathfinderGoal {
public static final int TELEPORT_WHEN_DISTANCE_IS = 12;
@@ -122,7 +128,14 @@
@@ -123,7 +129,14 @@
} else if (!this.canTeleportTo(new BlockPosition(i, j, k))) {
return false;
} else {

View File

@@ -1,7 +1,7 @@
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.java
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.java
@@ -21,6 +21,11 @@
import net.minecraft.world.level.chunk.IChunkAccess;
import net.minecraft.world.level.chunk.status.ChunkStatus;
import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalTempt.java
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalTempt.java
@@ -9,6 +9,13 @@
@@ -10,6 +10,13 @@
import net.minecraft.world.entity.player.EntityHuman;
import net.minecraft.world.item.crafting.RecipeItemStack;
import net.minecraft.world.item.ItemStack;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
@@ -14,7 +14,7 @@
public class PathfinderGoalTempt extends PathfinderGoal {
private static final PathfinderTargetCondition TEMP_TARGETING = PathfinderTargetCondition.forNonCombat().range(10.0D).ignoreLineOfSight();
@@ -21,7 +28,7 @@
@@ -22,7 +29,7 @@
private double pRotX;
private double pRotY;
@Nullable
@@ -22,8 +22,8 @@
+ protected EntityLiving player; // CraftBukkit
private int calmDown;
private boolean isRunning;
private final RecipeItemStack items;
@@ -43,6 +50,15 @@
private final Predicate<ItemStack> items;
@@ -44,6 +51,15 @@
return false;
} else {
this.player = this.mob.level().getNearestPlayer(this.targetingConditions, this.mob);

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/world/entity/ai/sensing/TemptingSensor.java
+++ b/net/minecraft/world/entity/ai/sensing/TemptingSensor.java
@@ -18,6 +18,14 @@
import net.minecraft.world.entity.player.EntityHuman;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.RecipeItemStack;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/ai/village/VillageSiege.java
+++ b/net/minecraft/world/entity/ai/village/VillageSiege.java
@@ -122,7 +122,7 @@
@@ -121,7 +121,7 @@
}
entityzombie.moveTo(vec3d.x, vec3d.y, vec3d.z, worldserver.random.nextFloat() * 360.0F, 0.0F);