compile fixes

This commit is contained in:
Jason Penilla 2024-04-25 20:15:07 -07:00
parent 9c8593cb14
commit af2e3abf87
9 changed files with 12 additions and 25 deletions

View file

@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - Add PlayerChangeBeaconEffectEvent + // Paper start - Add PlayerChangeBeaconEffectEvent
+ private static @Nullable org.bukkit.potion.PotionEffectType convert(Optional<Holder<MobEffect>> optionalEffect) { + private static @Nullable org.bukkit.potion.PotionEffectType convert(Optional<Holder<MobEffect>> optionalEffect) {
+ return optionalEffect.map(org.bukkit.craftbukkit.potion.CraftPotionEffectType::minecraftToBukkit).orElse(null); + return optionalEffect.map(org.bukkit.craftbukkit.potion.CraftPotionEffectType::minecraftHolderToBukkit).orElse(null);
+ } + }
+ // Paper end - Add PlayerChangeBeaconEffectEvent + // Paper end - Add PlayerChangeBeaconEffectEvent
+ +

View file

@ -3,20 +3,9 @@ From: Josh Roy <10731363+JRoy@users.noreply.github.com>
Date: Wed, 26 Aug 2020 02:12:31 -0400 Date: Wed, 26 Aug 2020 02:12:31 -0400
Subject: [PATCH] Add additional open container api to HumanEntity Subject: [PATCH] Add additional open container api to HumanEntity
== AT ==
public net/minecraft/world/level/block/state/BlockBehaviour getMenuProvider(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/MenuProvider;
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement {
}
@Nullable
- protected MenuProvider getMenuProvider(BlockState state, Level world, BlockPos pos) {
+ public MenuProvider getMenuProvider(BlockState state, Level world, BlockPos pos) { // Paper - public
return null;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java

View file

@ -107,7 +107,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
private void explode(BlockState state, Level world, final BlockPos explodedPos) { private void explode(BlockState state, Level world, final BlockPos explodedPos) {
+ final org.bukkit.block.BlockState explodedBlockState = org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(explodedPos, state, null); // Paper - add exploded state + final org.bukkit.block.BlockState explodedBlockState = org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(world, explodedPos, state, null); // Paper - add exploded state
world.removeBlock(explodedPos, false); world.removeBlock(explodedPos, false);
Stream<Direction> stream = Direction.Plane.HORIZONTAL.stream(); // CraftBukkit - decompile error Stream<Direction> stream = Direction.Plane.HORIZONTAL.stream(); // CraftBukkit - decompile error

View file

@ -66,7 +66,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - Custom beacon ranges + // Paper start - Custom beacon ranges
+ BeaconBlockEntity.applyEffects(world, pos, beaconLevel, primaryEffect, secondaryEffect, null); + BeaconBlockEntity.applyEffects(world, pos, beaconLevel, primaryEffect, secondaryEffect, null);
+ } + }
+ private static void applyEffects(Level world, BlockPos pos, int beaconLevel, @Nullable MobEffect primaryEffect, @Nullable MobEffect secondaryEffect, @Nullable BeaconBlockEntity blockEntity) { + private static void applyEffects(Level world, BlockPos pos, int beaconLevel, @Nullable Holder<MobEffect> primaryEffect, @Nullable Holder<MobEffect> secondaryEffect, @Nullable BeaconBlockEntity blockEntity) {
+ // Paper end - Custom beacon ranges + // Paper end - Custom beacon ranges
if (!world.isClientSide && primaryEffect != null) { if (!world.isClientSide && primaryEffect != null) {
double d0 = (double) (beaconLevel * 10 + 10); double d0 = (double) (beaconLevel * 10 + 10);

View file

@ -691,7 +691,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // call BlockStateBase#neighborChanged directly. This change mostly + // call BlockStateBase#neighborChanged directly. This change mostly
+ // restores old behavior, at the cost of bypassing the + // restores old behavior, at the cost of bypassing the
+ // max-chained-neighbor-updates server property. + // max-chained-neighbor-updates server property.
+ worldIn.getBlockState(upd.self).neighborChanged(worldIn, upd.self, wire, upd.parent, false); + worldIn.getBlockState(upd.self).handleNeighborChanged(worldIn, upd.self, wire, upd.parent, false);
+ } + }
+ } + }
+ +

View file

@ -192,7 +192,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
CandleBlock candleblock = (CandleBlock) block; CandleBlock candleblock = (CandleBlock) block;
- -
+ // Paper start - call change block event + // Paper start - call change block event
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, pos, CandleCakeBlock.byCandle(block))) { + if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, pos, CandleCakeBlock.byCandle(candleblock))) {
+ player.containerMenu.sendAllDataToRemote(); // update inv because candle could decrease + player.containerMenu.sendAllDataToRemote(); // update inv because candle could decrease
+ return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; + return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;
+ } + }
@ -234,7 +234,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
BlockState iblockdata1 = ComposterBlock.addItem(player, state, world, pos, stack); BlockState iblockdata1 = ComposterBlock.addItem(player, state, world, pos, stack);
+ // Paper start - handle cancelled events + // Paper start - handle cancelled events
+ if (iblockdata1 == null) { + if (iblockdata1 == null) {
+ return InteractionResult.PASS; + return ItemInteractionResult.SKIP_DEFAULT_BLOCK_INTERACTION;
+ } + }
+ // Paper end + // Paper end

