diff options
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/level/block/SculkCatalystBlock.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower/net/minecraft/world/level/block/SculkCatalystBlock.java.patch | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/level/block/SculkCatalystBlock.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/level/block/SculkCatalystBlock.java.patch new file mode 100644 index 0000000000..839690d392 --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/world/level/block/SculkCatalystBlock.java.patch @@ -0,0 +1,93 @@ +--- a/net/minecraft/world/level/block/SculkCatalystBlock.java ++++ b/net/minecraft/world/level/block/SculkCatalystBlock.java +@@ -14,7 +14,7 @@ + import net.minecraft.world.level.block.entity.BlockEntityType; + import net.minecraft.world.level.block.entity.SculkCatalystBlockEntity; + 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.block.state.StateDefinition; + import net.minecraft.world.level.block.state.properties.BlockStateProperties; + import net.minecraft.world.level.block.state.properties.BooleanProperty; +@@ -26,58 +26,58 @@ + private final IntProvider xpRange = ConstantInt.of(5); + + @Override +- @Override + public MapCodec<SculkCatalystBlock> codec() { + return SculkCatalystBlock.CODEC; + } + +- public SculkCatalystBlock(BlockBehaviour.Properties blockbehaviour_properties) { +- super(blockbehaviour_properties); +- this.registerDefaultState((BlockState) ((BlockState) this.stateDefinition.any()).setValue(SculkCatalystBlock.PULSE, false)); ++ public SculkCatalystBlock(BlockBehaviour.Properties properties) { ++ super(properties); ++ this.registerDefaultState((IBlockData) ((IBlockData) this.stateDefinition.any()).setValue(SculkCatalystBlock.PULSE, false)); + } + + @Override +- @Override +- protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> statedefinition_builder) { +- statedefinition_builder.add(SculkCatalystBlock.PULSE); ++ protected void createBlockStateDefinition(StateDefinition.Builder<Block, IBlockData> builder) { ++ builder.add(SculkCatalystBlock.PULSE); + } + + @Override +- @Override +- public void tick(BlockState blockstate, ServerLevel serverlevel, BlockPos blockpos, RandomSource randomsource) { +- if ((Boolean) blockstate.getValue(SculkCatalystBlock.PULSE)) { +- serverlevel.setBlock(blockpos, (BlockState) blockstate.setValue(SculkCatalystBlock.PULSE, false), 3); ++ public void tick(IBlockData state, ServerLevel level, BlockPos pos, RandomSource random) { ++ if ((Boolean) state.getValue(SculkCatalystBlock.PULSE)) { ++ level.setBlock(pos, (IBlockData) state.setValue(SculkCatalystBlock.PULSE, false), 3); + } + + } + + @Nullable + @Override +- @Override +- public BlockEntity newBlockEntity(BlockPos blockpos, BlockState blockstate) { +- return new SculkCatalystBlockEntity(blockpos, blockstate); ++ public BlockEntity newBlockEntity(BlockPos pos, IBlockData state) { ++ return new SculkCatalystBlockEntity(pos, state); + } + + @Nullable + @Override ++ public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, IBlockData state, BlockEntityType<T> blockEntityType) { ++ return level.isClientSide ? null : createTickerHelper(blockEntityType, BlockEntityType.SCULK_CATALYST, SculkCatalystBlockEntity::serverTick); ++ } ++ + @Override +- public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState blockstate, BlockEntityType<T> blockentitytype) { +- return level.isClientSide ? null : createTickerHelper(blockentitytype, BlockEntityType.SCULK_CATALYST, SculkCatalystBlockEntity::serverTick); ++ public EnumRenderType getRenderShape(IBlockData state) { ++ return EnumRenderType.MODEL; + } + + @Override +- @Override +- public RenderShape getRenderShape(BlockState blockstate) { +- return RenderShape.MODEL; ++ public void spawnAfterBreak(IBlockData state, ServerLevel level, BlockPos pos, ItemStack stack, boolean dropExperience) { ++ super.spawnAfterBreak(state, level, pos, stack, dropExperience); ++ // CraftBukkit start - Delegate to getExpDrop + } + + @Override +- @Override +- public void spawnAfterBreak(BlockState blockstate, ServerLevel serverlevel, BlockPos blockpos, ItemStack itemstack, boolean flag) { +- super.spawnAfterBreak(blockstate, serverlevel, blockpos, itemstack, flag); ++ public int getExpDrop(IBlockData iblockdata, ServerLevel worldserver, BlockPos blockposition, ItemStack itemstack, boolean flag) { + if (flag) { +- this.tryDropExperience(serverlevel, blockpos, itemstack, this.xpRange); ++ return this.tryDropExperience(worldserver, blockposition, itemstack, this.xpRange); + } + ++ return 0; ++ // CraftBukkit end + } + } |