Cleaning up some imports and formatting

This commit is contained in:
pahimar 2013-07-15 20:51:54 -04:00
parent 4dac7c1bde
commit 09fe8c8c85
21 changed files with 135 additions and 159 deletions

View file

@ -38,13 +38,7 @@ import com.pahimar.ee3.network.PacketHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.FingerprintWarning;
import cpw.mods.fml.common.Mod.IMCCallback;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.Mod.ServerStarting;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLFingerprintViolationEvent;
import cpw.mods.fml.common.event.FMLInitializationEvent;
@ -72,118 +66,136 @@ import cpw.mods.fml.relauncher.Side;
@NetworkMod(channels = { Reference.CHANNEL_NAME }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)
public class EquivalentExchange3 {
@Instance(Reference.MOD_ID)
public static EquivalentExchange3 instance;
@Instance(Reference.MOD_ID)
public static EquivalentExchange3 instance;
@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
public static CommonProxy proxy;
@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
public static CommonProxy proxy;
public static CreativeTabs tabsEE3 = new CreativeTabEE3(CreativeTabs.getNextID(), Reference.MOD_ID);
public static CreativeTabs tabsEE3 = new CreativeTabEE3(
CreativeTabs.getNextID(), Reference.MOD_ID);
@EventHandler
public void invalidFingerprint(FMLFingerprintViolationEvent event) {
@EventHandler
public void invalidFingerprint(FMLFingerprintViolationEvent event) {
// Report (log) to the user that the version of Equivalent Exchange 3 they are using has been changed/tampered with
LogHelper.severe(Strings.INVALID_FINGERPRINT_MESSAGE);
}
// Report (log) to the user that the version of Equivalent Exchange 3
// they are using has been changed/tampered with
LogHelper.severe(Strings.INVALID_FINGERPRINT_MESSAGE);
}
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
// Initialize the custom commands
CommandHandler.initCommands(event);
}
// Initialize the custom commands
CommandHandler.initCommands(event);
}
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
// Initialize the log helper
LogHelper.init();
// Initialize the log helper
LogHelper.init();
// Load the localization files into the LanguageRegistry
LocalizationHandler.loadLanguages();
// Load the localization files into the LanguageRegistry
LocalizationHandler.loadLanguages();
// Initialize the configuration
ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + File.separator + Reference.CHANNEL_NAME + File.separator + Reference.MOD_ID + ".cfg"));
// Initialize the configuration
ConfigurationHandler.init(new File(event.getModConfigurationDirectory()
.getAbsolutePath()
+ File.separator
+ Reference.CHANNEL_NAME
+ File.separator + Reference.MOD_ID + ".cfg"));
// Conduct the version check and log the result
VersionHelper.execute();
// Conduct the version check and log the result
VersionHelper.execute();
// Initialize the Version Check Tick Handler (Client only)
TickRegistry.registerTickHandler(new VersionCheckTickHandler(), Side.CLIENT);
// Initialize the Version Check Tick Handler (Client only)
TickRegistry.registerTickHandler(new VersionCheckTickHandler(),
Side.CLIENT);
// Initialize the Render Tick Handler (Client only)
proxy.registerRenderTickHandler();
// Initialize the Render Tick Handler (Client only)
proxy.registerRenderTickHandler();
// Register the KeyBinding Handler (Client only)
proxy.registerKeyBindingHandler();
// Register the KeyBinding Handler (Client only)
proxy.registerKeyBindingHandler();
// Register the Sound Handler (Client only)
proxy.registerSoundHandler();
// Register the Sound Handler (Client only)
proxy.registerSoundHandler();
// Initialize mod blocks
ModBlocks.init();
// Initialize mod blocks
ModBlocks.init();
// Initialize mod items
ModItems.init();
}
// Initialize mod items
ModItems.init();
}
@EventHandler
@SuppressWarnings("unchecked")
public void load(FMLInitializationEvent event) {
@EventHandler
@SuppressWarnings("unchecked")
public void load(FMLInitializationEvent event) {
// Register the GUI Handler
NetworkRegistry.instance().registerGuiHandler(instance, proxy);
// Register the GUI Handler
NetworkRegistry.instance().registerGuiHandler(instance, proxy);
// Register the PlayerDestroyItem Handler
MinecraftForge.EVENT_BUS.register(new PlayerDestroyItemHandler());
// Register the PlayerDestroyItem Handler
MinecraftForge.EVENT_BUS.register(new PlayerDestroyItemHandler());
// Register the Item Pickup Handler
MinecraftForge.EVENT_BUS.register(new ItemEventHandler());
// Register the Item Pickup Handler
MinecraftForge.EVENT_BUS.register(new ItemEventHandler());
// Register the EntityLiving Handler
MinecraftForge.EVENT_BUS.register(new EntityLivingHandler());
// Register the EntityLiving Handler
MinecraftForge.EVENT_BUS.register(new EntityLivingHandler());
MinecraftForge.EVENT_BUS.register(new ActionRequestHandler());
MinecraftForge.EVENT_BUS.register(new ActionRequestHandler());
MinecraftForge.EVENT_BUS.register(new WorldTransmutationHandler());
MinecraftForge.EVENT_BUS.register(new WorldTransmutationHandler());
GameRegistry.registerCraftingHandler(new CraftingHandler());
GameRegistry.registerCraftingHandler(new CraftingHandler());
// Register the DrawBlockHighlight Handler
proxy.registerDrawBlockHighlightHandler();
// Register the DrawBlockHighlight Handler
proxy.registerDrawBlockHighlightHandler();
// Initialize mod tile entities
proxy.registerTileEntities();
// Initialize mod tile entities
proxy.registerTileEntities();
// Initialize custom rendering and pre-load textures (Client only)
proxy.initRenderingAndTextures();
// Initialize custom rendering and pre-load textures (Client only)
proxy.initRenderingAndTextures();
// Add in the ability to dye Alchemical Bags
CraftingManager.getInstance().getRecipeList().add(new RecipesAlchemicalBagDyes());
// Add in the ability to dye Alchemical Bags
CraftingManager.getInstance().getRecipeList()
.add(new RecipesAlchemicalBagDyes());
// Register the Fuel Handler
GameRegistry.registerFuelHandler(new FuelHandler());
// Register the Fuel Handler
GameRegistry.registerFuelHandler(new FuelHandler());
// Quick test to see that sending an encoded recipe to be added to the recipe registry works
FMLInterModComms.sendMessage(Reference.MOD_ID, InterModComms.ADD_RECIPE, NBTHelper.encodeRecipeAsNBT(Item.bucketWater, Arrays.asList(Item.bucketEmpty, Block.waterStill)));
FMLInterModComms.sendMessage(Reference.MOD_ID, InterModComms.ADD_RECIPE, NBTHelper.encodeRecipeAsNBT(Item.bucketLava, Arrays.asList(Item.bucketEmpty, Block.lavaStill)));
}
// Quick test to see that sending an encoded recipe to be added to the
// recipe registry works
FMLInterModComms.sendMessage(
Reference.MOD_ID,
InterModComms.ADD_RECIPE,
NBTHelper.encodeRecipeAsNBT(Item.bucketWater,
Arrays.asList(Item.bucketEmpty, Block.waterStill)));
FMLInterModComms.sendMessage(
Reference.MOD_ID,
InterModComms.ADD_RECIPE,
NBTHelper.encodeRecipeAsNBT(Item.bucketLava,
Arrays.asList(Item.bucketEmpty, Block.lavaStill)));
}
@EventHandler
public void modsLoaded(FMLPostInitializationEvent event) {
@EventHandler
public void modsLoaded(FMLPostInitializationEvent event) {
// Initialize the Addon Handler
AddonHandler.init();
// Initialize the Addon Handler
AddonHandler.init();
// Initialize the DynEMC system
// TODO Seems like this happens earlier than it should now, investigate where this should go
DynEMC dynEMC = DynEMC.getInstance();
}
// Initialize the DynEMC system
// TODO Seems like this happens earlier than it should now, investigate
// where this should go
DynEMC dynEMC = DynEMC.getInstance();
}
@EventHandler
public void handleIMCMessages(IMCEvent event) {
@EventHandler
public void handleIMCMessages(IMCEvent event) {
InterModCommsHandler.processIMCMessages(event);
}
InterModCommsHandler.processIMCMessages(event);
}
}

