mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 23:10:16 +01:00
Fix more derps from file patch updates
This commit is contained in:
parent
9d837fe4b6
commit
c4fd69c807
7 changed files with 19 additions and 46 deletions
|
@ -1,6 +1,6 @@
|
||||||
--- a/net/minecraft/world/entity/monster/Skeleton.java
|
--- a/net/minecraft/world/entity/monster/Skeleton.java
|
||||||
+++ b/net/minecraft/world/entity/monster/Skeleton.java
|
+++ b/net/minecraft/world/entity/monster/Skeleton.java
|
||||||
@@ -89,11 +_,18 @@
|
@@ -89,11 +_,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doFreezeConversion() {
|
protected void doFreezeConversion() {
|
||||||
|
@ -10,14 +10,13 @@
|
||||||
this.level().levelEvent(null, 1048, this.blockPosition(), 0);
|
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);
|
+ }, 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) {
|
+ if (stray == null) {
|
||||||
|
+ // Reset conversion time to prevent event spam
|
||||||
+ this.conversionTime = 300;
|
+ this.conversionTime = 300;
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end - Fix issues with mob conversion
|
+ // Paper end - add spawn and transform reasons
|
||||||
+ // CraftBukkit end - add spawn and transform reasons
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -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;
|
+ 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
|
+ // CraftBukkit end
|
||||||
ZombieVillager zombieVillager = villager.convertTo(EntityType.ZOMBIE_VILLAGER, ConversionParams.single(villager, true, true), mob -> {
|
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));
|
mob.finalizeSpawn(level, level.getCurrentDifficultyAt(mob.blockPosition()), EntitySpawnReason.CONVERSION, new Zombie.ZombieGroupData(false, true));
|
||||||
|
@ -130,10 +130,11 @@
|
||||||
+ if (!silent) {
|
+ if (!silent) {
|
||||||
+ level.levelEvent(null, 1026, blockPosition, 0);
|
+ level.levelEvent(null, 1026, blockPosition, 0);
|
||||||
}
|
}
|
||||||
+ // CraftBukkit end
|
- });
|
||||||
});
|
|
||||||
- return zombieVillager != null;
|
- return zombieVillager != null;
|
||||||
|
+ }, transformReason, creatureSpawnReason);
|
||||||
+ return zombieVillager;
|
+ return zombieVillager;
|
||||||
|
+ // CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSunSensitive() {
|
public boolean isSunSensitive() {
|
||||||
|
|
|
@ -16,18 +16,6 @@
|
||||||
|
|
||||||
public ZombieVillager(EntityType<? extends ZombieVillager> entityType, Level level) {
|
public ZombieVillager(EntityType<? extends ZombieVillager> entityType, Level level) {
|
||||||
super(entityType, 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 @@
|
@@ -147,6 +_,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,9 +83,9 @@
|
||||||
serverLevel.levelEvent(null, 1027, this.blockPosition(), 0);
|
serverLevel.levelEvent(null, 1027, this.blockPosition(), 0);
|
||||||
}
|
}
|
||||||
- }
|
- }
|
||||||
|
+ // CraftBukkit start
|
||||||
+ }, org.bukkit.event.entity.EntityTransformEvent.TransformReason.CURED, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CURED // CraftBukkit
|
+ }, org.bukkit.event.entity.EntityTransformEvent.TransformReason.CURED, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CURED // CraftBukkit
|
||||||
);
|
);
|
||||||
+ // CraftBukkit start
|
|
||||||
+ if (converted == null) {
|
+ if (converted == null) {
|
||||||
+ ((org.bukkit.entity.ZombieVillager) this.getBukkitEntity()).setConversionTime(-1); // SPIGOT-5208: End conversion to stop event spam
|
+ ((org.bukkit.entity.ZombieVillager) this.getBukkitEntity()).setConversionTime(-1); // SPIGOT-5208: End conversion to stop event spam
|
||||||
+ }
|
+ }
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
--- a/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
--- a/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||||
+++ b/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) {
|
public WanderingTraderSpawner(ServerLevelData serverLevelData) {
|
||||||
this.serverLevelData = serverLevelData;
|
this.serverLevelData = serverLevelData;
|
||||||
|
@ -65,6 +65,7 @@
|
||||||
} else if (this.spawn(level)) {
|
} else if (this.spawn(level)) {
|
||||||
- this.spawnChance = 25;
|
- this.spawnChance = 25;
|
||||||
+ this.spawnChance = level.paperConfig().entities.spawning.wanderingTrader.spawnChanceMin;
|
+ this.spawnChance = level.paperConfig().entities.spawning.wanderingTrader.spawnChanceMin;
|
||||||
|
+ // Paper end - Add Wandering Trader spawn rate config options
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
if (hitResultOnMoveVector.getType() != HitResult.Type.MISS && this.isAlive()) {
|
if (hitResultOnMoveVector.getType() != HitResult.Type.MISS && this.isAlive()) {
|
||||||
- this.hitTargetOrDeflectSelf(hitResultOnMoveVector);
|
- this.hitTargetOrDeflectSelf(hitResultOnMoveVector);
|
||||||
+ this.preHitTargetOrDeflectSelf(hitResultOnMoveVector);
|
+ this.preHitTargetOrDeflectSelf(hitResultOnMoveVector); // CraftBukkit - projectile hit event
|
||||||
}
|
}
|
||||||
|
|
||||||
this.createParticleTrail();
|
this.createParticleTrail();
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
public BeaconMenu(int containerId, Container container) {
|
public BeaconMenu(int containerId, Container container) {
|
||||||
this(containerId, container, new SimpleContainerData(3), ContainerLevelAccess.NULL);
|
this(containerId, container, new SimpleContainerData(3), ContainerLevelAccess.NULL);
|
||||||
@@ -43,10 +_,31 @@
|
@@ -43,6 +_,27 @@
|
||||||
|
|
||||||
public BeaconMenu(int containerId, Container container, ContainerData beaconData, ContainerLevelAccess access) {
|
public BeaconMenu(int containerId, Container container, ContainerData beaconData, ContainerLevelAccess access) {
|
||||||
super(MenuType.BEACON, containerId);
|
super(MenuType.BEACON, containerId);
|
||||||
|
@ -55,11 +55,6 @@
|
||||||
checkContainerDataCount(beaconData, 3);
|
checkContainerDataCount(beaconData, 3);
|
||||||
this.beaconData = beaconData;
|
this.beaconData = beaconData;
|
||||||
this.access = access;
|
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 @@
|
@@ -65,6 +_,7 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -25,16 +25,14 @@
|
||||||
- this.addSlot(new BrewingStandMenu.PotionSlot(brewingStandContainer, 0, 56, 51));
|
- this.addSlot(new BrewingStandMenu.PotionSlot(brewingStandContainer, 0, 56, 51));
|
||||||
- this.addSlot(new BrewingStandMenu.PotionSlot(brewingStandContainer, 1, 79, 58));
|
- this.addSlot(new BrewingStandMenu.PotionSlot(brewingStandContainer, 1, 79, 58));
|
||||||
- this.addSlot(new BrewingStandMenu.PotionSlot(brewingStandContainer, 2, 102, 51));
|
- 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
|
+ // Paper start - custom potion mixes
|
||||||
+ this.addSlot(new PotionSlot(brewingStandContainer, 0, 56, 51, potionBrewing));
|
+ this.addSlot(new BrewingStandMenu.PotionSlot(brewingStandContainer, 0, 56, 51, potionBrewing));
|
||||||
+ this.addSlot(new PotionSlot(brewingStandContainer, 1, 79, 58, potionBrewing));
|
+ this.addSlot(new BrewingStandMenu.PotionSlot(brewingStandContainer, 1, 79, 58, potionBrewing));
|
||||||
+ this.addSlot(new PotionSlot(brewingStandContainer, 2, 102, 51, potionBrewing));
|
+ this.addSlot(new BrewingStandMenu.PotionSlot(brewingStandContainer, 2, 102, 51, potionBrewing));
|
||||||
+ // Paper end - custom potion mixes
|
+ // Paper end - custom potion mixes
|
||||||
+ this.ingredientSlot = this.addSlot(new IngredientsSlot(potionBrewing, brewingStandContainer, 3, 79, 17));
|
this.ingredientSlot = this.addSlot(new BrewingStandMenu.IngredientsSlot(potionBrewing, brewingStandContainer, 3, 79, 17));
|
||||||
+ this.addSlot(new FuelSlot(brewingStandContainer, 4, 17, 17));
|
this.addSlot(new BrewingStandMenu.FuelSlot(brewingStandContainer, 4, 17, 17));
|
||||||
|
- this.addDataSlots(brewingStandData);
|
||||||
+ // Paper start - Add recipeBrewTime
|
+ // Paper start - Add recipeBrewTime
|
||||||
+ this.addDataSlots(new SimpleContainerData(2) {
|
+ this.addDataSlots(new SimpleContainerData(2) {
|
||||||
+ @Override
|
+ @Override
|
||||||
|
@ -58,15 +56,6 @@
|
||||||
return this.brewingStand.stillValid(player);
|
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 @@
|
@@ -75,7 +_,7 @@
|
||||||
if (!this.moveItemStackTo(item, 3, 4, false)) {
|
if (!this.moveItemStackTo(item, 3, 4, false)) {
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
|
|
Loading…
Reference in a new issue