Skip to content

Commit

Permalink
Update RFG, use tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ACGaming committed May 27, 2024
1 parent a03aa9d commit 6db0506
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 32 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id 'maven-publish'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7'
id 'eclipse'
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.33'
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.35'
id 'com.matthewprenger.cursegradle' version '1.4.0'
}

Expand Down Expand Up @@ -66,11 +66,11 @@ minecraft {
// Add any properties you want to swap out for a dynamic value at build time here
// Any properties here will be added to a class at build time, the name can be configured below
// Example:
// injectedTags.put('VERSION', project.version)
// injectedTags.put('MOD_ID', project.archives_base_name)
injectedTags.put('VERSION', project.version)
injectedTags.put('MOD_ID', project.mod_id)
}

// Generate a group.archives_base_name.Tags class
// Generate a group.mod_id.Tags class
tasks.injectTags.configure {
// Change Tags class' name here:
outputClassName.set("${project.group}.${project.mod_id}.Tags")
Expand Down
52 changes: 25 additions & 27 deletions src/main/java/com/progwml6/natura/Natura.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
package com.progwml6.natura;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import net.minecraft.util.datafix.FixTypes;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.ModFixs;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.relauncher.Side;

import com.progwml6.natura.common.CommonProxy;
import com.progwml6.natura.common.config.Config;
import com.progwml6.natura.common.gui.GuiHandler;
Expand All @@ -28,29 +14,41 @@
import com.progwml6.natura.shared.NaturaCommons;
import com.progwml6.natura.tools.NaturaTools;
import com.progwml6.natura.world.NaturaWorld;
import net.minecraft.util.datafix.FixTypes;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.ModFixs;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.relauncher.Side;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import slimeknights.mantle.pulsar.control.PulseManager;

@Mod(modid = Natura.modID, name = Natura.modName, version = Natura.modVersion, dependencies = "required-after:forge@[14.23.3.2673,);required-after:mantle@[1.12-1.3.0,);", acceptedMinecraftVersions = "[1.12, 1.13)")
@Mod(modid = Natura.modID, name = Natura.modName, version = Natura.modVersion, dependencies = "required-after:mantle@[1.12-1.3.0,);", acceptedMinecraftVersions = "[1.12, 1.13)")
public class Natura
{
public static final String modID = Util.MODID;
public static final String modID = Tags.MOD_ID;

public static final String modVersion = "${version}";
public static final String modVersion = Tags.VERSION;

public static final String modName = "Natura";

public static final Logger log = LogManager.getLogger(modID);

/* Instance of this mod, used for grabbing prototype fields */
@Instance(modID)
public static Natura instance;
@Instance(modID) public static Natura instance;

@SidedProxy(clientSide = "com.progwml6.natura.common.CommonProxy", serverSide = "com.progwml6.natura.common.CommonProxy")
public static CommonProxy proxy;
@SidedProxy(clientSide = "com.progwml6.natura.common.CommonProxy", serverSide = "com.progwml6.natura.common.CommonProxy") public static CommonProxy proxy;

public static PulseManager pulseManager = new PulseManager(Config.pulseConfig);

public static boolean isServer() {

public static boolean isServer()
{
return (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER);
}

Expand All @@ -64,17 +62,17 @@ public static boolean isServer() {
pulseManager.registerPulse(new NaturaEntities());
pulseManager.registerPulse(new NaturaOredict());
pulseManager.registerPulse(new NaturaWorld());

pulseManager.registerPulse(new CraftingTweaks());
}

@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
Config.load(event);

if (!isServer()) {
MinecraftForge.EVENT_BUS.register(new NaturaClientEvents());

if (!isServer())
{
MinecraftForge.EVENT_BUS.register(new NaturaClientEvents());
}

NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler());
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/progwml6/natura/library/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

import java.util.Locale;

import com.progwml6.natura.Tags;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import net.minecraft.util.ResourceLocation;

public class Util
{
public static final String MODID = "natura";
public static final String MODID = Tags.MOD_ID;

public static final String RESOURCE = MODID.toLowerCase(Locale.US);

Expand Down

0 comments on commit 6db0506

Please sign in to comment.