Skip to content

Commit e50d3fc

Browse files
committed
a bunch more work on the port
1 parent 6525ff5 commit e50d3fc

File tree

107 files changed

+1320
-1267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+1320
-1267
lines changed

Diff for: src/main/java/de/ellpeck/naturesaura/Helper.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import de.ellpeck.naturesaura.api.misc.ILevelData;
77
import de.ellpeck.naturesaura.blocks.tiles.BlockEntityImpl;
88
import de.ellpeck.naturesaura.chunk.AuraChunk;
9-
import de.ellpeck.naturesaura.compat.Compat;
109
import de.ellpeck.naturesaura.misc.LevelData;
1110
import de.ellpeck.naturesaura.packet.PacketHandler;
1211
import de.ellpeck.naturesaura.packet.PacketParticles;
@@ -15,6 +14,8 @@
1514
import net.minecraft.core.BlockPos;
1615
import net.minecraft.core.Registry;
1716
import net.minecraft.core.registries.BuiltInRegistries;
17+
import net.minecraft.nbt.IntArrayTag;
18+
import net.minecraft.nbt.Tag;
1819
import net.minecraft.resources.ResourceLocation;
1920
import net.minecraft.server.level.ServerChunkCache;
2021
import net.minecraft.server.level.ServerPlayer;
@@ -367,4 +368,13 @@ public static boolean toggleToolEnabled(Player player, ItemStack stack) {
367368
return true;
368369
}
369370

371+
public static BlockPos readBlockPos(Tag tag) {
372+
if (tag instanceof IntArrayTag i) {
373+
var arr = i.getAsIntArray();
374+
if (arr.length == 3)
375+
return new BlockPos(arr[0], arr[1], arr[2]);
376+
}
377+
return null;
378+
}
379+
370380
}

Diff for: src/main/java/de/ellpeck/naturesaura/ModConfig.java

+104-104
Large diffs are not rendered by default.

