From 55c3e624f7420e1f2e93a396cdef5189885062d9 Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Fri, 5 Aug 2022 01:16:57 +0200 Subject: Empty minecraft mod --- src/main/java/kubaworks/ClientProxy.java | 57 ++++++++++++++++++++ src/main/java/kubaworks/CommonProxy.java | 45 ++++++++++++++++ src/main/java/kubaworks/Config.java | 35 ++++++++++++ src/main/java/kubaworks/MyMod.java | 91 ++++++++++++++++++++++++++++++++ src/main/java/kubaworks/Tags.java | 30 +++++++++++ 5 files changed, 258 insertions(+) create mode 100644 src/main/java/kubaworks/ClientProxy.java create mode 100644 src/main/java/kubaworks/CommonProxy.java create mode 100644 src/main/java/kubaworks/Config.java create mode 100644 src/main/java/kubaworks/MyMod.java create mode 100644 src/main/java/kubaworks/Tags.java (limited to 'src/main/java') diff --git a/src/main/java/kubaworks/ClientProxy.java b/src/main/java/kubaworks/ClientProxy.java new file mode 100644 index 0000000000..3f450eb803 --- /dev/null +++ b/src/main/java/kubaworks/ClientProxy.java @@ -0,0 +1,57 @@ +/* + * kubaworks - Gregtech Addon + * Copyright (C) 2022 kuba6000 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package kubaworks; + +import cpw.mods.fml.common.event.*; + +public class ClientProxy extends CommonProxy { + + public void preInit(FMLPreInitializationEvent event) { + super.preInit(event); + } + + public void init(FMLInitializationEvent event) { + super.init(event); + } + + public void postInit(FMLPostInitializationEvent event) { + super.postInit(event); + } + + public void serverAboutToStart(FMLServerAboutToStartEvent event) { + super.serverAboutToStart(event); + } + + public void serverStarting(FMLServerStartingEvent event) { + super.serverStarting(event); + } + + public void serverStarted(FMLServerStartedEvent event) { + super.serverStarted(event); + } + + public void serverStopping(FMLServerStoppingEvent event) { + super.serverStopping(event); + } + + public void serverStopped(FMLServerStoppedEvent event) { + super.serverStopped(event); + } +} diff --git a/src/main/java/kubaworks/CommonProxy.java b/src/main/java/kubaworks/CommonProxy.java new file mode 100644 index 0000000000..2c6e7d9ddf --- /dev/null +++ b/src/main/java/kubaworks/CommonProxy.java @@ -0,0 +1,45 @@ +/* + * kubaworks - Gregtech Addon + * Copyright (C) 2022 kuba6000 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package kubaworks; + +import cpw.mods.fml.common.event.*; + +public class CommonProxy { + + public void preInit(FMLPreInitializationEvent event) { + Config.syncronizeConfiguration(event.getSuggestedConfigurationFile()); + + MyMod.info("I am " + Tags.MODNAME + " at version " + Tags.VERSION); + } + + public void init(FMLInitializationEvent event) {} + + public void postInit(FMLPostInitializationEvent event) {} + + public void serverAboutToStart(FMLServerAboutToStartEvent event) {} + + public void serverStarting(FMLServerStartingEvent event) {} + + public void serverStarted(FMLServerStartedEvent event) {} + + public void serverStopping(FMLServerStoppingEvent event) {} + + public void serverStopped(FMLServerStoppedEvent event) {} +} diff --git a/src/main/java/kubaworks/Config.java b/src/main/java/kubaworks/Config.java new file mode 100644 index 0000000000..d0bcb0ebfd --- /dev/null +++ b/src/main/java/kubaworks/Config.java @@ -0,0 +1,35 @@ +/* + * kubaworks - Gregtech Addon + * Copyright (C) 2022 kuba6000 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package kubaworks; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; + +public class Config { + + public static void syncronizeConfiguration(File configFile) { + Configuration configuration = new Configuration(configFile); + configuration.load(); + + if (configuration.hasChanged()) { + configuration.save(); + } + } +} diff --git a/src/main/java/kubaworks/MyMod.java b/src/main/java/kubaworks/MyMod.java new file mode 100644 index 0000000000..493a464412 --- /dev/null +++ b/src/main/java/kubaworks/MyMod.java @@ -0,0 +1,91 @@ +/* + * kubaworks - Gregtech Addon + * Copyright (C) 2022 kuba6000 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package kubaworks; + +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.*; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@Mod(modid = Tags.MODID, version = Tags.VERSION, name = Tags.MODNAME, acceptedMinecraftVersions = "[1.7.10]") +public class MyMod { + + private static Logger LOG = LogManager.getLogger(Tags.MODID); + + @SidedProxy(clientSide = Tags.MODID + ".ClientProxy", serverSide = Tags.MODID + ".CommonProxy") + public static CommonProxy proxy; + + @Mod.EventHandler + public void preInit(FMLPreInitializationEvent event) { + proxy.preInit(event); + } + + @Mod.EventHandler + public void init(FMLInitializationEvent event) { + proxy.init(event); + } + + @Mod.EventHandler + public void postInit(FMLPostInitializationEvent event) { + proxy.postInit(event); + } + + @Mod.EventHandler + public void serverAboutToStart(FMLServerAboutToStartEvent event) { + proxy.serverAboutToStart(event); + } + + @Mod.EventHandler + public void serverStarting(FMLServerStartingEvent event) { + proxy.serverStarting(event); + } + + @Mod.EventHandler + public void serverStarted(FMLServerStartedEvent event) { + proxy.serverStarted(event); + } + + @Mod.EventHandler + public void serverStopping(FMLServerStoppingEvent event) { + proxy.serverStopping(event); + } + + @Mod.EventHandler + public void serverStopped(FMLServerStoppedEvent event) { + proxy.serverStopped(event); + } + + public static void debug(String message) { + LOG.debug(message); + } + + public static void info(String message) { + LOG.info(message); + } + + public static void warn(String message) { + LOG.warn(message); + } + + public static void error(String message) { + LOG.error(message); + } +} diff --git a/src/main/java/kubaworks/Tags.java b/src/main/java/kubaworks/Tags.java new file mode 100644 index 0000000000..4fd634c2ad --- /dev/null +++ b/src/main/java/kubaworks/Tags.java @@ -0,0 +1,30 @@ +/* + * kubaworks - Gregtech Addon + * Copyright (C) 2022 kuba6000 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package kubaworks; + +// Use this class for Strings only. Do not import any classes here. It will lead to issues with Mixins if in use! + +public class Tags { + + // GRADLETOKEN_* will be replaced by your configuration values at build time + public static final String MODID = "GRADLETOKEN_MODID"; + public static final String MODNAME = "GRADLETOKEN_MODNAME"; + public static final String VERSION = "GRADLETOKEN_VERSION"; +} -- cgit From a6f18fd57ea6e216d4e90445ada8d4d5c56f8a51 Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Wed, 10 Aug 2022 15:57:40 +0200 Subject: Rename --- src/main/java/KubaTech/ClientProxy.java | 57 ++++++++++++++++++++ src/main/java/KubaTech/CommonProxy.java | 45 ++++++++++++++++ src/main/java/KubaTech/Config.java | 35 ++++++++++++ src/main/java/KubaTech/KubaTech.java | 91 ++++++++++++++++++++++++++++++++ src/main/java/KubaTech/Tags.java | 30 +++++++++++ src/main/java/kubaworks/ClientProxy.java | 57 -------------------- src/main/java/kubaworks/CommonProxy.java | 45 ---------------- src/main/java/kubaworks/Config.java | 35 ------------ src/main/java/kubaworks/MyMod.java | 91 -------------------------------- src/main/java/kubaworks/Tags.java | 30 ----------- 10 files changed, 258 insertions(+), 258 deletions(-) create mode 100644 src/main/java/KubaTech/ClientProxy.java create mode 100644 src/main/java/KubaTech/CommonProxy.java create mode 100644 src/main/java/KubaTech/Config.java create mode 100644 src/main/java/KubaTech/KubaTech.java create mode 100644 src/main/java/KubaTech/Tags.java delete mode 100644 src/main/java/kubaworks/ClientProxy.java delete mode 100644 src/main/java/kubaworks/CommonProxy.java delete mode 100644 src/main/java/kubaworks/Config.java delete mode 100644 src/main/java/kubaworks/MyMod.java delete mode 100644 src/main/java/kubaworks/Tags.java (limited to 'src/main/java') diff --git a/src/main/java/KubaTech/ClientProxy.java b/src/main/java/KubaTech/ClientProxy.java new file mode 100644 index 0000000000..c38b754a62 --- /dev/null +++ b/src/main/java/KubaTech/ClientProxy.java @@ -0,0 +1,57 @@ +/* + * KubaTech - Gregtech Addon + * Copyright (C) 2022 kuba6000 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package KubaTech; + +import cpw.mods.fml.common.event.*; + +public class ClientProxy extends CommonProxy { + + public void preInit(FMLPreInitializationEvent event) { + super.preInit(event); + } + + public void init(FMLInitializationEvent event) { + super.init(event); + } + + public void postInit(FMLPostInitializationEvent event) { + super.postInit(event); + } + + public void serverAboutToStart(FMLServerAboutToStartEvent event) { + super.serverAboutToStart(event); + } + + public void serverStarting(FMLServerStartingEvent event) { + super.serverStarting(event); + } + + public void serverStarted(FMLServerStartedEvent event) { + super.serverStarted(event); + } + + public void serverStopping(FMLServerStoppingEvent event) { + super.serverStopping(event); + } + + public void serverStopped(FMLServerStoppedEvent event) { + super.serverStopped(event); + } +} diff --git a/src/main/java/KubaTech/CommonProxy.java b/src/main/java/KubaTech/CommonProxy.java new file mode 100644 index 0000000000..b510299c89 --- /dev/null +++ b/src/main/java/KubaTech/CommonProxy.java @@ -0,0 +1,45 @@ +/* + * KubaTech - Gregtech Addon + * Copyright (C) 2022 kuba6000 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package KubaTech; + +import cpw.mods.fml.common.event.*; + +public class CommonProxy { + + public void preInit(FMLPreInitializationEvent event) { + Config.syncronizeConfiguration(event.getSuggestedConfigurationFile()); + + KubaTech.info("I am " + Tags.MODNAME + " at version " + Tags.VERSION); + } + + public void init(FMLInitializationEvent event) {} + + public void postInit(FMLPostInitializationEvent event) {} + + public void serverAboutToStart(FMLServerAboutToStartEvent event) {} + + public void serverStarting(FMLServerStartingEvent event) {} + + public void serverStarted(FMLServerStartedEvent event) {} + + public void serverStopping(FMLServerStoppingEvent event) {} + + public void serverStopped(FMLServerStoppedEvent event) {} +} diff --git a/src/main/java/KubaTech/Config.java b/src/main/java/KubaTech/Config.java new file mode 100644 index 0000000000..51e689bf37 --- /dev/null +++ b/src/main/java/KubaTech/Config.java @@ -0,0 +1,35 @@ +/* + * KubaTech - Gregtech Addon + * Copyright (C) 2022 kuba6000 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package KubaTech; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; + +public class Config { + + public static void syncronizeConfiguration(File configFile) { + Configuration configuration = new Configuration(configFile); + configuration.load(); + + if (configuration.hasChanged()) { + configuration.save(); + } + } +} diff --git a/src/main/java/KubaTech/KubaTech.java b/src/main/java/KubaTech/KubaTech.java new file mode 100644 index 0000000000..aa077a18ae --- /dev/null +++ b/src/main/java/KubaTech/KubaTech.java @@ -0,0 +1,91 @@ +/* + * KubaTech - Gregtech Addon + * Copyright (C) 2022 kuba6000 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package KubaTech; + +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.*; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@Mod(modid = Tags.MODID, version = Tags.VERSION, name = Tags.MODNAME, acceptedMinecraftVersions = "[1.7.10]") +public class KubaTech { + + private static Logger LOG = LogManager.getLogger(Tags.MODID); + + @SidedProxy(clientSide = Tags.MODID + ".ClientProxy", serverSide = Tags.MODID + ".CommonProxy") + public static CommonProxy proxy; + + @Mod.EventHandler + public void preInit(FMLPreInitializationEvent event) { + proxy.preInit(event); + } + + @Mod.EventHandler + public void init(FMLInitializationEvent event) { + proxy.init(event); + } + + @Mod.EventHandler + public void postInit(FMLPostInitializationEvent event) { + proxy.postInit(event); + } + + @Mod.EventHandler + public void serverAboutToStart(FMLServerAboutToStartEvent event) { + proxy.serverAboutToStart(event); + } + + @Mod.EventHandler + public void serverStarting(FMLServerStartingEvent event) { + proxy.serverStarting(event); + } + + @Mod.EventHandler + public void serverStarted(FMLServerStartedEvent event) { + proxy.serverStarted(event); + } + + @Mod.EventHandler + public void serverStopping(FMLServerStoppingEvent event) { + proxy.serverStopping(event); + } + + @Mod.EventHandler + public void serverStopped(FMLServerStoppedEvent event) { + proxy.serverStopped(event); + } + + public static void debug(String message) { + LOG.debug(message); + } + + public static void info(String message) { + LOG.info(message); + } + + public static void warn(String message) { + LOG.warn(message); + } + + public static void error(String message) { + LOG.error(message); + } +} diff --git a/src/main/java/KubaTech/Tags.java b/src/main/java/KubaTech/Tags.java new file mode 100644 index 0000000000..f9f1e066bf --- /dev/null +++ b/src/main/java/KubaTech/Tags.java @@ -0,0 +1,30 @@ +/* + * KubaTech - Gregtech Addon + * Copyright (C) 2022 kuba6000 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package KubaTech; + +// Use this class for Strings only. Do not import any classes here. It will lead to issues with Mixins if in use! + +public class Tags { + + // GRADLETOKEN_* will be replaced by your configuration values at build time + public static final String MODID = "GRADLETOKEN_MODID"; + public static final String MODNAME = "GRADLETOKEN_MODNAME"; + public static final String VERSION = "GRADLETOKEN_VERSION"; +} diff --git a/src/main/java/kubaworks/ClientProxy.java b/src/main/java/kubaworks/ClientProxy.java deleted file mode 100644 index 3f450eb803..0000000000 --- a/src/main/java/kubaworks/ClientProxy.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * kubaworks - Gregtech Addon - * Copyright (C) 2022 kuba6000 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -package kubaworks; - -import cpw.mods.fml.common.event.*; - -public class ClientProxy extends CommonProxy { - - public void preInit(FMLPreInitializationEvent event) { - super.preInit(event); - } - - public void init(FMLInitializationEvent event) { - super.init(event); - } - - public void postInit(FMLPostInitializationEvent event) { - super.postInit(event); - } - - public void serverAboutToStart(FMLServerAboutToStartEvent event) { - super.serverAboutToStart(event); - } - - public void serverStarting(FMLServerStartingEvent event) { - super.serverStarting(event); - } - - public void serverStarted(FMLServerStartedEvent event) { - super.serverStarted(event); - } - - public void serverStopping(FMLServerStoppingEvent event) { - super.serverStopping(event); - } - - public void serverStopped(FMLServerStoppedEvent event) { - super.serverStopped(event); - } -} diff --git a/src/main/java/kubaworks/CommonProxy.java b/src/main/java/kubaworks/CommonProxy.java deleted file mode 100644 index 2c6e7d9ddf..0000000000 --- a/src/main/java/kubaworks/CommonProxy.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * kubaworks - Gregtech Addon - * Copyright (C) 2022 kuba6000 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -package kubaworks; - -import cpw.mods.fml.common.event.*; - -public class CommonProxy { - - public void preInit(FMLPreInitializationEvent event) { - Config.syncronizeConfiguration(event.getSuggestedConfigurationFile()); - - MyMod.info("I am " + Tags.MODNAME + " at version " + Tags.VERSION); - } - - public void init(FMLInitializationEvent event) {} - - public void postInit(FMLPostInitializationEvent event) {} - - public void serverAboutToStart(FMLServerAboutToStartEvent event) {} - - public void serverStarting(FMLServerStartingEvent event) {} - - public void serverStarted(FMLServerStartedEvent event) {} - - public void serverStopping(FMLServerStoppingEvent event) {} - - public void serverStopped(FMLServerStoppedEvent event) {} -} diff --git a/src/main/java/kubaworks/Config.java b/src/main/java/kubaworks/Config.java deleted file mode 100644 index d0bcb0ebfd..0000000000 --- a/src/main/java/kubaworks/Config.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * kubaworks - Gregtech Addon - * Copyright (C) 2022 kuba6000 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -package kubaworks; - -import java.io.File; -import net.minecraftforge.common.config.Configuration; - -public class Config { - - public static void syncronizeConfiguration(File configFile) { - Configuration configuration = new Configuration(configFile); - configuration.load(); - - if (configuration.hasChanged()) { - configuration.save(); - } - } -} diff --git a/src/main/java/kubaworks/MyMod.java b/src/main/java/kubaworks/MyMod.java deleted file mode 100644 index 493a464412..0000000000 --- a/src/main/java/kubaworks/MyMod.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * kubaworks - Gregtech Addon - * Copyright (C) 2022 kuba6000 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -package kubaworks; - -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.*; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -@Mod(modid = Tags.MODID, version = Tags.VERSION, name = Tags.MODNAME, acceptedMinecraftVersions = "[1.7.10]") -public class MyMod { - - private static Logger LOG = LogManager.getLogger(Tags.MODID); - - @SidedProxy(clientSide = Tags.MODID + ".ClientProxy", serverSide = Tags.MODID + ".CommonProxy") - public static CommonProxy proxy; - - @Mod.EventHandler - public void preInit(FMLPreInitializationEvent event) { - proxy.preInit(event); - } - - @Mod.EventHandler - public void init(FMLInitializationEvent event) { - proxy.init(event); - } - - @Mod.EventHandler - public void postInit(FMLPostInitializationEvent event) { - proxy.postInit(event); - } - - @Mod.EventHandler - public void serverAboutToStart(FMLServerAboutToStartEvent event) { - proxy.serverAboutToStart(event); - } - - @Mod.EventHandler - public void serverStarting(FMLServerStartingEvent event) { - proxy.serverStarting(event); - } - - @Mod.EventHandler - public void serverStarted(FMLServerStartedEvent event) { - proxy.serverStarted(event); - } - - @Mod.EventHandler - public void serverStopping(FMLServerStoppingEvent event) { - proxy.serverStopping(event); - } - - @Mod.EventHandler - public void serverStopped(FMLServerStoppedEvent event) { - proxy.serverStopped(event); - } - - public static void debug(String message) { - LOG.debug(message); - } - - public static void info(String message) { - LOG.info(message); - } - - public static void warn(String message) { - LOG.warn(message); - } - - public static void error(String message) { - LOG.error(message); - } -} diff --git a/src/main/java/kubaworks/Tags.java b/src/main/java/kubaworks/Tags.java deleted file mode 100644 index 4fd634c2ad..0000000000 --- a/src/main/java/kubaworks/Tags.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * kubaworks - Gregtech Addon - * Copyright (C) 2022 kuba6000 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -package kubaworks; - -// Use this class for Strings only. Do not import any classes here. It will lead to issues with Mixins if in use! - -public class Tags { - - // GRADLETOKEN_* will be replaced by your configuration values at build time - public static final String MODID = "GRADLETOKEN_MODID"; - public static final String MODNAME = "GRADLETOKEN_MODNAME"; - public static final String VERSION = "GRADLETOKEN_VERSION"; -} -- cgit From b215737c229618c5dcf11bd47fb35b5d10c68c73 Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Wed, 10 Aug 2022 16:19:58 +0200 Subject: Rename --- src/main/java/KubaTech/ClientProxy.java | 57 --------------------- src/main/java/KubaTech/CommonProxy.java | 45 ---------------- src/main/java/KubaTech/Config.java | 35 ------------- src/main/java/KubaTech/KubaTech.java | 91 --------------------------------- src/main/java/KubaTech/Tags.java | 30 ----------- src/main/java/kubatech/ClientProxy.java | 57 +++++++++++++++++++++ src/main/java/kubatech/CommonProxy.java | 45 ++++++++++++++++ src/main/java/kubatech/Config.java | 35 +++++++++++++ src/main/java/kubatech/Tags.java | 30 +++++++++++ src/main/java/kubatech/kubatech.java | 91 +++++++++++++++++++++++++++++++++ 10 files changed, 258 insertions(+), 258 deletions(-) delete mode 100644 src/main/java/KubaTech/ClientProxy.java delete mode 100644 src/main/java/KubaTech/CommonProxy.java delete mode 100644 src/main/java/KubaTech/Config.java delete mode 100644 src/main/java/KubaTech/KubaTech.java delete mode 100644 src/main/java/KubaTech/Tags.java create mode 100644 src/main/java/kubatech/ClientProxy.java create mode 100644 src/main/java/kubatech/CommonProxy.java create mode 100644 src/main/java/kubatech/Config.java create mode 100644 src/main/java/kubatech/Tags.java create mode 100644 src/main/java/kubatech/kubatech.java (limited to 'src/main/java') diff --git a/src/main/java/KubaTech/ClientProxy.java b/src/main/java/KubaTech/ClientProxy.java deleted file mode 100644 index c38b754a62..0000000000 --- a/src/main/java/KubaTech/ClientProxy.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * KubaTech - Gregtech Addon - * Copyright (C) 2022 kuba6000 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -package KubaTech; - -import cpw.mods.fml.common.event.*; - -public class ClientProxy extends CommonProxy { - - public void preInit(FMLPreInitializationEvent event) { - super.preInit(event); - } - - public void init(FMLInitializationEvent event) { - super.init(event); - } - - public void postInit(FMLPostInitializationEvent event) { - super.postInit(event); - } - - public void serverAboutToStart(FMLServerAboutToStartEvent event) { - super.serverAboutToStart(event); - } - - public void serverStarting(FMLServerStartingEvent event) { - super.serverStarting(event); - } - - public void serverStarted(FMLServerStartedEvent event) { - super.serverStarted(event); - } - - public void serverStopping(FMLServerStoppingEvent event) { - super.serverStopping(event); - } - - public void serverStopped(FMLServerStoppedEvent event) { - super.serverStopped(event); - } -} diff --git a/src/main/java/KubaTech/CommonProxy.java b/src/main/java/KubaTech/CommonProxy.java deleted file mode 100644 index b510299c89..0000000000 --- a/src/main/java/KubaTech/CommonProxy.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * KubaTech - Gregtech Addon - * Copyright (C) 2022 kuba6000 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -package KubaTech; - -import cpw.mods.fml.common.event.*; - -public class CommonProxy { - - public void preInit(FMLPreInitializationEvent event) { - Config.syncronizeConfiguration(event.getSuggestedConfigurationFile()); - - KubaTech.info("I am " + Tags.MODNAME + " at version " + Tags.VERSION); - } - - public void init(FMLInitializationEvent event) {} - - public void postInit(FMLPostInitializationEvent event) {} - - public void serverAboutToStart(FMLServerAboutToStartEvent event) {} - - public void serverStarting(FMLServerStartingEvent event) {} - - public void serverStarted(FMLServerStartedEvent event) {} - - public void serverStopping(FMLServerStoppingEvent event) {} - - public void serverStopped(FMLServerStoppedEvent event) {} -} diff --git a/src/main/java/KubaTech/Config.java b/src/main/java/KubaTech/Config.java deleted file mode 100644 index 51e689bf37..0000000000 --- a/src/main/java/KubaTech/Config.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * KubaTech - Gregtech Addon - * Copyright (C) 2022 kuba6000 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -package KubaTech; - -import java.io.File; -import net.minecraftforge.common.config.Configuration; - -public class Config { - - public static void syncronizeConfiguration(File configFile) { - Configuration configuration = new Configuration(configFile); - configuration.load(); - - if (configuration.hasChanged()) { - configuration.save(); - } - } -} diff --git a/src/main/java/KubaTech/KubaTech.java b/src/main/java/KubaTech/KubaTech.java deleted file mode 100644 index aa077a18ae..0000000000 --- a/src/main/java/KubaTech/KubaTech.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * KubaTech - Gregtech Addon - * Copyright (C) 2022 kuba6000 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -package KubaTech; - -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.*; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -@Mod(modid = Tags.MODID, version = Tags.VERSION, name = Tags.MODNAME, acceptedMinecraftVersions = "[1.7.10]") -public class KubaTech { - - private static Logger LOG = LogManager.getLogger(Tags.MODID); - - @SidedProxy(clientSide = Tags.MODID + ".ClientProxy", serverSide = Tags.MODID + ".CommonProxy") - public static CommonProxy proxy; - - @Mod.EventHandler - public void preInit(FMLPreInitializationEvent event) { - proxy.preInit(event); - } - - @Mod.EventHandler - public void init(FMLInitializationEvent event) { - proxy.init(event); - } - - @Mod.EventHandler - public void postInit(FMLPostInitializationEvent event) { - proxy.postInit(event); - } - - @Mod.EventHandler - public void serverAboutToStart(FMLServerAboutToStartEvent event) { - proxy.serverAboutToStart(event); - } - - @Mod.EventHandler - public void serverStarting(FMLServerStartingEvent event) { - proxy.serverStarting(event); - } - - @Mod.EventHandler - public void serverStarted(FMLServerStartedEvent event) { - proxy.serverStarted(event); - } - - @Mod.EventHandler - public void serverStopping(FMLServerStoppingEvent event) { - proxy.serverStopping(event); - } - - @Mod.EventHandler - public void serverStopped(FMLServerStoppedEvent event) { - proxy.serverStopped(event); - } - - public static void debug(String message) { - LOG.debug(message); - } - - public static void info(String message) { - LOG.info(message); - } - - public static void warn(String message) { - LOG.warn(message); - } - - public static void error(String message) { - LOG.error(message); - } -} diff --git a/src/main/java/KubaTech/Tags.java b/src/main/java/KubaTech/Tags.java deleted file mode 100644 index f9f1e066bf..0000000000 --- a/src/main/java/KubaTech/Tags.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * KubaTech - Gregtech Addon - * Copyright (C) 2022 kuba6000 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -package KubaTech; - -// Use this class for Strings only. Do not import any classes here. It will lead to issues with Mixins if in use! - -public class Tags { - - // GRADLETOKEN_* will be replaced by your configuration values at build time - public static final String MODID = "GRADLETOKEN_MODID"; - public static final String MODNAME = "GRADLETOKEN_MODNAME"; - public static final String VERSION = "GRADLETOKEN_VERSION"; -} diff --git a/src/main/java/kubatech/ClientProxy.java b/src/main/java/kubatech/ClientProxy.java new file mode 100644 index 0000000000..8d676b30ec --- /dev/null +++ b/src/main/java/kubatech/ClientProxy.java @@ -0,0 +1,57 @@ +/* + * kubatech - Gregtech Addon + * Copyright (C) 2022 kuba6000 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package kubatech; + +import cpw.mods.fml.common.event.*; + +public class ClientProxy extends CommonProxy { + + public void preInit(FMLPreInitializationEvent event) { + super.preInit(event); + } + + public void init(FMLInitializationEvent event) { + super.init(event); + } + + public void postInit(FMLPostInitializationEvent event) { + super.postInit(event); + } + + public void serverAboutToStart(FMLServerAboutToStartEvent event) { + super.serverAboutToStart(event); + } + + public void serverStarting(FMLServerStartingEvent event) { + super.serverStarting(event); + } + + public void serverStarted(FMLServerStartedEvent event) { + super.serverStarted(event); + } + + public void serverStopping(FMLServerStoppingEvent event) { + super.serverStopping(event); + } + + public void serverStopped(FMLServerStoppedEvent event) { + super.serverStopped(event); + } +} diff --git a/src/main/java/kubatech/CommonProxy.java b/src/main/java/kubatech/CommonProxy.java new file mode 100644 index 0000000000..b058dc96e7 --- /dev/null +++ b/src/main/java/kubatech/CommonProxy.java @@ -0,0 +1,45 @@ +/* + * kubatech - Gregtech Addon + * Copyright (C) 2022 kuba6000 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package kubatech; + +import cpw.mods.fml.common.event.*; + +public class CommonProxy { + + public void preInit(FMLPreInitializationEvent event) { + Config.syncronizeConfiguration(event.getSuggestedConfigurationFile()); + + kubatech.info("I am " + Tags.MODNAME + " at version " + Tags.VERSION); + } + + public void init(FMLInitializationEvent event) {} + + public void postInit(FMLPostInitializationEvent event) {} + + public void serverAboutToStart(FMLServerAboutToStartEvent event) {} + + public void serverStarting(FMLServerStartingEvent event) {} + + public void serverStarted(FMLServerStartedEvent event) {} + + public void serverStopping(FMLServerStoppingEvent event) {} + + public void serverStopped(FMLServerStoppedEvent event) {} +} diff --git a/src/main/java/kubatech/Config.java b/src/main/java/kubatech/Config.java new file mode 100644 index 0000000000..b3af0fe9bc --- /dev/null +++ b/src/main/java/kubatech/Config.java @@ -0,0 +1,35 @@ +/* + * kubatech - Gregtech Addon + * Copyright (C) 2022 kuba6000 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package kubatech; + +import java.io.File; +import net.minecraftforge.common.config.Configuration; + +public class Config { + + public static void syncronizeConfiguration(File configFile) { + Configuration configuration = new Configuration(configFile); + configuration.load(); + + if (configuration.hasChanged()) { + configuration.save(); + } + } +} diff --git a/src/main/java/kubatech/Tags.java b/src/main/java/kubatech/Tags.java new file mode 100644 index 0000000000..eb89cfdb6d --- /dev/null +++ b/src/main/java/kubatech/Tags.java @@ -0,0 +1,30 @@ +/* + * kubatech - Gregtech Addon + * Copyright (C) 2022 kuba6000 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package kubatech; + +// Use this class for Strings only. Do not import any classes here. It will lead to issues with Mixins if in use! + +public class Tags { + + // GRADLETOKEN_* will be replaced by your configuration values at build time + public static final String MODID = "GRADLETOKEN_MODID"; + public static final String MODNAME = "GRADLETOKEN_MODNAME"; + public static final String VERSION = "GRADLETOKEN_VERSION"; +} diff --git a/src/main/java/kubatech/kubatech.java b/src/main/java/kubatech/kubatech.java new file mode 100644 index 0000000000..187fa255b6 --- /dev/null +++ b/src/main/java/kubatech/kubatech.java @@ -0,0 +1,91 @@ +/* + * kubatech - Gregtech Addon + * Copyright (C) 2022 kuba6000 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package kubatech; + +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.*; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@Mod(modid = Tags.MODID, version = Tags.VERSION, name = Tags.MODNAME, acceptedMinecraftVersions = "[1.7.10]") +public class kubatech { + + private static Logger LOG = LogManager.getLogger(Tags.MODID); + + @SidedProxy(clientSide = Tags.MODID + ".ClientProxy", serverSide = Tags.MODID + ".CommonProxy") + public static CommonProxy proxy; + + @Mod.EventHandler + public void preInit(FMLPreInitializationEvent event) { + proxy.preInit(event); + } + + @Mod.EventHandler + public void init(FMLInitializationEvent event) { + proxy.init(event); + } + + @Mod.EventHandler + public void postInit(FMLPostInitializationEvent event) { + proxy.postInit(event); + } + + @Mod.EventHandler + public void serverAboutToStart(FMLServerAboutToStartEvent event) { + proxy.serverAboutToStart(event); + } + + @Mod.EventHandler + public void serverStarting(FMLServerStartingEvent event) { + proxy.serverStarting(event); + } + + @Mod.EventHandler + public void serverStarted(FMLServerStartedEvent event) { + proxy.serverStarted(event); + } + + @Mod.EventHandler + public void serverStopping(FMLServerStoppingEvent event) { + proxy.serverStopping(event); + } + + @Mod.EventHandler + public void serverStopped(FMLServerStoppedEvent event) { + proxy.serverStopped(event); + } + + public static void debug(String message) { + LOG.debug(message); + } + + public static void info(String message) { + LOG.info(message); + } + + public static void warn(String message) { + LOG.warn(message); + } + + public static void error(String message) { + LOG.error(message); + } +} -- cgit From 6d436a2c6a5d9b51070b8399c4fdb196603a8e82 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Sun, 14 Aug 2022 15:19:13 +0200 Subject: Add "Mob Drops" NEI page + Extreme Extermination Chamber (#1) * First commit * Mixins * Merge the same items with diffrent damage * Faster random in NEI * More accuracy ? * Update ClientProxy.java * Renaming * Update buildscript * Use reserved MTE ID's * EEC work * Rework NEI page * Fix inaccurate chances * Basic equipment spawn * Add config options * Translations * Add infernal drops * Witchery fix * Forestry fixes * More fixes * Default blacklist * NEI sorting * Comment out testing deps * Clientsided check * Blood Magic support * LoaderReference * Check if peacefull is allowed * Add some XP output * Add recipe * Send Server config to Client * Add command to reload config * Translations * Process MT additions --- src/main/java/kubatech/ClientProxy.java | 8 + src/main/java/kubatech/CommonProxy.java | 20 +- src/main/java/kubatech/Config.java | 54 +- src/main/java/kubatech/FMLEventHandler.java | 16 + src/main/java/kubatech/api/LoaderReference.java | 12 + src/main/java/kubatech/api/Variables.java | 26 + src/main/java/kubatech/api/enums/ItemList.java | 167 ++++ src/main/java/kubatech/api/utils/FastRandom.java | 27 + .../java/kubatech/api/utils/InfernalHelper.java | 226 +++++ src/main/java/kubatech/api/utils/ModUtils.java | 50 ++ .../java/kubatech/api/utils/ReflectionHelper.java | 62 ++ src/main/java/kubatech/commands/CommandConfig.java | 96 ++ .../java/kubatech/commands/CommandHandler.java | 115 +++ src/main/java/kubatech/commands/CommandHelp.java | 80 ++ ...MetaTileEntity_ExtremeExterminationChamber.java | 394 +++++++++ src/main/java/kubatech/kubatech.java | 26 +- .../java/kubatech/loaders/MobRecipeLoader.java | 973 +++++++++++++++++++++ src/main/java/kubatech/loaders/RecipeLoader.java | 77 ++ src/main/java/kubatech/mixin/Mixin.java | 42 + src/main/java/kubatech/mixin/MixinPlugin.java | 110 +++ src/main/java/kubatech/mixin/TargetedMod.java | 35 + .../mixins/minecraft/EnchantmentHelperMixin.java | 40 + src/main/java/kubatech/nei/IMCForNEI.java | 76 ++ src/main/java/kubatech/nei/Mob_Handler.java | 592 +++++++++++++ src/main/java/kubatech/nei/NEI_Config.java | 44 + .../java/kubatech/network/LoadConfigHandler.java | 36 + .../java/kubatech/network/LoadConfigPacket.java | 61 ++ 27 files changed, 3458 insertions(+), 7 deletions(-) create mode 100644 src/main/java/kubatech/FMLEventHandler.java create mode 100644 src/main/java/kubatech/api/LoaderReference.java create mode 100644 src/main/java/kubatech/api/Variables.java create mode 100644 src/main/java/kubatech/api/enums/ItemList.java create mode 100644 src/main/java/kubatech/api/utils/FastRandom.java create mode 100644 src/main/java/kubatech/api/utils/InfernalHelper.java create mode 100644 src/main/java/kubatech/api/utils/ModUtils.java create mode 100644 src/main/java/kubatech/api/utils/ReflectionHelper.java create mode 100644 src/main/java/kubatech/commands/CommandConfig.java create mode 100644 src/main/java/kubatech/commands/CommandHandler.java create mode 100644 src/main/java/kubatech/commands/CommandHelp.java create mode 100644 src/main/java/kubatech/common/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeExterminationChamber.java create mode 100644 src/main/java/kubatech/loaders/MobRecipeLoader.java create mode 100644 src/main/java/kubatech/loaders/RecipeLoader.java create mode 100644 src/main/java/kubatech/mixin/Mixin.java create mode 100644 src/main/java/kubatech/mixin/MixinPlugin.java create mode 100644 src/main/java/kubatech/mixin/TargetedMod.java create mode 100644 src/main/java/kubatech/mixin/mixins/minecraft/EnchantmentHelperMixin.java create mode 100644 src/main/java/kubatech/nei/IMCForNEI.java create mode 100644 src/main/java/kubatech/nei/Mob_Handler.java create mode 100644 src/main/java/kubatech/nei/NEI_Config.java create mode 100644 src/main/java/kubatech/network/LoadConfigHandler.java create mode 100644 src/main/java/kubatech/network/LoadConfigPacket.java (limited to 'src/main/java') diff --git a/src/main/java/kubatech/ClientProxy.java b/src/main/java/kubatech/ClientProxy.java index 8d676b30ec..f25f41ee2c 100644 --- a/src/main/java/kubatech/ClientProxy.java +++ b/src/main/java/kubatech/ClientProxy.java @@ -20,15 +20,23 @@ package kubatech; import cpw.mods.fml.common.event.*; +import kubatech.api.utils.ModUtils; +import kubatech.loaders.MobRecipeLoader; +import kubatech.nei.IMCForNEI; +import net.minecraftforge.common.MinecraftForge; +@SuppressWarnings("unused") public class ClientProxy extends CommonProxy { public void preInit(FMLPreInitializationEvent event) { + ModUtils.isClientSided = true; super.preInit(event); } public void init(FMLInitializationEvent event) { super.init(event); + IMCForNEI.IMCSender(); + MinecraftForge.EVENT_BUS.register(MobRecipeLoader.instance); } public void postInit(FMLPostInitializationEvent event) { diff --git a/src/main/java/kubatech/CommonProxy.java b/src/main/java/kubatech/CommonProxy.java index b058dc96e7..e844cd19d0 100644 --- a/src/main/java/kubatech/CommonProxy.java +++ b/src/main/java/kubatech/CommonProxy.java @@ -19,14 +19,22 @@ package kubatech; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.event.*; +import kubatech.commands.CommandConfig; +import kubatech.commands.CommandHandler; +import kubatech.commands.CommandHelp; +import kubatech.loaders.RecipeLoader; public class CommonProxy { public void preInit(FMLPreInitializationEvent event) { - Config.syncronizeConfiguration(event.getSuggestedConfigurationFile()); + kubatech.info("Initializing ! Version: " + Tags.VERSION); - kubatech.info("I am " + Tags.MODNAME + " at version " + Tags.VERSION); + Config.init(event.getSuggestedConfigurationFile()); + Config.synchronizeConfiguration(); + RecipeLoader.addRecipes(); + FMLCommonHandler.instance().bus().register(new FMLEventHandler()); } public void init(FMLInitializationEvent event) {} @@ -35,7 +43,13 @@ public class CommonProxy { public void serverAboutToStart(FMLServerAboutToStartEvent event) {} - public void serverStarting(FMLServerStartingEvent event) {} + public void serverStarting(FMLServerStartingEvent event) { + RecipeLoader.addRecipesLate(); + CommandHandler cmd = new CommandHandler(); + cmd.addCommand(new CommandHelp()); + cmd.addCommand(new CommandConfig()); + event.registerServerCommand(cmd); + } public void serverStarted(FMLServerStartedEvent event) {} diff --git a/src/main/java/kubatech/Config.java b/src/main/java/kubatech/Config.java index b3af0fe9bc..439557d9a0 100644 --- a/src/main/java/kubatech/Config.java +++ b/src/main/java/kubatech/Config.java @@ -24,10 +24,62 @@ import net.minecraftforge.common.config.Configuration; public class Config { - public static void syncronizeConfiguration(File configFile) { + private static class Categories { + public static final String mobHandler = "MobHandler"; + } + + public static boolean mobHandlerEnabled = true; + public static boolean includeEmptyMobs = true; + public static String[] mobBlacklist; + public static File configFile; + + public static void init(File configFile) { + Config.configFile = configFile; + } + + public static void synchronizeConfiguration() { Configuration configuration = new Configuration(configFile); configuration.load(); + mobHandlerEnabled = configuration + .get( + Categories.mobHandler, + "Enabled", + true, + "Enable \"Mob Drops\" NEI page and Extreme Extermination Chamber") + .getBoolean(); + includeEmptyMobs = configuration + .get(Categories.mobHandler, "IncludeEmptyMobs", true, "Include mobs that have no drops in NEI") + .getBoolean(); + mobBlacklist = configuration + .get( + Categories.mobHandler, + "MobBlacklist", + new String[] { + "Giant", + "Thaumcraft.TravelingTrunk", + "chisel.snowman", + "OpenBlocks.Luggage", + "OpenBlocks.MiniMe", + "SpecialMobs.SpecialCreeper", + "SpecialMobs.SpecialZombie", + "SpecialMobs.SpecialPigZombie", + "SpecialMobs.SpecialSlime", + "SpecialMobs.SpecialSkeleton", + "SpecialMobs.SpecialEnderman", + "SpecialMobs.SpecialCaveSpider", + "SpecialMobs.SpecialGhast", + "SpecialMobs.SpecialWitch", + "SpecialMobs.SpecialSpider", + "TwilightForest.HydraHead", + "TwilightForest.RovingCube", + "TwilightForest.Harbinger Cube", + "TwilightForest.Adherent", + "SpecialMobs.SpecialSilverfish", + }, + "These mobs will be skipped when generating recipe map") + .getStringList(); + if (configuration.hasChanged()) { configuration.save(); } diff --git a/src/main/java/kubatech/FMLEventHandler.java b/src/main/java/kubatech/FMLEventHandler.java new file mode 100644 index 0000000000..e5acd58a36 --- /dev/null +++ b/src/main/java/kubatech/FMLEventHandler.java @@ -0,0 +1,16 @@ +package kubatech; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.PlayerEvent; +import kubatech.network.LoadConfigPacket; +import net.minecraft.entity.player.EntityPlayerMP; + +public class FMLEventHandler { + // Gets fired only server-sided + @SubscribeEvent + public void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) { + if (!(event.player instanceof EntityPlayerMP)) return; + kubatech.info("Sending config to " + event.player.getDisplayName()); + kubatech.NETWORK.sendTo(LoadConfigPacket.instance, (EntityPlayerMP) event.player); + } +} diff --git a/src/main/java/kubatech/api/LoaderReference.java b/src/main/java/kubatech/api/LoaderReference.java new file mode 100644 index 0000000000..aef8930905 --- /dev/null +++ b/src/main/java/kubatech/api/LoaderReference.java @@ -0,0 +1,12 @@ +package kubatech.api; + +import cpw.mods.fml.common.Loader; + +public class LoaderReference { + public static final boolean BloodMagic = Loader.isModLoaded("AWWayofTime"); + public static final boolean EnderIO = Loader.isModLoaded("EnderIO"); + public static final boolean ExtraUtilities = Loader.isModLoaded("ExtraUtilities"); + public static final boolean InfernalMobs = Loader.isModLoaded("InfernalMobs"); + public static final boolean Thaumcraft = Loader.isModLoaded("Thaumcraft"); + public static final boolean MineTweaker = Loader.isModLoaded("MineTweaker3"); +} diff --git a/src/main/java/kubatech/api/Variables.java b/src/main/java/kubatech/api/Variables.java new file mode 100644 index 0000000000..c989b45f6f --- /dev/null +++ b/src/main/java/kubatech/api/Variables.java @@ -0,0 +1,26 @@ +/* + * KubaTech - Gregtech Addon + * Copyright (C) 2022 kuba6000 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package kubatech.api; + +import net.minecraft.util.EnumChatFormatting; + +public class Variables { + public static final String Author = "Author: " + EnumChatFormatting.GOLD + "kuba6000"; +} diff --git a/src/main/java/kubatech/api/enums/ItemList.java b/src/main/java/kubatech/api/enums/ItemList.java new file mode 100644 index 0000000000..b0cf3289b6 --- /dev/null +++ b/src/main/java/kubatech/api/enums/ItemList.java @@ -0,0 +1,167 @@ +package kubatech.api.enums; + +import static gregtech.api.enums.GT_Values.NI; +import static gregtech.api.enums.GT_Values.W; + +import gregtech.api.interfaces.IItemContainer; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import java.util.Locale; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public enum ItemList implements IItemContainer { + ExtremeExterminationChamber; + + private ItemStack mStack; + private boolean mHasNotBeenSet = true; + + @Override + public IItemContainer set(Item aItem) { + mHasNotBeenSet = false; + if (aItem == null) return this; + ItemStack aStack = new ItemStack(aItem, 1, 0); + mStack = GT_Utility.copyAmount(1, aStack); + return this; + } + + @Override + public IItemContainer set(ItemStack aStack) { + mHasNotBeenSet = false; + mStack = GT_Utility.copyAmount(1, aStack); + return this; + } + + @Override + public Item getItem() { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + if (GT_Utility.isStackInvalid(mStack)) return null; + return mStack.getItem(); + } + + @Override + public Block getBlock() { + if (mHasNotBeenSet) + throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!"); + return GT_Utility.getBlockFromItem(getItem()); + } + + @Override + public final boolean hasBeenSet() { + return !mHasN