fix compile errors

This commit is contained in:
Jake Potrebic 2023-06-07 17:30:05 -07:00
parent 752fd058f1
commit bca9b424ba
9 changed files with 21 additions and 21 deletions

View file

@ -15,38 +15,38 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - Add additional containers + // Paper start - Add additional containers
+ @Override + @Override
+ public InventoryView openAnvil(Location location, boolean force) { + public InventoryView openAnvil(Location location, boolean force) {
+ return openInventory(location, force, Material.ANVIL); + return this.openInventory(location, force, Material.ANVIL);
+ } + }
+ +
+ @Override + @Override
+ public InventoryView openCartographyTable(Location location, boolean force) { + public InventoryView openCartographyTable(Location location, boolean force) {
+ return openInventory(location, force, Material.CARTOGRAPHY_TABLE); + return this.openInventory(location, force, Material.CARTOGRAPHY_TABLE);
+ } + }
+ +
+ @Override + @Override
+ public InventoryView openGrindstone(Location location, boolean force) { + public InventoryView openGrindstone(Location location, boolean force) {
+ return openInventory(location, force, Material.GRINDSTONE); + return this.openInventory(location, force, Material.GRINDSTONE);
+ } + }
+ +
+ @Override + @Override
+ public InventoryView openLoom(Location location, boolean force) { + public InventoryView openLoom(Location location, boolean force) {
+ return openInventory(location, force, Material.LOOM); + return this.openInventory(location, force, Material.LOOM);
+ } + }
+ +
+ @Override + @Override
+ public InventoryView openSmithingTable(Location location, boolean force) { + public InventoryView openSmithingTable(Location location, boolean force) {
+ return openInventory(location, force, Material.SMITHING_TABLE); + return this.openInventory(location, force, Material.SMITHING_TABLE);
+ } + }
+ +
+ @Override + @Override
+ public InventoryView openStonecutter(Location location, boolean force) { + 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) { + private InventoryView openInventory(Location location, boolean force, Material material) {
+ org.spigotmc.AsyncCatcher.catchOp("open" + material); + org.spigotmc.AsyncCatcher.catchOp("open" + material);
+ if (location == null) { + if (location == null) {
+ location = getLocation(); + location = this.getLocation();
+ } + }
+ if (!force) { + if (!force) {
+ Block block = location.getBlock(); + Block block = location.getBlock();
@ -70,9 +70,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } else { + } else {
+ throw new IllegalArgumentException("Unsupported inventory type: " + material); + throw new IllegalArgumentException("Unsupported inventory type: " + material);
+ } + }
+ getHandle().openMenu(block.getMenuProvider(null, getHandle().level, new BlockPos(location.getBlockX(), location.getBlockY(), location.getBlockZ()))); + this.getHandle().openMenu(block.getMenuProvider(null, this.getHandle().level(), new BlockPos(location.getBlockX(), location.getBlockY(), location.getBlockZ())));
+ getHandle().containerMenu.checkReachable = !force; + this.getHandle().containerMenu.checkReachable = !force;
+ return getHandle().containerMenu.getBukkitView(); + return this.getHandle().containerMenu.getBukkitView();
+ } + }
+ // Paper end + // Paper end
+ +

View file