Diff for: src/main/java/de/ellpeck/naturesaura/NaturesAura.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
import de.ellpeck.naturesaura.proxy.IProxy;
1111
import de.ellpeck.naturesaura.proxy.ServerProxy;
1212
import de.ellpeck.naturesaura.recipes.ModRecipes;
13-
import net.neoforged.bus.api.IEventBus;
14-
import net.neoforged.fml.ModLoadingContext;
13+
import net.neoforged.fml.ModContainer;
1514
import net.neoforged.fml.common.Mod;
1615
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
1716
import net.neoforged.fml.loading.FMLEnvironment;
@@ -30,15 +29,16 @@ public final class NaturesAura {
3029
public static NaturesAura instance;
3130
public static IProxy proxy;
3231

33-
public NaturesAura(IEventBus eventBus) {
32+
public NaturesAura(ModContainer container) {
3433
NaturesAura.instance = this;
3534
NaturesAura.proxy = FMLEnvironment.dist.isClient() ? new ClientProxy() : new ServerProxy();
3635

37-
eventBus.addListener(this::setup);
36+
container.getEventBus().addListener(this::setup);
37+
container.getEventBus().register(NaturesAura.proxy);
3838

3939
var builder = new ModConfigSpec.Builder();
4040
ModConfig.instance = new ModConfig(builder);
41-
ModLoadingContext.get().registerConfig(net.neoforged.fml.config.ModConfig.Type.COMMON, builder.build());
41+
container.registerConfig(net.neoforged.fml.config.ModConfig.Type.COMMON, builder.build());
4242
}
4343

4444
public void setup(FMLCommonSetupEvent event) {

Diff for: src/main/java/de/ellpeck/naturesaura/blocks/BlockAncientSapling.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import de.ellpeck.naturesaura.reg.IModItem;
1010
import de.ellpeck.naturesaura.reg.ModRegistry;
1111
import net.minecraft.core.BlockPos;
12-
import net.minecraft.core.Registry;
1312
import net.minecraft.core.registries.Registries;
1413
import net.minecraft.server.level.ServerLevel;
1514
import net.minecraft.util.RandomSource;
@@ -19,11 +18,9 @@
1918
import net.minecraft.world.level.block.*;
2019
import net.minecraft.world.level.block.state.BlockState;
2120
import net.minecraft.world.level.block.state.StateDefinition;
22-
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
2321
import net.minecraft.world.phys.shapes.CollisionContext;
2422
import net.minecraft.world.phys.shapes.VoxelShape;
2523
import net.neoforged.neoforge.event.EventHooks;
26-
import net.neoforged.bus.api.Event;
2724

2825
public class BlockAncientSapling extends BushBlock implements BonemealableBlock, IModItem, ICustomBlockState, ICustomItemModel {
2926

@@ -75,9 +72,12 @@ public boolean isBonemealSuccess(Level level, RandomSource rand, BlockPos pos, B
7572
public void performBonemeal(ServerLevel level, RandomSource rand, BlockPos pos, BlockState state) {
7673
if (state.getValue(SaplingBlock.STAGE) == 0) {
7774
level.setBlock(pos, state.cycle(SaplingBlock.STAGE), 4);
78-
} else if (!EventHooks.blockGrowFeature(level, rand, pos, null).getResult().equals(Event.Result.DENY)) {
79-
Registry<ConfiguredFeature<?, ?>> registry = level.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE);
80-
registry.getHolderOrThrow(ModFeatures.Configured.ANCIENT_TREE).value().place(level, level.getChunkSource().getGenerator(), rand, pos);
75+
} else {
76+
var event = EventHooks.fireBlockGrowFeature(level, rand, pos, null);
77+
if (!event.isCanceled()) {
78+
var registry = level.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE);
79+
registry.getHolderOrThrow(ModFeatures.Configured.ANCIENT_TREE).value().place(level, level.getChunkSource().getGenerator(), rand, pos);
80+
}
8181
}
8282
}
8383

Diff for: src/main/java/de/ellpeck/naturesaura/blocks/BlockAnimalGenerator.java

+13-11
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
import net.minecraft.world.phys.AABB;
1818
import net.neoforged.api.distmarker.Dist;
1919
import net.neoforged.api.distmarker.OnlyIn;
20+
import net.neoforged.bus.api.SubscribeEvent;
2021
import net.neoforged.neoforge.common.NeoForge;
21-
import net.neoforged.neoforge.event.entity.living.*;
22+
import net.neoforged.neoforge.event.entity.living.LivingDeathEvent;
23+
import net.neoforged.neoforge.event.entity.living.LivingDropsEvent;
2224
import net.neoforged.neoforge.event.entity.living.LivingExperienceDropEvent;
23-
import net.neoforged.bus.api.SubscribeEvent;
24-
import net.neoforged.neoforge.event.entity.living.LivingEvent;
25+
import net.neoforged.neoforge.event.tick.EntityTickEvent;
2526

2627
public class BlockAnimalGenerator extends BlockContainerImpl implements IVisualizable, ICustomBlockState {
2728

@@ -32,7 +33,7 @@ public BlockAnimalGenerator() {
3233
}
3334

3435
@SubscribeEvent
35-
public void onLivingUpdate(LivingEvent.LivingTickEvent event) {
36+
public void onLivingUpdate(EntityTickEvent event) {
3637
var entity = event.getEntity();
3738
if (entity.level().isClientSide || entity.level().getGameTime() % 40 != 0 || !(entity instanceof Animal) || entity instanceof Npc)
3839
return;
@@ -70,10 +71,10 @@ public void onEntityDeath(LivingDeathEvent event) {
7071

7172
var genPos = gen.getBlockPos();
7273
PacketHandler.sendToAllAround(entity.level(), pos, 32, new PacketParticles(
73-
(float) entity.getX(), (float) entity.getY(), (float) entity.getZ(), PacketParticles.Type.ANIMAL_GEN_CONSUME,
74-
child ? 1 : 0,
75-
(int) (entity.getEyeHeight() * 10F),
76-
genPos.getX(), genPos.getY(), genPos.getZ()));
74+
(float) entity.getX(), (float) entity.getY(), (float) entity.getZ(), PacketParticles.Type.ANIMAL_GEN_CONSUME,
75+
child ? 1 : 0,
76+
(int) (entity.getEyeHeight() * 10F),
77+
genPos.getX(), genPos.getY(), genPos.getZ()));
7778

7879
return true;
7980
});
@@ -108,8 +109,9 @@ public int getVisualizationColor(Level level, BlockPos pos) {
108109
@Override
109110
public void generateCustomBlockState(BlockStateGenerator generator) {
110111
generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(),
111-
generator.modLoc("block/" + this.getBaseName()),
112-
generator.modLoc("block/" + this.getBaseName() + "_bottom"),
113-
generator.modLoc("block/" + this.getBaseName() + "_top")));
112+
generator.modLoc("block/" + this.getBaseName()),
113+
generator.modLoc("block/" + this.getBaseName() + "_bottom"),
114+
generator.modLoc("block/" + this.getBaseName() + "_top")));
114115
}
116+
115117
}

