diff options
author | MiniDigger | Martin <[email protected]> | 2024-01-14 11:04:49 +0100 |
---|---|---|
committer | MiniDigger | Martin <[email protected]> | 2024-01-14 11:04:49 +0100 |
commit | bee74680e607c2e29b038329f62181238911cd83 (patch) | |
tree | 708fd1a4a0227d9071243adf2a42d5e9e96cde4a /patch-remap/mache-spigotflower/net/minecraft/world/level/block/BuddingAmethystBlock.java.patch | |
parent | 0a44692ef6ff6e255d48eb3ba1bb114166eafda9 (diff) | |
download | Paper-softspoon.tar.gz Paper-softspoon.zip |
add remapped patches as a testsoftspoon
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/level/block/BuddingAmethystBlock.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower/net/minecraft/world/level/block/BuddingAmethystBlock.java.patch | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/level/block/BuddingAmethystBlock.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/level/block/BuddingAmethystBlock.java.patch new file mode 100644 index 0000000000..1f93242eb5 --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/world/level/block/BuddingAmethystBlock.java.patch @@ -0,0 +1,71 @@ +--- a/net/minecraft/world/level/block/BuddingAmethystBlock.java ++++ b/net/minecraft/world/level/block/BuddingAmethystBlock.java +@@ -6,7 +6,7 @@ + import net.minecraft.server.level.ServerLevel; + import net.minecraft.util.RandomSource; + import net.minecraft.world.level.block.state.BlockBehaviour; +-import net.minecraft.world.level.block.state.BlockState; ++import net.minecraft.world.level.block.state.IBlockData; + import net.minecraft.world.level.material.Fluids; + + public class BuddingAmethystBlock extends AmethystBlock { +@@ -16,44 +16,42 @@ + private static final Direction[] DIRECTIONS = Direction.values(); + + @Override +- @Override + public MapCodec<BuddingAmethystBlock> codec() { + return BuddingAmethystBlock.CODEC; + } + +- public BuddingAmethystBlock(BlockBehaviour.Properties blockbehaviour_properties) { +- super(blockbehaviour_properties); ++ public BuddingAmethystBlock(BlockBehaviour.Properties properties) { ++ super(properties); + } + + @Override +- @Override +- public void randomTick(BlockState blockstate, ServerLevel serverlevel, BlockPos blockpos, RandomSource randomsource) { +- if (randomsource.nextInt(5) == 0) { +- Direction direction = BuddingAmethystBlock.DIRECTIONS[randomsource.nextInt(BuddingAmethystBlock.DIRECTIONS.length)]; +- BlockPos blockpos1 = blockpos.relative(direction); +- BlockState blockstate1 = serverlevel.getBlockState(blockpos1); ++ public void randomTick(IBlockData state, ServerLevel level, BlockPos pos, RandomSource random) { ++ if (random.nextInt(5) == 0) { ++ Direction enumdirection = BuddingAmethystBlock.DIRECTIONS[random.nextInt(BuddingAmethystBlock.DIRECTIONS.length)]; ++ BlockPos blockposition1 = pos.relative(enumdirection); ++ IBlockData iblockdata1 = level.getBlockState(blockposition1); + Block block = null; + +- if (canClusterGrowAtState(blockstate1)) { ++ if (canClusterGrowAtState(iblockdata1)) { + block = Blocks.SMALL_AMETHYST_BUD; +- } else if (blockstate1.is(Blocks.SMALL_AMETHYST_BUD) && blockstate1.getValue(AmethystClusterBlock.FACING) == direction) { ++ } else if (iblockdata1.is(Blocks.SMALL_AMETHYST_BUD) && iblockdata1.getValue(AmethystClusterBlock.FACING) == enumdirection) { + block = Blocks.MEDIUM_AMETHYST_BUD; +- } else if (blockstate1.is(Blocks.MEDIUM_AMETHYST_BUD) && blockstate1.getValue(AmethystClusterBlock.FACING) == direction) { ++ } else if (iblockdata1.is(Blocks.MEDIUM_AMETHYST_BUD) && iblockdata1.getValue(AmethystClusterBlock.FACING) == enumdirection) { + block = Blocks.LARGE_AMETHYST_BUD; +- } else if (blockstate1.is(Blocks.LARGE_AMETHYST_BUD) && blockstate1.getValue(AmethystClusterBlock.FACING) == direction) { ++ } else if (iblockdata1.is(Blocks.LARGE_AMETHYST_BUD) && iblockdata1.getValue(AmethystClusterBlock.FACING) == enumdirection) { + block = Blocks.AMETHYST_CLUSTER; + } + + if (block != null) { +- BlockState blockstate2 = (BlockState) ((BlockState) block.defaultBlockState().setValue(AmethystClusterBlock.FACING, direction)).setValue(AmethystClusterBlock.WATERLOGGED, blockstate1.getFluidState().getType() == Fluids.WATER); ++ IBlockData iblockdata2 = (IBlockData) ((IBlockData) block.defaultBlockState().setValue(AmethystClusterBlock.FACING, enumdirection)).setValue(AmethystClusterBlock.WATERLOGGED, iblockdata1.getFluidState().getType() == Fluids.WATER); + +- serverlevel.setBlockAndUpdate(blockpos1, blockstate2); ++ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(level, pos, blockposition1, iblockdata2); // CraftBukkit + } + + } + } + +- public static boolean canClusterGrowAtState(BlockState blockstate) { +- return blockstate.isAir() || blockstate.is(Blocks.WATER) && blockstate.getFluidState().getAmount() == 8; ++ public static boolean canClusterGrowAtState(IBlockData state) { ++ return state.isAir() || state.is(Blocks.WATER) && state.getFluidState().getAmount() == 8; + } + } |