fix compile errors

This commit is contained in:
Jake Potrebic 2023-06-07 17:30:05 -07:00
parent ac1a626493
commit c13b259ff2
No known key found for this signature in database
GPG Key ID: ECE0B3C133C016C5
9 changed files with 30 additions and 30 deletions

View File

@ -38,7 +38,7 @@ index a1eb5b0357d646b42031a5a21cc7740a94430558..ef5adc495a6feefdcf3ba595334436a5
public @org.jetbrains.annotations.Nullable net.minecraft.server.level.ChunkMap.TrackedEntity tracker; // Paper
diff --git a/src/main/java/net/minecraft/world/level/BlockCollisions.java b/src/main/java/net/minecraft/world/level/BlockCollisions.java
index f2c423154ed6a00882a46d93b69ed4f6ba73782c..8e1ca05ef78395b95a992f367214755b8084eee4 100644
index f2c423154ed6a00882a46d93b69ed4f6ba73782c..a3eaf80b020c3bbc0306c5d17659ee661dfd275b 100644
--- a/src/main/java/net/minecraft/world/level/BlockCollisions.java
+++ b/src/main/java/net/minecraft/world/level/BlockCollisions.java
@@ -65,22 +65,41 @@ public class BlockCollisions<T> extends AbstractIterator<T> {
@ -77,7 +77,7 @@ index f2c423154ed6a00882a46d93b69ed4f6ba73782c..8e1ca05ef78395b95a992f367214755b
+
+ if (blockState == null) {
+ if (!(source instanceof net.minecraft.server.level.ServerPlayer) || source.level().paperConfig().chunks.preventMovingIntoUnloadedChunks) {
+ return Shapes.create(far ? source.getBoundingBox() : new AABB(new BlockPos(x, y, z)));
+ return this.resultProvider.apply(new BlockPos.MutableBlockPos(x, y, z), Shapes.create(far ? source.getBoundingBox() : new AABB(new BlockPos(x, y, z))));
+ }
+ // Paper end
continue;

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 d8834abadc82617a2d09506432102211ea99b0b7..11a999182fd561611b3399d93ce9e2565cd4332a 100644
index d8834abadc82617a2d09506432102211ea99b0b7..06d4c1787b1ee4976e6ed1773d3ff7130aebc2d0 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java
@@ -312,6 +312,7 @@ public abstract class Raider extends PatrollingMonster {
@Override
public boolean canUse() {
+ if (!this.mob.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items
+ if (!this.mob.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items
Raid raid = this.mob.getCurrentRaid();
if (this.mob.hasActiveRaid() && !this.mob.getCurrentRaid().isOver() && this.mob.canBeLeader() && !ItemStack.matches(this.mob.getItemBySlot(EquipmentSlot.HEAD), Raid.getLeaderBannerInstance())) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Improve/fix EntityTargetLivingEntityEvent
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java b/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java
index 5aeef564cdaabeed88a52635e56073cca3a9d1f1..2fd7763f125421cf6bb3c0faf26253c9034183fc 100644
index 5aeef564cdaabeed88a52635e56073cca3a9d1f1..fe635e46569c67dac1d3581ee930d1bfa8b4030e 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java
@@ -47,17 +47,30 @@ public class StopAttackingIfTargetInvalid {
@ -20,7 +20,7 @@ index 5aeef564cdaabeed88a52635e56073cca3a9d1f1..2fd7763f125421cf6bb3c0faf26253c9
+ reason = EntityTargetEvent.TargetReason.FORGOT_TARGET;
+ } else if (!entityliving.isAlive()) {
+ reason = EntityTargetEvent.TargetReason.TARGET_DIED;
+ } else if (entityliving.level != entityinsentient.level) {
+ } else if (entityliving.level() != entityinsentient.level()) {
+ reason = EntityTargetEvent.TargetReason.TARGET_OTHER_LEVEL;
+ } else {
+ reason = EntityTargetEvent.TargetReason.TARGET_INVALID;

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add additional open container api to HumanEntity
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 2d3a7bb9f68350df136ee3d2e3aed0bbbe1a91cc..43a98bcd8e9fe8b204d6d750e3e301cc644024cb 100644
index 2d3a7bb9f68350df136ee3d2e3aed0bbbe1a91cc..b2c55ef236da89b70356712a6a5005d2240f92bf 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -463,6 +463,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@ -15,38 +15,38 @@ index 2d3a7bb9f68350df136ee3d2e3aed0bbbe1a91cc..43a98bcd8e9fe8b204d6d750e3e301cc
+ // Paper start - Add additional containers
+ @Override
+ public InventoryView openAnvil(Location location, boolean force) {
+ return openInventory(location, force, Material.ANVIL);
+ return this.openInventory(location, force, Material.ANVIL);
+ }
+
+ @Override
+ public InventoryView openCartographyTable(Location location, boolean force) {
+ return openInventory(location, force, Material.CARTOGRAPHY_TABLE);
+ return this.openInventory(location, force, Material.CARTOGRAPHY_TABLE);
+ }
+
+ @Override
+ public InventoryView openGrindstone(Location location, boolean force) {
+ return openInventory(location, force, Material.GRINDSTONE);
+ return this.openInventory(location, force, Material.GRINDSTONE);
+ }
+
+ @Override
+ public InventoryView openLoom(Location location, boolean force) {
+ return openInventory(location, force, Material.LOOM);
+ return this.openInventory(location, force, Material.LOOM);
+ }
+
+ @Override
+ public InventoryView openSmithingTable(Location location, boolean force) {
+ return openInventory(location, force, Material.SMITHING_TABLE);
+ return this.openInventory(location, force, Material.SMITHING_TABLE);
+ }
+
+ @Override
+ public InventoryView openStonecutter(Location location, boolean force) {
+ return openInventory(location, force, Material.STONECUTTER);
+ return this.openInventory(location, force, Material.STONECUTTER);
+ }
+
+ private InventoryView openInventory(Location location, boolean force, Material material) {
+ org.spigotmc.AsyncCatcher.catchOp("open" + material);
+ if (location == null) {
+ location = getLocation();
+ location = this.getLocation();
+ }
+ if (!force) {
+ Block block = location.getBlock();
@ -70,9 +70,9 @@ index 2d3a7bb9f68350df136ee3d2e3aed0bbbe1a91cc..43a98bcd8e9fe8b204d6d750e3e301cc
+ } else {
+ throw new IllegalArgumentException("Unsupported inventory type: " + material);
+ }
+ getHandle().openMenu(block.getMenuProvider(null, getHandle().level, new BlockPos(location.getBlockX(), location.getBlockY(), location.getBlockZ())));
+ getHandle().containerMenu.checkReachable = !force;
+ return getHandle().containerMenu.getBukkitView();
+ this.getHandle().openMenu(block.getMenuProvider(null, this.getHandle().level(), new BlockPos(location.getBlockX(), location.getBlockY(), location.getBlockZ())));
+ this.getHandle().containerMenu.checkReachable = !force;
+ return this.getHandle().containerMenu.getBukkitView();
+ }
+ // Paper end
+

View File

@ -8,7 +8,7 @@ and curing a villager on repeat by simply resetting the relevant part of
the reputation when it is cured.
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
index 24434b66d158b10d21579b2db6efb0bdcc788a5c..0c78c1ccb1443dca7efc5a429b6020373fc7331e 100644
index 24434b66d158b10d21579b2db6efb0bdcc788a5c..4bef7abbed6b64c2f126c81af5484eff200e620f 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -1000,6 +1000,15 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@ -16,7 +16,7 @@ index 24434b66d158b10d21579b2db6efb0bdcc788a5c..0c78c1ccb1443dca7efc5a429b602037
public void onReputationEventFrom(ReputationEventType interaction, Entity entity) {
if (interaction == ReputationEventType.ZOMBIE_VILLAGER_CURED) {
+ // Paper start - fix MC-181190
+ if (level.paperConfig().fixes.fixCuringZombieVillagerDiscountExploit) {
+ if (this.level().paperConfig().fixes.fixCuringZombieVillagerDiscountExploit) {
+ final GossipContainer.EntityGossips playerReputation = this.getGossips().gossips.get(entity.getUUID());
+ if (playerReputation != null) {
+ playerReputation.remove(GossipType.MAJOR_POSITIVE);

View File

@ -9,7 +9,7 @@ process to do this in the Bukkit API
Adds API for buildable, replaceable, burnable too.
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index 6c6867c007cec2b8364c875fbfc25c372b39351c..822ee0dbeec25646d2d2f335a1d1395726e6678e 100644
index 6c6867c007cec2b8364c875fbfc25c372b39351c..e181525525b8809c3d413047716264fd2b32cedd 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -467,6 +467,25 @@ public class CraftBlock implements Block {
@ -19,19 +19,19 @@ index 6c6867c007cec2b8364c875fbfc25c372b39351c..822ee0dbeec25646d2d2f335a1d13957
+ // Paper start
+ @Override
+ public boolean isBuildable() {
+ return getNMS().getMaterial().isSolid(); // This is in fact isSolid, despite the fact that isSolid below returns blocksMotion
+ return this.getNMS().isSolid(); // This is in fact isSolid, despite the fact that isSolid below returns blocksMotion
+ }
+ @Override
+ public boolean isBurnable() {
+ return getNMS().getMaterial().isFlammable();
+ return this.getNMS().ignitedByLava();
+ }
+ @Override
+ public boolean isReplaceable() {
+ return getNMS().getMaterial().isReplaceable();
+ return this.getNMS().canBeReplaced();
+ }
+ @Override
+ public boolean isSolid() {
+ return getNMS().getMaterial().blocksMotion();
+ return this.getNMS().blocksMotion();
+ }
+ // Paper end
+

View File

@ -8,7 +8,7 @@ Before this patch, instant effects would be applied before the potion ItemStack
This patch makes it so that instant effects are applied after the potion ItemStack is removed, and the glass bottle is only put into the player's inventory if the player is not dead. Otherwise, the glass bottle is dropped on the ground.
diff --git a/src/main/java/net/minecraft/world/item/PotionItem.java b/src/main/java/net/minecraft/world/item/PotionItem.java
index 84723e0e04cde81d695b95ea6a29bc875fb58ff1..93bb2cbd397fef4db9d903d2b41a35b6d67bf4a9 100644
index 84723e0e04cde81d695b95ea6a29bc875fb58ff1..8c79ca75089e739d4899421106833e42e4e57280 100644
--- a/src/main/java/net/minecraft/world/item/PotionItem.java
+++ b/src/main/java/net/minecraft/world/item/PotionItem.java
@@ -50,6 +50,7 @@ public class PotionItem extends Item {
@ -39,7 +39,7 @@ index 84723e0e04cde81d695b95ea6a29bc875fb58ff1..93bb2cbd397fef4db9d903d2b41a35b6
+ // Paper end
if (entityhuman == null || !entityhuman.getAbilities().instabuild) {
+ // Paper start - Fix harming potion dupe
+ if (user.getHealth() <= 0 && !user.level.getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_KEEPINVENTORY)) {
+ if (user.getHealth() <= 0 && !user.level().getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_KEEPINVENTORY)) {
+ user.spawnAtLocation(new ItemStack(Items.GLASS_BOTTLE), 0);
+ return ItemStack.EMPTY;
+ }

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Added world settings for mobs picking up loot
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
index 4ea7a6bd6fdc98bef30546e19e2676a78fb29007..14b172e0769d3503b755867fd46c272ea8c715a4 100644
index 4ea7a6bd6fdc98bef30546e19e2676a78fb29007..ef525e5f523966c9af7380e8d09ff5092e56e7c5 100644
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
@@ -153,7 +153,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
@ -13,7 +13,7 @@ index 4ea7a6bd6fdc98bef30546e19e2676a78fb29007..14b172e0769d3503b755867fd46c272e
this.populateDefaultEquipmentEnchantments(randomsource, difficulty);
this.reassessWeaponGoal();
- this.setCanPickUpLoot(randomsource.nextFloat() < 0.55F * difficulty.getSpecialMultiplier());
+ this.setCanPickUpLoot(this.level.paperConfig().entities.behavior.mobsCanAlwaysPickUpLoot.skeletons || randomsource.nextFloat() < 0.55F * difficulty.getSpecialMultiplier()); // Paper
+ this.setCanPickUpLoot(this.level().paperConfig().entities.behavior.mobsCanAlwaysPickUpLoot.skeletons || randomsource.nextFloat() < 0.55F * difficulty.getSpecialMultiplier()); // Paper
if (this.getItemBySlot(EquipmentSlot.HEAD).isEmpty()) {
LocalDate localdate = LocalDate.now();
int i = localdate.get(ChronoField.DAY_OF_MONTH);

View File

@ -10,7 +10,7 @@ public net.minecraft.world.entity.monster.Zombie DOOR_BREAKING_PREDICATE
Co-authored-by: Doc <nachito94@msn.com>
diff --git a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
index e6139ff42470cfa9bcad02d746f15b99b1096b48..da961f6495f8c448f0d53a0ed2f783b804e9eb6e 100644
index e6139ff42470cfa9bcad02d746f15b99b1096b48..2acc531bd9e948251cac77d979f973678f576394 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
@@ -197,7 +197,7 @@ public class Vindicator extends AbstractIllager {
@ -18,7 +18,7 @@ index e6139ff42470cfa9bcad02d746f15b99b1096b48..da961f6495f8c448f0d53a0ed2f783b8
static class VindicatorBreakDoorGoal extends BreakDoorGoal {
public VindicatorBreakDoorGoal(Mob mob) {
- super(mob, 6, Vindicator.DOOR_BREAKING_PREDICATE);
+ super(mob, 6, com.google.common.base.Predicates.in(mob.level.paperConfig().entities.behavior.doorBreakingDifficulty.getOrDefault(mob.getType(), mob.level.paperConfig().entities.behavior.doorBreakingDifficulty.get(EntityType.VINDICATOR)))); // Paper
+ super(mob, 6, com.google.common.base.Predicates.in(mob.level().paperConfig().entities.behavior.doorBreakingDifficulty.getOrDefault(mob.getType(), mob.level().paperConfig().entities.behavior.doorBreakingDifficulty.get(EntityType.VINDICATOR)))); // Paper
this.setFlags(EnumSet.of(Goal.Flag.MOVE));
}