Diff for: src/main/java/de/ellpeck/naturesaura/blocks/BlockAuraTimer.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
import net.minecraft.server.level.ServerLevel;
1414
import net.minecraft.util.RandomSource;
1515
import net.minecraft.world.InteractionHand;
16-
import net.minecraft.world.InteractionResult;
16+
import net.minecraft.world.ItemInteractionResult;
1717
import net.minecraft.world.entity.player.Player;
18+
import net.minecraft.world.item.ItemStack;
1819
import net.minecraft.world.level.BlockGetter;
1920
import net.minecraft.world.level.Level;
2021
import net.minecraft.world.level.block.Block;
@@ -52,9 +53,8 @@ protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockSt
5253
}
5354

5455
@Override
55-
@SuppressWarnings("deprecation")
56-
public InteractionResult use(BlockState state, Level levelIn, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult p_225533_6_) {
57-
return Helper.putStackOnTile(player, handIn, pos, 0, true);
56+
protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) {
57+
return Helper.putStackOnTile(player, hand, pos, 0, true);
5858
}
5959

6060
@Override
@@ -80,4 +80,5 @@ public void tick(BlockState state, ServerLevel levelIn, BlockPos pos, RandomSour
8080
public void registerTESR() {
8181
BlockEntityRenderers.register(ModBlockEntities.AURA_TIMER, RenderAuraTimer::new);
8282
}
83+
8384
}

Diff for: src/main/java/de/ellpeck/naturesaura/blocks/BlockEnderCrate.java

+9-10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import net.minecraft.world.InteractionHand;
2121
import net.minecraft.world.InteractionResult;
2222
import net.minecraft.world.entity.player.Player;
23+
import net.minecraft.world.item.Item;
2324
import net.minecraft.world.item.ItemStack;
2425
import net.minecraft.world.item.Items;
2526
import net.minecraft.world.item.TooltipFlag;
@@ -85,10 +86,9 @@ public void onAnvilUpdate(AnvilUpdateEvent event) {
8586
}
8687

