Skip to content

Commit be3a8be

Browse files
authored
Dev/mc1.20.1 (#78)
fix server crash
1 parent 5b57d34 commit be3a8be

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

forge/src/main/java/cc/tweaked_programs/cccbridge/client/CCConfig.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@
55
import net.minecraft.client.gui.screens.Screen;
66
import net.minecraftforge.api.distmarker.Dist;
77
import net.minecraftforge.api.distmarker.OnlyIn;
8+
import net.minecraftforge.fml.loading.FMLPaths;
89
import org.jetbrains.annotations.Nullable;
910

1011
import java.io.*;
1112
import java.util.Properties;
1213

1314
@OnlyIn(Dist.CLIENT)
1415
public class CCConfig {
16+
public static final CCConfig CONFIG = new CCConfig(
17+
FMLPaths.CONFIGDIR.get().toString()
18+
);
19+
1520
private final Properties properties;
1621
public String config_dir;
1722

forge/src/main/java/cc/tweaked_programs/cccbridge/common/assistance/Randomness.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77

88
import java.util.Random;
99

10+
import static cc.tweaked_programs.cccbridge.client.CCConfig.CONFIG;
1011
import static cc.tweaked_programs.cccbridge.common.minecraft.block.RedRouterBlock.FACE_AMOUNT;
1112

1213
public class Randomness {
1314
private static final Random random = new Random();
1415

1516
@OnlyIn(Dist.CLIENT)
1617
public static int lightFlickering() {
17-
if (CCCBridge.CONFIG.FLICKERING)
18+
if (CONFIG.FLICKERING)
1819
return ((int)(LightTexture.FULL_BRIGHT - (Math.random()*35) - (random.nextInt(0,45) == 1 ? 50 : 0)));
1920
else
2021
return LightTexture.FULL_BRIGHT;

forge/src/main/java/cc/tweaked_programs/cccbridge/common/modloader/CCCBridge.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ public class CCCBridge {
2626
public static final String MOD_ID = "cccbridge";
2727
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
2828

29-
@OnlyIn(Dist.CLIENT)
30-
public static final CCConfig CONFIG = new CCConfig(
31-
FMLPaths.CONFIGDIR.get().toString()
32-
);
33-
3429
public CCCBridge() {
3530
// Minecraft stuff
3631
CCCRegistries.register();
@@ -43,7 +38,7 @@ public static void complete(FMLLoadCompleteEvent event) {
4338

4439
@SubscribeEvent
4540
public static void registerRenderers(EntityRenderersEvent.RegisterRenderers event) {
46-
event.registerBlockEntityRenderer((BlockEntityType<RedRouterBlockEntity>) CCCRegistries.REDROUTER_BLOCK_ENTITY.get(), RedRouterBlockEntityRenderer::new);
47-
event.registerBlockEntityRenderer((BlockEntityType<AnimatronicBlockEntity>) CCCRegistries.ANIMATRONIC_BLOCK_ENTITY.get(), AnimatronicBlockEntityRenderer::new);
41+
event.registerBlockEntityRenderer(CCCRegistries.REDROUTER_BLOCK_ENTITY.get(), RedRouterBlockEntityRenderer::new);
42+
event.registerBlockEntityRenderer(CCCRegistries.ANIMATRONIC_BLOCK_ENTITY.get(), AnimatronicBlockEntityRenderer::new);
4843
}
4944
}

0 commit comments

Comments
 (0)