Skip to content

Commit

Permalink
Final changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JackyyTV committed Apr 28, 2023
1 parent 9a61506 commit ded859c
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 47 deletions.
29 changes: 4 additions & 25 deletions src/main/java/jackyy/avaritiatweaks/AvaritiaTweaks.java
Original file line number Diff line number Diff line change
@@ -1,39 +1,18 @@
package jackyy.avaritiatweaks;

import jackyy.avaritiatweaks.proxy.CommonProxy;
import jackyy.avaritiatweaks.tweaks.ModTweaks;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import jackyy.avaritiatweaks.util.Reference;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLFingerprintViolationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

@Mod(modid = AvaritiaTweaks.MODID, version = AvaritiaTweaks.VERSION, name = AvaritiaTweaks.MODNAME, dependencies = AvaritiaTweaks.DEPENDS, acceptedMinecraftVersions = AvaritiaTweaks.MCVERSION, guiFactory = AvaritiaTweaks.GUIFACTORY, certificateFingerprint = "@FINGERPRINT@", useMetadata = true)
@Mod(modid = Reference.MODID, version = Reference.VERSION, name = Reference.MODNAME, dependencies = Reference.DEPENDS, acceptedMinecraftVersions = Reference.MCVERSION, guiFactory = Reference.GUIFACTORY, certificateFingerprint = "@FINGERPRINT@", useMetadata = true)
public class AvaritiaTweaks {

public static final String MODID = "avaritiatweaks";
public static final String MODNAME = "Avaritia Tweaks";
public static final String VERSION = "1.10.2-1.3.1";
public static final String MCVERSION = "[1.10,1.11)";
public static final String DEPENDS = "required-after:avaritia;required-after:CodeChickenLib;after:Botania;";
public static final String GUIFACTORY = "jackyy.avaritiatweaks.config.ConfigGuiFactory";
public static final String COMMON_PROXY = "jackyy.avaritiatweaks.proxy.CommonProxy";
public static final String CLIENT_PROXY = "jackyy.avaritiatweaks.proxy.ClientProxy";
public static final CreativeTabs TAB = new CreativeTabs(MODID) {
@Override
public Item getTabIconItem() {
return ModTweaks.enhancementCrystal;
}
};

public static Logger logger = LogManager.getLogger(MODNAME);

@SidedProxy(serverSide = AvaritiaTweaks.COMMON_PROXY, clientSide = AvaritiaTweaks.CLIENT_PROXY)
@SidedProxy(serverSide = Reference.COMMON_PROXY, clientSide = Reference.CLIENT_PROXY)
public static CommonProxy proxy;

@Mod.EventHandler
Expand All @@ -53,7 +32,7 @@ public void postInit(FMLPostInitializationEvent event) {

@Mod.EventHandler
public void onFingerprintViolation(FMLFingerprintViolationEvent event) {
logger.warn("Invalid fingerprint detected! The file " + event.getSource().getName() + " may have been modified or running in dev environment.");
Reference.LOGGER.warn("Invalid fingerprint detected! The file " + event.getSource().getName() + " may have been modified or running in dev environment.");
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package jackyy.avaritiatweaks.compat.botania;

import jackyy.avaritiatweaks.AvaritiaTweaks;
import jackyy.avaritiatweaks.compat.botania.block.BlockGaia;
import jackyy.avaritiatweaks.compat.botania.block.BlockInfinitato;
import jackyy.avaritiatweaks.compat.botania.render.RenderTileInfinitato;
Expand All @@ -9,6 +8,7 @@
import jackyy.avaritiatweaks.compat.botania.tile.TileInfinitato;
import jackyy.avaritiatweaks.config.ModConfig;
import jackyy.avaritiatweaks.util.ModUtils;
import jackyy.avaritiatweaks.util.Reference;
import morph.avaritia.init.ModItems;
import morph.avaritia.recipe.extreme.ExtremeCraftingManager;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
Expand Down Expand Up @@ -97,10 +97,10 @@ public static void init() {
public static void initModels() {
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(gaiaBlock), 0, new ModelResourceLocation(gaiaBlock.getRegistryName(), "inventory"));
if (ModConfig.Compats.Botania.asgardandelion.enabled) {
BotaniaAPIClient.registerSubtileModel(SubTileAsgardandelion.class, new ModelResourceLocation(AvaritiaTweaks.MODID + ":asgardandelion"));
BotaniaAPIClient.registerSubtileModel(SubTileAsgardandelion.class, new ModelResourceLocation(Reference.MODID + ":asgardandelion"));
}
if (ModConfig.Compats.Botania.soarleander.enabled) {
BotaniaAPIClient.registerSubtileModel(SubTileSoarleander.class, new ModelResourceLocation(AvaritiaTweaks.MODID + ":soarleander"));
BotaniaAPIClient.registerSubtileModel(SubTileSoarleander.class, new ModelResourceLocation(Reference.MODID + ":soarleander"));
}
if (ModConfig.Compats.botania.infinitato) {
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(infinitato), 0, new ModelResourceLocation(infinitato.getRegistryName(), "facing=south"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package jackyy.avaritiatweaks.compat.botania.block;

import jackyy.avaritiatweaks.AvaritiaTweaks;
import jackyy.avaritiatweaks.config.ModConfig;
import jackyy.avaritiatweaks.util.Reference;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
Expand All @@ -23,12 +23,12 @@ public class BlockGaia extends Block {
public BlockGaia() {
super(Material.IRON);
setRegistryName("gaia_block");
setUnlocalizedName(AvaritiaTweaks.MODID + ".gaia_block");
setUnlocalizedName(Reference.MODID + ".gaia_block");
setSoundType(SoundType.METAL);
setHarvestLevel("pickaxe", 3);
setHardness(50.0F);
setResistance(2000.0F);
setCreativeTab(AvaritiaTweaks.TAB);
setCreativeTab(Reference.TAB);
}

@Override @SideOnly(Side.CLIENT)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package jackyy.avaritiatweaks.compat.botania.block;

import jackyy.avaritiatweaks.AvaritiaTweaks;
import jackyy.avaritiatweaks.compat.botania.tile.TileInfinitato;
import jackyy.avaritiatweaks.util.Reference;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockStateContainer;
Expand Down Expand Up @@ -36,9 +36,9 @@ public class BlockInfinitato extends BlockContainer implements ILexiconable {
public BlockInfinitato() {
super(Material.CLOTH);
setRegistryName("infinitato");
setUnlocalizedName(AvaritiaTweaks.MODID + ".infinitato");
setUnlocalizedName(Reference.MODID + ".infinitato");
setHardness(0.25F);
setCreativeTab(AvaritiaTweaks.TAB);
setCreativeTab(Reference.TAB);
}

@Override @SuppressWarnings("deprecation")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package jackyy.avaritiatweaks.compat.botania.render;

import jackyy.avaritiatweaks.AvaritiaTweaks;
import jackyy.avaritiatweaks.compat.botania.BotaniaCompat;
import jackyy.avaritiatweaks.compat.botania.tile.TileInfinitato;
import jackyy.avaritiatweaks.util.Reference;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
Expand All @@ -17,7 +17,7 @@

public class RenderTileInfinitato extends TileEntitySpecialRenderer<TileInfinitato> {

private static final ResourceLocation TEXTURE = new ResourceLocation(AvaritiaTweaks.MODID,"textures/blocks/infinitato.png");
private static final ResourceLocation TEXTURE = new ResourceLocation(Reference.MODID,"textures/blocks/infinitato.png");
private static final ModelInfinitato MODEL = new ModelInfinitato();

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package jackyy.avaritiatweaks.config;

import jackyy.avaritiatweaks.AvaritiaTweaks;
import jackyy.avaritiatweaks.util.Reference;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.config.ConfigElement;
Expand Down Expand Up @@ -36,7 +36,7 @@ public static class ConfigGui extends GuiConfig {
private static Configuration config = ModConfig.ConfigHolder.getConfig();
public ConfigGui(GuiScreen parentScreen) {
super(parentScreen, new ArrayList<>(new ConfigElement(config.getCategory("general")).getChildElements()),
AvaritiaTweaks.MODID, false, false, GuiConfig.getAbridgedConfigPath(config.toString()));
Reference.MODID, false, false, GuiConfig.getAbridgedConfigPath(config.toString()));
}
@Override
public void onGuiClosed() {
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/jackyy/avaritiatweaks/config/ModConfig.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package jackyy.avaritiatweaks.config;

import jackyy.avaritiatweaks.AvaritiaTweaks;
import jackyy.avaritiatweaks.util.ModUtils;
import jackyy.avaritiatweaks.util.Reference;
import net.minecraftforge.common.config.Config;
import net.minecraftforge.common.config.ConfigManager;
import net.minecraftforge.common.config.Configuration;
Expand All @@ -14,7 +14,7 @@
import java.util.Map;
import java.util.Optional;

@Config(modid = AvaritiaTweaks.MODID, name = "AvaritiaTweaks")
@Config(modid = Reference.MODID, name = "AvaritiaTweaks")
public class ModConfig {

public static Tweaks tweaks = new Tweaks();
Expand Down Expand Up @@ -148,15 +148,15 @@ public static Configuration getConfig() {
.filter(entry -> fileName.equals(new File(entry.getKey()).getName())).findFirst();
entryOptional.ifPresent(stringConfigurationEntry -> config = stringConfigurationEntry.getValue());
} catch (Throwable throwable) {
AvaritiaTweaks.logger.error("Failed to get Configuration instance!", throwable);
Reference.LOGGER.error("Failed to get Configuration instance!", throwable);
}
}
return config;
}
@SubscribeEvent
public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
if (event.getModID().equals(AvaritiaTweaks.MODID)) {
ConfigManager.load(AvaritiaTweaks.MODID, Config.Type.INSTANCE);
if (event.getModID().equals(Reference.MODID)) {
ConfigManager.load(Reference.MODID, Config.Type.INSTANCE);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package jackyy.avaritiatweaks.item;

import jackyy.avaritiatweaks.AvaritiaTweaks;
import jackyy.avaritiatweaks.config.ModConfig;
import jackyy.avaritiatweaks.util.Reference;
import morph.avaritia.api.IHaloRenderItem;
import morph.avaritia.entity.EntityImmortalItem;
import morph.avaritia.init.AvaritiaTextures;
Expand All @@ -25,8 +25,8 @@ public class ItemEnhancementCrystal extends Item implements IHaloRenderItem {

public ItemEnhancementCrystal() {
setRegistryName("enhancement_crystal");
setUnlocalizedName(AvaritiaTweaks.MODID + ".enhancement_crystal");
setCreativeTab(AvaritiaTweaks.TAB);
setUnlocalizedName(Reference.MODID + ".enhancement_crystal");
setCreativeTab(Reference.TAB);
}

@Override @SideOnly(Side.CLIENT)
Expand Down
35 changes: 35 additions & 0 deletions src/main/java/jackyy/avaritiatweaks/util/Reference.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package jackyy.avaritiatweaks.util;

import jackyy.avaritiatweaks.tweaks.ModTweaks;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class Reference {

public static final String MODID = "avaritiatweaks";
public static final String MODNAME = "Avaritia Tweaks";
public static final String VERSION = "1.10.2-1.3.1";
public static final String MCVERSION = "[1.10,1.11)";

public static final String DEPENDS
= "required-after:avaritia;"
+ "required-after:CodeChickenLib;"
+ "after:Botania;";

public static final CreativeTabs TAB = new CreativeTabs(MODID) {
@Override
public Item getTabIconItem() {
return ModTweaks.enhancementCrystal;
}
};

public static final Logger LOGGER = LogManager.getLogger(MODNAME);

public static final String GUIFACTORY = "jackyy.avaritiatweaks.config.ConfigGuiFactory";

public static final String COMMON_PROXY = "jackyy.avaritiatweaks.proxy.CommonProxy";
public static final String CLIENT_PROXY = "jackyy.avaritiatweaks.proxy.ClientProxy";

}
Binary file added src/main/resources/assets/avaritiatweaks/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"updateUrl": "",
"authorList": ["Jackyy"],
"credits": "",
"logoFile": "",
"logoFile": "assets/avaritiatweaks/logo.png",
"screenshots": [],
"dependencies": ["avaritia"]
}
Expand Down

0 comments on commit ded859c

Please sign in to comment.