Skip to content

Commit

Permalink
Merge pull request #5 from MisterJulsen/1.20.1-dev
Browse files Browse the repository at this point in the history
1.20.1 dev
  • Loading branch information
MisterJulsen authored Apr 5, 2024
2 parents 713155a + 0c7cc75 commit 3a1a181
Show file tree
Hide file tree
Showing 144 changed files with 8,025 additions and 196 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ bin
.metadata
.classpath
.project
.vscode

# idea
out
Expand Down
8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"projectName": "CRN 1.20.1",
"cwd": "${workspaceFolder}\\run",
"vmArgs": "-Dforge.logging.console.level\u003ddebug -Dforge.logging.markers\u003dREGISTRIES \"-DlegacyClassPath.file\u003dC:\\Users\\julia\\Documents\\Forge Modding\\CreateRailwaysNavigator\\CRN 1.20.1\\build\\classpath\\runClient_minecraftClasspath.txt\" -Dmixin.env.remapRefMap\u003dtrue \"-Dmixin.env.refMapRemappingFile\u003dC:\\Users\\julia\\Documents\\Forge Modding\\CreateRailwaysNavigator\\CRN 1.20.1\\build/createSrgToMcp/output.srg\" \"-Dnet.minecraftforge.gradle.GradleStart.srg.srg-mcp\u003dC:\\Users\\julia\\Documents\\Forge Modding\\CreateRailwaysNavigator\\CRN 1.20.1\\build\\createSrgToMcp\\output.srg\" -DignoreList\u003dbootstraplauncher,securejarhandler,asm-commons,asm-util,asm-analysis,asm-tree,asm,JarJarFileSystems,client-extra,fmlcore,javafmllanguage,lowcodelanguage,mclanguage,forge- -DmergeModules\u003djna-5.10.0.jar,jna-platform-5.10.0.jar -Dforge.enabledGameTestNamespaces\u003dcreaterailwaysnavigator -Dforge.enableGameTest\u003dtrue -Djava.net.preferIPv6Addresses\u003dsystem -p C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\bootstraplauncher\\1.1.2\\c546e00443d8432cda6baa1c860346980742628\\bootstraplauncher-1.1.2.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\securejarhandler\\2.1.10\\51e6a22c6c716beb11e244bf5b8be480f51dd6b5\\securejarhandler-2.1.10.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-commons\\9.5\\19ab5b5800a3910d30d3a3e64fdb00fd0cb42de0\\asm-commons-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-util\\9.5\\64b5a1fc8c1b15ed2efd6a063e976bc8d3dc5ffe\\asm-util-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-analysis\\9.5\\490bacc77de7cbc0be1a30bb3471072d705be4a4\\asm-analysis-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-tree\\9.5\\fd33c8b6373abaa675be407082fdfda35021254a\\asm-tree-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm\\9.5\\dc6ea1875f4d64fbc85e1691c95b96a3d8569c90\\asm-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\JarJarFileSystems\\0.3.19\\2464eb7d6b9ddb9db36a82cf8a95193e5c6fe020\\JarJarFileSystems-0.3.19.jar --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar\u003dcpw.mods.securejarhandler --add-opens java.base/java.lang.invoke\u003dcpw.mods.securejarhandler --add-exports java.base/sun.security.util\u003dcpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns\u003djava.naming -XX:HeapDumpPath\u003dMojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump",
"args": "--launchTarget forgeclientuserdev --version MOD_DEV --assetIndex 5 --assetsDir C:\\Users\\julia\\.gradle\\caches\\forge_gradle\\assets --gameDir . --fml.forgeVersion 47.2.0 --fml.mcVersion 1.20.1 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20230612.114412 --mixin.config createrailwaysnavigator.mixin.json",
"args": "--launchTarget forgeclientuserdev --version MOD_DEV --assetIndex 5 --assetsDir C:\\Users\\julia\\.gradle\\caches\\forge_gradle\\assets --gameDir . --fml.forgeVersion 47.2.0 --fml.mcVersion 1.20.1 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20230612.114412 --mixin.config createrailwaysnavigator.mixins.json",
"env": {
"MOD_CLASSES": "createrailwaysnavigator%%${workspaceFolder}\\build\\resources\\main;createrailwaysnavigator%%${workspaceFolder}\\build\\classes\\java\\main",
"MCP_MAPPINGS": "parchment_2023.09.03-1.20.1"
Expand All @@ -24,7 +24,7 @@
"projectName": "CRN 1.20.1",
"cwd": "${workspaceFolder}\\run-data",
"vmArgs": "-Dforge.logging.console.level\u003ddebug -Dforge.logging.markers\u003dREGISTRIES \"-DlegacyClassPath.file\u003dC:\\Users\\julia\\Documents\\Forge Modding\\CreateRailwaysNavigator\\CRN 1.20.1\\build\\classpath\\runData_minecraftClasspath.txt\" -Dmixin.env.remapRefMap\u003dtrue \"-Dmixin.env.refMapRemappingFile\u003dC:\\Users\\julia\\Documents\\Forge Modding\\CreateRailwaysNavigator\\CRN 1.20.1\\build/createSrgToMcp/output.srg\" \"-Dnet.minecraftforge.gradle.GradleStart.srg.srg-mcp\u003dC:\\Users\\julia\\Documents\\Forge Modding\\CreateRailwaysNavigator\\CRN 1.20.1\\build\\createSrgToMcp\\output.srg\" -DignoreList\u003dbootstraplauncher,securejarhandler,asm-commons,asm-util,asm-analysis,asm-tree,asm,JarJarFileSystems,client-extra,fmlcore,javafmllanguage,lowcodelanguage,mclanguage,forge- -DmergeModules\u003djna-5.10.0.jar,jna-platform-5.10.0.jar -Djava.net.preferIPv6Addresses\u003dsystem -p C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\bootstraplauncher\\1.1.2\\c546e00443d8432cda6baa1c860346980742628\\bootstraplauncher-1.1.2.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\securejarhandler\\2.1.10\\51e6a22c6c716beb11e244bf5b8be480f51dd6b5\\securejarhandler-2.1.10.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-commons\\9.5\\19ab5b5800a3910d30d3a3e64fdb00fd0cb42de0\\asm-commons-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-util\\9.5\\64b5a1fc8c1b15ed2efd6a063e976bc8d3dc5ffe\\asm-util-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-analysis\\9.5\\490bacc77de7cbc0be1a30bb3471072d705be4a4\\asm-analysis-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-tree\\9.5\\fd33c8b6373abaa675be407082fdfda35021254a\\asm-tree-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm\\9.5\\dc6ea1875f4d64fbc85e1691c95b96a3d8569c90\\asm-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\JarJarFileSystems\\0.3.19\\2464eb7d6b9ddb9db36a82cf8a95193e5c6fe020\\JarJarFileSystems-0.3.19.jar --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar\u003dcpw.mods.securejarhandler --add-opens java.base/java.lang.invoke\u003dcpw.mods.securejarhandler --add-exports java.base/sun.security.util\u003dcpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns\u003djava.naming",
"args": "--launchTarget forgedatauserdev --assetIndex 5 --assetsDir C:\\Users\\julia\\.gradle\\caches\\forge_gradle\\assets --gameDir . --fml.forgeVersion 47.2.0 --fml.mcVersion 1.20.1 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20230612.114412 --mod createrailwaysnavigator --all --output \"C:\\Users\\julia\\Documents\\Forge Modding\\CreateRailwaysNavigator\\CRN 1.20.1\\src\\generated\\resources\" --existing \"C:\\Users\\julia\\Documents\\Forge Modding\\CreateRailwaysNavigator\\CRN 1.20.1\\src\\main\\resources\" --mixin.config createrailwaysnavigator.mixin.json",
"args": "--launchTarget forgedatauserdev --assetIndex 5 --assetsDir C:\\Users\\julia\\.gradle\\caches\\forge_gradle\\assets --gameDir . --fml.forgeVersion 47.2.0 --fml.mcVersion 1.20.1 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20230612.114412 --mod createrailwaysnavigator --all --output \"C:\\Users\\julia\\Documents\\Forge Modding\\CreateRailwaysNavigator\\CRN 1.20.1\\src\\generated\\resources\" --existing \"C:\\Users\\julia\\Documents\\Forge Modding\\CreateRailwaysNavigator\\CRN 1.20.1\\src\\main\\resources\" --mixin.config createrailwaysnavigator.mixins.json",
"env": {
"MOD_CLASSES": "createrailwaysnavigator%%${workspaceFolder}\\build\\resources\\main;createrailwaysnavigator%%${workspaceFolder}\\build\\classes\\java\\main",
"MCP_MAPPINGS": "parchment_2023.09.03-1.20.1"
Expand All @@ -39,7 +39,7 @@
"projectName": "CRN 1.20.1",
"cwd": "${workspaceFolder}\\run",
"vmArgs": "-Dforge.logging.console.level\u003ddebug -Dforge.logging.markers\u003dREGISTRIES \"-DlegacyClassPath.file\u003dC:\\Users\\julia\\Documents\\Forge Modding\\CreateRailwaysNavigator\\CRN 1.20.1\\build\\classpath\\runGameTestServer_minecraftClasspath.txt\" -Dmixin.env.remapRefMap\u003dtrue \"-Dmixin.env.refMapRemappingFile\u003dC:\\Users\\julia\\Documents\\Forge Modding\\CreateRailwaysNavigator\\CRN 1.20.1\\build/createSrgToMcp/output.srg\" \"-Dnet.minecraftforge.gradle.GradleStart.srg.srg-mcp\u003dC:\\Users\\julia\\Documents\\Forge Modding\\CreateRailwaysNavigator\\CRN 1.20.1\\build\\createSrgToMcp\\output.srg\" -DignoreList\u003dbootstraplauncher,securejarhandler,asm-commons,asm-util,asm-analysis,asm-tree,asm,JarJarFileSystems,client-extra,fmlcore,javafmllanguage,lowcodelanguage,mclanguage,forge- -DmergeModules\u003djna-5.10.0.jar,jna-platform-5.10.0.jar -Dforge.enabledGameTestNamespaces\u003dcreaterailwaysnavigator -Djava.net.preferIPv6Addresses\u003dsystem -p C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\bootstraplauncher\\1.1.2\\c546e00443d8432cda6baa1c860346980742628\\bootstraplauncher-1.1.2.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\securejarhandler\\2.1.10\\51e6a22c6c716beb11e244bf5b8be480f51dd6b5\\securejarhandler-2.1.10.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-commons\\9.5\\19ab5b5800a3910d30d3a3e64fdb00fd0cb42de0\\asm-commons-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-util\\9.5\\64b5a1fc8c1b15ed2efd6a063e976bc8d3dc5ffe\\asm-util-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-analysis\\9.5\\490bacc77de7cbc0be1a30bb3471072d705be4a4\\asm-analysis-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-tree\\9.5\\fd33c8b6373abaa675be407082fdfda35021254a\\asm-tree-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm\\9.5\\dc6ea1875f4d64fbc85e1691c95b96a3d8569c90\\asm-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\JarJarFileSystems\\0.3.19\\2464eb7d6b9ddb9db36a82cf8a95193e5c6fe020\\JarJarFileSystems-0.3.19.jar --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar\u003dcpw.mods.securejarhandler --add-opens java.base/java.lang.invoke\u003dcpw.mods.securejarhandler --add-exports java.base/sun.security.util\u003dcpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns\u003djava.naming",
"args": "--launchTarget forgegametestserveruserdev --gameDir . --fml.forgeVersion 47.2.0 --fml.mcVersion 1.20.1 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20230612.114412 --mixin.config createrailwaysnavigator.mixin.json",
"args": "--launchTarget forgegametestserveruserdev --gameDir . --fml.forgeVersion 47.2.0 --fml.mcVersion 1.20.1 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20230612.114412 --mixin.config createrailwaysnavigator.mixins.json",
"env": {
"MOD_CLASSES": "createrailwaysnavigator%%${workspaceFolder}\\build\\resources\\main;createrailwaysnavigator%%${workspaceFolder}\\build\\classes\\java\\main",
"MCP_MAPPINGS": "parchment_2023.09.03-1.20.1"
Expand All @@ -54,7 +54,7 @@
"projectName": "CRN 1.20.1",
"cwd": "${workspaceFolder}\\run",
"vmArgs": "-Dforge.logging.console.level\u003ddebug -Dforge.logging.markers\u003dREGISTRIES \"-DlegacyClassPath.file\u003dC:\\Users\\julia\\Documents\\Forge Modding\\CreateRailwaysNavigator\\CRN 1.20.1\\build\\classpath\\runServer_minecraftClasspath.txt\" -Dmixin.env.remapRefMap\u003dtrue \"-Dmixin.env.refMapRemappingFile\u003dC:\\Users\\julia\\Documents\\Forge Modding\\CreateRailwaysNavigator\\CRN 1.20.1\\build/createSrgToMcp/output.srg\" \"-Dnet.minecraftforge.gradle.GradleStart.srg.srg-mcp\u003dC:\\Users\\julia\\Documents\\Forge Modding\\CreateRailwaysNavigator\\CRN 1.20.1\\build\\createSrgToMcp\\output.srg\" -DignoreList\u003dbootstraplauncher,securejarhandler,asm-commons,asm-util,asm-analysis,asm-tree,asm,JarJarFileSystems,client-extra,fmlcore,javafmllanguage,lowcodelanguage,mclanguage,forge- -DmergeModules\u003djna-5.10.0.jar,jna-platform-5.10.0.jar -Dforge.enabledGameTestNamespaces\u003dcreaterailwaysnavigator -Dforge.enableGameTest\u003dtrue -Djava.net.preferIPv6Addresses\u003dsystem -p C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\bootstraplauncher\\1.1.2\\c546e00443d8432cda6baa1c860346980742628\\bootstraplauncher-1.1.2.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\securejarhandler\\2.1.10\\51e6a22c6c716beb11e244bf5b8be480f51dd6b5\\securejarhandler-2.1.10.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-commons\\9.5\\19ab5b5800a3910d30d3a3e64fdb00fd0cb42de0\\asm-commons-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-util\\9.5\\64b5a1fc8c1b15ed2efd6a063e976bc8d3dc5ffe\\asm-util-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-analysis\\9.5\\490bacc77de7cbc0be1a30bb3471072d705be4a4\\asm-analysis-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-tree\\9.5\\fd33c8b6373abaa675be407082fdfda35021254a\\asm-tree-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm\\9.5\\dc6ea1875f4d64fbc85e1691c95b96a3d8569c90\\asm-9.5.jar;C:\\Users\\julia\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\JarJarFileSystems\\0.3.19\\2464eb7d6b9ddb9db36a82cf8a95193e5c6fe020\\JarJarFileSystems-0.3.19.jar --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar\u003dcpw.mods.securejarhandler --add-opens java.base/java.lang.invoke\u003dcpw.mods.securejarhandler --add-exports java.base/sun.security.util\u003dcpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns\u003djava.naming",
"args": "--launchTarget forgeserveruserdev --gameDir . --fml.forgeVersion 47.2.0 --fml.mcVersion 1.20.1 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20230612.114412 --nogui --mixin.config createrailwaysnavigator.mixin.json",
"args": "--launchTarget forgeserveruserdev --gameDir . --fml.forgeVersion 47.2.0 --fml.mcVersion 1.20.1 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20230612.114412 --nogui --mixin.config createrailwaysnavigator.mixins.json",
"env": {
"MOD_CLASSES": "createrailwaysnavigator%%${workspaceFolder}\\build\\resources\\main;createrailwaysnavigator%%${workspaceFolder}\\build\\classes\\java\\main",
"MCP_MAPPINGS": "parchment_2023.09.03-1.20.1"
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"java.configuration.updateBuildConfiguration": "automatic",
"java.compile.nullAnalysis.mode": "disabled"
"java.compile.nullAnalysis.mode": "disabled",
"commentTranslate.hover.enabled": false
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
org.gradle.jvmargs=-Xmx6G
org.gradle.daemon=false

mod_version = 0.3.0-beta
mod_version = 0.4.0-beta
mod_root_path = de.mrjulsen.crn

minecraft_version=1.20.1
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/de/mrjulsen/crn/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.UUID;

import com.google.gson.Gson;

Expand All @@ -21,10 +22,11 @@ public class Constants {
public static final Component TEXT_TRUE = Utils.translate("gui." + ModMain.MOD_ID + ".common.true");
public static final Component TEXT_FALSE = Utils.translate("gui." + ModMain.MOD_ID + ".common.false");
public static final Component TEXT_SERVER_ERROR = Utils.translate("gui." + ModMain.MOD_ID + ".common.server_error");
public static final String TEXT_SEARCH = Utils.translate("common." + ModMain.MOD_ID + ".search").getString();
public static final Component TEXT_SEARCH = Utils.translate("gui." + ModMain.MOD_ID + ".common.search");
public static final Gson GSON = new Gson();
public static final DateFormat DATE_FORMAT = new SimpleDateFormat();
public static final int TIME_SHIFT = 6000;
public static final UUID ZERO_UUID = UUID.fromString("00000000-0000-0000-0000-000000000000");

public static final int COLOR_ON_TIME = 0x1AEA5F;
public static final int COLOR_DELAYED = 0xFF4242;
Expand Down
54 changes: 46 additions & 8 deletions src/main/java/de/mrjulsen/crn/ModMain.java
Original file line number Diff line number Diff line change
@@ -1,42 +1,80 @@
package de.mrjulsen.crn;

import com.mojang.logging.LogUtils;
import com.simibubi.create.foundation.data.CreateRegistrate;
import com.simibubi.create.foundation.item.ItemDescription;
import com.simibubi.create.foundation.item.KineticStats;
import com.simibubi.create.foundation.item.TooltipHelper;
import com.simibubi.create.foundation.item.TooltipModifier;

import de.mrjulsen.crn.block.AdvancedDisplayBlock;
import de.mrjulsen.crn.config.ModClientConfig;
import de.mrjulsen.crn.config.ModCommonConfig;
import de.mrjulsen.crn.item.ModItems;
import de.mrjulsen.crn.item.creativemodetab.ModCreativeModeTab;
import de.mrjulsen.crn.network.NetworkManager;
import de.mrjulsen.crn.proxy.ClientInitWrapper;
import de.mrjulsen.crn.proxy.ServerInit;
import de.mrjulsen.crn.registry.ModBlockEntities;
import de.mrjulsen.crn.registry.ModBlocks;
import de.mrjulsen.crn.registry.ModCreativeModeTab;
import de.mrjulsen.crn.registry.ModExtras;
import de.mrjulsen.crn.registry.ModItems;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;

import javax.annotation.Nullable;

import org.slf4j.Logger;

@Mod(ModMain.MOD_ID)
public final class ModMain {

// The value here should match an entry in the META-INF/mods.toml file
public static final String MOD_ID = "createrailwaysnavigator";

// Directly reference a slf4j logger
public static final Logger LOGGER = LogUtils.getLogger();

public static final CreateRegistrate REGISTRATE = CreateRegistrate.create(MOD_ID);

@Nullable
public static KineticStats create(Item item) {
if (item instanceof BlockItem blockItem) {
Block block = blockItem.getBlock();
if (block instanceof AdvancedDisplayBlock) {
return new KineticStats(block);
}
}
return null;
}

static {
ModMain.REGISTRATE.setTooltipModifierFactory(item ->
new ItemDescription.Modifier(item, TooltipHelper.Palette.STANDARD_CREATE)
.andThen(TooltipModifier.mapNull(ModMain.create(item)))
);
}

public ModMain() {
IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus();
eventBus.addListener(ServerInit::setup);
eventBus.addListener(ClientInitWrapper::setup);

ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, ModClientConfig.SPEC, MOD_ID + "-client.toml");
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, ModCommonConfig.SPEC, MOD_ID + "-common.toml");

ModItems.register(eventBus);
eventBus.addListener(ServerInit::setup);
eventBus.addListener(ClientInitWrapper::setup);

REGISTRATE.registerEventListeners(eventBus);

ModBlocks.register();
ModItems.register();
ModBlockEntities.register();
ModCreativeModeTab.register(eventBus);
NetworkManager.create();
ModExtras.register();
MinecraftForge.EVENT_BUS.register(this);
}
}
Loading

0 comments on commit 3a1a181

Please sign in to comment.