View file

@ -4,7 +4,6 @@ import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.event.ForgeSubscribe;
import com.pahimar.ee3.core.util.LogHelper;
import com.pahimar.ee3.lib.Reference;
import com.pahimar.ee3.lib.Sounds;
/**

View file

@ -3,12 +3,10 @@ package com.pahimar.ee3.client.gui.inventory;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.core.util.ResourceLocationHelper;
import com.pahimar.ee3.inventory.ContainerAlchemicalBag;
import com.pahimar.ee3.lib.Strings;
import com.pahimar.ee3.lib.Textures;
@ -29,46 +27,52 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiAlchemicalBag extends GuiContainer {
public GuiAlchemicalBag(InventoryPlayer inventoryPlayer) {
public GuiAlchemicalBag(InventoryPlayer inventoryPlayer) {
super(new ContainerAlchemicalBag(inventoryPlayer));
xSize = 248;
ySize = 186;
}
super(new ContainerAlchemicalBag(inventoryPlayer));
xSize = 248;
ySize = 186;
}
@Override
protected void drawGuiContainerForegroundLayer(int x, int y) {
@Override
protected void drawGuiContainerForegroundLayer(int x, int y) {
fontRenderer.drawString(StatCollector.translateToLocal(Strings.CONTAINER_ALCHEMICAL_BAG_NAME), 8, 6, 4210752);
fontRenderer.drawString(StatCollector.translateToLocal(Strings.CONTAINER_INVENTORY), 44, ySize - 96 + 2, 4210752);
}
fontRenderer.drawString(StatCollector
.translateToLocal(Strings.CONTAINER_ALCHEMICAL_BAG_NAME), 8, 6,
4210752);
fontRenderer.drawString(
StatCollector.translateToLocal(Strings.CONTAINER_INVENTORY),
44, ySize - 96 + 2, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y) {
@Override
protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
// this.mc.getTextureManager().bindTexture(...)
this.mc.func_110434_K().func_110577_a(Textures.GUI_ALCHEMICAL_STORAGE);
int xStart = (width - xSize) / 2;
int yStart = (height - ySize) / 2;
this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize);
}
// this.mc.getTextureManager().bindTexture(...)
this.mc.func_110434_K().func_110577_a(Textures.GUI_ALCHEMICAL_STORAGE);
@Override
public void onGuiClosed() {
int xStart = (width - xSize) / 2;
int yStart = (height - ySize) / 2;
this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize);
}
super.onGuiClosed();
@Override
public void onGuiClosed() {
if (mc.thePlayer != null) {
for (ItemStack itemStack : mc.thePlayer.inventory.mainInventory) {
if (itemStack != null) {
if (NBTHelper.hasTag(itemStack, Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN)) {
NBTHelper.removeTag(itemStack, Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN);
}
}
}
}
}
super.onGuiClosed();
if (mc.thePlayer != null) {
for (ItemStack itemStack : mc.thePlayer.inventory.mainInventory) {
if (itemStack != null) {
if (NBTHelper.hasTag(itemStack,
Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN)) {
NBTHelper.removeTag(itemStack,
Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN);
}
}
}
}
}
}

View file

@ -2,12 +2,10 @@ package com.pahimar.ee3.client.gui.inventory;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.core.util.ResourceLocationHelper;
import com.pahimar.ee3.inventory.ContainerAlchemicalChest;
import com.pahimar.ee3.lib.Strings;
import com.pahimar.ee3.lib.Textures;

View file

@ -2,12 +2,10 @@ package com.pahimar.ee3.client.gui.inventory;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.core.util.ResourceLocationHelper;
import com.pahimar.ee3.inventory.ContainerAludel;
import com.pahimar.ee3.lib.Strings;
import com.pahimar.ee3.lib.Textures;

View file

@ -2,12 +2,10 @@ package com.pahimar.ee3.client.gui.inventory;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.core.util.ResourceLocationHelper;
import com.pahimar.ee3.inventory.ContainerCalcinator;
import com.pahimar.ee3.lib.Strings;
import com.pahimar.ee3.lib.Textures;

View file

@ -2,12 +2,10 @@ package com.pahimar.ee3.client.gui.inventory;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.core.util.ResourceLocationHelper;
import com.pahimar.ee3.inventory.ContainerGlassBell;
import com.pahimar.ee3.lib.Strings;
import com.pahimar.ee3.lib.Textures;

View file

@ -3,13 +3,11 @@ package com.pahimar.ee3.client.gui.inventory;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.core.util.ResourceLocationHelper;
import com.pahimar.ee3.inventory.ContainerPortableCrafting;
import com.pahimar.ee3.lib.Strings;
import com.pahimar.ee3.lib.Textures;

View file

@ -3,11 +3,8 @@ package com.pahimar.ee3.client.gui.inventory;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.core.util.ResourceLocationHelper;
import com.pahimar.ee3.lib.Strings;
import com.pahimar.ee3.lib.Textures;
import com.pahimar.ee3.nbt.NBTHelper;

View file

@ -4,7 +4,6 @@ import net.minecraft.block.Block;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;

View file

@ -2,13 +2,10 @@ package com.pahimar.ee3.client.renderer.item;
import net.minecraft.client.model.ModelChest;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.core.util.ResourceLocationHelper;
import com.pahimar.ee3.lib.Reference;
import com.pahimar.ee3.lib.Textures;
import cpw.mods.fml.client.FMLClientHandler;

View file

@ -1,14 +1,11 @@
package com.pahimar.ee3.client.renderer.item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.client.model.ModelAludel;
import com.pahimar.ee3.core.util.ResourceLocationHelper;
import com.pahimar.ee3.lib.Reference;
import com.pahimar.ee3.lib.Textures;
import cpw.mods.fml.client.FMLClientHandler;

View file

@ -1,13 +1,11 @@
package com.pahimar.ee3.client.renderer.item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.client.model.ModelCalcinator;
import com.pahimar.ee3.core.util.ResourceLocationHelper;
import com.pahimar.ee3.lib.Textures;
import cpw.mods.fml.client.FMLClientHandler;

View file

@ -1,13 +1,11 @@
package com.pahimar.ee3.client.renderer.item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.client.model.ModelGlassBell;
import com.pahimar.ee3.core.util.ResourceLocationHelper;
import com.pahimar.ee3.lib.Textures;
import cpw.mods.fml.client.FMLClientHandler;

View file

@ -3,14 +3,11 @@ package com.pahimar.ee3.client.renderer.tileentity;
import net.minecraft.client.model.ModelChest;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.ForgeDirection;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import com.pahimar.ee3.core.util.ResourceLocationHelper;
import com.pahimar.ee3.lib.Reference;
import com.pahimar.ee3.lib.Textures;
import com.pahimar.ee3.tileentity.TileAlchemicalChest;

View file

@ -7,13 +7,11 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.ForgeDirection;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.client.model.ModelAludel;
import com.pahimar.ee3.core.util.ResourceLocationHelper;
import com.pahimar.ee3.lib.Textures;
import com.pahimar.ee3.tileentity.TileAludel;
import com.pahimar.ee3.tileentity.TileGlassBell;

View file

@ -2,12 +2,9 @@ package com.pahimar.ee3.client.renderer.tileentity;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.client.model.ModelCalcinator;
import com.pahimar.ee3.core.util.ResourceLocationHelper;
import com.pahimar.ee3.lib.Textures;
import com.pahimar.ee3.tileentity.TileCalcinator;

View file

@ -7,13 +7,11 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.ForgeDirection;
import org.lwjgl.opengl.GL11;
import com.pahimar.ee3.client.model.ModelGlassBell;
import com.pahimar.ee3.core.util.ResourceLocationHelper;
import com.pahimar.ee3.lib.Textures;
import com.pahimar.ee3.tileentity.TileGlassBell;

View file

@ -7,7 +7,6 @@ import net.minecraft.util.ChatMessageComponent;
import com.pahimar.ee3.configuration.ConfigurationHandler;
import com.pahimar.ee3.configuration.ConfigurationSettings;
import com.pahimar.ee3.core.util.LocalizationUtil;
import com.pahimar.ee3.lib.Colours;
import com.pahimar.ee3.lib.Commands;
import com.pahimar.ee3.lib.Strings;

View file

@ -6,8 +6,6 @@ import net.minecraft.util.ChatMessageComponent;
import com.pahimar.ee3.configuration.ConfigurationHandler;
import com.pahimar.ee3.configuration.ConfigurationSettings;
import com.pahimar.ee3.core.util.LocalizationUtil;
import com.pahimar.ee3.lib.Colours;
import com.pahimar.ee3.lib.Commands;
import com.pahimar.ee3.lib.Strings;

View file

@ -6,8 +6,6 @@ import net.minecraft.util.ChatMessageComponent;
import com.pahimar.ee3.configuration.ConfigurationHandler;
import com.pahimar.ee3.configuration.ConfigurationSettings;
import com.pahimar.ee3.core.util.LocalizationUtil;
import com.pahimar.ee3.lib.Colours;
import com.pahimar.ee3.lib.Commands;
/**