mirror of
https://github.com/TeamMidnightDust/CullLeaves.git
synced 2025-12-18 15:15:10 +01:00
Port to Architectury
Still need to figure out how to register built-in resource packs on forge
This commit is contained in:
10
common/src/main/java/eu/midnightdust/cullleaves/CullLeavesClient.java
Executable file
10
common/src/main/java/eu/midnightdust/cullleaves/CullLeavesClient.java
Executable file
@@ -0,0 +1,10 @@
|
||||
package eu.midnightdust.cullleaves;
|
||||
|
||||
import eu.midnightdust.cullleaves.config.CullLeavesConfig;
|
||||
|
||||
public class CullLeavesClient {
|
||||
|
||||
public static void onInitializeClient() {
|
||||
CullLeavesConfig.init("cullleaves", CullLeavesConfig.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package eu.midnightdust.cullleaves.config;
|
||||
|
||||
import eu.midnightdust.lib.config.MidnightConfig;
|
||||
|
||||
public class CullLeavesConfig extends MidnightConfig {
|
||||
@Entry // Enable/Disable the mod. Requires Chunk Reload (F3 + A).
|
||||
public static boolean enabled = true;
|
||||
}
|
||||
28
common/src/main/java/eu/midnightdust/cullleaves/mixin/MixinLeavesBlock.java
Executable file
28
common/src/main/java/eu/midnightdust/cullleaves/mixin/MixinLeavesBlock.java
Executable file
@@ -0,0 +1,28 @@
|
||||
package eu.midnightdust.cullleaves.mixin;
|
||||
|
||||
import eu.midnightdust.cullleaves.config.CullLeavesConfig;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.LeavesBlock;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(LeavesBlock.class)
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class MixinLeavesBlock extends Block {
|
||||
|
||||
public MixinLeavesBlock(Settings settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isSideInvisible(BlockState state, BlockState neighborState, Direction offset) {
|
||||
if (CullLeavesConfig.enabled) {
|
||||
return neighborState.getBlock() instanceof LeavesBlock;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user