Update to Minecraft 1.21.2

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-10-23 02:15:00 +11:00
parent 2c4beb962b
commit d3a23f42c3
522 changed files with 8501 additions and 6477 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityFox.java
+++ b/net/minecraft/world/entity/animal/EntityFox.java
@@ -93,6 +93,10 @@
@@ -91,6 +91,10 @@
import net.minecraft.world.level.pathfinder.PathType;
import net.minecraft.world.phys.Vec3D;
@@ -11,8 +11,8 @@
public class EntityFox extends EntityAnimal implements VariantHolder<EntityFox.Type> {
private static final DataWatcherObject<Integer> DATA_TYPE_ID = DataWatcher.defineId(EntityFox.class, DataWatcherRegistry.INT);
@@ -518,7 +522,8 @@
protected void pickUpItem(EntityItem entityitem) {
@@ -503,7 +507,8 @@
protected void pickUpItem(WorldServer worldserver, EntityItem entityitem) {
ItemStack itemstack = entityitem.getItem();
- if (this.canHoldItem(itemstack)) {
@@ -21,7 +21,7 @@
int i = itemstack.getCount();
if (i > 1) {
@@ -530,7 +535,7 @@
@@ -515,7 +520,7 @@
this.setItemSlot(EnumItemSlot.MAINHAND, itemstack.split(1));
this.setGuaranteedDrop(EnumItemSlot.MAINHAND);
this.take(entityitem, itemstack.getCount());
@@ -30,7 +30,7 @@
this.ticksSinceEaten = 0;
}
@@ -868,6 +873,16 @@
@@ -853,6 +858,16 @@
if (entityplayer1 != null && entityplayer != entityplayer1) {
entityfox.addTrustedUUID(entityplayer1.getUUID());
}
@@ -47,7 +47,7 @@
if (entityplayer2 != null) {
entityplayer2.awardStat(StatisticList.ANIMALS_BRED);
@@ -878,12 +893,14 @@
@@ -863,12 +878,14 @@
this.partner.setAge(6000);
this.animal.resetLove();
this.partner.resetLove();
@@ -56,7 +56,7 @@
- worldserver.addFreshEntityWithPassengers(entityfox);
+ worldserver.addFreshEntityWithPassengers(entityfox, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - added SpawnReason
this.level.broadcastEntityEvent(this.animal, (byte) 18);
if (this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
if (worldserver.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
- this.level.addFreshEntity(new EntityExperienceOrb(this.level, this.animal.getX(), this.animal.getY(), this.animal.getZ(), this.animal.getRandom().nextInt(7) + 1));
+ // CraftBukkit start - use event experience
+ if (experience > 0) {
@@ -66,7 +66,7 @@
}
}
@@ -1279,6 +1296,11 @@
@@ -1264,6 +1281,11 @@
int i = (Integer) iblockdata.getValue(BlockSweetBerryBush.AGE);
iblockdata.setValue(BlockSweetBerryBush.AGE, 1);
@@ -78,12 +78,12 @@
int j = 1 + EntityFox.this.level().random.nextInt(2) + (i == 3 ? 1 : 0);
ItemStack itemstack = EntityFox.this.getItemBySlot(EnumItemSlot.MAINHAND);
@@ -1436,7 +1458,7 @@
private EntityLiving trustedLastHurt;
private int timestamp;
- public a(final Class oclass, final boolean flag, final boolean flag1, @Nullable final Predicate predicate) {
+ public a(final Class oclass, final boolean flag, final boolean flag1, @Nullable final Predicate<EntityLiving> predicate) { // CraftBukkit - decompile error
super(EntityFox.this, oclass, 10, flag, flag1, predicate);
@@ -1494,7 +1516,7 @@
}
public static EntityFox.Type byName(String s) {
- return (EntityFox.Type) EntityFox.Type.CODEC.byName(s, (Enum) EntityFox.Type.RED);
+ return (EntityFox.Type) EntityFox.Type.CODEC.byName(s, EntityFox.Type.RED); // CraftBukkit - decompile error
}
public static EntityFox.Type byId(int i) {