From 32044d27ae2904c7eca92537c4e28d72bede17a2 Mon Sep 17 00:00:00 2001 From: Aidan Brady Date: Fri, 2 Aug 2013 01:25:41 -0400 Subject: [PATCH] Began work on Quantum Entangler Also started work on base code for Item and cleaned up core class. Expect Quantum Entangler to be finished overnight, code-wise! --- .../languages/en_US.properties | 4 +++- src/resonantinduction/ResonantInduction.java | 24 ++++++++++++++----- src/resonantinduction/base/ItemBase.java | 21 ++++++++++++++++ .../entangler/ItemQuantumEntangler.java | 17 +++++++++++++ 4 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 src/resonantinduction/base/ItemBase.java create mode 100644 src/resonantinduction/entangler/ItemQuantumEntangler.java diff --git a/resources/assets/resonantinduction/languages/en_US.properties b/resources/assets/resonantinduction/languages/en_US.properties index e8315a57f..2eb25067a 100755 --- a/resources/assets/resonantinduction/languages/en_US.properties +++ b/resources/assets/resonantinduction/languages/en_US.properties @@ -2,4 +2,6 @@ itemGroup.resonantinduction=Resonant Induction -tile.resonantinduction\:tesla.name=Tesla Coil \ No newline at end of file +tile.resonantinduction\:tesla.name=Tesla Coil + +item.resonantinduction\:entangler.name=Quantum Entangler \ No newline at end of file diff --git a/src/resonantinduction/ResonantInduction.java b/src/resonantinduction/ResonantInduction.java index 03f40c9f6..09b6b28bb 100644 --- a/src/resonantinduction/ResonantInduction.java +++ b/src/resonantinduction/ResonantInduction.java @@ -9,6 +9,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.Configuration; import net.minecraftforge.oredict.ShapedOreRecipe; +import resonantinduction.entangler.ItemQuantumEntangler; import resonantinduction.tesla.BlockTesla; import resonantinduction.tesla.TileEntityTesla; import cpw.mods.fml.common.FMLLog; @@ -38,7 +39,7 @@ public class ResonantInduction */ public static final String ID = "resonantinduction"; public static final String NAME = "Resonant Induction"; - public static final String CHANNEL = "resonantinduc"; + public static final String CHANNEL = "R_INDUC"; public static final String MAJOR_VERSION = "@MAJOR@"; public static final String MINOR_VERSION = "@MINOR@"; @@ -95,10 +96,11 @@ public class ResonantInduction { return NEXT_ITEM_ID++; } + + //Items + public static Item itemQuantumEntangler; - /** - * Blocks and Items - */ + //Blocks public static Block blockTesla; @EventHandler @@ -107,13 +109,23 @@ public class ResonantInduction LOGGER.setParent(FMLLog.getLogger()); CONFIGURATION.load(); + + //config POWER_PER_COAL = (float) CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Coal Wattage", POWER_PER_COAL).getDouble(POWER_PER_COAL); + //items + itemQuantumEntangler = new ItemQuantumEntangler(getNextItemID()); + GameRegistry.registerItem(itemQuantumEntangler, itemQuantumEntangler.getUnlocalizedName()); + + //blocks blockTesla = new BlockTesla(getNextBlockID()); - CONFIGURATION.save(); - GameRegistry.registerBlock(blockTesla, blockTesla.getUnlocalizedName()); + + CONFIGURATION.save(); + + //tiles GameRegistry.registerTileEntity(TileEntityTesla.class, blockTesla.getUnlocalizedName()); + ResonantInduction.proxy.registerRenderers(); TabRI.ITEMSTACK = new ItemStack(blockTesla); diff --git a/src/resonantinduction/base/ItemBase.java b/src/resonantinduction/base/ItemBase.java new file mode 100644 index 000000000..9bd69d365 --- /dev/null +++ b/src/resonantinduction/base/ItemBase.java @@ -0,0 +1,21 @@ +package resonantinduction.base; + +import net.minecraft.item.Item; +import net.minecraftforge.common.Configuration; +import resonantinduction.ResonantInduction; +import resonantinduction.TabRI; + +/** + * + * @author AidanBrady + * + */ +public class ItemBase extends Item +{ + public ItemBase(String name, int id) + { + super(ResonantInduction.CONFIGURATION.get(Configuration.CATEGORY_ITEM, name, id).getInt(id)); + this.setCreativeTab(TabRI.INSTANCE); + this.setUnlocalizedName(ResonantInduction.PREFIX + name); + } +} diff --git a/src/resonantinduction/entangler/ItemQuantumEntangler.java b/src/resonantinduction/entangler/ItemQuantumEntangler.java new file mode 100644 index 000000000..c5b7838c6 --- /dev/null +++ b/src/resonantinduction/entangler/ItemQuantumEntangler.java @@ -0,0 +1,17 @@ +package resonantinduction.entangler; + +import resonantinduction.base.ItemBase; + +/** + * + * @author AidanBrady + * + */ +public class ItemQuantumEntangler extends ItemBase +{ + public ItemQuantumEntangler(int id) + { + super("entangler", id); + setMaxStackSize(1); + } +}