Fix more derps from file patch updates

This commit is contained in:
Nassim Jahnke 2024-12-18 11:56:22 +01:00
parent 9d837fe4b6
commit c4fd69c807
No known key found for this signature in database
GPG key ID: EF6771C01F6EF02F
7 changed files with 19 additions and 46 deletions

View file

@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/Skeleton.java
+++ b/net/minecraft/world/entity/monster/Skeleton.java
@@ -89,11 +_,18 @@
@@ -89,11 +_,17 @@
}
protected void doFreezeConversion() {
@ -10,14 +10,13 @@
this.level().levelEvent(null, 1048, this.blockPosition(), 0);
}
- });
+ // CraftBukkit start - add spawn and transform reasons
+ // Paper start - add spawn and transform reasons
+ }, org.bukkit.event.entity.EntityTransformEvent.TransformReason.FROZEN, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.FROZEN);
+ // Paper start - Fix issues with mob conversion; reset conversion time to prevent event spam
+ if (stray == null) {
+ // Reset conversion time to prevent event spam
+ this.conversionTime = 300;
+ }
+ // Paper end - Fix issues with mob conversion
+ // CraftBukkit end - add spawn and transform reasons
+ // Paper end - add spawn and transform reasons
}
@Override

View file

@ -116,7 +116,7 @@
+ return Zombie.convertVillagerToZombieVillager(level, villager, this.blockPosition(), this.isSilent(), org.bukkit.event.entity.EntityTransformEvent.TransformReason.INFECTION, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.INFECTION) != null;
+ }
+
+ public static ZombieVillager convertVillagerToZombieVillager(ServerLevel level, Villager villager, net.minecraft.core.BlockPos blockPosition, boolean silent, org.bukkit.event.entity.EntityTransformEvent.TransformReason transformReason, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) {
+ public static ZombieVillager convertVillagerToZombieVillager(ServerLevel level, Villager villager, net.minecraft.core.BlockPos blockPosition, boolean silent, org.bukkit.event.entity.EntityTransformEvent.TransformReason transformReason, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason creatureSpawnReason) {
+ // CraftBukkit end
ZombieVillager zombieVillager = villager.convertTo(EntityType.ZOMBIE_VILLAGER, ConversionParams.single(villager, true, true), mob -> {
mob.finalizeSpawn(level, level.getCurrentDifficultyAt(mob.blockPosition()), EntitySpawnReason.CONVERSION, new Zombie.ZombieGroupData(false, true));
@ -130,10 +130,11 @@
+ if (!silent) {
+ level.levelEvent(null, 1026, blockPosition, 0);
}
+ // CraftBukkit end
});
- });
- return zombieVillager != null;
+ }, transformReason, creatureSpawnReason);
+ return zombieVillager;
+ // CraftBukkit end
}
public boolean isSunSensitive() {

View file

@ -16,18 +16,6 @@
public ZombieVillager(EntityType<? extends ZombieVillager> entityType, Level level) {
super(entityType, level);
@@ -140,6 +_,11 @@
public void tick() {
if (!this.level().isClientSide && this.isAlive() && this.isConverting()) {
int conversionProgress = this.getConversionProgress();
+ // CraftBukkit start - Use wall time instead of ticks for villager conversion
+ // TODO: WE WANT TO REMOVE THIS? I THOUGHT WE REMOVED IT.
+ int elapsedTicks = net.minecraft.server.MinecraftServer.currentTick - this.lastTick;
+ conversionProgress *= elapsedTicks;
+ // CraftBukkit end
this.villagerConversionTime -= conversionProgress;
if (this.villagerConversionTime <= 0) {
this.finishConversion((ServerLevel)this.level());
@@ -147,6 +_,7 @@
}
@ -95,9 +83,9 @@
serverLevel.levelEvent(null, 1027, this.blockPosition(), 0);
}
- }
+ // CraftBukkit start
+ }, org.bukkit.event.entity.EntityTransformEvent.TransformReason.CURED, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CURED // CraftBukkit
);
+ // CraftBukkit start
+ if (converted == null) {
+ ((org.bukkit.entity.ZombieVillager) this.getBukkitEntity()).setConversionTime(-1); // SPIGOT-5208: End conversion to stop event spam
+ }

View file

