Skip to content

Commit f2547e6

Browse files
committed
a lot more 1.20.4 port work
1 parent 5a4a191 commit f2547e6

File tree

64 files changed

+348
-398
lines changed

Some content is hidden

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

64 files changed

+348
-398
lines changed

src/main/java/de/ellpeck/naturesaura/InternalHooks.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import de.ellpeck.naturesaura.api.misc.ILevelData;
66
import de.ellpeck.naturesaura.api.multiblock.IMultiblock;
77
import de.ellpeck.naturesaura.blocks.multi.Multiblock;
8+
import de.ellpeck.naturesaura.chunk.AuraChunk;
89
import de.ellpeck.naturesaura.misc.LevelData;
910
import net.minecraft.core.BlockPos;
1011
import net.minecraft.resources.ResourceLocation;
@@ -38,9 +39,9 @@ public boolean insertAuraIntoPlayer(Player player, int amount, boolean simulate)
3839
private boolean auraPlayerInteraction(Player player, int amount, boolean extract, boolean simulate) {
3940
if (extract && player.isCreative())
4041
return true;
41-
var stack = Helper.getEquippedItem(s -> s.getCapability(NaturesAuraAPI.AURA_CONTAINER_CAPABILITY) != null, player, false);
42+
var stack = Helper.getEquippedItem(s -> s.getCapability(NaturesAuraAPI.AURA_CONTAINER_ITEM_CAPABILITY) != null, player, false);
4243
if (!stack.isEmpty()) {
43-
var container = stack.getCapability(NaturesAuraAPI.AURA_CONTAINER_CAPABILITY);
44+
var container = stack.getCapability(NaturesAuraAPI.AURA_CONTAINER_ITEM_CAPABILITY);
4445
if (extract) {
4546
return container.drainAura(amount, simulate) > 0;
4647
} else {
@@ -199,4 +200,9 @@ public ILevelData getLevelData(Level level) {
199200
}
200201
}
201202

203+
@Override
204+
public IAuraChunk createAuraChunk() {
205+
return new AuraChunk();
206+
}
207+
202208
}

src/main/java/de/ellpeck/naturesaura/api/NaturesAuraAPI.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.google.common.collect.BiMap;
44
import com.google.common.collect.HashBiMap;
5+
import de.ellpeck.naturesaura.api.aura.chunk.AuraChunkProvider;
56
import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk;
67
import de.ellpeck.naturesaura.api.aura.chunk.IDrainSpotEffect;
78
import de.ellpeck.naturesaura.api.aura.container.IAuraContainer;
@@ -14,6 +15,7 @@
1415
import de.ellpeck.naturesaura.api.multiblock.IMultiblock;
1516
import de.ellpeck.naturesaura.api.multiblock.Matcher;
1617
import net.minecraft.core.BlockPos;
18+
import net.minecraft.core.Direction;
1719
import net.minecraft.resources.ResourceLocation;
1820
import net.minecraft.util.Tuple;
1921
import net.minecraft.world.entity.EntityType;
@@ -24,6 +26,7 @@
2426
import net.minecraft.world.phys.AABB;
2527
import net.minecraft.world.phys.Vec3;
2628
import net.neoforged.neoforge.attachment.AttachmentType;
29+
import net.neoforged.neoforge.capabilities.BlockCapability;
2730
import net.neoforged.neoforge.capabilities.ItemCapability;
2831
import org.apache.commons.lang3.tuple.Pair;
2932

@@ -82,17 +85,21 @@ public final class NaturesAuraAPI {
8285
*/
8386
public static final Map<ItemStack, WeatherType> WEATHER_CHANGER_CONVERSIONS = new HashMap<>();
8487
/**
85-
* The capability for any item or block that stores Aura in the form of an {@link IAuraContainer}
88+
* The capability for any item that stores Aura in the form of an {@link IAuraContainer}
8689
*/
87-
public static final ItemCapability<IAuraContainer, Void> AURA_CONTAINER_CAPABILITY = ItemCapability.createVoid(new ResourceLocation(NaturesAuraAPI.MOD_ID, "aura_container"), IAuraContainer.class);
90+
public static final ItemCapability<IAuraContainer, Void> AURA_CONTAINER_ITEM_CAPABILITY = ItemCapability.createVoid(new ResourceLocation(NaturesAuraAPI.MOD_ID, "aura_container_item"), IAuraContainer.class);
91+
/**
92+
* The capability for any block that stores Aura in the form of an {@link IAuraContainer}
93+
*/
94+
public static final BlockCapability<IAuraContainer, Direction> AURA_CONTAINER_BLOCK_CAPABILITY = BlockCapability.create(new ResourceLocation(NaturesAuraAPI.MOD_ID, "aura_container_block"), IAuraContainer.class, Direction.class);
8895
/**
8996
* The capability for any item that can be recharged from an Aura storage container like the Aura Cache in the form of {@link IAuraRecharge} by a player holding it in their hand
9097
*/
9198
public static final ItemCapability<IAuraRecharge, Void> AURA_RECHARGE_CAPABILITY = ItemCapability.createVoid(new ResourceLocation(NaturesAuraAPI.MOD_ID, "aura_recharge"), IAuraRecharge.class);
9299
/**
93100
* The capability that any chunk in a level has to store Aura in it. As this is only applicable to chunks and all chunks in the level automatically get assigned this capability, using it directly is not necessary for addon developers. To retrieve this capability from any chunk, use the helper method {@link IAuraChunk#getAuraChunk(net.minecraft.world.level.Level, BlockPos)}.
94101
*/
95-
public static final AttachmentType<IAuraChunk> AURA_CHUNK_ATTACHMENT = AttachmentType.serializable(() -> (IAuraChunk) null).build();
102+
public static final AttachmentType<AuraChunkProvider> AURA_CHUNK_ATTACHMENT = AttachmentType.serializable(AuraChunkProvider::new).build();
96103
private static final IInternalHooks INSTANCE;
97104

98105
static {
@@ -253,6 +260,8 @@ public interface IInternalHooks {
253260

254261
ILevelData getLevelData(Level level);
255262

263+
IAuraChunk createAuraChunk();
264+
256265
}
257266

258267
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package de.ellpeck.naturesaura.api.aura.chunk;
2+
3+
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
4+
import net.minecraft.nbt.CompoundTag;
5+
import net.minecraft.world.level.chunk.LevelChunk;
6+
import net.neoforged.neoforge.common.util.INBTSerializable;
7+
8+
public class AuraChunkProvider implements INBTSerializable<CompoundTag> {
9+
10+
private IAuraChunk auraChunk;
11+
12+
public IAuraChunk get(LevelChunk chunk) {
13+
if (this.auraChunk == null)
14+
this.auraChunk = NaturesAuraAPI.instance().createAuraChunk();
15+
this.auraChunk.ensureInitialized(chunk);
16+
return this.auraChunk;
17+
}
18+
19+
@Override
20+
public CompoundTag serializeNBT() {
21+
return this.get(null).serializeNBT();
22+
}
23+
24+
@Override
25+
public void deserializeNBT(CompoundTag nbt) {
26+
this.get(null).deserializeNBT(nbt);
27+
}
28+
29+
}

src/main/java/de/ellpeck/naturesaura/api/aura/chunk/IAuraChunk.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public interface IAuraChunk extends INBTSerializable<CompoundTag> {
3333
*/
3434
static IAuraChunk getAuraChunk(Level level, BlockPos pos) {
3535
var chunk = (LevelChunk) level.getChunk(pos);
36-
return chunk.getData(NaturesAuraAPI.AURA_CHUNK_ATTACHMENT);
36+
return chunk.getData(NaturesAuraAPI.AURA_CHUNK_ATTACHMENT).get(chunk);
3737
}
3838

3939
/**
@@ -160,4 +160,6 @@ static BlockPos getHighestSpot(Level level, BlockPos pos, int radius, BlockPos d
160160

161161
void markDirty();
162162

163+
void ensureInitialized(LevelChunk chunk);
164+
163165
}

src/main/java/de/ellpeck/naturesaura/blocks/BlockAncientLeaves.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ public void animateTick(BlockState stateIn, Level levelIn, BlockPos pos, RandomS
5353
if (rand.nextFloat() >= 0.95F && !levelIn.getBlockState(pos.below()).isCollisionShapeFullBlock(levelIn, pos)) {
5454
var tile = levelIn.getBlockEntity(pos);
5555
if (tile instanceof BlockEntityAncientLeaves) {
56-
if (((BlockEntityAncientLeaves) tile).getAuraContainer().getStoredAura() > 0) {
56+
var container = levelIn.getCapability(NaturesAuraAPI.AURA_CONTAINER_BLOCK_CAPABILITY, tile.getBlockPos(), tile.getBlockState(), tile, null);
57+
if (container.getStoredAura() > 0) {
5758
NaturesAuraAPI.instance().spawnMagicParticle(
5859
pos.getX() + rand.nextDouble(), pos.getY(), pos.getZ() + rand.nextDouble(),
5960
0F, 0F, 0F, 0xCC4780,
@@ -72,7 +73,8 @@ public void randomTick(BlockState state, ServerLevel levelIn, BlockPos pos, Rand
7273
if (!levelIn.isClientSide) {
7374
var tile = levelIn.getBlockEntity(pos);
7475
if (tile instanceof BlockEntityAncientLeaves) {
75-
if (((BlockEntityAncientLeaves) tile).getAuraContainer().getStoredAura() <= 0) {
76+
var container = levelIn.getCapability(NaturesAuraAPI.AURA_CONTAINER_BLOCK_CAPABILITY, tile.getBlockPos(), tile.getBlockState(), tile, null);
77+
if (container.getStoredAura() <= 0) {
7678
levelIn.setBlockAndUpdate(pos, ModBlocks.DECAYED_LEAVES.defaultBlockState());
7779
}
7880
}
@@ -94,4 +96,5 @@ public void generateCustomBlockState(BlockStateGenerator generator) {
9496
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
9597
return new BlockEntityAncientLeaves(pos, state);
9698
}
99+
97100
}

src/main/java/de/ellpeck/naturesaura/blocks/BlockAncientSapling.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package de.ellpeck.naturesaura.blocks;
22

3+
import com.mojang.serialization.MapCodec;
34
import de.ellpeck.naturesaura.data.BlockStateGenerator;
45
import de.ellpeck.naturesaura.data.ItemModelGenerator;
56
import de.ellpeck.naturesaura.gen.ModFeatures;
@@ -61,7 +62,7 @@ protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockSt
6162
}
6263

6364
@Override
64-
public boolean isValidBonemealTarget(LevelReader p_256559_, BlockPos p_50898_, BlockState p_50899_, boolean p_50900_) {
65+
public boolean isValidBonemealTarget(LevelReader pLevel, BlockPos pPos, BlockState pState) {
6566
return true;
6667
}
6768

@@ -89,4 +90,10 @@ public void generateCustomBlockState(BlockStateGenerator generator) {
8990
public void generateCustomItemModel(ItemModelGenerator generator) {
9091
generator.withExistingParent(this.getBaseName(), "item/generated").texture("layer0", "block/" + this.getBaseName());
9192
}
93+
94+
@Override
95+
protected MapCodec<? extends BushBlock> codec() {
96+
return null;
97+
}
98+
9299
}

src/main/java/de/ellpeck/naturesaura/blocks/BlockAnimalContainer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class BlockAnimalContainer extends BlockContainerImpl implements IVisuali
2121
private static final VoxelShape SHAPE = Block.box(5, 0, 5, 11, 13, 11);
2222

2323
public BlockAnimalContainer() {
24-
super("animal_container", BlockEntityAnimalContainer.class, Properties.copy(Blocks.STONE));
24+
super("animal_container", BlockEntityAnimalContainer.class, Properties.ofFullCopy(Blocks.STONE));
2525
}
2626

2727
@Override
@@ -57,4 +57,5 @@ public int getVisualizationColor(Level level, BlockPos pos) {
5757
public void generateCustomBlockState(BlockStateGenerator generator) {
5858
generator.simpleBlock(this, generator.models().getExistingFile(generator.modLoc(this.getBaseName())));
5959
}
60+
6061
}

src/main/java/de/ellpeck/naturesaura/blocks/BlockAuraBloom.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package de.ellpeck.naturesaura.blocks;
22

3+
import com.mojang.serialization.MapCodec;
34
import de.ellpeck.naturesaura.blocks.tiles.BlockEntityAuraBloom;
45
import de.ellpeck.naturesaura.blocks.tiles.ITickableBlockEntity;
56
import de.ellpeck.naturesaura.blocks.tiles.ModBlockEntities;
@@ -47,6 +48,11 @@ public boolean canSurvive(BlockState state, LevelReader levelIn, BlockPos pos) {
4748
return this.mayPlaceOn(levelIn.getBlockState(down), levelIn, down);
4849
}
4950

51+
@Override
52+
protected MapCodec<? extends BushBlock> codec() {
53+
return null;
54+
}
55+
5056
@Override
5157
protected boolean mayPlaceOn(BlockState state, BlockGetter levelIn, BlockPos pos) {
5258
return Arrays.stream(this.allowedGround).anyMatch(state::is);
@@ -92,4 +98,5 @@ public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
9298
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> type) {
9399
return ITickableBlockEntity.createTickerHelper(type, ModBlockEntities.AURA_BLOOM);
94100
}
101+
95102
}

src/main/java/de/ellpeck/naturesaura/blocks/BlockAuraTimer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class BlockAuraTimer extends BlockContainerImpl implements ICustomBlockSt
3131
private static final VoxelShape SHAPE = Block.box(1, 0, 1, 15, 15, 15);
3232

3333
public BlockAuraTimer() {
34-
super("aura_timer", BlockEntityAuraTimer.class, Properties.copy(Blocks.SMOOTH_STONE));
34+
super("aura_timer", BlockEntityAuraTimer.class, Properties.ofFullCopy(Blocks.SMOOTH_STONE));
3535
this.registerDefaultState(this.defaultBlockState().setValue(BlockStateProperties.POWERED, false));
3636
}
3737

src/main/java/de/ellpeck/naturesaura/blocks/BlockBlastFurnaceBooster.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class BlockBlastFurnaceBooster extends BlockContainerImpl implements ICus
2222
private static final VoxelShape SHAPE = Shapes.create(1 / 16F, 0, 1 / 16F, 15 / 16F, 1, 15 / 16F);
2323

2424
public BlockBlastFurnaceBooster() {
25-
super("blast_furnace_booster", BlockEntityBlastFurnaceBooster.class, Block.Properties.copy(Blocks.BLAST_FURNACE).lightLevel(s -> 0));
25+
super("blast_furnace_booster", BlockEntityBlastFurnaceBooster.class, Block.Properties.ofFullCopy(Blocks.BLAST_FURNACE).lightLevel(s -> 0));
2626
}
2727

2828
@Override

src/main/java/de/ellpeck/naturesaura/blocks/BlockChorusGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
public class BlockChorusGenerator extends BlockContainerImpl implements ICustomBlockState {
99

1010
public BlockChorusGenerator() {
11-
super("chorus_generator", BlockEntityChorusGenerator.class, Properties.copy(Blocks.END_STONE));
11+
super("chorus_generator", BlockEntityChorusGenerator.class, Properties.ofFullCopy(Blocks.END_STONE));
1212
}
1313

1414
@Override

src/main/java/de/ellpeck/naturesaura/blocks/BlockContainerImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package de.ellpeck.naturesaura.blocks;
22

3+
import com.mojang.serialization.MapCodec;
34
import de.ellpeck.naturesaura.blocks.tiles.BlockEntityImpl;
45
import de.ellpeck.naturesaura.blocks.tiles.ITickableBlockEntity;
56
import de.ellpeck.naturesaura.reg.IModItem;
@@ -106,6 +107,11 @@ public String getBaseName() {
106107
return this.baseName;
107108
}
108109

110+
@Override
111+
protected MapCodec<? extends BaseEntityBlock> codec() {
112+
return null;
113+
}
114+
109115
@Override
110116
public RenderShape getRenderShape(BlockState state) {
111117
return RenderShape.MODEL;

src/main/java/de/ellpeck/naturesaura/blocks/BlockDimensionRail.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package de.ellpeck.naturesaura.blocks;
22

3+
import com.mojang.serialization.MapCodec;
34
import de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk;
45
import de.ellpeck.naturesaura.data.BlockStateGenerator;
56
import de.ellpeck.naturesaura.data.ItemModelGenerator;
@@ -49,7 +50,7 @@ public class BlockDimensionRail extends BaseRailBlock implements IModItem, ICust
4950

5051
@SafeVarargs
5152
public BlockDimensionRail(String name, ResourceKey<Level> goalDim, ResourceKey<Level>... canUseDims) {
52-
super(false, Properties.copy(Blocks.RAIL));
53+
super(false, Properties.ofFullCopy(Blocks.RAIL));
5354
this.name = name;
5455
this.goalDim = goalDim;
5556
this.canUseDims = canUseDims;
@@ -136,6 +137,11 @@ private BlockPos getGoalCoords(Level level, BlockPos pos) {
136137
}
137138
}
138139

140+
@Override
141+
protected MapCodec<? extends BaseRailBlock> codec() {
142+
return null;
143+
}
144+
139145
@Override
140146
@SuppressWarnings({"deprecation", "RedundantSuppression"})
141147
public Property<RailShape> getShapeProperty() {

src/main/java/de/ellpeck/naturesaura/blocks/BlockEndFlower.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package de.ellpeck.naturesaura.blocks;
22

3+
import com.mojang.serialization.MapCodec;
34
import de.ellpeck.naturesaura.blocks.tiles.BlockEntityEndFlower;
45
import de.ellpeck.naturesaura.blocks.tiles.ITickableBlockEntity;
56
import de.ellpeck.naturesaura.blocks.tiles.ModBlockEntities;
@@ -70,6 +71,11 @@ public void onDragonTick(LivingEvent.LivingTickEvent event) {
7071
}
7172
}
7273

74+
@Override
75+
protected MapCodec<? extends BushBlock> codec() {
76+
return null;
77+
}
78+
7379
@Override
7480
public boolean canSurvive(BlockState state, LevelReader levelIn, BlockPos pos) {
7581
return levelIn.getBlockState(pos.below()).getBlock() == Blocks.END_STONE;

src/main/java/de/ellpeck/naturesaura/blocks/BlockGoldPowder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class BlockGoldPowder extends BlockImpl implements IColorProvidingBlock,
3434
protected static final VoxelShape[] SHAPES = {Block.box(3.0D, 0.0D, 3.0D, 13.0D, 1.0D, 13.0D), Block.box(3.0D, 0.0D, 3.0D, 13.0D, 1.0D, 16.0D), Block.box(0.0D, 0.0D, 3.0D, 13.0D, 1.0D, 13.0D), Block.box(0.0D, 0.0D, 3.0D, 13.0D, 1.0D, 16.0D), Block.box(3.0D, 0.0D, 0.0D, 13.0D, 1.0D, 13.0D), Block.box(3.0D, 0.0D, 0.0D, 13.0D, 1.0D, 16.0D), Block.box(0.0D, 0.0D, 0.0D, 13.0D, 1.0D, 13.0D), Block.box(0.0D, 0.0D, 0.0D, 13.0D, 1.0D, 16.0D), Block.box(3.0D, 0.0D, 3.0D, 16.0D, 1.0D, 13.0D), Block.box(3.0D, 0.0D, 3.0D, 16.0D, 1.0D, 16.0D), Block.box(0.0D, 0.0D, 3.0D, 16.0D, 1.0D, 13.0D), Block.box(0.0D, 0.0D, 3.0D, 16.0D, 1.0D, 16.0D), Block.box(3.0D, 0.0D, 0.0D, 16.0D, 1.0D, 13.0D), Block.box(3.0D, 0.0D, 0.0D, 16.0D, 1.0D, 16.0D), Block.box(0.0D, 0.0D, 0.0D, 16.0D, 1.0D, 13.0D), Block.box(0.0D, 0.0D, 0.0D, 16.0D, 1.0D, 16.0D)};
3535

3636
public BlockGoldPowder() {
37-
super("gold_powder", Properties.copy(Blocks.REDSTONE_WIRE));
37+
super("gold_powder", Properties.ofFullCopy(Blocks.REDSTONE_WIRE));
3838
this.registerDefaultState(this.defaultBlockState().setValue(BlockGoldPowder.NORTH, RedstoneSide.NONE).setValue(BlockGoldPowder.EAST, RedstoneSide.NONE).setValue(BlockGoldPowder.SOUTH, RedstoneSide.NONE).setValue(BlockGoldPowder.WEST, RedstoneSide.NONE));
3939
}
4040

src/main/java/de/ellpeck/naturesaura/blocks/BlockGratedChute.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import net.minecraft.world.phys.shapes.CollisionContext;
2828
import net.minecraft.world.phys.shapes.Shapes;
2929
import net.minecraft.world.phys.shapes.VoxelShape;
30+
import net.neoforged.neoforge.capabilities.Capabilities;
3031
import net.neoforged.neoforge.items.IItemHandler;
3132

3233
import javax.annotation.Nullable;
@@ -122,7 +123,7 @@ public boolean hasAnalogOutputSignal(BlockState state) {
122123
public int getAnalogOutputSignal(BlockState blockState, Level levelIn, BlockPos pos) {
123124
var tile = levelIn.getBlockEntity(pos);
124125
if (tile instanceof BlockEntityGratedChute) {
125-
IItemHandler handler = ((BlockEntityGratedChute) tile).getItemHandler();
126+
var handler = levelIn.getCapability(Capabilities.ItemHandler.BLOCK, tile.getBlockPos(), tile.getBlockState(), tile, null);
126127
var stack = handler.getStackInSlot(0);
127128
if (stack.isEmpty())
128129
return 0;
@@ -146,4 +147,5 @@ public void generateCustomBlockState(BlockStateGenerator generator) {
146147
public void generateCustomItemModel(ItemModelGenerator generator) {
147148
generator.withExistingParent(this.getBaseName(), generator.modLoc("block/" + this.getBaseName() + "_down"));
148149
}
150+
149151
}

src/main/java/de/ellpeck/naturesaura/blocks/BlockItemDistributor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
public class BlockItemDistributor extends BlockContainerImpl implements ICustomBlockState {
1616

1717
public BlockItemDistributor() {
18-
super("item_distributor", BlockEntityItemDistributor.class, Properties.copy(Blocks.STONE_BRICKS));
18+
super("item_distributor", BlockEntityItemDistributor.class, Properties.ofFullCopy(Blocks.STONE_BRICKS));
1919
}
2020

2121
@Override

src/main/java/de/ellpeck/naturesaura/blocks/BlockNetherGrass.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
public class BlockNetherGrass extends BlockImpl implements ICustomBlockState, BonemealableBlock {
1616

1717
public BlockNetherGrass() {
18-
super("nether_grass", Properties.copy(Blocks.NETHERRACK).randomTicks());
18+
super("nether_grass", Properties.ofFullCopy(Blocks.NETHERRACK).randomTicks());
1919
}
2020

2121
@Override
@@ -36,7 +36,7 @@ public void generateCustomBlockState(BlockStateGenerator generator) {
3636
}
3737

3838
@Override
39-
public boolean isValidBonemealTarget(LevelReader levelIn, BlockPos pos, BlockState state, boolean isClient) {
39+
public boolean isValidBonemealTarget(LevelReader levelIn, BlockPos pos, BlockState state) {
4040
return levelIn.getBlockState(pos.above()).isAir();
4141
}
4242

@@ -48,7 +48,7 @@ public boolean isBonemealSuccess(Level levelIn, RandomSource rand, BlockPos pos,
4848
@Override
4949
public void performBonemeal(ServerLevel level, RandomSource rand, BlockPos pos, BlockState state) {
5050
var blockpos = pos.above();
51-
var blockstate = Blocks.GRASS.defaultBlockState();
51+
var blockstate = Blocks.GRASS_BLOCK.defaultBlockState();
5252

5353
for (var i = 0; i < 128; ++i) {
5454
var blockpos1 = blockpos;
@@ -81,4 +81,5 @@ public void performBonemeal(ServerLevel level, RandomSource rand, BlockPos pos,
8181
}
8282

8383
}
84+
8485
}

0 commit comments

Comments
 (0)