Skip to content

Commit

Permalink
Try and remove some IForgeBlock usages
Browse files Browse the repository at this point in the history
That one on GrateBlock, turns out Forge only ever calls it with a `null`
parameter for the mob, i think
  • Loading branch information
quat1024 committed Nov 5, 2023
1 parent 1709357 commit 69a97fc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
11 changes: 0 additions & 11 deletions src/main/java/vazkii/quark/content/building/block/GrateBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 69a97fc

Please sign in to comment.