@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
+++ b/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
@@ -38,41 +_,50 @@
@@ -38,41 +_,51 @@
public WanderingTraderSpawner(ServerLevelData serverLevelData) {
this.serverLevelData = serverLevelData;
@ -65,6 +65,7 @@
} else if (this.spawn(level)) {
- this.spawnChance = 25;
+ this.spawnChance = level.paperConfig().entities.spawning.wanderingTrader.spawnChanceMin;
+ // Paper end - Add Wandering Trader spawn rate config options
return 1;
} else {
return 0;

View file

@ -14,7 +14,7 @@
if (hitResultOnMoveVector.getType() != HitResult.Type.MISS && this.isAlive()) {
- this.hitTargetOrDeflectSelf(hitResultOnMoveVector);
+ this.preHitTargetOrDeflectSelf(hitResultOnMoveVector);
+ this.preHitTargetOrDeflectSelf(hitResultOnMoveVector); // CraftBukkit - projectile hit event
}
this.createParticleTrail();

View file

@ -27,7 +27,7 @@
public BeaconMenu(int containerId, Container container) {
this(containerId, container, new SimpleContainerData(3), ContainerLevelAccess.NULL);
@@ -43,10 +_,31 @@
@@ -43,6 +_,27 @@
public BeaconMenu(int containerId, Container container, ContainerData beaconData, ContainerLevelAccess access) {
super(MenuType.BEACON, containerId);
@ -55,11 +55,6 @@
checkContainerDataCount(beaconData, 3);
this.beaconData = beaconData;
this.access = access;
- this.paymentSlot = new BeaconMenu.PaymentSlot(this.beacon, 0, 136, 110);
+ this.paymentSlot = new PaymentSlot(this.beacon, 0, 136, 110);
this.addSlot(this.paymentSlot);
this.addDataSlots(beaconData);
this.addStandardInventorySlots(container, 36, 137);
@@ -65,6 +_,7 @@
@Override

View file

@ -25,16 +25,14 @@
- this.addSlot(new BrewingStandMenu.PotionSlot(brewingStandContainer, 0, 56, 51));
- this.addSlot(new BrewingStandMenu.PotionSlot(brewingStandContainer, 1, 79, 58));
- this.addSlot(new BrewingStandMenu.PotionSlot(brewingStandContainer, 2, 102, 51));
- this.ingredientSlot = this.addSlot(new BrewingStandMenu.IngredientsSlot(potionBrewing, brewingStandContainer, 3, 79, 17));
- this.addSlot(new BrewingStandMenu.FuelSlot(brewingStandContainer, 4, 17, 17));
- this.addDataSlots(brewingStandData);
+ // Paper start - custom potion mixes
+ this.addSlot(new PotionSlot(brewingStandContainer, 0, 56, 51, potionBrewing));
+ this.addSlot(new PotionSlot(brewingStandContainer, 1, 79, 58, potionBrewing));
+ this.addSlot(new PotionSlot(brewingStandContainer, 2, 102, 51, potionBrewing));
+ this.addSlot(new BrewingStandMenu.PotionSlot(brewingStandContainer, 0, 56, 51, potionBrewing));
+ this.addSlot(new BrewingStandMenu.PotionSlot(brewingStandContainer, 1, 79, 58, potionBrewing));
+ this.addSlot(new BrewingStandMenu.PotionSlot(brewingStandContainer, 2, 102, 51, potionBrewing));
+ // Paper end - custom potion mixes
+ this.ingredientSlot = this.addSlot(new IngredientsSlot(potionBrewing, brewingStandContainer, 3, 79, 17));
+ this.addSlot(new FuelSlot(brewingStandContainer, 4, 17, 17));
this.ingredientSlot = this.addSlot(new BrewingStandMenu.IngredientsSlot(potionBrewing, brewingStandContainer, 3, 79, 17));
this.addSlot(new BrewingStandMenu.FuelSlot(brewingStandContainer, 4, 17, 17));
- this.addDataSlots(brewingStandData);
+ // Paper start - Add recipeBrewTime
+ this.addDataSlots(new SimpleContainerData(2) {
+ @Override
@ -58,15 +56,6 @@
return this.brewingStand.stillValid(player);
}
@@ -67,7 +_,7 @@
ItemStack item = slot.getItem();
itemStack = item.copy();
if ((index < 0 || index > 2) && index != 3 && index != 4) {
- if (BrewingStandMenu.FuelSlot.mayPlaceItem(itemStack)) {
+ if (FuelSlot.mayPlaceItem(itemStack)) {
if (this.moveItemStackTo(item, 4, 5, false) || this.ingredientSlot.mayPlace(item) && !this.moveItemStackTo(item, 3, 4, false)) {
return ItemStack.EMPTY;
}
@@ -75,7 +_,7 @@
if (!this.moveItemStackTo(item, 3, 4, false)) {
return ItemStack.EMPTY;