Fix a bunch of vanilla bugs

https://bugs.mojang.com/browse/MC-253721
  wrong msg for opping multiple players

https://bugs.mojang.com/browse/MC-248588
  respect mob griefing gamerule for draining water cauldrons

https://bugs.mojang.com/browse/MC-244739
  play goat eating sound for last item in stack

https://bugs.mojang.com/browse/MC-243057
  ignore furnace fuel slot in recipe book click

https://bugs.mojang.com/browse/MC-147659
  Some witch huts spawn the incorrect cat
  Note: Marked as Won't Fix, makes 0 sense

https://bugs.mojang.com/browse/MC-179072
  Creepers do not defuse when switching from Survival to Creative/Spectator

https://bugs.mojang.com/browse/MC-259571
  Fix changeGameModeForPlayer to use gameModeForPlayer

https://bugs.mojang.com/browse/MC-262422
  Fix lightning being able to hit spectators

https://bugs.mojang.com/browse/MC-263999
  Fix mobs breaking doors not spawning block break particles

https://bugs.mojang.com/browse/MC-210802
  Fixes sheep eating blocks outside of ticking range

https://bugs.mojang.com/browse/MC-123848
  Fixes item frames dropping items above when pointing down

https://bugs.mojang.com/browse/MC-174630
  Fix secondary beacon effect remaining after switching effect

https://bugs.mojang.com/browse/MC-153086
  Fix the beacon deactivation sound always playing when broken

https://bugs.mojang.com/browse/MC-200092
  Fix yaw being ignored for a player's first spawn pos

https://bugs.mojang.com/browse/MC-158900
  Fix error when joining after tempban expired

https://bugs.mojang.com/browse/MC-99075
  Fix inventory desync within spawn protected area

https://bugs.mojang.com/browse/MC-273635
  Fix TrialSpawner forgets assigned mob when placed by player

== AT ==
public net/minecraft/world/entity/Mob leashInfoTag
public net/minecraft/server/level/ChunkMap anyPlayerCloseEnoughForSpawning(Lnet/minecraft/world/level/ChunkPos;)Z

Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
This commit is contained in:
Jake Potrebic
2022-07-11 11:56:41 -07:00
parent 492ebf1459
commit 0b9ef3701e
20 changed files with 256 additions and 83 deletions

View File

@@ -20,10 +20,11 @@
if (world instanceof ServerLevel worldserver) {
if (entity.isOnFire() && this.isEntityInsideContent(state, pos, entity)) {
- entity.clearFire();
- if (entity.mayInteract(worldserver, pos)) {
- this.handleEntityOnFireInside(state, world, pos);
+ // CraftBukkit start - moved down
+ // entity.clearFire();
if (entity.mayInteract(worldserver, pos)) {
- this.handleEntityOnFireInside(state, world, pos);
+ if ((entity instanceof net.minecraft.world.entity.player.Player || worldserver.getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING)) && entity.mayInteract(worldserver, pos)) { // Paper - Fixes MC-248588
+ if (this.handleEntityOnFireInsideWithEvent(state, world, pos, entity)) { // Paper - fix powdered snow cauldron extinguishing entities
+ entity.clearFire();
+ }

View File

@@ -276,7 +276,7 @@
}
}
@@ -378,30 +481,47 @@
@@ -378,41 +481,55 @@
}
public List<RecipeHolder<?>> getRecipesToAwardAndPopExperience(ServerLevel world, Vec3 pos) {
@@ -330,3 +330,18 @@
}
@Override
public void fillStackedContents(StackedItemContents finder) {
- Iterator iterator = this.items.iterator();
+ // Paper start - don't account fuel stack (fixes MC-243057)
+ finder.accountStack(this.items.get(SLOT_INPUT));
+ finder.accountStack(this.items.get(SLOT_RESULT));
+ // Paper end
- while (iterator.hasNext()) {
- ItemStack itemstack = (ItemStack) iterator.next();
-
- finder.accountStack(itemstack);
- }
-
}
}

View File

@@ -77,7 +77,7 @@
if (blockEntity.lastCheckY >= l) {
blockEntity.lastCheckY = world.getMinY() - 1;
@@ -247,43 +291,104 @@
@@ -247,43 +291,108 @@
@Override
public void setRemoved() {
@@ -85,7 +85,11 @@
+ org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(level, worldPosition);
+ new io.papermc.paper.event.block.BeaconDeactivatedEvent(block).callEvent();
+ // Paper end - beacon activation/deactivation events
+ // Paper start - fix MC-153086
+ if (this.levels > 0 && !this.beamSections.isEmpty()) {
BeaconBlockEntity.playSound(this.level, this.worldPosition, SoundEvents.BEACON_DEACTIVATE);
+ }
+ // Paper end
super.setRemoved();
}
@@ -197,7 +201,7 @@
public static void playSound(Level world, BlockPos pos, SoundEvent sound) {
world.playSound((Player) null, pos, sound, SoundSource.BLOCKS, 1.0F, 1.0F);
}
@@ -316,7 +421,7 @@
@@ -316,7 +425,7 @@
if (nbt.contains(key, 8)) {
ResourceLocation minecraftkey = ResourceLocation.tryParse(nbt.getString(key));
@@ -206,7 +210,7 @@
} else {
return null;
}
@@ -327,11 +432,13 @@
@@ -327,11 +436,13 @@
super.loadAdditional(nbt, registries);
this.primaryPower = BeaconBlockEntity.loadEffect(nbt, "primary_effect");
this.secondaryPower = BeaconBlockEntity.loadEffect(nbt, "secondary_effect");
@@ -220,7 +224,7 @@
}
@Override
@@ -345,6 +452,7 @@
@@ -345,6 +456,7 @@
}
this.lockKey.addToTag(nbt, registries);

View File

@@ -52,3 +52,12 @@
ObjectListIterator objectlistiterator = objectarraylist.iterator();
while (objectlistiterator.hasNext()) {
@@ -370,7 +391,7 @@
}
public void overrideEntityToSpawn(EntityType<?> entityType, Level world) {
- this.data.reset();
+ this.data.reset(this); // Paper
this.normalConfig = Holder.direct(((TrialSpawnerConfig) this.normalConfig.value()).withSpawning(entityType));
this.ominousConfig = Holder.direct(((TrialSpawnerConfig) this.ominousConfig.value()).withSpawning(entityType));
this.setState(world, TrialSpawnerState.INACTIVE);

View File

@@ -1,5 +1,17 @@
--- a/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java
+++ b/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java
@@ -100,9 +100,9 @@
this.ejectingLootTable = rewardLootTable;
}
- public void reset() {
+ public void reset(TrialSpawner logic) { // Paper - Fix TrialSpawner forgets assigned mob; MC-273635
this.currentMobs.clear();
- this.nextSpawnData = Optional.empty();
+ if (!logic.getConfig().spawnPotentialsDefinition().isEmpty()) this.nextSpawnData = Optional.empty(); // Paper - Fix TrialSpawner forgets assigned mob; MC-273635
this.resetStatistics();
}
@@ -210,7 +210,7 @@
}

View File

@@ -0,0 +1,11 @@
--- a/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java
+++ b/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java
@@ -145,7 +145,7 @@
yield ACTIVE;
} else if (trialSpawnerData.isCooldownFinished(world)) {
logic.removeOminous(world, pos);
- trialSpawnerData.reset();
+ trialSpawnerData.reset(logic); // Paper - Fix TrialSpawner forgets assigned mob; MC-273635
yield WAITING_FOR_PLAYERS;
} else {
yield this;