diff options
| author | Lance5057 <Lance5057@gmail.com> | 2015-03-09 04:09:26 -0500 |
|---|---|---|
| committer | Lance5057 <Lance5057@gmail.com> | 2015-03-09 04:09:26 -0500 |
| commit | fad218d842cac7a9b8bf4d57020c79c690c17183 (patch) | |
| tree | 31e024c614e06ad78438b6bcfaa703dfc7cd0804 /src | |
| parent | c70a7618c8d3e016319a7194a67fee6c50fe45dd (diff) | |
This stupid crest mount needs to work properly already.
Diffstat (limited to 'src')
3 files changed, 30 insertions, 28 deletions
diff --git a/src/main/java/gmail/Lance5057/com/mod_TinkersDefense.java b/src/main/java/gmail/Lance5057/com/mod_TinkersDefense.java index f3cf7f4..47dae73 100644 --- a/src/main/java/gmail/Lance5057/com/mod_TinkersDefense.java +++ b/src/main/java/gmail/Lance5057/com/mod_TinkersDefense.java @@ -94,20 +94,29 @@ public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent e) -{ - //Network - network = NetworkRegistry.INSTANCE.newSimpleChannel("tDefense"); - //Handler_CrestMount.INSTANCE.ordinal(); +{ //Renderers proxy.registerRenderers(); + block_CrestMount = new CrestMount() + .setHardness(4.0F) + .setStepSound(Block.soundTypeMetal) + .setBlockName("CrestMount") + .setCreativeTab(tabName); + + GameRegistry.registerBlock(block_CrestMount, "Block_CrestMount"); + GameRegistry.registerTileEntity(TileEntity_CrestMount.class, "Tile_CrestMount"); + + NetworkRegistry.INSTANCE.registerGuiHandler(mod_TinkersDefense.instance, new CommonProxy()); + MinecraftForge.EVENT_BUS.register(this); + //AeonSteel item_AeonSteelIngot = new AeonSteelIngot() .setCreativeTab(tabName) .setMaxStackSize(64) .setUnlocalizedName("AeonSteelIngot") - .setTextureName(MODID+":AeonSteelIngot"); + .setTextureName(Reference.MOD_ID+":AeonSteelIngot"); GameRegistry.registerItem(item_AeonSteelIngot, "AeonSteel Ingot"); @@ -116,7 +125,7 @@ public void preInit(FMLPreInitializationEvent e) .setStepSound(Block.soundTypeMetal) .setBlockName("AeonSteelBlock") .setCreativeTab(tabName) - .setBlockTextureName(MODID+":AeonSteelBlock"); + .setBlockTextureName(Reference.MOD_ID+":AeonSteelBlock"); GameRegistry.registerBlock(block_AeonSteelBlock, "aeonsteelblock"); @@ -136,7 +145,7 @@ public void preInit(FMLPreInitializationEvent e) .setCreativeTab(tabName) .setMaxStackSize(64) .setUnlocalizedName("QueensGoldIngot") - .setTextureName(MODID+":QueensGoldIngot"); + .setTextureName(Reference.MOD_ID+":QueensGoldIngot"); GameRegistry.registerItem(item_QueensGoldIngot, "Queen's Gold Ingot"); @@ -145,7 +154,7 @@ public void preInit(FMLPreInitializationEvent e) .setStepSound(Block.soundTypeMetal) .setBlockName("QueensGoldBlock") .setCreativeTab(tabName) - .setBlockTextureName(MODID+":QueensGoldBlock"); + .setBlockTextureName(Reference.MOD_ID+":QueensGoldBlock"); GameRegistry.registerBlock(block_QueensGoldBlock, "QueensGoldblock"); @@ -166,7 +175,7 @@ public void preInit(FMLPreInitializationEvent e) .setCreativeTab(tabName) .setMaxStackSize(64) .setUnlocalizedName("DogbeariumIngot") - .setTextureName(MODID+":DogbeariumIngot"); + .setTextureName(Reference.MOD_ID+":DogbeariumIngot"); GameRegistry.registerItem(item_DogbeariumIngot, "DogbeariumIngot"); @@ -175,7 +184,7 @@ public void preInit(FMLPreInitializationEvent e) .setStepSound(Block.soundTypeMetal) .setBlockName("DogbeariumBlock") .setCreativeTab(tabName) - .setBlockTextureName(MODID+":DogbeariumBlock"); + .setBlockTextureName(Reference.MOD_ID+":DogbeariumBlock"); GameRegistry.registerBlock(block_DogbeariumBlock, "Dogbeariumblock"); @@ -199,12 +208,7 @@ public void preInit(FMLPreInitializationEvent e) TConstructRegistry.addItemToDirectory("Round Shield", tool_roundShield); TConstructRegistry.addItemToDirectory("Heater Shield", tool_heaterShield); - block_CrestMount = new CrestMount() - .setHardness(4.0F) - .setStepSound(Block.soundTypeMetal) - .setBlockName("CrestMount") - .setCreativeTab(tabName); - + //item_TinkerArmor = new TinkerArmor(ArmorMaterial.IRON, 4, 1).setUnlocalizedName("Tinker_Armor"); @@ -215,18 +219,9 @@ public void preInit(FMLPreInitializationEvent e) } @EventHandler -public void load(FMLInitializationEvent evt) -{ - GameRegistry.registerTileEntity(TileEntity_CrestMount.class, "Tile_CrestMount"); - GameRegistry.registerBlock(block_CrestMount, "Block_CrestMount"); - NetworkRegistry.INSTANCE.registerGuiHandler(mod_TinkersDefense.instance, new CommonProxy()); - MinecraftForge.EVENT_BUS.register(this); -} - -@EventHandler public void init(FMLInitializationEvent e) { - System.out.print(MODID); + System.out.print(Reference.MOD_ID); PatternBuilder pb = PatternBuilder.instance; //Aeonsteel diff --git a/src/main/java/gmail/Lance5057/gui/Gui_CrestMount.java b/src/main/java/gmail/Lance5057/gui/Gui_CrestMount.java index 4017c43..4824a39 100644 --- a/src/main/java/gmail/Lance5057/gui/Gui_CrestMount.java +++ b/src/main/java/gmail/Lance5057/gui/Gui_CrestMount.java @@ -63,6 +63,9 @@ protected void actionPerformed(GuiButton button) inventory.flip[i-1]=true; else inventory.flip[i-1]=false; + + inventory.getWorldObj().markBlockForUpdate(inventory.xCoord, inventory.yCoord, inventory.zCoord); + inventory.markDirty(); } } } diff --git a/src/main/java/gmail/Lance5057/tileentities/TileEntity_CrestMount.java b/src/main/java/gmail/Lance5057/tileentities/TileEntity_CrestMount.java index 135539f..8e96516 100644 --- a/src/main/java/gmail/Lance5057/tileentities/TileEntity_CrestMount.java +++ b/src/main/java/gmail/Lance5057/tileentities/TileEntity_CrestMount.java @@ -23,7 +23,6 @@ public class TileEntity_CrestMount extends TileEntity implements IInventory { super(); inventory = new ItemStack[invSize]; - flip = new boolean[4]; } @Override @@ -32,7 +31,8 @@ public class TileEntity_CrestMount extends TileEntity implements IInventory super.updateEntity(); if (worldObj.isRemote) { - markDirty(); + + } } @@ -144,10 +144,13 @@ public class TileEntity_CrestMount extends TileEntity implements IInventory public void writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); + if(flip!=null) + { compound.setBoolean("flip_1", flip[0]); compound.setBoolean("flip_2", flip[1]); compound.setBoolean("flip_3", flip[2]); compound.setBoolean("flip_4", flip[3]); + } writeInventoryToNBT(compound); } @@ -156,6 +159,7 @@ public class TileEntity_CrestMount extends TileEntity implements IInventory public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); + flip = new boolean[4]; flip[0] = compound.getBoolean("flip_1"); flip[1] = compound.getBoolean("flip_2"); flip[2] = compound.getBoolean("flip_3"); |
