From ded859c6c4f2b0a1e1bff6ca39acd1106c90a369 Mon Sep 17 00:00:00 2001 From: Jacky Date: Sat, 29 Apr 2023 03:01:15 +0800 Subject: [PATCH] Final changes --- .../jackyy/avaritiatweaks/AvaritiaTweaks.java | 29 ++------------- .../compat/botania/BotaniaCompat.java | 6 +-- .../compat/botania/block/BlockGaia.java | 6 +-- .../compat/botania/block/BlockInfinitato.java | 6 +-- .../botania/render/RenderTileInfinitato.java | 4 +- .../config/ConfigGuiFactory.java | 4 +- .../avaritiatweaks/config/ModConfig.java | 10 ++--- .../item/ItemEnhancementCrystal.java | 6 +-- .../jackyy/avaritiatweaks/util/Reference.java | 35 ++++++++++++++++++ .../resources/assets/avaritiatweaks/logo.png | Bin 0 -> 1575 bytes src/main/resources/mcmod.info | 2 +- 11 files changed, 61 insertions(+), 47 deletions(-) create mode 100644 src/main/java/jackyy/avaritiatweaks/util/Reference.java create mode 100644 src/main/resources/assets/avaritiatweaks/logo.png diff --git a/src/main/java/jackyy/avaritiatweaks/AvaritiaTweaks.java b/src/main/java/jackyy/avaritiatweaks/AvaritiaTweaks.java index 3d313d6..a79d1a0 100644 --- a/src/main/java/jackyy/avaritiatweaks/AvaritiaTweaks.java +++ b/src/main/java/jackyy/avaritiatweaks/AvaritiaTweaks.java @@ -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 @@ -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."); } } diff --git a/src/main/java/jackyy/avaritiatweaks/compat/botania/BotaniaCompat.java b/src/main/java/jackyy/avaritiatweaks/compat/botania/BotaniaCompat.java index 5e21152..796f7e8 100644 --- a/src/main/java/jackyy/avaritiatweaks/compat/botania/BotaniaCompat.java +++ b/src/main/java/jackyy/avaritiatweaks/compat/botania/BotaniaCompat.java @@ -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; @@ -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; @@ -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")); diff --git a/src/main/java/jackyy/avaritiatweaks/compat/botania/block/BlockGaia.java b/src/main/java/jackyy/avaritiatweaks/compat/botania/block/BlockGaia.java index e266066..bb40100 100644 --- a/src/main/java/jackyy/avaritiatweaks/compat/botania/block/BlockGaia.java +++ b/src/main/java/jackyy/avaritiatweaks/compat/botania/block/BlockGaia.java @@ -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; @@ -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) diff --git a/src/main/java/jackyy/avaritiatweaks/compat/botania/block/BlockInfinitato.java b/src/main/java/jackyy/avaritiatweaks/compat/botania/block/BlockInfinitato.java index 8dc949a..6711849 100644 --- a/src/main/java/jackyy/avaritiatweaks/compat/botania/block/BlockInfinitato.java +++ b/src/main/java/jackyy/avaritiatweaks/compat/botania/block/BlockInfinitato.java @@ -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; @@ -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") diff --git a/src/main/java/jackyy/avaritiatweaks/compat/botania/render/RenderTileInfinitato.java b/src/main/java/jackyy/avaritiatweaks/compat/botania/render/RenderTileInfinitato.java index 165bc6f..085a27f 100644 --- a/src/main/java/jackyy/avaritiatweaks/compat/botania/render/RenderTileInfinitato.java +++ b/src/main/java/jackyy/avaritiatweaks/compat/botania/render/RenderTileInfinitato.java @@ -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; @@ -17,7 +17,7 @@ public class RenderTileInfinitato extends TileEntitySpecialRenderer { - 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 diff --git a/src/main/java/jackyy/avaritiatweaks/config/ConfigGuiFactory.java b/src/main/java/jackyy/avaritiatweaks/config/ConfigGuiFactory.java index de5babe..3c4da82 100644 --- a/src/main/java/jackyy/avaritiatweaks/config/ConfigGuiFactory.java +++ b/src/main/java/jackyy/avaritiatweaks/config/ConfigGuiFactory.java @@ -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; @@ -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() { diff --git a/src/main/java/jackyy/avaritiatweaks/config/ModConfig.java b/src/main/java/jackyy/avaritiatweaks/config/ModConfig.java index 2a897fd..6f8a789 100644 --- a/src/main/java/jackyy/avaritiatweaks/config/ModConfig.java +++ b/src/main/java/jackyy/avaritiatweaks/config/ModConfig.java @@ -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; @@ -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(); @@ -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); } } } diff --git a/src/main/java/jackyy/avaritiatweaks/item/ItemEnhancementCrystal.java b/src/main/java/jackyy/avaritiatweaks/item/ItemEnhancementCrystal.java index 5a6b94a..d80ce81 100644 --- a/src/main/java/jackyy/avaritiatweaks/item/ItemEnhancementCrystal.java +++ b/src/main/java/jackyy/avaritiatweaks/item/ItemEnhancementCrystal.java @@ -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; @@ -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) diff --git a/src/main/java/jackyy/avaritiatweaks/util/Reference.java b/src/main/java/jackyy/avaritiatweaks/util/Reference.java new file mode 100644 index 0000000..901ca3a --- /dev/null +++ b/src/main/java/jackyy/avaritiatweaks/util/Reference.java @@ -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"; + +} diff --git a/src/main/resources/assets/avaritiatweaks/logo.png b/src/main/resources/assets/avaritiatweaks/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..d554e5e659acf124132508663a9cd77c9e3ad451 GIT binary patch literal 1575 zcmb7_|4&<07{*Umwu>VSBFj)Z=yWq#qB1latxBmZjE*>&8X_~YR&hdwPRcqcAlb#C zTd>o{n7J)dYSIvv6lGZ%xL8_PMP)*pn}tp~XxAcz(c9jYws(~K&HE?ZCZFWIKfHPJ zylq)Eg4~@~4w_H=`%HGZ8_NEEU;1Y%)!R#NsejL&+FAG9;k(uEmL0vE`}2O! z2m8+#2ktiRd&Od@avN5nN62qllC?FAK@*&j2qQrfTYf$g2n2d*5V6H)kpqwY?psKR z*$9h_t4+$=Dkfuy&hqlrm1*D(NBSW3^a{_~vhp<|*zgQ0^2TXo_JN5y4ijdCChX+o zfV{`a2RAwDv2A@&QAyUrTQ0aI&bK8NGEDdF?TvUBGw%4%L=muDkK4WUtdiNp9!(DUFA7-m>+|0tbWVt^6z{`=aA<+|=2gIz6Ld+p zZVHXA{}eJIw5qkp(>(N@j2MqKR1iG^Q?gEC-GWhc5QYA@&F?PaapeZt0WO;7JAkf9 zFN@t<`T?PP<}M?&H#mpTKB2SJ{-oeiP&Xd)f0@=20eg;d<|VjbVmgQt=%8qaj989B z?A$(sM95%Sq6z{c8cb9)ipK0>m*URe)RdV|*9NsevKw7Pl+0sQ!-({xBrhx)bIOPp zYwC@@>1nj2d-+UTL7CwVke2H>rflxL3){xY6WhNM^xe*ty2nJVKSz`N{Rv zmBkBiJ>E`Et)X2bQhCYluxJ?5<27yl`Qcp464-@FI<+`IkaFDa&7m2Oum!uwuQZ>poMKR>|sMQ8R)fL=!3v1&QC=3 e%e!<8Z%?b`Rl|+X?d%5tDvwl^|9beN^Zx@uD}BxY literal 0 HcmV?d00001 diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 952b0dc..1d79ca1 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -9,7 +9,7 @@ "updateUrl": "", "authorList": ["Jackyy"], "credits": "", - "logoFile": "", + "logoFile": "assets/avaritiatweaks/logo.png", "screenshots": [], "dependencies": ["avaritia"] }