8788
@Override
88-
@SuppressWarnings("deprecation")
89-
public InteractionResult use(BlockState state, Level levelIn, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) {
90-
if (!levelIn.isClientSide) {
91-
var tile = levelIn.getBlockEntity(pos);
89+
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
90+
if (!level.isClientSide) {
91+
var tile = level.getBlockEntity(pos);
9292
if (tile instanceof BlockEntityEnderCrate crate && crate.canOpen() && crate.canUseRightNow(2500)) {
9393
crate.drainAura(2500);
9494
player.openMenu(crate, pos);
@@ -98,9 +98,8 @@ public InteractionResult use(BlockState state, Level levelIn, BlockPos pos, Play
9898
}
9999

100100
@Override
101-
@OnlyIn(Dist.CLIENT)
102-
public void appendHoverText(ItemStack stack, @Nullable BlockGetter levelIn, List<Component> tooltip, TooltipFlag flagIn) {
103-
BlockEnderCrate.addEnderNameInfo(stack, tooltip);
101+
public void appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
102+
BlockEnderCrate.addEnderNameInfo(stack, tooltipComponents);
104103
}
105104

106105
@Override
@@ -122,9 +121,9 @@ public void animateTick(BlockState stateIn, Level levelIn, BlockPos pos, RandomS
122121
@Override
123122
public void generateCustomBlockState(BlockStateGenerator generator) {
124123
generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(),
125-
generator.modLoc("block/" + this.getBaseName()),
126-
generator.modLoc("block/" + this.getBaseName() + "_bottom"),
127-
generator.modLoc("block/" + this.getBaseName() + "_top")));
124+
generator.modLoc("block/" + this.getBaseName()),
125+
generator.modLoc("block/" + this.getBaseName() + "_bottom"),
126+
generator.modLoc("block/" + this.getBaseName() + "_top")));
128127
}
129128

130129
@Override

Diff for: src/main/java/de/ellpeck/naturesaura/blocks/BlockFieldCreator.java

+15-15
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
import net.minecraft.network.chat.Component;
1010
import net.minecraft.util.RandomSource;
1111
import net.minecraft.world.InteractionHand;
12-
import net.minecraft.world.InteractionResult;
12+
import net.minecraft.world.ItemInteractionResult;
1313
import net.minecraft.world.entity.player.Player;
14+
import net.minecraft.world.item.ItemStack;
1415
import net.minecraft.world.level.Level;
1516
import net.minecraft.world.level.block.SoundType;
1617
import net.minecraft.world.level.block.state.BlockState;
@@ -25,19 +26,18 @@ public BlockFieldCreator() {
2526
}
2627

2728
@Override
28-
@SuppressWarnings("deprecation")
29-
public InteractionResult use(BlockState state, Level levelIn, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult result) {
30-
var tile = levelIn.getBlockEntity(pos);
29+
protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) {
30+
var tile = level.getBlockEntity(pos);
3131
if (tile instanceof BlockEntityFieldCreator) {
32-
if (!levelIn.isClientSide) {
32+
if (!level.isClientSide) {
3333
var key = NaturesAura.MOD_ID + ":field_creator_pos";
3434
var compound = player.getPersistentData();
3535
if (!player.isShiftKeyDown() && compound.contains(key)) {
3636
var stored = BlockPos.of(compound.getLong(key));
3737
var creator = (BlockEntityFieldCreator) tile;
3838
if (!pos.equals(stored)) {
3939
if (creator.isCloseEnough(stored)) {
40-
var otherTile = levelIn.getBlockEntity(stored);
40+
var otherTile = level.getBlockEntity(stored);
4141
if (otherTile instanceof BlockEntityFieldCreator otherCreator) {
4242
creator.connectionOffset = stored.subtract(pos);
4343
creator.isMain = true;
@@ -60,9 +60,9 @@ public InteractionResult use(BlockState state, Level levelIn, BlockPos pos, Play
6060
player.displayClientMessage(Component.translatable("info." + NaturesAura.MOD_ID + ".stored_pos"), true);
6161
}
6262
}
63-
return InteractionResult.SUCCESS;
63+
return ItemInteractionResult.SUCCESS;
6464
} else
65-
return InteractionResult.FAIL;
65+
return ItemInteractionResult.FAIL;
6666
}
6767

6868
@Override
@@ -73,13 +73,13 @@ public void animateTick(BlockState stateIn, Level levelIn, BlockPos pos, RandomS
7373
var connected = creator.getConnectedPos();
7474
if (connected != null)
7575
NaturesAuraAPI.instance().spawnParticleStream(
76-
pos.getX() + 0.25F + rand.nextFloat() * 0.5F,
77-
pos.getY() + 0.25F + rand.nextFloat() * 0.5F,
78-
pos.getZ() + 0.25F + rand.nextFloat() * 0.5F,
79-
connected.getX() + 0.25F + rand.nextFloat() * 0.5F,
80-
connected.getY() + 0.25F + rand.nextFloat() * 0.5F,
81-
connected.getZ() + 0.25F + rand.nextFloat() * 0.5F,
82-
0.65F, 0x4245f4, 1F
76+
pos.getX() + 0.25F + rand.nextFloat() * 0.5F,
77+
pos.getY() + 0.25F + rand.nextFloat() * 0.5F,
78+
pos.getZ() + 0.25F + rand.nextFloat() * 0.5F,
79+
connected.getX() + 0.25F + rand.nextFloat() * 0.5F,
80+
connected.getY() + 0.25F + rand.nextFloat() * 0.5F,
81+
connected.getZ() + 0.25F + rand.nextFloat() * 0.5F,
82+
0.65F, 0x4245f4, 1F
8383
);
8484
}
8585
}

Diff for: src/main/java/de/ellpeck/naturesaura/blocks/BlockGratedChute.java

+11-14
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import net.minecraft.core.BlockPos;
99
import net.minecraft.core.Direction;
1010
import net.minecraft.util.Mth;
11-
import net.minecraft.world.InteractionHand;
1211
import net.minecraft.world.InteractionResult;
1312
import net.minecraft.world.entity.player.Player;
1413
import net.minecraft.world.item.context.BlockPlaceContext;
@@ -18,7 +17,6 @@
1817
import net.minecraft.world.level.block.HopperBlock;
1918
import net.minecraft.world.level.block.RenderShape;
2019
import net.minecraft.world.level.block.SoundType;
21-
import net.minecraft.world.level.block.entity.Hopper;
2220
import net.minecraft.world.level.block.state.BlockState;
2321
import net.minecraft.world.level.block.state.StateDefinition;
2422
import net.minecraft.world.level.block.state.properties.DirectionProperty;
@@ -28,27 +26,27 @@
2826
import net.minecraft.world.phys.shapes.Shapes;
2927
import net.minecraft.world.phys.shapes.VoxelShape;
3028
import net.neoforged.neoforge.capabilities.Capabilities;
31-
import net.neoforged.neoforge.items.IItemHandler;
3229

3330
import javax.annotation.Nullable;
3431

3532
public class BlockGratedChute extends BlockContainerImpl implements ICustomBlockState, ICustomItemModel {
3633

3734
public static final DirectionProperty FACING = HopperBlock.FACING;
35+
private static final VoxelShape INSIDE = Block.box(2.0, 11.0, 2.0, 14.0, 16.0, 14.0);
3836
private static final VoxelShape INPUT_SHAPE = Block.box(0.0D, 10.0D, 0.0D, 16.0D, 16.0D, 16.0D);
3937
private static final VoxelShape MIDDLE_SHAPE = Block.box(4.0D, 4.0D, 4.0D, 12.0D, 10.0D, 12.0D);
4038
private static final VoxelShape INPUT_MIDDLE_SHAPE = Shapes.or(BlockGratedChute.MIDDLE_SHAPE, BlockGratedChute.INPUT_SHAPE);
41-
private static final VoxelShape COMBINED_SHAPE = Shapes.join(BlockGratedChute.INPUT_MIDDLE_SHAPE, Hopper.INSIDE, BooleanOp.ONLY_FIRST);
39+
private static final VoxelShape COMBINED_SHAPE = Shapes.join(BlockGratedChute.INPUT_MIDDLE_SHAPE, BlockGratedChute.INSIDE, BooleanOp.ONLY_FIRST);
4240
private static final VoxelShape DOWN_SHAPE = Shapes.or(BlockGratedChute.COMBINED_SHAPE, Block.box(6.0D, 0.0D, 6.0D, 10.0D, 4.0D, 10.0D));
4341
private static final VoxelShape EAST_SHAPE = Shapes.or(BlockGratedChute.COMBINED_SHAPE, Block.box(12.0D, 4.0D, 6.0D, 16.0D, 8.0D, 10.0D));
4442
private static final VoxelShape NORTH_SHAPE = Shapes.or(BlockGratedChute.COMBINED_SHAPE, Block.box(6.0D, 4.0D, 0.0D, 10.0D, 8.0D, 4.0D));
4543
private static final VoxelShape SOUTH_SHAPE = Shapes.or(BlockGratedChute.COMBINED_SHAPE, Block.box(6.0D, 4.0D, 12.0D, 10.0D, 8.0D, 16.0D));
4644
private static final VoxelShape WEST_SHAPE = Shapes.or(BlockGratedChute.COMBINED_SHAPE, Block.box(0.0D, 4.0D, 6.0D, 4.0D, 8.0D, 10.0D));
47-
private static final VoxelShape DOWN_RAYTRACE_SHAPE = Hopper.INSIDE;
48-
private static final VoxelShape EAST_RAYTRACE_SHAPE = Shapes.or(Hopper.INSIDE, Block.box(12.0D, 8.0D, 6.0D, 16.0D, 10.0D, 10.0D));
49-
private static final VoxelShape NORTH_RAYTRACE_SHAPE = Shapes.or(Hopper.INSIDE, Block.box(6.0D, 8.0D, 0.0D, 10.0D, 10.0D, 4.0D));
50-
private static final VoxelShape SOUTH_RAYTRACE_SHAPE = Shapes.or(Hopper.INSIDE, Block.box(6.0D, 8.0D, 12.0D, 10.0D, 10.0D, 16.0D));
51-
private static final VoxelShape WEST_RAYTRACE_SHAPE = Shapes.or(Hopper.INSIDE, Block.box(0.0D, 8.0D, 6.0D, 4.0D, 10.0D, 10.0D));
45+
private static final VoxelShape DOWN_RAYTRACE_SHAPE = BlockGratedChute.INSIDE;
46+
private static final VoxelShape EAST_RAYTRACE_SHAPE = Shapes.or(BlockGratedChute.INSIDE, Block.box(12.0D, 8.0D, 6.0D, 16.0D, 10.0D, 10.0D));
47+
private static final VoxelShape NORTH_RAYTRACE_SHAPE = Shapes.or(BlockGratedChute.INSIDE, Block.box(6.0D, 8.0D, 0.0D, 10.0D, 10.0D, 4.0D));
48+
private static final VoxelShape SOUTH_RAYTRACE_SHAPE = Shapes.or(BlockGratedChute.INSIDE, Block.box(6.0D, 8.0D, 12.0D, 10.0D, 10.0D, 16.0D));
49+
private static final VoxelShape WEST_RAYTRACE_SHAPE = Shapes.or(BlockGratedChute.INSIDE, Block.box(0.0D, 8.0D, 6.0D, 4.0D, 10.0D, 10.0D));
5250

5351
public BlockGratedChute() {
5452
super("grated_chute", BlockEntityGratedChute.class, Properties.of().strength(3.0F, 8.0F).sound(SoundType.METAL));
@@ -81,17 +79,16 @@ public VoxelShape getInteractionShape(BlockState state, BlockGetter levelIn, Blo
8179
case SOUTH -> BlockGratedChute.SOUTH_RAYTRACE_SHAPE;
8280
case WEST -> BlockGratedChute.WEST_RAYTRACE_SHAPE;
8381
case EAST -> BlockGratedChute.EAST_RAYTRACE_SHAPE;
84-
default -> Hopper.INSIDE;
82+
default -> BlockGratedChute.INSIDE;
8583
};
8684
}
8785

8886
@Override
89-
@SuppressWarnings("deprecation")
90-
public InteractionResult use(BlockState state, Level levelIn, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) {
91-
var tile = levelIn.getBlockEntity(pos);
87+
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
88+
var tile = level.getBlockEntity(pos);
9289
if (!(tile instanceof BlockEntityGratedChute chute))
9390
return InteractionResult.FAIL;
94-
if (!levelIn.isClientSide) {
91+
if (!level.isClientSide) {
9592
chute.isBlacklist = !chute.isBlacklist;
9693
chute.sendToClients();
9794
}

0 commit comments

Comments
 (0)