generated from Nekojimi/ForgeModTemplate
parent
1f9a053f68
commit
36a7a198ba
@ -1,5 +1,5 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
||||||
<project version="4"> |
<project version="4"> |
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" /> |
<component name="ExternalStorageConfigurationManager" enabled="true" /> |
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK" /> |
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK" /> |
||||||
</project> |
</project> |
@ -1,17 +1,18 @@ |
|||||||
<component name="ProjectRunConfigurationManager"> |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||||||
<configuration default="false" name="runClient" type="Application" factoryName="Application" singleton="false"> |
<component> |
||||||
|
<configuration default="false" factoryName="Application" name="runClient" singleton="false" type="Application"> |
||||||
|
<option name="MAIN_CLASS_NAME" value="cpw.mods.bootstraplauncher.BootstrapLauncher"/> |
||||||
|
<option name="VM_PARAMETERS" value="-Dforge.logging.console.level=debug -Dforge.logging.markers=REGISTRIES "-DlegacyClassPath.file=/home/jimj316/nextcloud/jimj316 home/Programming/_Mods/Dimensionwalker-Mod/build/classpath/runClient_minecraftClasspath.txt" -DignoreList=bootstraplauncher,securejarhandler,asm-commons,asm-util,asm-analysis,asm-tree,asm,JarJarFileSystems,client-extra,fmlcore,javafmllanguage,lowcodelanguage,mclanguage,forge- -DmergeModules=jna-5.10.0.jar,jna-platform-5.10.0.jar -Dforge.enabledGameTestNamespaces=DimensionwalkerMod -Dforge.enableGameTest=true -Djava.net.preferIPv6Addresses=system -p /home/jimj316/.gradle/caches/modules-2/files-2.1/cpw.mods/bootstraplauncher/1.1.2/c546e00443d8432cda6baa1c860346980742628/bootstraplauncher-1.1.2.jar:/home/jimj316/.gradle/caches/modules-2/files-2.1/cpw.mods/securejarhandler/2.1.4/f47e3b9dd860a7b82154b8f90a650ffd0aaa5582/securejarhandler-2.1.4.jar:/home/jimj316/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-commons/9.3/1f2a432d1212f5c352ae607d7b61dcae20c20af5/asm-commons-9.3.jar:/home/jimj316/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-util/9.3/9595bc05510d0bd4b610188b77333fe4851a1975/asm-util-9.3.jar:/home/jimj316/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-analysis/9.3/4b071f211b37c38e0e9f5998550197c8593f6ad8/asm-analysis-9.3.jar:/home/jimj316/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-tree/9.3/78d2ecd61318b5a58cd04fb237636c0e86b77d97/asm-tree-9.3.jar:/home/jimj316/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm/9.3/8e6300ef51c1d801a7ed62d07cd221aca3a90640/asm-9.3.jar:/home/jimj316/.gradle/caches/modules-2/files-2.1/net.minecraftforge/JarJarFileSystems/0.3.16/e52afbb2599dc7c6f779efea0496d32fc01152e3/JarJarFileSystems-0.3.16.jar --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar=cpw.mods.securejarhandler --add-opens java.base/java.lang.invoke=cpw.mods.securejarhandler --add-exports java.base/sun.security.util=cpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns=java.naming"/> |
||||||
|
<option name="PROGRAM_PARAMETERS" value="--launchTarget forgeclientuserdev --version MOD_DEV --assetIndex 1.19 --assetsDir /home/jimj316/.gradle/caches/forge_gradle/assets --gameDir . --fml.forgeVersion 43.1.39 --fml.mcVersion 1.19.2 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20220805.130853"/> |
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/run"/> |
||||||
|
<module name="Dimensionwalker-Mod.main"/> |
||||||
<envs> |
<envs> |
||||||
<env name="MOD_CLASSES" value="${REPO_NAME_LOWER}%%$PROJECT_DIR$/build/resources/main:${REPO_NAME_LOWER}%%$PROJECT_DIR$/build/classes/java/main" /> |
<env name="MOD_CLASSES" value="dimensionwalker_mod%%$PROJECT_DIR$/build/resources/main:dimensionwalker_mod%%$PROJECT_DIR$/build/classes/java/main"/> |
||||||
<env name="MCP_MAPPINGS" value="official_1.19.2" /> |
<env name="MCP_MAPPINGS" value="official_1.19.2"/> |
||||||
</envs> |
</envs> |
||||||
<option name="MAIN_CLASS_NAME" value="cpw.mods.bootstraplauncher.BootstrapLauncher" /> |
|
||||||
<module name="moe.nekojimi.testmod.TestMod.main" /> |
|
||||||
<option name="PROGRAM_PARAMETERS" value="--launchTarget forgeclientuserdev --version MOD_DEV --assetIndex 1.19 --assetsDir $USER_HOME$/.gradle/caches/forge_gradle/assets --gameDir . --fml.forgeVersion 43.1.39 --fml.mcVersion 1.19.2 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20220805.130853" /> |
|
||||||
<option name="VM_PARAMETERS" value="-Dforge.logging.console.level=debug -Dforge.logging.markers=REGISTRIES "-DlegacyClassPath.file=$USER_HOME$/nextcloud/jimj316 home/Programming/_Mods/TestMod/build/classpath/runClient_minecraftClasspath.txt" -DignoreList=bootstraplauncher,securejarhandler,asm-commons,asm-util,asm-analysis,asm-tree,asm,JarJarFileSystems,client-extra,fmlcore,javafmllanguage,lowcodelanguage,mclanguage,forge- -DmergeModules=jna-5.10.0.jar,jna-platform-5.10.0.jar -Dforge.enabledGameTestNamespaces=TestMod -Dforge.enableGameTest=true -Djava.net.preferIPv6Addresses=system -p $USER_HOME$/.gradle/caches/modules-2/files-2.1/cpw.mods/bootstraplauncher/1.1.2/c546e00443d8432cda6baa1c860346980742628/bootstraplauncher-1.1.2.jar:$USER_HOME$/.gradle/caches/modules-2/files-2.1/cpw.mods/securejarhandler/2.1.4/f47e3b9dd860a7b82154b8f90a650ffd0aaa5582/securejarhandler-2.1.4.jar:$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-commons/9.3/1f2a432d1212f5c352ae607d7b61dcae20c20af5/asm-commons-9.3.jar:$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-util/9.3/9595bc05510d0bd4b610188b77333fe4851a1975/asm-util-9.3.jar:$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-analysis/9.3/4b071f211b37c38e0e9f5998550197c8593f6ad8/asm-analysis-9.3.jar:$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-tree/9.3/78d2ecd61318b5a58cd04fb237636c0e86b77d97/asm-tree-9.3.jar:$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm/9.3/8e6300ef51c1d801a7ed62d07cd221aca3a90640/asm-9.3.jar:$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.minecraftforge/JarJarFileSystems/0.3.16/e52afbb2599dc7c6f779efea0496d32fc01152e3/JarJarFileSystems-0.3.16.jar --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar=cpw.mods.securejarhandler --add-opens java.base/java.lang.invoke=cpw.mods.securejarhandler --add-exports java.base/sun.security.util=cpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns=java.naming" /> |
|
||||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/run" /> |
|
||||||
<method v="2"> |
<method v="2"> |
||||||
<option name="Make" enabled="true" /> |
<option enabled="true" name="Make"/> |
||||||
<option name="Gradle.BeforeRunTask" enabled="true" tasks=":prepareRunClient" externalProjectPath="$PROJECT_DIR$" /> |
<option enabled="true" externalProjectPath="$PROJECT_DIR$" name="Gradle.BeforeRunTask" tasks=":prepareRunClient"/> |
||||||
</method> |
</method> |
||||||
</configuration> |
</configuration> |
||||||
</component> |
</component> |
||||||
|
@ -0,0 +1,124 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project version="4"> |
||||||
|
<component name="Palette2"> |
||||||
|
<group name="Swing"> |
||||||
|
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" /> |
||||||
|
<initial-values> |
||||||
|
<property name="text" value="Button" /> |
||||||
|
</initial-values> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> |
||||||
|
<initial-values> |
||||||
|
<property name="text" value="RadioButton" /> |
||||||
|
</initial-values> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> |
||||||
|
<initial-values> |
||||||
|
<property name="text" value="CheckBox" /> |
||||||
|
</initial-values> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" /> |
||||||
|
<initial-values> |
||||||
|
<property name="text" value="Label" /> |
||||||
|
</initial-values> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
||||||
|
<preferred-size width="150" height="-1" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
||||||
|
<preferred-size width="150" height="-1" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
||||||
|
<preferred-size width="150" height="-1" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||||
|
<preferred-size width="150" height="50" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> |
||||||
|
<preferred-size width="200" height="200" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> |
||||||
|
<preferred-size width="200" height="200" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1"> |
||||||
|
<preferred-size width="-1" height="20" /> |
||||||
|
</default-constraints> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" /> |
||||||
|
</item> |
||||||
|
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||||
|
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" /> |
||||||
|
</item> |
||||||
|
</group> |
||||||
|
</component> |
||||||
|
</project> |
@ -1,6 +1,6 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
||||||
<project version="4"> |
<project version="4"> |
||||||
<component name="VcsDirectoryMappings"> |
<component name="VcsDirectoryMappings"> |
||||||
<mapping directory="PROJECT_DIR$" vcs="Git" /> |
<mapping directory="$USER_HOME$/nextcloud/jimj316 home/Programming/_Mods/Dimensionwalker-Mod" vcs="Git" /> |
||||||
</component> |
</component> |
||||||
</project> |
</project> |
@ -1,89 +0,0 @@ |
|||||||
package com.example.dimensionwalker-mod; |
|
||||||
|
|
||||||
import com.mojang.logging.LogUtils; |
|
||||||
import net.minecraft.client.Minecraft; |
|
||||||
import net.minecraft.world.item.BlockItem; |
|
||||||
import net.minecraft.world.item.CreativeModeTab; |
|
||||||
import net.minecraft.world.item.Item; |
|
||||||
import net.minecraft.world.level.block.Block; |
|
||||||
import net.minecraft.world.level.block.Blocks; |
|
||||||
import net.minecraft.world.level.block.state.BlockBehaviour; |
|
||||||
import net.minecraft.world.level.material.Material; |
|
||||||
import net.minecraftforge.common.MinecraftForge; |
|
||||||
import net.minecraftforge.eventbus.api.IEventBus; |
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent; |
|
||||||
import net.minecraftforge.fml.InterModComms; |
|
||||||
import net.minecraftforge.fml.common.Mod; |
|
||||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; |
|
||||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; |
|
||||||
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent; |
|
||||||
import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent; |
|
||||||
import net.minecraftforge.event.server.ServerStartingEvent; |
|
||||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; |
|
||||||
import net.minecraftforge.registries.DeferredRegister; |
|
||||||
import net.minecraftforge.registries.ForgeRegistries; |
|
||||||
import net.minecraftforge.registries.RegistryObject; |
|
||||||
import org.slf4j.Logger; |
|
||||||
|
|
||||||
// The value here should match an entry in the META-INF/mods.toml file
|
|
||||||
@Mod(DimensionwalkerMod.MODID) |
|
||||||
public class DimensionwalkerMod |
|
||||||
{ |
|
||||||
// Define mod id in a common place for everything to reference
|
|
||||||
public static final String MODID = "dimensionwalker-mod"; |
|
||||||
// Directly reference a slf4j logger
|
|
||||||
private static final Logger LOGGER = LogUtils.getLogger(); |
|
||||||
// Create a Deferred Register to hold Blocks which will all be registered under the "dimensionwalker-mod" namespace
|
|
||||||
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MODID); |
|
||||||
// Create a Deferred Register to hold Items which will all be registered under the "dimensionwalker-mod" namespace
|
|
||||||
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID); |
|
||||||
|
|
||||||
// Creates a new Block with the id "dimensionwalker-mod:example_block", combining the namespace and path
|
|
||||||
public static final RegistryObject<Block> EXAMPLE_BLOCK = BLOCKS.register("example_block", () -> new Block(BlockBehaviour.Properties.of(Material.STONE))); |
|
||||||
// Creates a new BlockItem with the id "dimensionwalker-mod:example_block", combining the namespace and path
|
|
||||||
public static final RegistryObject<Item> EXAMPLE_BLOCK_ITEM = ITEMS.register("example_block", () -> new BlockItem(EXAMPLE_BLOCK.get(), new Item.Properties().tab(CreativeModeTab.TAB_BUILDING_BLOCKS))); |
|
||||||
|
|
||||||
public DimensionwalkerMod() |
|
||||||
{ |
|
||||||
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); |
|
||||||
|
|
||||||
// Register the commonSetup method for modloading
|
|
||||||
modEventBus.addListener(this::commonSetup); |
|
||||||
|
|
||||||
// Register the Deferred Register to the mod event bus so blocks get registered
|
|
||||||
BLOCKS.register(modEventBus); |
|
||||||
// Register the Deferred Register to the mod event bus so items get registered
|
|
||||||
ITEMS.register(modEventBus); |
|
||||||
|
|
||||||
// Register ourselves for server and other game events we are interested in
|
|
||||||
MinecraftForge.EVENT_BUS.register(this); |
|
||||||
} |
|
||||||
|
|
||||||
private void commonSetup(final FMLCommonSetupEvent event) |
|
||||||
{ |
|
||||||
// Some common setup code
|
|
||||||
LOGGER.info("HELLO FROM COMMON SETUP"); |
|
||||||
LOGGER.info("DIRT BLOCK >> {}", ForgeRegistries.BLOCKS.getKey(Blocks.DIRT)); |
|
||||||
} |
|
||||||
|
|
||||||
// You can use SubscribeEvent and let the Event Bus discover methods to call
|
|
||||||
@SubscribeEvent |
|
||||||
public void onServerStarting(ServerStartingEvent event) |
|
||||||
{ |
|
||||||
// Do something when the server starts
|
|
||||||
LOGGER.info("HELLO from server starting"); |
|
||||||
} |
|
||||||
|
|
||||||
// You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
|
|
||||||
@Mod.EventBusSubscriber(modid = MODID, bus = Mod.EventBusSubscriber.Bus.MOD) |
|
||||||
public static class ClientModEvents |
|
||||||
{ |
|
||||||
@SubscribeEvent |
|
||||||
public static void onClientSetup(FMLClientSetupEvent event) |
|
||||||
{ |
|
||||||
// Some client setup code
|
|
||||||
LOGGER.info("HELLO FROM CLIENT SETUP"); |
|
||||||
LOGGER.info("MINECRAFT NAME >> {}", Minecraft.getInstance().getUser().getName()); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue