From 69a97fc5a6a16dfb2637e5c618cabff71663c797 Mon Sep 17 00:00:00 2001 From: quat1024 Date: Sat, 4 Nov 2023 21:03:02 -0400 Subject: [PATCH] Try and remove some IForgeBlock usages That one on GrateBlock, turns out Forge only ever calls it with a `null` parameter for the mob, i think --- .../quark/addons/oddities/block/TinyPotatoBlock.java | 5 +++-- .../quark/content/building/block/CutVineBlock.java | 3 ++- .../quark/content/building/block/GrateBlock.java | 11 ----------- .../vazkii/quark/content/tools/block/CloudBlock.java | 3 ++- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/main/java/vazkii/quark/addons/oddities/block/TinyPotatoBlock.java b/src/main/java/vazkii/quark/addons/oddities/block/TinyPotatoBlock.java index 5abac2d8a7..638ecf8bcc 100644 --- a/src/main/java/vazkii/quark/addons/oddities/block/TinyPotatoBlock.java +++ b/src/main/java/vazkii/quark/addons/oddities/block/TinyPotatoBlock.java @@ -108,9 +108,10 @@ public void onRemove(@Nonnull BlockState state, @Nonnull Level world, @Nonnull B } } + @SuppressWarnings("deprecation") //Needless Forge extension @Override - public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter level, BlockPos pos, Player player) { - ItemStack stack = super.getCloneItemStack(state, target, level, pos, player); + public ItemStack getCloneItemStack(BlockGetter level, BlockPos pos, BlockState state) { + ItemStack stack = super.getCloneItemStack(level, pos, state); BlockEntity be = level.getBlockEntity(pos); if (be instanceof TinyPotatoBlockEntity tater) { if (tater.hasCustomName()) diff --git a/src/main/java/vazkii/quark/content/building/block/CutVineBlock.java b/src/main/java/vazkii/quark/content/building/block/CutVineBlock.java index 303bd02f97..6148ee2198 100644 --- a/src/main/java/vazkii/quark/content/building/block/CutVineBlock.java +++ b/src/main/java/vazkii/quark/content/building/block/CutVineBlock.java @@ -34,8 +34,9 @@ public boolean canSupportAtFace(@Nonnull BlockGetter level, @Nonnull BlockPos po return super.canSupportAtFace(level, pos, dir); } + @SuppressWarnings("deprecation") //Needless Forge extension @Override - public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter world, BlockPos pos, Player player) { + public ItemStack getCloneItemStack(BlockGetter level, BlockPos pos, BlockState state) { return new ItemStack(Items.VINE); } diff --git a/src/main/java/vazkii/quark/content/building/block/GrateBlock.java b/src/main/java/vazkii/quark/content/building/block/GrateBlock.java index e75711b9b9..577e3c3a61 100755 --- a/src/main/java/vazkii/quark/content/building/block/GrateBlock.java +++ b/src/main/java/vazkii/quark/content/building/block/GrateBlock.java @@ -8,7 +8,6 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.ExperienceOrb; -import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.SpawnPlacements.Type; import net.minecraft.world.entity.animal.Animal; import net.minecraft.world.entity.animal.WaterAnimal; @@ -30,7 +29,6 @@ import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Material; -import net.minecraft.world.level.pathfinder.BlockPathTypes; import net.minecraft.world.level.pathfinder.PathComputationType; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.EntityCollisionContext; @@ -44,7 +42,6 @@ import vazkii.zeta.module.ZetaModule; import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class GrateBlock extends QuarkBlock implements SimpleFluidloggedBlock, ICrawlSpaceBlock { private static final VoxelShape TRUE_SHAPE = box(0, 15, 0, 16, 16, 16); @@ -131,14 +128,6 @@ public VoxelShape getCollisionShape(@Nonnull BlockState state, @Nonnull BlockGet return TRUE_SHAPE; } - @Nullable - @Override - public BlockPathTypes getBlockPathType(BlockState state, BlockGetter world, BlockPos pos, @Nullable Mob entity) { - if (entity instanceof Animal || entity instanceof WaterAnimal) - return BlockPathTypes.DAMAGE_OTHER; - return null; - } - @Override public BlockState getStateForPlacement(BlockPlaceContext context) { Fluid fluidAt = context.getLevel().getFluidState(context.getClickedPos()).getType(); diff --git a/src/main/java/vazkii/quark/content/tools/block/CloudBlock.java b/src/main/java/vazkii/quark/content/tools/block/CloudBlock.java index e231c6dc3e..592c5200fa 100644 --- a/src/main/java/vazkii/quark/content/tools/block/CloudBlock.java +++ b/src/main/java/vazkii/quark/content/tools/block/CloudBlock.java @@ -83,8 +83,9 @@ public InteractionResult use(@Nonnull BlockState state, @Nonnull Level world, @N return InteractionResult.PASS; } + @SuppressWarnings("deprecation") //Needless Forge extension @Override - public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter world, BlockPos pos, Player player) { + public ItemStack getCloneItemStack(BlockGetter level, BlockPos pos, BlockState state) { return new ItemStack(BottledCloudModule.bottled_cloud); }