diff --git a/build.properties b/build.properties index 847ebe53..1c2b7eea 100644 --- a/build.properties +++ b/build.properties @@ -1,7 +1,7 @@ dir.development=./ dir.mcp=${dir.development}forge/mcp -version.minecraft=1.6.2 +version.minecraft=1.6.4 version.mod.major=0 version.mod.minor=2 -version.mod.revis=0 -version.universalelectricity=2.0.0 \ No newline at end of file +version.mod.revis=1 +version.universalelectricity=2.2.0 \ No newline at end of file diff --git a/src/resonantinduction/BlockAdvancedFurnace.java b/src/resonantinduction/BlockAdvancedFurnace.java new file mode 100644 index 00000000..393f5264 --- /dev/null +++ b/src/resonantinduction/BlockAdvancedFurnace.java @@ -0,0 +1,22 @@ +package resonantinduction; + +import net.minecraft.block.BlockFurnace; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +/** + * @author Calclavia + * + */ +public class BlockAdvancedFurnace extends BlockFurnace +{ + protected BlockAdvancedFurnace(int par1, boolean par2) + { + super(par1, par2); + } + + public TileEntity createNewTileEntity(World par1World) + { + return new TileEntityAdvancedFurnace(); + } +} diff --git a/src/resonantinduction/ResonantInduction.java b/src/resonantinduction/ResonantInduction.java index 46689a40..84e7c24c 100644 --- a/src/resonantinduction/ResonantInduction.java +++ b/src/resonantinduction/ResonantInduction.java @@ -4,13 +4,17 @@ import ic2.api.item.Items; import java.io.File; import java.util.Arrays; +import java.util.Map; import java.util.logging.Logger; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityFurnace; import net.minecraftforge.common.Configuration; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; @@ -49,6 +53,7 @@ import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.ObfuscationReflectionHelper; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; @@ -145,6 +150,9 @@ public class ResonantInduction public static Block blockEMContractor; public static Block blockBattery; public static Block blockWire; + + public static Block blockAdvancedFurnaceIdle, blockAdvancedFurnaceBurning; + public static final Vector3[] DYE_COLORS = new Vector3[] { new Vector3(), new Vector3(1, 0, 0), new Vector3(0, 0.608, 0.232), new Vector3(0.588, 0.294, 0), new Vector3(0, 0, 1), new Vector3(0.5, 0, 05), new Vector3(0, 1, 1), new Vector3(0.8, 0.8, 0.8), new Vector3(0.3, 0.3, 0.3), new Vector3(1, 0.412, 0.706), new Vector3(0.616, 1, 0), new Vector3(1, 1, 0), new Vector3(0.46f, 0.932, 1), new Vector3(0.5, 0.2, 0.5), new Vector3(0.7, 0.5, 0.1), new Vector3(1, 1, 1) }; @EventHandler @@ -171,7 +179,7 @@ public class ResonantInduction itemCapacitor = new ItemCapacitor(getNextItemID()); itemLinker = new ItemLinker(getNextItemID()); itemInfiniteCapacitor = new ItemInfiniteCapacitor(getNextItemID()); - + itemPartWire = new ItemPartWire(getNextItemID()); // Blocks @@ -180,6 +188,8 @@ public class ResonantInduction blockEMContractor = new BlockEMContractor(getNextBlockID()); blockBattery = new BlockBattery(getNextBlockID()); blockWire = new BlockWire(getNextBlockID()); + blockAdvancedFurnaceIdle = new BlockAdvancedFurnace(getNextBlockID(), false); + blockAdvancedFurnaceBurning = new BlockAdvancedFurnace(getNextBlockID(), true); CONFIGURATION.save(); @@ -205,6 +215,7 @@ public class ResonantInduction ResonantInduction.proxy.registerRenderers(); TabRI.ITEMSTACK = new ItemStack(blockBattery); + OreDictionary.registerOre("copperWire", new ItemStack(blockWire)); // Basic Components BasicRegistry.register("itemIngotSteel"); @@ -226,7 +237,7 @@ public class ResonantInduction metadata.authorList = Arrays.asList(new String[] { "Calclavia", "Aidancbrady" }); metadata.credits = "Thanks to Archadia for the awesome assets!"; metadata.autogenerated = false; - + new MultipartRI().init(); } @@ -278,10 +289,41 @@ public class ResonantInduction GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockWire, 1, EnumWireMaterial.IRON.ordinal()), Items.getItem("ironCableItem"))); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockWire, 2, EnumWireMaterial.SUPERCONDUCTOR.ordinal()), Items.getItem("glassFiberCableItem"))); } - + if (Loader.isModLoaded("Mekanism")) { GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockWire, 1, EnumWireMaterial.COPPER.ordinal()), "universalCable")); } + + /** Inject new furnace tile class */ + replaceTileEntity(TileEntityFurnace.class, TileEntityAdvancedFurnace.class); + } + + public static void replaceTileEntity(Class findTile, Class replaceTile) + { + try + { + Map nameToClassMap = ObfuscationReflectionHelper.getPrivateValue(TileEntity.class, null, "field_" + "70326_a", "nameToClassMap", "a"); + Map classToNameMap = ObfuscationReflectionHelper.getPrivateValue(TileEntity.class, null, "field_" + "70326_b", "classToNameMap", "b"); + + String findTileID = classToNameMap.get(findTile); + + if (findTileID != null) + { + nameToClassMap.put(findTileID, replaceTile); + classToNameMap.put(replaceTile, findTileID); + classToNameMap.remove(findTile); + LOGGER.fine("Replaced TileEntity: " + findTile); + } + else + { + LOGGER.severe("Failed to replace TileEntity: " + findTile); + } + } + catch (Exception e) + { + LOGGER.severe("Failed to replace TileEntity: " + findTile); + e.printStackTrace(); + } } } diff --git a/src/resonantinduction/SoundHandler.java b/src/resonantinduction/SoundHandler.java index adf3408d..b40396e5 100644 --- a/src/resonantinduction/SoundHandler.java +++ b/src/resonantinduction/SoundHandler.java @@ -24,7 +24,7 @@ public class SoundHandler { for (int i = 0; i < SOUND_FILES.length; i++) { - event.manager.soundPoolSounds.addSound(ResonantInduction.PREFIX + SOUND_FILES[i]); + event.manager.addSound(ResonantInduction.PREFIX + SOUND_FILES[i]); } ResonantInduction.LOGGER.fine("Loaded sound fxs"); diff --git a/src/resonantinduction/TileEntityAdvancedFurnace.java b/src/resonantinduction/TileEntityAdvancedFurnace.java new file mode 100644 index 00000000..0315b266 --- /dev/null +++ b/src/resonantinduction/TileEntityAdvancedFurnace.java @@ -0,0 +1,18 @@ +package resonantinduction; + +import net.minecraft.tileentity.TileEntityFurnace; + +/** + * Meant to replace the furnace class. + * + * @author Calclavia + * + */ +public class TileEntityAdvancedFurnace extends TileEntityFurnace +{ + public void updateEntity() + { + super.updateEntity(); + System.out.println("WOR"); + } +}