Some more compile issues

This commit is contained in:
Bjarne Koll 2024-10-25 13:34:01 +02:00
parent 9c83387157
commit 0f011a31b1
No known key found for this signature in database
GPG Key ID: 27F6CCCF55D2EE62
32 changed files with 62 additions and 68 deletions

View File

@ -58,6 +58,19 @@ index 7344cff32fa6fe3dedb74ed98126072c55b0abd2..d98b28e9488a5a7736719cf656736bb0
entityliving1 = entityliving2;
} else {
entityliving1 = null;
diff --git a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
index 33170f2f1d3f030fbf342e44a1baa109a34c31a7..db8bb6e47b28bac6cf568415af3ffdd6eeac6ac7 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
@@ -349,7 +349,7 @@ public class Dolphin extends AgeableWaterCreature {
@Nullable
@Override
- protected SoundEvent getDeathSound() {
+ public SoundEvent getDeathSound() { // Paper - remap fixes
return SoundEvents.DOLPHIN_DEATH;
}
diff --git a/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java b/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java
index f3a2612f0e27c36d5206334307eac1880ce8c4b7..4d4d413b8527e1a109276928611b8c857ad6f6aa 100644
--- a/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java

View File

@ -1344,7 +1344,7 @@ index c010d18061f58a583c69e85fc29305497523f569..c8b8102d84119dfb6093f4b79aa3124c
private void applyMovementEmissionAndPlaySound(Entity.MovementEmission moveEffect, Vec3 movement, BlockPos landingPos, BlockState landingState) {
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index 17ab230c95901f0533997ac117d5b3d852fcd467..0782b2b58ed30d4ef2598e4b89f338a94a62bbe5 100644
index 17ab230c95901f0533997ac117d5b3d852fcd467..a9ae3d3210e049b0ce066b47378a3f2024154cfd 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -413,6 +413,16 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
@ -1352,9 +1352,9 @@ index 17ab230c95901f0533997ac117d5b3d852fcd467..0782b2b58ed30d4ef2598e4b89f338a9
public EntityType(EntityType.EntityFactory<T> factory, MobCategory spawnGroup, boolean saveable, boolean summonable, boolean fireImmune, boolean spawnableFarFromPlayer, ImmutableSet<Block> canSpawnInside, EntityDimensions dimensions, float spawnBoxScale, int maxTrackDistance, int trackTickInterval, String translationKey, Optional<ResourceKey<LootTable>> lootTable, FeatureFlagSet requiredFeatures) {
+ // Paper start
+ this(factory, spawnGroup, saveable, summonable, fireImmune, spawnableFarFromPlayer, canSpawnInside, dimensions, spawnBoxScale, maxTrackDistance, trackTickInterval, requiredFeatures, "custom");
+ this(factory, spawnGroup, saveable, summonable, fireImmune, spawnableFarFromPlayer, canSpawnInside, dimensions, spawnBoxScale, maxTrackDistance, trackTickInterval, translationKey, lootTable, requiredFeatures, "custom");
+ }
+ public EntityType(EntityType.EntityFactory<T> factory, MobCategory spawnGroup, boolean saveable, boolean summonable, boolean fireImmune, boolean spawnableFarFromPlayer, ImmutableSet<Block> canSpawnInside, EntityDimensions dimensions, float spawnBoxScale, int maxTrackDistance, int trackTickInterval, FeatureFlagSet requiredFeatures, String id) {
+ public EntityType(EntityType.EntityFactory<T> factory, MobCategory spawnGroup, boolean saveable, boolean summonable, boolean fireImmune, boolean spawnableFarFromPlayer, ImmutableSet<Block> canSpawnInside, EntityDimensions dimensions, float spawnBoxScale, int maxTrackDistance, int trackTickInterval, String translationKey, Optional<ResourceKey<LootTable>> lootTable, FeatureFlagSet requiredFeatures, String id) {
+ this.tickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "tick");
+ this.inactiveTickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "inactiveTick");
+ this.passengerTickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "passengerTick");
@ -1378,15 +1378,6 @@ index 17ab230c95901f0533997ac117d5b3d852fcd467..0782b2b58ed30d4ef2598e4b89f338a9
public boolean trackDeltas() {
return this != EntityType.PLAYER && this != EntityType.LLAMA_SPIT && this != EntityType.WITHER && this != EntityType.BAT && this != EntityType.ITEM_FRAME && this != EntityType.GLOW_ITEM_FRAME && this != EntityType.LEASH_KNOT && this != EntityType.PAINTING && this != EntityType.END_CRYSTAL && this != EntityType.EVOKER_FANGS;
}
@@ -926,7 +943,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
Util.fetchChoiceType(References.ENTITY_TREE, registryKey.location().toString());
}
- return new EntityType<>(this.factory, this.category, this.serialize, this.summon, this.fireImmune, this.canSpawnFarFromPlayer, this.immuneTo, this.dimensions.withAttachments(this.attachments), this.spawnDimensionsScale, this.clientTrackingRange, this.updateInterval, (String) this.descriptionId.get(registryKey), (Optional) this.lootTable.get(registryKey), this.requiredFeatures);
+ return new EntityType<>(this.factory, this.category, this.serialize, this.summon, this.fireImmune, this.canSpawnFarFromPlayer, this.immuneTo, this.dimensions.withAttachments(this.attachments), this.spawnDimensionsScale, this.clientTrackingRange, this.updateInterval, (String) this.descriptionId.get(registryKey), (Optional) this.lootTable.get(registryKey), this.requiredFeatures, this.id); // Paper - add id
}
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 9aa4e70f1d1c4de2138d31701dceaed25062e69c..6cc86412d45186dff312d9b1246fd1d03dbc15d8 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Drop falling block and tnt entities at the specified height
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index e9e8ad33371749f52a88a0ee089540eb26fb0f28..5ed77cc6c8b0459691d8044232d9972e4278964b 100644
index e9e8ad33371749f52a88a0ee089540eb26fb0f28..a5543a6b4811628ff5178a0ec01933ec4b30dfa4 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -159,6 +159,16 @@ public class FallingBlockEntity extends Entity {
@ -15,8 +15,8 @@ index e9e8ad33371749f52a88a0ee089540eb26fb0f28..5ed77cc6c8b0459691d8044232d9972e
this.applyEffectsFromBlocks();
+ // Paper start - Configurable falling blocks height nerf
+ if (this.level().paperConfig().fixes.fallingBlockHeightNerf.test(v -> this.getY() > v)) {
+ if (this.dropItem && this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
+ this.spawnAtLocation(block);
+ if (this.dropItem && this.level() instanceof final ServerLevel serverLevel && serverLevel.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
+ this.spawnAtLocation(serverLevel, block);
+ }
+
+ this.discard(EntityRemoveEvent.Cause.OUT_OF_WORLD);

View File

@ -60,7 +60,7 @@ index 0594b6adcb849bba2c810de245a3bdaeeca0be60..52d8ea3e40cdb01eab428f5d3d945c0c
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index 3836d9255ac326a7220e1decd2e9d98be7884c17..ab7500864e3a77444212bce4eb6ea75976f5ee5a 100644
index 3836d9255ac326a7220e1decd2e9d98be7884c17..73c4585870b7af409f84474f126a58497ed0495f 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -349,7 +349,7 @@ public class Zombie extends Monster {
@ -68,7 +68,7 @@ index 3836d9255ac326a7220e1decd2e9d98be7884c17..ab7500864e3a77444212bce4eb6ea759
if (SpawnPlacements.isSpawnPositionOk(entitytypes, world, blockposition) && SpawnPlacements.checkSpawnRules(entitytypes, world, EntitySpawnReason.REINFORCEMENT, blockposition, world.random)) {
entityzombie.setPos((double) i1, (double) j1, (double) k1);
- if (!world.hasNearbyAlivePlayer((double) i1, (double) j1, (double) k1, 7.0D) && world.isUnobstructed(entityzombie) && world.noCollision((Entity) entityzombie) && (entityzombie.canSpawnInLiquids() || !world.containsAnyLiquid(entityzombie.getBoundingBox()))) {
+ if (!world.hasNearbyAlivePlayerhasNearbyAlivePlayerThatAffectsSpawning((double) i1, (double) j1, (double) k1, 7.0D) && world.isUnobstructed(entityzombie) && world.noCollision((Entity) entityzombie) && (entityzombie.canSpawnInLiquids() || !world.containsAnyLiquid(entityzombie.getBoundingBox()))) { // Paper - affects spawning api
+ if (!world.hasNearbyAlivePlayerThatAffectsSpawning((double) i1, (double) j1, (double) k1, 7.0D) && world.isUnobstructed(entityzombie) && world.noCollision((Entity) entityzombie) && (entityzombie.canSpawnInLiquids() || !world.containsAnyLiquid(entityzombie.getBoundingBox()))) { // Paper - affects spawning api
entityzombie.setTarget(entityliving, EntityTargetEvent.TargetReason.REINFORCEMENT_TARGET, true); // CraftBukkit
entityzombie.finalizeSpawn(world, world.getCurrentDifficultyAt(entityzombie.blockPosition()), EntitySpawnReason.REINFORCEMENT, (SpawnGroupData) null);
world.addFreshEntityWithPassengers(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit

View File

@ -656,7 +656,7 @@ index a4be7b19b626957efdf2f2507121f0085ba1da50..d528e8e4aea266c495377365f01e3140
public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
private int maxStack = MAX_STACK;
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java b/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java
index beba927cffdeedcd68d8048708f5bf1a409ff965..5c78e33d4d369700a5fa6eb3cbbe85756465a063 100644
index beba927cffdeedcd68d8048708f5bf1a409ff965..874a44ab77248665c2db243764e8542bfc0d6514 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java
@@ -62,22 +62,26 @@ public interface ContainerEntity extends Container, MenuProvider {
@ -678,7 +678,7 @@ index beba927cffdeedcd68d8048708f5bf1a409ff965..5c78e33d4d369700a5fa6eb3cbbe8575
if (nbt.contains("LootTable", 8)) {
this.setContainerLootTable(ResourceKey.create(Registries.LOOT_TABLE, ResourceLocation.parse(nbt.getString("LootTable"))));
+ // Paper start - LootTable API
+ if (this.getLootTable() != null) {
+ if (this.getContainerLootTable() != null) {
+ this.lootableData().loadNbt(nbt);
+ }
+ // Paper end - LootTable API

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Filter bad block entity nbt data from falling blocks
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index 5ed77cc6c8b0459691d8044232d9972e4278964b..84d9ae7be1bc9b2c4940cc69de24abf7e4c228b3 100644
index a5543a6b4811628ff5178a0ec01933ec4b30dfa4..72abeb4f37b70094498ed3b18e8f73346ba0ead0 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -356,7 +356,7 @@ public class FallingBlockEntity extends Entity {

View File

@ -55,7 +55,7 @@ index e139ed6bc6f2dd07fe546588b31309ba30ed9755..34c3bf85473b3ad89355ebc21b68c59b
if (t0 != null) {
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index 0782b2b58ed30d4ef2598e4b89f338a94a62bbe5..7fb2155b8d320f8871556083aef9ed8e1e91e6e7 100644
index a9ae3d3210e049b0ce066b47378a3f2024154cfd..47fe53ed2f50f1a7ed9f324adf9fc73a6ecc184a 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -507,6 +507,16 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT

View File

@ -7,7 +7,7 @@ Subject: [PATCH] Add more Zombie API
public net.minecraft.world.entity.monster.Zombie isSunSensitive()Z
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index ab7500864e3a77444212bce4eb6ea75976f5ee5a..81d27114bd081096612e50a8cb93cae772cf46eb 100644
index 73c4585870b7af409f84474f126a58497ed0495f..d3d1e170380e7674c9ac13b06186eb563a58cd64 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -99,6 +99,7 @@ public class Zombie extends Monster {

View File

@ -116,7 +116,7 @@ index 5d551a50e1043e369ebf3ddfe181be1e24cfd068..463d34e7b54efd503c4879d1386b2439
} catch (Throwable throwable) {
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index 7fb2155b8d320f8871556083aef9ed8e1e91e6e7..ab02f4ca0bb8cd4939f167b410db208e38f7102b 100644
index 47fe53ed2f50f1a7ed9f324adf9fc73a6ecc184a..9fe4027aa16d73d806f51a7c195a5cf0468ebba3 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -443,7 +443,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Bees get gravity in void. Fixes MC-167279
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
index 310a2aa23365f9a8a8b7b6fa2323aed792f95adb..8c7943fdb56cd75c362e47e6c934bde5a714adaa 100644
index 310a2aa23365f9a8a8b7b6fa2323aed792f95adb..adff3bec90786b87323653cf4f94a38c7b9ef7ff 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
@@ -150,7 +150,22 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
@ -21,7 +21,7 @@ index 310a2aa23365f9a8a8b7b6fa2323aed792f95adb..8c7943fdb56cd75c362e47e6c934bde5
+
+ @Override
+ public void tick() {
+ if (this.mob.getY() <= Bee.this.level().getMinBuildHeight()) {
+ if (this.mob.getY() <= Bee.this.level().getMinY()) {
+ this.mob.setNoGravity(false);
+ }
+ super.tick();

View File

@ -8,7 +8,7 @@ This allows you to solve an issue in vanilla behavior where:
* On normal difficulty they will have a 50% of getting infected or dying.
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index 81d27114bd081096612e50a8cb93cae772cf46eb..2ed71c9a091bedea276f9043fb0c082dd250cdae 100644
index d3d1e170380e7674c9ac13b06186eb563a58cd64..5b8ac7113eb8a57fe07bfaacc1b1320383a56d06 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -484,10 +484,8 @@ public class Zombie extends Monster {

View File

@ -6,14 +6,14 @@ Subject: [PATCH] Ensure EntityRaider respects game and entity rules for
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java
index 96c6a2a6cb015d4ac90f98ce48a4c345ab72fd7a..4b9b961b1b910775788f85b13ee48abcc474daca 100644
index 96c6a2a6cb015d4ac90f98ce48a4c345ab72fd7a..6ac2351b3476aa04872196836ce00c622adab315 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java
@@ -338,6 +338,7 @@ public abstract class Raider extends PatrollingMonster {
}
private boolean cannotPickUpBanner() {
+ if (!this.mob.level().getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items
+ if (!getServerLevel(this.mob).getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items
if (!this.mob.hasActiveRaid()) {
return true;
} else if (this.mob.getCurrentRaid().isOver()) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add zombie targets turtle egg config
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index 2ed71c9a091bedea276f9043fb0c082dd250cdae..9adcaa646dff7f5415a467a2bfe5b817e17f5640 100644
index 5b8ac7113eb8a57fe07bfaacc1b1320383a56d06..c182bdcc5da5652f8b34b4cb8d28651cf79009fe 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -112,7 +112,7 @@ public class Zombie extends Monster {

View File

@ -18,7 +18,7 @@ index 8f63e27d904abb33492daf627d48d33d1193deef..723a098eabcc632caeb096f39c90e4e0
LocalDate localdate = LocalDate.now();
int i = localdate.get(ChronoField.DAY_OF_MONTH);
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index 9adcaa646dff7f5415a467a2bfe5b817e17f5640..4477d1a82a49e391760689eb991d1595995914f5 100644
index c182bdcc5da5652f8b34b4cb8d28651cf79009fe..34e46a64b3638f749a571d080fd8e7ac1f57edba 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -518,7 +518,7 @@ public class Zombie extends Monster {

View File

@ -23,7 +23,7 @@ index b06eedb1cb13771bbc7d0b812a9df864d1f73142..96b105697c91314148fd1b7835013892
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index 4477d1a82a49e391760689eb991d1595995914f5..6dc9fc3451edec01f11f526c05d84138c46a3a8e 100644
index 34e46a64b3638f749a571d080fd8e7ac1f57edba..a835ec6e063dd247a008da84446f8647f38d89d4 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -103,7 +103,7 @@ public class Zombie extends Monster {

View File

@ -128,7 +128,7 @@ index 30095df7b64cfda4931dbfa22549ff5abefd53e0..c8ae49f58c254119c0e64a4e1501ebc5
this.leader = null;
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
index 8c7943fdb56cd75c362e47e6c934bde5a714adaa..63e068c1a2d98c9c07dbabd1fa574d6b44e1a2fb 100644
index adff3bec90786b87323653cf4f94a38c7b9ef7ff..048a357546c8f5ad5dbb86e2e1ada2730a52d061 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
@@ -561,11 +561,13 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {

View File

@ -93,7 +93,7 @@ index 42b1bd58c6e2c3bd1170171eabfefe315202f340..55868c82bf8bd61ce3494aa9f363c20c
}
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java
index 4b9b961b1b910775788f85b13ee48abcc474daca..69a0a8aa7eec0a68a1460f6d6a4b604963b884c4 100644
index 6ac2351b3476aa04872196836ce00c622adab315..45375ccdcf730732dd915304dea2f523807eedd6 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java
@@ -233,7 +233,9 @@ public abstract class Raider extends PatrollingMonster {

View File

@ -5,27 +5,17 @@ Subject: [PATCH] prevent unintended light block manipulation
diff --git a/src/main/java/net/minecraft/world/level/block/LightBlock.java b/src/main/java/net/minecraft/world/level/block/LightBlock.java
index 6c3ca57a29d3c5ad1add1cf2f707b930dfc422ea..606c9b03cc69031faed33f437ca254f12224bb62 100644
index 6c3ca57a29d3c5ad1add1cf2f707b930dfc422ea..fec6bf38f080039436ba80d5528857ba4787bf4e 100644
--- a/src/main/java/net/minecraft/world/level/block/LightBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/LightBlock.java
@@ -5,7 +5,9 @@ import java.util.function.ToIntFunction;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.component.DataComponents;
+import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.RandomSource;
+import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
@@ -50,6 +52,14 @@ public class LightBlock extends Block implements SimpleWaterloggedBlock {
@@ -50,6 +50,14 @@ public class LightBlock extends Block implements SimpleWaterloggedBlock {
builder.add(LEVEL, WATERLOGGED);
}
+ // Paper start - prevent unintended light block manipulation
+ @Override
+ protected InteractionResult useItemOn(ItemStack stack, BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
+ if (player.getItemInHand(hand).getItem() != Items.LIGHT || (world instanceof final ServerLevel serverLevel && !player.mayInteract(serverLevel, pos)) || !player.mayUseItemAt(pos, hit.getDirection(), player.getItemInHand(hand))) { return net.minecraft.world.InteractionResult.PASS; } // Paper - Prevent unintended light block manipulation
+ protected InteractionResult useItemOn(ItemStack stack, BlockState state, Level world, BlockPos pos, Player player, net.minecraft.world.InteractionHand hand, BlockHitResult hit) {
+ if (player.getItemInHand(hand).getItem() != Items.LIGHT || (world instanceof final net.minecraft.server.level.ServerLevel serverLevel && !player.mayInteract(serverLevel, pos)) || !player.mayUseItemAt(pos, hit.getDirection(), player.getItemInHand(hand))) { return net.minecraft.world.InteractionResult.PASS; } // Paper - Prevent unintended light block manipulation
+ return super.useItemOn(stack, state, world, pos, player, hand, hit);
+ }
+ // Paper end - prevent unintended light block manipulation

View File

@ -9,7 +9,7 @@ so this resets it after each call to
Zombie#getExperienceReward
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index 6dc9fc3451edec01f11f526c05d84138c46a3a8e..17974f85d3c1db549ea11e8809954cd9d2af063e 100644
index a835ec6e063dd247a008da84446f8647f38d89d4..94b3ba2688676e92d9d093b63d92cab39d5d2f02 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -174,11 +174,16 @@ public class Zombie extends Monster {

View File

@ -117,7 +117,7 @@ index c661ae4e5c07494c7de852cc8d01f0f9839c1590..c96fbfe448b3e7b722a8db0e16882767
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
index 52d8ea3e40cdb01eab428f5d3d945c0c9f6088ce..1580c8b93a4ea1a9f2d7bf9c589ef64e070e3f53 100644
index 52d8ea3e40cdb01eab428f5d3d945c0c9f6088ce..ff65cb8ea5233f2dd159f42ad53bc9d300cd604f 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
@@ -165,7 +165,8 @@ public class Silverfish extends Monster {
@ -125,7 +125,7 @@ index 52d8ea3e40cdb01eab428f5d3d945c0c9f6088ce..1580c8b93a4ea1a9f2d7bf9c589ef64e
if (block instanceof InfestedBlock) {
// CraftBukkit start
- if (!CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition1, net.minecraft.world.level.block.Blocks.AIR.defaultBlockState())) {
+ BlockState afterState = world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? iblockdata.getFluidState().createLegacyBlock() : ((InfestedBlock) block).hostStateByInfested(world.getBlockState(blockposition1)); // Paper - fix wrong block state
+ BlockState afterState = getServerLevel(world).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? iblockdata.getFluidState().createLegacyBlock() : ((InfestedBlock) block).hostStateByInfested(world.getBlockState(blockposition1)); // Paper - fix wrong block state
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition1, afterState)) { // Paper - fix wrong block state
continue;
}

View File

@ -13,7 +13,7 @@ public net.minecraft.world.entity.item.FallingBlockEntity blockState
Co-authored-by: Lukas Planz <lukas.planz@web.de>
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index 84d9ae7be1bc9b2c4940cc69de24abf7e4c228b3..c228ca3ee911d25932932564b73e182840963e7d 100644
index 72abeb4f37b70094498ed3b18e8f73346ba0ead0..0ecda05a98046938546fe7bc6cf2590c886add41 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -71,6 +71,7 @@ public class FallingBlockEntity extends Entity {

View File

@ -24,7 +24,7 @@ index 37111113f6ab6d77c558b10c4162758135db99b0..911b6391455402922e8bd52cfe9e5694
EntityDropItemEvent event = new EntityDropItemEvent(this.getBukkitEntity(), (org.bukkit.entity.Item) entityitem.getBukkitEntity());
Bukkit.getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
index 33170f2f1d3f030fbf342e44a1baa109a34c31a7..b99e5878b3094ba25084b756c058510bc39f941a 100644
index db8bb6e47b28bac6cf568415af3ffdd6eeac6ac7..34f35502faf2029525a8e0a8f347456b2868804b 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
@@ -604,7 +604,7 @@ public class Dolphin extends AgeableWaterCreature {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Fix Bee flower NPE
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
index 63e068c1a2d98c9c07dbabd1fa574d6b44e1a2fb..3f775aeed0afb5c4f19cbb17bf7bd9f7cfdc3adb 100644
index 048a357546c8f5ad5dbb86e2e1ada2730a52d061..42276acfeadec6e7aa9a91d3f446f4fedb04829d 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
@@ -940,7 +940,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {

View File

@ -235,7 +235,7 @@ index dbcf14f5af9c9c0655a82529ee99450a8da14525..f745a554b9b84a53d9bd942ca9908153
}
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
index 30af4cbb17148c247a46c0346419d6c838dbc9d2..07c143c3eac263848fc5daf6f958d16a1a163e92 100644
index 30af4cbb17148c247a46c0346419d6c838dbc9d2..65f7f1f98f415a564aadb440d3a67143699e43db 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
@@ -272,6 +272,14 @@ public class ItemFrame extends HangingEntity {
@ -245,8 +245,8 @@ index 30af4cbb17148c247a46c0346419d6c838dbc9d2..07c143c3eac263848fc5daf6f958d16a
+ // Paper start - Fix MC-123848 (spawn item frame drops above block)
+ @Nullable
+ @Override
+ public net.minecraft.world.entity.item.ItemEntity spawnAtLocation(ItemStack stack) {
+ return this.spawnAtLocation(stack, getDirection().equals(Direction.DOWN) ? -0.6F : 0.0F);
+ public net.minecraft.world.entity.item.ItemEntity spawnAtLocation(ServerLevel serverLevel, ItemStack stack) {
+ return this.spawnAtLocation(serverLevel, stack, getDirection().equals(Direction.DOWN) ? -0.6F : 0.0F);
+ }
+ // Paper end
+

View File

@ -56,7 +56,7 @@ index 5c26beef2d3f3d4afa51950ddeb7089989218462..e283b1296c1e831376bfe9491cbf02ed
if (!flag) {
PiglinAi.putInInventory(piglin, itemstack);
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java
index 69a0a8aa7eec0a68a1460f6d6a4b604963b884c4..02f2107285d1bbe2137afd4f94880ad1f9d82fb9 100644
index 45375ccdcf730732dd915304dea2f523807eedd6..2eb1ad88bd39b3e6539d6c4ac61fb1d58edb5eb2 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java
@@ -228,6 +228,11 @@ public abstract class Raider extends PatrollingMonster {
@ -64,7 +64,7 @@ index 69a0a8aa7eec0a68a1460f6d6a4b604963b884c4..02f2107285d1bbe2137afd4f94880ad1
if (this.hasActiveRaid() && !flag && ItemStack.matches(itemstack, Raid.getOminousBannerInstance(this.registryAccess().lookupOrThrow(Registries.BANNER_PATTERN)))) {
+ // Paper start - EntityPickupItemEvent fixes
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, item, 0, false).isCancelled()) {
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, itemstack, 0, false).isCancelled()) {
+ return;
+ }
+ // Paper end - EntityPickupItemEvent fixes

View File

@ -5,7 +5,7 @@ Subject: [PATCH] config for disabling entity tag tags
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index ab02f4ca0bb8cd4939f167b410db208e38f7102b..6b2f0a4bc911888b72b796099760af38b1e28656 100644
index 9fe4027aa16d73d806f51a7c195a5cf0468ebba3..9be3f9b218b28fe8dde6321d8377232fbc634ee3 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -579,6 +579,16 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT

View File

@ -18,7 +18,7 @@ index 3cdcc4f44608d24550f2a8c6f3f5ce675d7777c5..7118e1f806af98159ec292f9340d7e40
if (worldmap != null) {
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
index 07c143c3eac263848fc5daf6f958d16a1a163e92..f046a866215fea7df10963af1a235ba9d04d4242 100644
index 65f7f1f98f415a564aadb440d3a67143699e43db..d6f835320014c07f9d174d05929ed8cc16a10c10 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
@@ -51,6 +51,7 @@ public class ItemFrame extends HangingEntity {

View File

@ -48,7 +48,7 @@ index e9142414c7d247ae2a27c0bc9ea2be3bb8e3db16..1d66c35b1092b8101f0a803d8c087e5a
this.entityData.set(Entity.DATA_POSE, pose);
}
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index 6b2f0a4bc911888b72b796099760af38b1e28656..4eec58353343b414120e189afed04b98ae3e87c8 100644
index 9be3f9b218b28fe8dde6321d8377232fbc634ee3..d036b02af0a4f63bd1e4e306f1ecd102b3d991fb 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -659,9 +659,15 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
@ -56,7 +56,7 @@ index 6b2f0a4bc911888b72b796099760af38b1e28656..4eec58353343b414120e189afed04b98
public static Optional<Entity> create(CompoundTag nbt, Level world, EntitySpawnReason reason) {
+ // Paper start - Don't fire sync event during generation
+ return create(nbt, world, false);
+ return create(nbt, world, reason, false);
+ }
+ public static Optional<Entity> create(CompoundTag nbt, Level world, EntitySpawnReason reason, boolean generation) {
+ // Paper end - Don't fire sync event during generation

View File

@ -53,7 +53,7 @@ index 084935138b1484f3d96e99f4e5655a6c04931907..9e357abe13f55bd9ce3a1d5348bcf19a
if (nbt.contains("LootTableSeed", 4)) {
this.setLootTableSeed(nbt.getLong("LootTableSeed"));
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index 4eec58353343b414120e189afed04b98ae3e87c8..d77014aadf83088fb53f30a9dbe879f3089e159e 100644
index d036b02af0a4f63bd1e4e306f1ecd102b3d991fb..97ad6cd38adbe8a7b2ea6e2a5a339bd67b81b5bd 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -690,7 +690,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
@ -129,7 +129,7 @@ index 75cc3db39c974abab8510af4a633fc6812efc647..14e31ae88e90d8ea1a98800cc6c1c352
if (nbt.contains("item", 10)) {
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java b/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java
index 5c78e33d4d369700a5fa6eb3cbbe85756465a063..35f90e06dcf30c2e6a2a63e81215283ffbb3ec05 100644
index 874a44ab77248665c2db243764e8542bfc0d6514..cc7826a10f22e3307231d887db2fee98063b1f46 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java
@@ -73,7 +73,7 @@ public interface ContainerEntity extends Container, MenuProvider {
@ -139,7 +139,7 @@ index 5c78e33d4d369700a5fa6eb3cbbe85756465a063..35f90e06dcf30c2e6a2a63e81215283f
- this.setContainerLootTable(ResourceKey.create(Registries.LOOT_TABLE, ResourceLocation.parse(nbt.getString("LootTable"))));
+ this.setContainerLootTable(net.minecraft.Optionull.map(ResourceLocation.tryParse(nbt.getString("LootTable")), rl -> ResourceKey.create(Registries.LOOT_TABLE, rl))); // Paper - Validate ResourceLocation
// Paper start - LootTable API
if (this.getLootTable() != null) {
if (this.getContainerLootTable() != null) {
this.lootableData().loadNbt(nbt);
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
index ecb9abc570ef87541184a8033cb33c82a4d1daf2..a1ac34668fcd53cf8adf4ce463e0254b26575fbf 100644

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Configurable Sand Duping
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index c228ca3ee911d25932932564b73e182840963e7d..d405ec0a6bb1e813cdf42d8e12db143df2d173b4 100644
index 0ecda05a98046938546fe7bc6cf2590c886add41..06d9a519e64d4b8b8764b3ad7691ad93b5cee065 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -435,7 +435,7 @@ public class FallingBlockEntity extends Entity {

View File

@ -51,7 +51,7 @@ index 8033abfd77bcc20326b992a9d81e2faa9582fb83..1f4cc08e84a23213bb9786ea09ad77ca
PiglinAi.angerNearbyPiglins(worldserver, player, true);
}
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java b/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java
index 35f90e06dcf30c2e6a2a63e81215283ffbb3ec05..5e7a5248852319471525019b3efcfdb730a9af46 100644
index cc7826a10f22e3307231d887db2fee98063b1f46..45f6191cc8e2ecdacbc2df0ddb5ea7cc6a546812 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java
@@ -95,7 +95,11 @@ public interface ContainerEntity extends Container, MenuProvider {

View File

@ -91,7 +91,7 @@ index 246b5649883e4f305afa5a887b9df0f3735f7593..5d8885bca55503bf7e1a2a4e1bb9b3bd
if (!this.level().isClientSide && this.age >= this.despawnRate) { // Spigot // Paper - Alternative item-despawn-rate
// CraftBukkit start - fire ItemDespawnEvent
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index 17974f85d3c1db549ea11e8809954cd9d2af063e..5a6e119d29ecdc45dee40d5984e502fb8e4d1543 100644
index 94b3ba2688676e92d9d093b63d92cab39d5d2f02..a12461907278cfbfa3b1c0aa74b9f07a31768b8a 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -98,7 +98,7 @@ public class Zombie extends Monster {