View file

@ -367,7 +367,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ // Paper start - Fix MC-224454 + // Paper start - Fix MC-224454
+ @Override + @Override
+ public boolean isPathfindable(BlockState state, BlockGetter world, BlockPos pos, net.minecraft.world.level.pathfinder.PathComputationType type) { + public boolean isPathfindable(BlockState state, net.minecraft.world.level.pathfinder.PathComputationType type) {
+ return false; + return false;
+ } + }
+ // Paper end + // Paper end

View file

@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
+ // Paper start - track changed items in the dispense event + // Paper start - track changed items in the dispense event
+ itemstack1 = CraftItemStack.unwrap(event.getItem()); // unwrap is safe because the stack won't be modified + itemstack1 = CraftItemStack.unwrap(event.getItem()); // unwrap is safe because the stack won't be modified
+ entitytypes = ((SpawnEggItem) itemstack1.getItem()).getType(itemstack1.getTag()); + entitytypes = ((SpawnEggItem) itemstack1.getItem()).getType(itemstack1);
+ // Paper end - track changed item from dispense event + // Paper end - track changed item from dispense event
} }

View file

@ -9000,12 +9000,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ LOGGER.warn("Future status not complete after scheduling: " + this.toStatus.toString() + ", generate: " + generation); + LOGGER.warn("Future status not complete after scheduling: " + this.toStatus.toString() + ", generate: " + generation);
+ } + }
+ +
+ final ChunkResult<ChunkAccess> either;
+ final ChunkAccess newChunk; + final ChunkAccess newChunk;
+ +
+ try { + try {
+ either = completeFuture.join(); + newChunk = completeFuture.join();
+ newChunk = (either == null) ? null : either.orElse(null);
+ } catch (final Throwable throwable) { + } catch (final Throwable throwable) {
+ this.complete(null, throwable); + this.complete(null, throwable);
+ // ensure the chunk system can respond, then die + // ensure the chunk system can respond, then die
@ -9016,7 +9014,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ +
+ if (newChunk == null) { + if (newChunk == null) {
+ this.complete(null, new IllegalStateException("Chunk for status: " + ChunkUpgradeGenericStatusTask.this.toStatus.toString() + ", generation: " + generation + " should not be null! Either: " + either).fillInStackTrace()); + this.complete(null, new IllegalStateException("Chunk for status: " + ChunkUpgradeGenericStatusTask.this.toStatus.toString() + ", generation: " + generation + " should not be null! Future: " + completeFuture).fillInStackTrace());
+ return; + return;
+ } + }
+ +