Skip to content

Commit

Permalink
fix: slight optimization in theory + fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed Jan 14, 2025
1 parent 223e3ad commit e503a0b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/zepalesque/redux/Redux.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ public void packSetup(AddPackFindersEvent event) {
if (event.getPackType() == PackType.CLIENT_RESOURCES) {
ASSETS_CONFIG.setup(event);
} else if (event.getPackType() == PackType.SERVER_DATA) {
if (ReduxConfig.COMMON.bronze_dungeon_upgrade.get()) { PackUtils.setupPack(event, MODID, "dungeon_upgrades/bronze", "bronze_upgrade", true, true); }
if (ReduxConfig.COMMON.redux_noise.get().get()) { PackUtils.setupPack(event, MODID, "redux_noise", "redux_noise", true, true); }
if (ReduxConfig.COMMON.bronze_dungeon_upgrade.get()) { PackUtils.setupPack(event, MODID, "data/dungeon_upgrades/bronze", "bronze_upgrade", true, true); }
if (ReduxConfig.COMMON.redux_noise.get().get()) { PackUtils.setupPack(event, MODID, "data/redux_noise", "redux_noise", true, true); }
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/zepalesque/redux/block/ReduxBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class ReduxBlocks extends ReduxBlockBuilders {
() -> new LeafPileBlock(GILDENROOT_LEAVES));

public static DeferredBlock<ShadedLeavesBlock> SHADEROOT_LEAVES = register("shaderoot_leaves",
() -> new ShadedLeavesBlock(ReduxParticles.SHADEROOT_LEAF, 5, Properties.ofFullCopy(AetherBlocks.SKYROOT_LEAVES.get()).mapColor(MapColor.TERRACOTTA_PURPLE)));
() -> new ShadedLeavesBlock(ReduxParticles.SHADEROOT_LEAF, 8, Properties.ofFullCopy(AetherBlocks.SKYROOT_LEAVES.get()).mapColor(MapColor.TERRACOTTA_PURPLE)));

public static DeferredBlock<LeafPileBlock> SHADEROOT_LEAF_PILE = register("shaderoot_leaf_pile",
() -> new LeafPileBlock(SHADEROOT_LEAVES));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@

public class ShadedLeavesBlock extends FallingLeavesBlock {
private final int lightBlock;
private final boolean propogateLight;

public ShadedLeavesBlock(Supplier<? extends ParticleOptions> particle, int lightBlock, Properties properties) {
super(particle, properties);
this.lightBlock = lightBlock;
this.propogateLight = lightBlock < 15;
}

@Override
Expand All @@ -22,6 +24,6 @@ protected int getLightBlock(BlockState state, BlockGetter level, BlockPos pos) {

@Override
protected boolean propagatesSkylightDown(BlockState state, BlockGetter level, BlockPos pos) {
return this.lightBlock < 15 && super.propagatesSkylightDown(state, level, pos);
return this.propogateLight && super.propagatesSkylightDown(state, level, pos);
}
}

0 comments on commit e503a0b

Please sign in to comment.