Merge branch 'master' into multipart-experimental

Conflicts:
	src/resonantinduction/ResonantInduction.java
This commit is contained in:
Calclavia 2013-09-22 11:08:00 +08:00
commit 22e69669f3
5 changed files with 89 additions and 7 deletions

View file

@ -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
version.mod.revis=1
version.universalelectricity=2.2.0

View file

@ -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();
}
}

View file

@ -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
@ -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");
@ -283,5 +294,36 @@ public class ResonantInduction
{
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<? extends TileEntity> findTile, Class<? extends TileEntity> replaceTile)
{
try
{
Map<String, Class> nameToClassMap = ObfuscationReflectionHelper.getPrivateValue(TileEntity.class, null, "field_" + "70326_a", "nameToClassMap", "a");
Map<Class, String> 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();
}
}
}

View file

@ -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");

View file

@ -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");
}
}