@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.populateDefaultEquipmentEnchantments(randomsource, difficulty); this.populateDefaultEquipmentEnchantments(randomsource, difficulty);
this.reassessWeaponGoal(); this.reassessWeaponGoal();
- this.setCanPickUpLoot(randomsource.nextFloat() < 0.55F * difficulty.getSpecialMultiplier()); - 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()) { if (this.getItemBySlot(EquipmentSlot.HEAD).isEmpty()) {
LocalDate localdate = LocalDate.now(); LocalDate localdate = LocalDate.now();
int i = localdate.get(ChronoField.DAY_OF_MONTH); int i = localdate.get(ChronoField.DAY_OF_MONTH);

View file

@ -19,19 +19,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start + // Paper start
+ @Override + @Override
+ public boolean isBuildable() { + 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 + @Override
+ public boolean isBurnable() { + public boolean isBurnable() {
+ return getNMS().getMaterial().isFlammable(); + return this.getNMS().ignitedByLava();
+ } + }
+ @Override + @Override
+ public boolean isReplaceable() { + public boolean isReplaceable() {
+ return getNMS().getMaterial().isReplaceable(); + return this.getNMS().canBeReplaced();
+ } + }
+ @Override + @Override
+ public boolean isSolid() { + public boolean isSolid() {
+ return getNMS().getMaterial().blocksMotion(); + return this.getNMS().blocksMotion();
+ } + }
+ // Paper end + // Paper end
+ +

View file

@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
static class VindicatorBreakDoorGoal extends BreakDoorGoal { static class VindicatorBreakDoorGoal extends BreakDoorGoal {
public VindicatorBreakDoorGoal(Mob mob) { public VindicatorBreakDoorGoal(Mob mob) {
- super(mob, 6, Vindicator.DOOR_BREAKING_PREDICATE); - 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)); this.setFlags(EnumSet.of(Goal.Flag.MOVE));
} }

View file

@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override @Override
public boolean canUse() { 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(); 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())) { if (this.mob.hasActiveRaid() && !this.mob.getCurrentRaid().isOver() && this.mob.canBeLeader() && !ItemStack.matches(this.mob.getItemBySlot(EquipmentSlot.HEAD), Raid.getLeaderBannerInstance())) {

View file

@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void onReputationEventFrom(ReputationEventType interaction, Entity entity) { public void onReputationEventFrom(ReputationEventType interaction, Entity entity) {
if (interaction == ReputationEventType.ZOMBIE_VILLAGER_CURED) { if (interaction == ReputationEventType.ZOMBIE_VILLAGER_CURED) {
+ // Paper start - fix MC-181190 + // 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()); + final GossipContainer.EntityGossips playerReputation = this.getGossips().gossips.get(entity.getUUID());
+ if (playerReputation != null) { + if (playerReputation != null) {
+ playerReputation.remove(GossipType.MAJOR_POSITIVE); + playerReputation.remove(GossipType.MAJOR_POSITIVE);

View file

@ -39,7 +39,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end + // Paper end
if (entityhuman == null || !entityhuman.getAbilities().instabuild) { if (entityhuman == null || !entityhuman.getAbilities().instabuild) {
+ // Paper start - Fix harming potion dupe + // 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); + user.spawnAtLocation(new ItemStack(Items.GLASS_BOTTLE), 0);
+ return ItemStack.EMPTY; + return ItemStack.EMPTY;
+ } + }

View file

@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ reason = EntityTargetEvent.TargetReason.FORGOT_TARGET; + reason = EntityTargetEvent.TargetReason.FORGOT_TARGET;
+ } else if (!entityliving.isAlive()) { + } else if (!entityliving.isAlive()) {
+ reason = EntityTargetEvent.TargetReason.TARGET_DIED; + reason = EntityTargetEvent.TargetReason.TARGET_DIED;
+ } else if (entityliving.level != entityinsentient.level) { + } else if (entityliving.level() != entityinsentient.level()) {
+ reason = EntityTargetEvent.TargetReason.TARGET_OTHER_LEVEL; + reason = EntityTargetEvent.TargetReason.TARGET_OTHER_LEVEL;
+ } else { + } else {
+ reason = EntityTargetEvent.TargetReason.TARGET_INVALID; + reason = EntityTargetEvent.TargetReason.TARGET_INVALID;

View file

@ -77,7 +77,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ if (blockState == null) { + if (blockState == null) {
+ if (!(source instanceof net.minecraft.server.level.ServerPlayer) || source.level().paperConfig().chunks.preventMovingIntoUnloadedChunks) { + 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 + // Paper end
continue; continue;