Readded tanks

This commit is contained in:
Calclavia 2014-01-11 12:09:02 +08:00
parent 033f6e4460
commit 904461936f
56 changed files with 700 additions and 1611 deletions

View file

@ -1,52 +0,0 @@
package dark.lib;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.util.Icon;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.fluids.BlockFluidFinite;
import net.minecraftforge.fluids.Fluid;
import resonantinduction.core.Settings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockFluid extends BlockFluidFinite
{
Icon flowing;
Icon still;
Fluid fluid;
String prefix = "";
public BlockFluid(String prefix, Fluid fluid, Configuration config)
{
this(prefix, Settings.getNextBlockID(), fluid, config);
}
public BlockFluid(String prefix, int id, Fluid fluid, Configuration config)
{
super(config.getBlock("BlockFluid" + fluid.getName(), id).getInt(), fluid, Material.water);
this.fluid = fluid;
if (prefix != null && prefix.contains(":"))
{
this.prefix = prefix;
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister)
{
this.flowing = par1IconRegister.registerIcon(prefix + this.getUnlocalizedName().replace("tile.", "") + "_flowing");
this.still = par1IconRegister.registerIcon(prefix + this.getUnlocalizedName().replace("tile.", "") + "_still");
fluid.setIcons(still, flowing);
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon(int par1, int par2)
{
return still;
}
}

View file

@ -1,32 +0,0 @@
package dark.lib;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemBlock;
import net.minecraft.tileentity.TileEntity;
import com.builtbroken.common.Pair;
import cpw.mods.fml.client.registry.ClientRegistry;
import dark.lib.IExtraInfo.IExtraBlockInfo;
public class ClientRegistryProxy extends RegistryProxy
{
@Override
public void registerBlock(Block block, Class<? extends ItemBlock> itemClass, String name, String modID)
{
super.registerBlock(block, itemClass, name, modID);
if (block instanceof IExtraBlockInfo)
{
List<Pair<Class<? extends TileEntity>, TileEntitySpecialRenderer>> set = new ArrayList<Pair<Class<? extends TileEntity>, TileEntitySpecialRenderer>>();
((IExtraBlockInfo) block).getClientTileEntityRenderers(set);
for (Pair<Class<? extends TileEntity>, TileEntitySpecialRenderer> par : set)
{
ClientRegistry.bindTileEntitySpecialRenderer(par.left(), par.right());
}
}
}
}

View file

@ -1,257 +0,0 @@
package dark.lib;
import java.io.File;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map.Entry;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import com.builtbroken.common.Pair;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import dark.lib.IExtraInfo.IExtraBlockInfo;
import dark.lib.IExtraInfo.IExtraItemInfo;
/**
* Handler to make registering all parts of a mod's objects that are loaded into the game by forge
*
* @author DarkGuardsman
*/
public class CoreRegistry
{
public static HashMap<Block, String> registredBlocks = new HashMap<Block, String>();
public static HashMap<Item, String> registredItems = new HashMap<Item, String>();
//@SidedProxy(clientSide = "com.builtbroken.minecraft.ClientRegistryProxy", serverSide = "com.builtbroken.minecraft.RegistryProxy")
public static RegistryProxy prox;
public static RegistryProxy proxy()
{
if (prox == null)
{
if (FMLCommonHandler.instance().getSide().isClient())
{
prox = new ClientRegistryProxy();
}
else
{
prox = new RegistryProxy();
}
}
return prox;
}
public static Configuration masterBlockConfig = new Configuration(new File(Loader.instance().getConfigDir(), "objects/EnabledBlocks.cfg"));
/**
* Generates a block using reflection, and runs it threw config checks
*
* @param name - name to register the block with
* @param modID - mod id to register the block to
* @param blockClass - class to generate the instance from
*/
public static Block createNewBlock(String name, String modID, Class<? extends Block> blockClass)
{
return CoreRegistry.createNewBlock(name, modID, blockClass, true);
}
/**
* Generates a block using reflection, and runs it threw config checks
*
* @param name - name to register the block with
* @param modID - mod id to register the block to
* @param blockClass - class to generate the instance from
* @param canDisable - should we allow the player the option to disable the block
*/
public static Block createNewBlock(String name, String modID, Class<? extends Block> blockClass, boolean canDisable)
{
return CoreRegistry.createNewBlock(name, modID, blockClass, null, canDisable);
}
/**
* Generates a block using reflection, and runs it threw config checks
*
* @param name - name to register the block with
* @param modID - mod id to register the block to
* @param blockClass - class to generate the instance from
* @param itemClass - item block to register with the block
*/
public static Block createNewBlock(String name, String modID, Class<? extends Block> blockClass, Class<? extends ItemBlock> itemClass)
{
return createNewBlock(name, modID, blockClass, itemClass, true);
}
/**
* Generates a block using reflection, and runs it threw config checks
*
* @param name - name to register the block with
* @param modID - mod id to register the block to
* @param blockClass - class to generate the instance from
* @param canDisable - should we allow the player the option to disable the block
* @param itemClass - item block to register with the block
*/
public static Block createNewBlock(String name, String modID, Class<? extends Block> blockClass, Class<? extends ItemBlock> itemClass, boolean canDisable)
{
Block block = null;
if (blockClass != null && (!canDisable || canDisable && masterBlockConfig.get("Enabled_List", "Enabled_" + name, true).getBoolean(true)))
{
// TODO redesign to catch blockID conflict
try
{
block = blockClass.newInstance();
}
catch (IllegalArgumentException e)
{
throw e;
}
catch (Exception e)
{
System.out.println("\n\nWarning: Block [" + name + "] failed to be created\n");
e.printStackTrace();
System.out.println("\n\n");
}
if (block != null)
{
registredBlocks.put(block, name);
proxy().registerBlock(block, itemClass, name, modID);
CoreRegistry.finishCreation(block);
}
}
return block;
}
/** Finishes the creation of the block loading config files and tile entities */
public static void finishCreation(Block block)
{
if (block instanceof IExtraInfo)
{
if (((IExtraInfo) block).hasExtraConfigs())
{
Configuration extraBlockConfig = new Configuration(new File(Loader.instance().getConfigDir(), "objects/blocks/" + block.getUnlocalizedName() + ".cfg"));
extraBlockConfig.load();
((IExtraInfo) block).loadExtraConfigs(extraBlockConfig);
extraBlockConfig.save();
}
if (block instanceof IExtraBlockInfo)
{
((IExtraBlockInfo) block).loadOreNames();
Set<Pair<String, Class<? extends TileEntity>>> tileListNew = new HashSet<Pair<String, Class<? extends TileEntity>>>();
((IExtraBlockInfo) block).getTileEntities(block.blockID, tileListNew);
for (Pair<String, Class<? extends TileEntity>> par : tileListNew)
{
proxy().regiserTileEntity(par.left(), par.right());
}
}
}
}
/**
* Method to get block via name
*
* @param blockName
* @return Block requested
*/
public static Block getBlock(String blockName)
{
for (Entry<Block, String> entry : registredBlocks.entrySet())
{
String name = entry.getKey().getUnlocalizedName().replace("tile.", "");
if (name.equalsIgnoreCase(blockName))
{
return entry.getKey();
}
}
return null;
}
/**
* Creates a new fluid block using the prefab following a few conditions.
*
* @param modDomainPrefix - prefix of the mod, used for texture refrence and block registry
* @param config - config file to pull the blockID from
* @param fluid - fluid to link to this block
*/
public static Block createNewFluidBlock(String modDomainPrefix, Configuration config, Fluid fluid)
{
Block fluidBlock = null;
Fluid fluidActual = null;
if (config != null && fluid != null && config.get("general", "EnableFluid_" + fluid.getName(), true).getBoolean(true) && FluidRegistry.getFluid(fluid.getName()) == null)
{
FluidRegistry.registerFluid(fluid);
fluidActual = FluidRegistry.getFluid(fluid.getName());
if (fluidActual == null)
{
fluidActual = fluid;
}
if (fluidActual.getBlockID() == -1 && masterBlockConfig.get("Enabled_List", "Enabled_" + fluid.getName() + "Block", true).getBoolean(true))
{
fluidBlock = new BlockFluid(modDomainPrefix, fluidActual, config).setUnlocalizedName("tile.Fluid." + fluid.getName());
proxy().registerBlock(fluidBlock, null, "DMBlockFluid" + fluid.getName(), modDomainPrefix);
}
else
{
fluidBlock = Block.blocksList[fluid.getBlockID()];
}
}
return fluidBlock;
}
/**
* Creates a new item using reflection as well runs it threw some check to activate any
* interface methods
*
* @param name - name to register the item with
* @param modid - mods that the item comes from
* @param clazz - item class
* @param canDisable - can a user disable this item
* @return the new item
*/
public static Item createNewItem(String name, String modid, Class<? extends Item> clazz, boolean canDisable)
{
Item item = null;
if (clazz != null && (!canDisable || canDisable && masterBlockConfig.get("Enabled_List", "Enabled_" + name, true).getBoolean(true)))
{
try
{
item = clazz.newInstance();
}
catch (Exception e)
{
e.printStackTrace();
}
if (item != null)
{
registredItems.put(item, name);
GameRegistry.registerItem(item, name, modid);
if (item instanceof IExtraInfo)
{
if (((IExtraInfo) item).hasExtraConfigs())
{
Configuration extraBlockConfig = new Configuration(new File(Loader.instance().getConfigDir(), "objects/items/" + item.getUnlocalizedName() + ".cfg"));
extraBlockConfig.load();
((IExtraInfo) item).loadExtraConfigs(extraBlockConfig);
extraBlockConfig.save();
}
if (item instanceof IExtraItemInfo)
{
((IExtraItemInfo) item).loadOreNames();
}
}
}
}
return item;
}
}

View file

@ -1,60 +0,0 @@
package dark.lib;
import java.util.List;
import java.util.Set;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.Configuration;
import com.builtbroken.common.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* Used to handle info about the block that would normally be handled by the mod main class. Use the
* BlockRegistry in order for these methods to be called on load of the mod.
*
* @author DarkGuardsman
*/
public interface IExtraInfo
{
/** Does this object need to generate a settings config */
public boolean hasExtraConfigs();
/**
* Loads the config file for this block. This is a single config file that is tied to just this
* block alone. Anything can be stored in the config file but its suggested to use it for
* advanced settings for the block/tile. Things like power, update rate, optional features,
* graphics, or crafting cost
*/
public void loadExtraConfigs(Configuration config);
public static interface IExtraBlockInfo extends IExtraInfo, ITileEntityProvider
{
/** Loads the names used to reference this item in a recipe */
public void loadOreNames();
/** List of all tileEntities this block needs */
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list);
@SideOnly(Side.CLIENT)
public void getClientTileEntityRenderers(List<Pair<Class<? extends TileEntity>, TileEntitySpecialRenderer>> list);
}
public static interface IExtraTileEntityInfo extends IExtraInfo
{
}
public static interface IExtraItemInfo extends IExtraInfo
{
/** Loads the names used to reference this item in a recipe */
public void loadOreNames();
}
}

View file

@ -1,22 +0,0 @@
package dark.lib;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.tileentity.TileEntity;
import cpw.mods.fml.common.registry.GameRegistry;
public class RegistryProxy
{
public void registerBlock(Block block, Class<? extends ItemBlock> itemClass, String name, String modID)
{
if (block != null && name != null)
{
GameRegistry.registerBlock(block, itemClass == null ? ItemBlock.class : itemClass, name, modID);
}
}
public void regiserTileEntity(String name, Class<? extends TileEntity> clazz)
{
GameRegistry.registerTileEntityWithAlternatives(clazz, name, "DM" + name);
}
}

View file

@ -13,7 +13,7 @@ import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.old.transport.ResonantInductionTransport;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.prefab.tile.IRotatable;
@ -21,7 +21,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.lib.interfaces.IRotatableBlock;
public class BlockTurntable extends BlockMachine
public class BlockTurntable extends BlockRI
{
private Icon top;

View file

@ -5,7 +5,7 @@ import java.util.Arrays;
import net.minecraft.server.MinecraftServer;
import net.minecraftforge.common.Configuration;
import calclavia.lib.prefab.block.IDManager;
import calclavia.lib.content.IDManager;
import calclavia.lib.utility.LanguageUtility;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;

View file

@ -13,16 +13,16 @@ import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.common.Configuration;
import resonantinduction.core.ResonantInductionTabs;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.old.transport.ResonantInductionTransport;
import calclavia.lib.content.IExtraInfo.IExtraBlockInfo;
import com.builtbroken.common.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.lib.IExtraInfo.IExtraBlockInfo;
public class BlockDebug extends BlockMachine implements IExtraBlockInfo
public class BlockDebug extends BlockRI implements IExtraBlockInfo
{
public static float DebugWattOut, DebugWattDemand;

View file

@ -15,7 +15,7 @@ import resonantinduction.old.transport.imprinter.ItemImprinter;
/** Extend this block class if a filter is allowed to be placed inside of this block.
*
* @author Calclavia */
public abstract class BlockImprintable extends BlockMachine
public abstract class BlockImprintable extends BlockRI
{
public BlockImprintable(String blockName, Material material)

View file

@ -1,37 +0,0 @@
package resonantinduction.core.prefab.block;
import net.minecraft.block.material.Material;
import net.minecraftforge.common.Configuration;
import resonantinduction.core.Reference;
import resonantinduction.core.ResonantInductionTabs;
import resonantinduction.core.Settings;
import universalelectricity.api.UniversalElectricity;
import calclavia.lib.prefab.block.BlockTile;
/**
* Basic prefab for machine
* @author DarkGuardsman
*
*/
public class BlockMachine extends BlockTile
{
public BlockMachine(String name)
{
this(name, UniversalElectricity.machine);
}
public BlockMachine(String name, Material material)
{
this(Settings.getNextBlockID(), name, material);
}
public BlockMachine(int id, String name, Material material)
{
super(Settings.CONFIGURATION.get(Configuration.CATEGORY_BLOCK, name, id).getInt(id), material);
this.setCreativeTab(ResonantInductionTabs.CORE);
this.setUnlocalizedName(Reference.PREFIX + name);
this.setTextureName(Reference.PREFIX + name);
this.setHardness(1f);
}
}

View file

@ -0,0 +1,39 @@
package resonantinduction.core.prefab.block;
import net.minecraft.block.material.Material;
import net.minecraftforge.common.Configuration;
import resonantinduction.core.Reference;
import resonantinduction.core.ResonantInductionTabs;
import resonantinduction.core.Settings;
import universalelectricity.api.UniversalElectricity;
import calclavia.lib.prefab.block.BlockTile;
/**
* Basic prefab for machine
*
* @author DarkGuardsman
*
*/
public class BlockRI extends BlockTile
{
public BlockRI(String name)
{
this(name, UniversalElectricity.machine);
}
public BlockRI(String name, Material material)
{
this(Settings.getNextBlockID(), name, material);
}
public BlockRI(int id, String name, Material material)
{
super(Settings.CONFIGURATION.get(Configuration.CATEGORY_BLOCK, name, id).getInt(id), material);
this.setCreativeTab(ResonantInductionTabs.CORE);
this.setUnlocalizedName(Reference.PREFIX + name);
this.setTextureName(Reference.PREFIX + name);
this.setHardness(1f);
}
}

View file

@ -12,13 +12,13 @@ import net.minecraftforge.common.ForgeDirection;
import resonantinduction.core.ResonantInduction;
import resonantinduction.core.network.ISimplePacketReceiver;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.content.IExtraInfo.IExtraTileEntityInfo;
import calclavia.lib.network.PacketHandler;
import com.google.common.io.ByteArrayDataInput;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.common.network.Player;
import dark.lib.IExtraInfo.IExtraTileEntityInfo;
import dark.lib.interfaces.IExternalInv;
import dark.lib.interfaces.IInvBox;

View file

@ -1,4 +1,4 @@
package resonantinduction.old.client.render;
package resonantinduction.core.render;
import java.util.HashMap;
import java.util.Map;
@ -15,6 +15,9 @@ import net.minecraftforge.fluids.FluidStack;
import org.lwjgl.opengl.GL11;
import resonantinduction.old.client.render.RenderBlockEntity;
import resonantinduction.render.BlockRenderInfo;
public class RenderFluidHelper
{

View file

@ -17,6 +17,7 @@ import net.minecraftforge.oredict.OreDictionary;
import resonantinduction.core.Reference;
import resonantinduction.core.Settings;
import resonantinduction.old.core.recipe.RecipeLoader;
import calclavia.lib.content.IExtraInfo.IExtraBlockInfo;
import calclavia.lib.ore.OreGenReplaceStone;
import com.builtbroken.common.Pair;
@ -24,7 +25,6 @@ import com.builtbroken.common.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.lib.EnumMaterial;
import dark.lib.IExtraInfo.IExtraBlockInfo;
public class BlockOre extends Block implements IExtraBlockInfo
{

View file

@ -128,8 +128,8 @@ public class ResourceGenerator
}
catch (Exception e)
{
System.out.println("Failed to compute colors for: " + theIngot);
e.printStackTrace();
ResonantInduction.LOGGER.fine("Failed to compute colors for: " + theIngot);
//e.printStackTrace();
}
}

View file

@ -2,6 +2,7 @@ package resonantinduction.core.resource.item;
import java.util.List;
import calclavia.lib.content.IExtraInfo.IExtraItemInfo;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
@ -13,7 +14,6 @@ import resonantinduction.core.Settings;
import resonantinduction.core.prefab.item.ItemBase;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.lib.IExtraInfo.IExtraItemInfo;
/**
* A meta data item containing parts of various crafting recipes. These parts do not do anything but

View file

@ -12,9 +12,10 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.Configuration;
import resonantinduction.core.ResonantInduction;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.mechanical.render.MechanicalBlockRenderingHandler;
import resonantinduction.old.client.render.RenderArmbot;
import calclavia.lib.content.IExtraInfo.IExtraBlockInfo;
import calclavia.lib.multiblock.link.IBlockActivate;
import calclavia.lib.multiblock.link.IMultiBlock;
@ -22,9 +23,8 @@ import com.builtbroken.common.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.lib.IExtraInfo.IExtraBlockInfo;
public class BlockArmbot extends BlockMachine implements IExtraBlockInfo
public class BlockArmbot extends BlockRI implements IExtraBlockInfo
{
public BlockArmbot()
{

View file

@ -2,12 +2,12 @@ package resonantinduction.electrical.generator.solar;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.electrical.render.ElectricalBlockRenderingHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockSolarPanel extends BlockMachine
public class BlockSolarPanel extends BlockRI
{
public BlockSolarPanel()
{

View file

@ -7,12 +7,12 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.core.Reference;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.electrical.render.ElectricalBlockRenderingHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockLevitator extends BlockMachine
public class BlockLevitator extends BlockRI
{
public BlockLevitator()
{

View file

@ -5,8 +5,10 @@ import resonantinduction.core.Reference;
import resonantinduction.core.ResonantInduction;
import resonantinduction.core.Settings;
import resonantinduction.mechanical.belt.BlockConveyorBelt;
import resonantinduction.old.core.recipe.RecipeLoader;
import resonantinduction.old.transport.ResonantInductionTransport;
import resonantinduction.mechanical.belt.TileConveyorBelt;
import resonantinduction.mechanical.fluid.tank.BlockTank;
import resonantinduction.mechanical.fluid.tank.TileTank;
import calclavia.lib.content.ContentRegistry;
import calclavia.lib.network.PacketHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
@ -17,7 +19,6 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import dark.lib.CoreRegistry;
/**
* Resonant Induction Archaic Module
@ -42,13 +43,16 @@ public class Mechanical
@Mod.Metadata(ID)
public static ModMetadata metadata;
public static final ContentRegistry contentRegistry = new ContentRegistry(Settings.CONFIGURATION, ID);
public static Block blockConveyorBelt;
public static Block blockTank;
@EventHandler
public void preInit(FMLPreInitializationEvent evt)
{
NetworkRegistry.instance().registerGuiHandler(this, proxy);
blockConveyorBelt = CoreRegistry.createNewBlock("RIConveyorBelt", ID, BlockConveyorBelt.class);
blockConveyorBelt = contentRegistry.createTile(BlockConveyorBelt.class, TileConveyorBelt.class);
blockTank = contentRegistry.createTile(BlockTank.class, TileTank.class);
proxy.preInit();
}

View file

@ -1,9 +1,7 @@
package resonantinduction.mechanical.belt;
import java.util.List;
import java.util.Set;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
@ -15,384 +13,347 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.mechanical.belt.TileConveyorBelt.SlantType;
import resonantinduction.mechanical.render.MechanicalBlockRenderingHandler;
import resonantinduction.old.client.render.RenderConveyorBelt;
import com.builtbroken.common.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.lib.IExtraInfo.IExtraBlockInfo;
/** The block for the actual conveyor belt!
/**
* The block for the actual conveyor belt!
*
* @author Calclavia, DarkGuardsman */
public class BlockConveyorBelt extends BlockMachine implements IExtraBlockInfo
* @author Calclavia, DarkGuardsman
*/
public class BlockConveyorBelt extends BlockRI
{
public BlockConveyorBelt()
{
super("conveyorBelt");
this.setBlockBounds(0, 0, 0, 1, 0.3f, 1);
}
public BlockConveyorBelt()
{
super("conveyorBelt");
this.setBlockBounds(0, 0, 0, 1, 0.3f, 1);
}
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
{
if (world.getBlockTileEntity(x, y, z) instanceof TileConveyorBelt)
{
TileConveyorBelt tileEntity = (TileConveyorBelt) world.getBlockTileEntity(x, y, z);
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
{
if (world.getBlockTileEntity(x, y, z) instanceof TileConveyorBelt)
{
TileConveyorBelt tileEntity = (TileConveyorBelt) world.getBlockTileEntity(x, y, z);
if (tileEntity.getSlant() == SlantType.UP || tileEntity.getSlant() == SlantType.DOWN)
{
this.setBlockBounds(0f, 0f, 0f, 1f, 0.96f, 1f);
return;
}
if (tileEntity.getSlant() == SlantType.TOP)
{
this.setBlockBounds(0f, 0.68f, 0f, 1f, 0.96f, 1f);
return;
}
}
if (tileEntity.getSlant() == SlantType.UP || tileEntity.getSlant() == SlantType.DOWN)
{
this.setBlockBounds(0f, 0f, 0f, 1f, 0.96f, 1f);
return;
}
if (tileEntity.getSlant() == SlantType.TOP)
{
this.setBlockBounds(0f, 0.68f, 0f, 1f, 0.96f, 1f);
return;
}
}
this.setBlockBounds(0f, 0f, 0f, 1f, 0.3f, 1f);
}
this.setBlockBounds(0f, 0f, 0f, 1f, 0.3f, 1f);
}
@Override
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z)
{
TileEntity t = world.getBlockTileEntity(x, y, z);
@Override
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z)
{
TileEntity t = world.getBlockTileEntity(x, y, z);
if (t != null && t instanceof TileConveyorBelt)
{
TileConveyorBelt tileEntity = (TileConveyorBelt) t;
if (t != null && t instanceof TileConveyorBelt)
{
TileConveyorBelt tileEntity = (TileConveyorBelt) t;
if (tileEntity.getSlant() == SlantType.UP || tileEntity.getSlant() == SlantType.DOWN)
{
return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, (double) x + 1, (double) y + 1, (double) z + 1);
}
if (tileEntity.getSlant() == SlantType.TOP)
{
return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, (double) y + 0.68f, z + this.minZ, x + this.maxX, (double) y + 0.98f, z + this.maxZ);
}
}
if (tileEntity.getSlant() == SlantType.UP || tileEntity.getSlant() == SlantType.DOWN)
{
return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, (double) x + 1, (double) y + 1, (double) z + 1);
}
if (tileEntity.getSlant() == SlantType.TOP)
{
return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, (double) y + 0.68f, z + this.minZ, x + this.maxX, (double) y + 0.98f, z + this.maxZ);
}
}
return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
}
return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
}
@Override
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
{
@Override
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
{
TileEntity t = world.getBlockTileEntity(x, y, z);
TileEntity t = world.getBlockTileEntity(x, y, z);
if (t != null && t instanceof TileConveyorBelt)
{
TileConveyorBelt tileEntity = (TileConveyorBelt) t;
if (t != null && t instanceof TileConveyorBelt)
{
TileConveyorBelt tileEntity = (TileConveyorBelt) t;
if (tileEntity.getSlant() == SlantType.UP || tileEntity.getSlant() == SlantType.DOWN)
{
AxisAlignedBB boundBottom = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 0.3, z + 1);
AxisAlignedBB boundTop = null;
if (tileEntity.getSlant() == SlantType.UP || tileEntity.getSlant() == SlantType.DOWN)
{
AxisAlignedBB boundBottom = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 0.3, z + 1);
AxisAlignedBB boundTop = null;
ForgeDirection direction = tileEntity.getDirection();
ForgeDirection direction = tileEntity.getDirection();
if (tileEntity.getSlant() == SlantType.UP)
{
if (direction.offsetX > 0)
{
boundTop = AxisAlignedBB.getAABBPool().getAABB(x + (float) direction.offsetX / 2, y, z, x + 1, y + 0.8, z + 1);
}
else if (direction.offsetX < 0)
{
boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + (float) direction.offsetX / -2, y + 0.8, z + 1);
}
else if (direction.offsetZ > 0)
{
boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z + (float) direction.offsetZ / 2, x + 1, y + 0.8, z + 1);
}
else if (direction.offsetZ < 0)
{
boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 0.8, z + (float) direction.offsetZ / -2);
}
}
else if (tileEntity.getSlant() == SlantType.DOWN)
{
if (direction.offsetX > 0)
{
boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + (float) direction.offsetX / 2, y + 0.8, z + 1);
}
else if (direction.offsetX < 0)
{
boundTop = AxisAlignedBB.getAABBPool().getAABB(x + (float) direction.offsetX / -2, y, z, x + 1, y + 0.8, z + 1);
}
else if (direction.offsetZ > 0)
{
boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 0.8, z + (float) direction.offsetZ / 2);
}
else if (direction.offsetZ < 0)
{
boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z + (float) direction.offsetZ / -2, x + 1, y + 0.8, z + 1);
}
}
if (tileEntity.getSlant() == SlantType.UP)
{
if (direction.offsetX > 0)
{
boundTop = AxisAlignedBB.getAABBPool().getAABB(x + (float) direction.offsetX / 2, y, z, x + 1, y + 0.8, z + 1);
}
else if (direction.offsetX < 0)
{
boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + (float) direction.offsetX / -2, y + 0.8, z + 1);
}
else if (direction.offsetZ > 0)
{
boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z + (float) direction.offsetZ / 2, x + 1, y + 0.8, z + 1);
}
else if (direction.offsetZ < 0)
{
boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 0.8, z + (float) direction.offsetZ / -2);
}
}
else if (tileEntity.getSlant() == SlantType.DOWN)
{
if (direction.offsetX > 0)
{
boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + (float) direction.offsetX / 2, y + 0.8, z + 1);
}
else if (direction.offsetX < 0)
{
boundTop = AxisAlignedBB.getAABBPool().getAABB(x + (float) direction.offsetX / -2, y, z, x + 1, y + 0.8, z + 1);
}
else if (direction.offsetZ > 0)
{
boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 0.8, z + (float) direction.offsetZ / 2);
}
else if (direction.offsetZ < 0)
{
boundTop = AxisAlignedBB.getAABBPool().getAABB(x, y, z + (float) direction.offsetZ / -2, x + 1, y + 0.8, z + 1);
}
}
if (par5AxisAlignedBB.intersectsWith(boundBottom))
{
par6List.add(boundBottom);
}
if (boundTop != null && par5AxisAlignedBB.intersectsWith(boundTop))
{
par6List.add(boundTop);
}
if (par5AxisAlignedBB.intersectsWith(boundBottom))
{
par6List.add(boundBottom);
}
if (boundTop != null && par5AxisAlignedBB.intersectsWith(boundTop))
{
par6List.add(boundTop);
}
return;
}
return;
}
if (tileEntity.getSlant() == SlantType.TOP)
{
AxisAlignedBB newBounds = AxisAlignedBB.getAABBPool().getAABB(x, y + 0.68, z, x + 1, y + 0.98, z + 1);
if (tileEntity.getSlant() == SlantType.TOP)
{
AxisAlignedBB newBounds = AxisAlignedBB.getAABBPool().getAABB(x, y + 0.68, z, x + 1, y + 0.98, z + 1);
if (newBounds != null && par5AxisAlignedBB.intersectsWith(newBounds))
{
par6List.add(newBounds);
}
if (newBounds != null && par5AxisAlignedBB.intersectsWith(newBounds))
{
par6List.add(newBounds);
}
return;
}
}
return;
}
}
AxisAlignedBB newBounds = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 0.3, z + 1);
AxisAlignedBB newBounds = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 0.3, z + 1);
if (newBounds != null && par5AxisAlignedBB.intersectsWith(newBounds))
{
par6List.add(newBounds);
}
}
if (newBounds != null && par5AxisAlignedBB.intersectsWith(newBounds))
{
par6List.add(newBounds);
}
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase par5EntityLiving, ItemStack stack)
{
super.onBlockPlacedBy(world, x, y, z, par5EntityLiving, stack);
int angle = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
int change = 2;
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase par5EntityLiving, ItemStack stack)
{
super.onBlockPlacedBy(world, x, y, z, par5EntityLiving, stack);
int angle = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
int change = 2;
switch (angle)
{
case 0:
change = 3;
break;
case 1:
change = 4;
break;
case 2:
change = 2;
break;
case 3:
change = 5;
break;
switch (angle)
{
case 0:
change = 3;
break;
case 1:
change = 4;
break;
case 2:
change = 2;
break;
case 3:
change = 5;
break;
}
world.setBlockMetadataWithNotify(x, y, z, change, 3);
}
}
world.setBlockMetadataWithNotify(x, y, z, change, 3);
}
@Override
public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ)
{
int original = world.getBlockMetadata(x, y, z);
int change = 2;
@Override
public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ)
{
int original = world.getBlockMetadata(x, y, z);
int change = 2;
switch (original)
{
case 2:
change = 4;
break;
case 3:
change = 5;
break;
case 4:
change = 3;
break;
case 5:
change = 2;
break;
switch (original)
{
case 2:
change = 4;
break;
case 3:
change = 5;
break;
case 4:
change = 3;
break;
case 5:
change = 2;
break;
}
}
world.setBlockMetadataWithNotify(x, y, z, change, 3);
world.setBlockMetadataWithNotify(x, y, z, change, 3);
return true;
}
return true;
}
@Override
public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ)
{
TileConveyorBelt tileEntity = (TileConveyorBelt) world.getBlockTileEntity(x, y, z);
@Override
public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ)
{
TileConveyorBelt tileEntity = (TileConveyorBelt) world.getBlockTileEntity(x, y, z);
int slantOrdinal = tileEntity.getSlant().ordinal() + 1;
int slantOrdinal = tileEntity.getSlant().ordinal() + 1;
if (slantOrdinal >= SlantType.values().length)
{
slantOrdinal = 0;
}
if (slantOrdinal >= SlantType.values().length)
{
slantOrdinal = 0;
}
tileEntity.setSlant(SlantType.values()[slantOrdinal]);
tileEntity.setSlant(SlantType.values()[slantOrdinal]);
return true;
}
return true;
}
/** Moves the entity if the conductor is powered. */
@Override
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
{
TileConveyorBelt tileEntity = (TileConveyorBelt) world.getBlockTileEntity(x, y, z);
if (tileEntity.IgnoreList.contains(entity))
{
return;
}
if (tileEntity.isFunctioning() && !world.isBlockIndirectlyGettingPowered(x, y, z))
{
float acceleration = tileEntity.acceleration;
float maxSpeed = tileEntity.maxSpeed;
/** Moves the entity if the conductor is powered. */
@Override
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
{
TileConveyorBelt tileEntity = (TileConveyorBelt) world.getBlockTileEntity(x, y, z);
if (tileEntity.IgnoreList.contains(entity))
{
return;
}
if (tileEntity.isFunctioning() && !world.isBlockIndirectlyGettingPowered(x, y, z))
{
float acceleration = tileEntity.acceleration;
float maxSpeed = tileEntity.maxSpeed;
SlantType slantType = tileEntity.getSlant();
ForgeDirection direction = tileEntity.getDirection();
SlantType slantType = tileEntity.getSlant();
ForgeDirection direction = tileEntity.getDirection();
if (entity instanceof EntityLiving)
{
acceleration *= 5;
maxSpeed *= 10;
}
if (slantType == SlantType.UP)
{
if (entity.motionY < 0.2)
{
entity.addVelocity(0, 0.2, 0);
}
}
else if (slantType == SlantType.DOWN)
{
if (entity.motionY > -0.1)
{
entity.addVelocity(0, -0.1, 0);
}
}
// Move the entity based on the conveyor belt's direction.
entity.addVelocity(direction.offsetX * acceleration, 0, direction.offsetZ * acceleration);
if (entity instanceof EntityLiving)
{
acceleration *= 5;
maxSpeed *= 10;
}
if (slantType == SlantType.UP)
{
if (entity.motionY < 0.2)
{
entity.addVelocity(0, 0.2, 0);
}
}
else if (slantType == SlantType.DOWN)
{
if (entity.motionY > -0.1)
{
entity.addVelocity(0, -0.1, 0);
}
}
// Move the entity based on the conveyor belt's direction.
entity.addVelocity(direction.offsetX * acceleration, 0, direction.offsetZ * acceleration);
if (direction.offsetX != 0 && Math.abs(entity.motionX) > maxSpeed)
{
entity.motionX = direction.offsetX * maxSpeed;
entity.motionZ = 0;
}
if (direction.offsetX != 0 && Math.abs(entity.motionX) > maxSpeed)
{
entity.motionX = direction.offsetX * maxSpeed;
entity.motionZ = 0;
}
if (direction.offsetZ != 0 && Math.abs(entity.motionZ) > maxSpeed)
{
entity.motionZ = direction.offsetZ * maxSpeed;
entity.motionX = 0;
}
if (direction.offsetZ != 0 && Math.abs(entity.motionZ) > maxSpeed)
{
entity.motionZ = direction.offsetZ * maxSpeed;
entity.motionX = 0;
}
entity.motionY += 0.0125f;
entity.motionY += 0.0125f;
if (entity instanceof EntityItem)
{
if (direction.offsetX != 0)
{
double difference = (z + 0.5) - entity.posZ;
entity.motionZ += difference * 0.1;
// entity.posZ = z + 0.5;
}
else if (direction.offsetZ != 0)
{
double difference = (x + 0.5) - entity.posX;
entity.motionX += difference * 0.1;
// /entity.posX = x + 0.5;
}
if (entity instanceof EntityItem)
{
if (direction.offsetX != 0)
{
double difference = (z + 0.5) - entity.posZ;
entity.motionZ += difference * 0.1;
// entity.posZ = z + 0.5;
}
else if (direction.offsetZ != 0)
{
double difference = (x + 0.5) - entity.posX;
entity.motionX += difference * 0.1;
// /entity.posX = x + 0.5;
}
((EntityItem) entity).age++;
((EntityItem) entity).age++;
boolean foundSneaking = false;
for (EntityPlayer player : (List<EntityPlayer>) world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x - 1, y - 1, z - 1, x + 1, y + 1, z + 1)))
{
if (player.isSneaking())
foundSneaking = true;
}
boolean foundSneaking = false;
for (EntityPlayer player : (List<EntityPlayer>) world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x - 1, y - 1, z - 1, x + 1, y + 1, z + 1)))
{
if (player.isSneaking())
foundSneaking = true;
}
if (foundSneaking)
((EntityItem) entity).delayBeforeCanPickup = 0;
else
((EntityItem) entity).delayBeforeCanPickup = 20;
entity.onGround = false;
}
if (foundSneaking)
((EntityItem) entity).delayBeforeCanPickup = 0;
else
((EntityItem) entity).delayBeforeCanPickup = 20;
entity.onGround = false;
}
}
}
}
}
@Override
@SideOnly(Side.CLIENT)
public void getClientTileEntityRenderers(List<Pair<Class<? extends TileEntity>, TileEntitySpecialRenderer>> list)
{
list.add(new Pair<Class<? extends TileEntity>, TileEntitySpecialRenderer>(TileConveyorBelt.class, new RenderConveyorBelt()));
}
/** Returns the TileEntity used by this block. */
@Override
public TileEntity createNewTileEntity(World var1)
{
return new TileConveyorBelt();
}
@Override
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
{
list.add(new Pair<String, Class<? extends TileEntity>>("ALConveyorBelt", TileConveyorBelt.class));
}
@SideOnly(Side.CLIENT)
@Override
public int getRenderType()
{
return MechanicalBlockRenderingHandler.BLOCK_RENDER_ID;
}
/** Returns the TileEntity used by this block. */
@Override
public TileEntity createNewTileEntity(World var1)
{
return new TileConveyorBelt();
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@SideOnly(Side.CLIENT)
@Override
public int getRenderType()
{
return MechanicalBlockRenderingHandler.BLOCK_RENDER_ID;
}
@Override
@SideOnly(Side.CLIENT)
public boolean renderAsNormalBlock()
{
return false;
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean renderAsNormalBlock()
{
return false;
}
@Override
public int damageDropped(int par1)
{
return 0;
}
@Override
public boolean hasExtraConfigs()
{
return false;
}
@Override
public void loadExtraConfigs(Configuration config)
{
// TODO Auto-generated method stub
}
@Override
public void loadOreNames()
{
// TODO Auto-generated method stub
}
@Override
public int damageDropped(int par1)
{
return 0;
}
}

View file

@ -1,4 +1,4 @@
package resonantinduction.old.client.render;
package resonantinduction.mechanical.belt;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;

View file

@ -1,114 +0,0 @@
package resonantinduction.mechanical.fluid;
import java.util.Set;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import resonantinduction.core.Settings;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.old.client.render.BlockRenderHelper;
import calclavia.lib.utility.FluidHelper;
import com.builtbroken.common.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockKitchenSink extends BlockMachine
{
public BlockKitchenSink()
{
super(Settings.CONFIGURATION, "FluidSink", Material.iron);
this.setResistance(4f);
this.setHardness(4f);
}
@Override
public TileEntity createNewTileEntity(World var1)
{
return new TileKitchenSink();
}
@Override
public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ)
{
return FluidHelper.playerActivatedFluidItem(world, x, y, z, entityplayer, side);
}
@Override
public boolean onUseWrench(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ)
{
int meta = par1World.getBlockMetadata(x, y, z);
int metaGroup = meta % 4;
if (meta == (metaGroup * 4) + 3)
{
par1World.setBlockMetadataWithNotify(x, y, z, (metaGroup * 4), 3);
return true;
}
else
{
par1World.setBlockMetadataWithNotify(x, y, z, meta + 1, 3);
return true;
}
// return false;
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase par5EntityLiving, ItemStack itemStack)
{
int meta = world.getBlockMetadata(x, y, z);
int angle = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
TileEntity ent = world.getBlockTileEntity(x, y, z);
world.setBlockMetadataWithNotify(x, y, z, angle * 4, 3);
if (ent instanceof TileEntityAdvanced)
{
((TileEntityAdvanced) world.getBlockTileEntity(x, y, z)).initiate();
}
world.notifyBlocksOfNeighborChange(x, y, z, this.blockID);
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
int meta = world.getBlockMetadata(x, y, z);
return new ItemStack(this, 1, 0);
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean renderAsNormalBlock()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderType()
{
return BlockRenderHelper.renderID;
}
@Override
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
{
list.add(new Pair<String, Class<? extends TileEntity>>("FluidSink", TileKitchenSink.class));
}
}

View file

@ -10,7 +10,7 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import resonantinduction.core.Settings;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.old.core.recipe.RecipeLoader;
import com.builtbroken.common.Pair;
@ -18,11 +18,11 @@ import com.builtbroken.common.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockReleaseValve extends BlockMachine
public class BlockReleaseValve extends BlockRI
{
public BlockReleaseValve()
{
super(Settings.CONFIGURATION, "ReleaseValve", Material.iron);
super("ReleaseValve");
this.setHardness(1f);
this.setResistance(5f);
}
@ -77,17 +77,4 @@ public class BlockReleaseValve extends BlockMachine
super.onNeighborBlockChange(par1World, x, y, z, side);
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
return new ItemStack(RecipeLoader.blockReleaseValve, 1, 0);
}
@Override
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
{
list.add(new Pair<String, Class<? extends TileEntity>>("ReleaseValve", TileEntityReleaseValve.class));
}
}

View file

@ -1,91 +0,0 @@
package resonantinduction.mechanical.fluid;
import java.util.Random;
import java.util.Set;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import resonantinduction.core.Settings;
import resonantinduction.core.prefab.block.BlockMachine;
import com.builtbroken.common.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockSteamPiston extends BlockMachine
{
public BlockSteamPiston()
{
super(Settings.CONFIGURATION, "SteamEngine", Material.iron);
}
@Override
public boolean onUseWrench(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ)
{
int angle = MathHelper.floor_double((par5EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
int metadata = par1World.getBlockMetadata(x, y, z);
if (metadata < 3)
{
par1World.setBlock(x, y, z, blockID, metadata + angle, 3);
}
else
{
par1World.setBlock(x, y, z, blockID, 0, 3);
}
return true;
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean renderAsNormalBlock()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderType()
{
return -1;
}
@Override
public TileEntity createNewTileEntity(World world)
{
return new TileEntitySteamPiston();
}
@Override
public int idDropped(int par1, Random par2Random, int par3)
{
return this.blockID;
}
@Override
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
int var5 = par1World.getBlockId(par2, par3, par4);
int var6 = par1World.getBlockId(par2, par3 + 1, par4);
return (var5 == 0 || blocksList[var5].blockMaterial.isReplaceable()) && (var6 == 0 || blocksList[var6].blockMaterial.isReplaceable());
}
@Override
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
{
list.add(new Pair<String, Class<? extends TileEntity>>("FMSteamPiston", TileEntitySteamPiston.class));
}
}

View file

@ -1,153 +0,0 @@
package resonantinduction.mechanical.fluid;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.Configuration;
import resonantinduction.core.Settings;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.mechanical.fluid.pipes.FluidPartsMaterial;
import resonantinduction.mechanical.fluid.pipes.ItemBlockPipe;
import resonantinduction.mechanical.fluid.pipes.TileEntityPipe;
import resonantinduction.old.client.render.BlockRenderHelper;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.utility.FluidHelper;
import calclavia.lib.utility.HelperMethods;
import com.builtbroken.common.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockTank extends BlockMachine
{
public static int tankVolume = 16;
public BlockTank()
{
super(Settings.CONFIGURATION, "FluidTank", Material.rock);
this.setHardness(1f);
this.setResistance(5f);
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean renderAsNormalBlock()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderType()
{
return BlockRenderHelper.renderID;
}
@Override
public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ)
{
return FluidHelper.playerActivatedFluidItem(world, x, y, z, entityplayer, side);
}
@Override
public TileEntity createNewTileEntity(World var1)
{
return new TileEntityTank();
}
@Override
public boolean hasComparatorInputOverride()
{
return true;
}
@Override
public int getComparatorInputOverride(World world, int x, int y, int z, int par5)
{
TileEntityTank tileEntity = (TileEntityTank) world.getBlockTileEntity(x, y, z);
if (tileEntity != null && tileEntity.getTileNetwork().getNetworkTankInfo().fluid != null)
{
return 15 * (tileEntity.getTileNetwork().getNetworkTankInfo().fluid.amount / tileEntity.getTileNetwork().getNetworkTankInfo().capacity);
}
return 0;
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
return new ItemStack(this, 1, FluidPartsMaterial.getDropItemMeta(world, x, y, z));
}
@Override
public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
{
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
TileEntity entity = world.getBlockTileEntity(x, y, z);
if (entity instanceof TileEntityPipe)
{
ret.add(new ItemStack(this, 1, FluidPartsMaterial.getDropItemMeta(world, x, y, z)));
}
return ret;
}
@SuppressWarnings("unchecked")
@Override
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
for (FluidPartsMaterial data : FluidPartsMaterial.values())
{
par3List.add(new ItemStack(this, 1, data.ordinal() * FluidPartsMaterial.spacing));
}
}
@Override
public boolean onSneakMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ)
{
if (!world.isRemote)
{
ItemStack dropStack = ItemBlockPipe.getWrenchedItem(world, new Vector3(x, y, z));
if (dropStack != null)
{
if (entityPlayer.getHeldItem() == null)
{
entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, dropStack);
}
else
{
HelperMethods.dropItemStack(world, new Vector3(x, y, z), dropStack, false);
}
world.setBlockToAir(x, y, z);
}
}
return true;
}
@Override
public void loadExtraConfigs(Configuration config)
{
BlockTank.tankVolume = config.get("settings", "TankBucketVolume", 16, "Number of buckets each tank block can store, Settings this to zero is the same as one").getInt();
}
@Override
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
{
list.add(new Pair<String, Class<? extends TileEntity>>("FluidTank", TileEntityTank.class));
}
}

View file

@ -1,90 +0,0 @@
package resonantinduction.mechanical.fluid;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.StatCollector;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.ItemFluidContainer;
import resonantinduction.core.ResonantInductionTabs;
import resonantinduction.old.transport.ResonantInductionTransport;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* Small fluid can that is designed to store up to one bucket of fluid. Doesn't work like a bucket
* as it is sealed with a pressure cap. This can is designed to work with tools or machines only.
*
* @author DarkGuardsman
*/
public class ItemFluidCan extends ItemFluidContainer
{
public static final String FLUID_NBT = "FluidStack";
@SideOnly(Side.CLIENT)
public Icon[] icons;
public ItemFluidCan()
{
super(ResonantInductionTransport.CONFIGURATION.getItem("FluidCan", DarkCore.getNextItemId()).getInt());
this.setUnlocalizedName("FluidCan");
this.setCreativeTab(ResonantInductionTabs.tabHydraulic());
this.setMaxStackSize(1);
this.setMaxDamage(100);
this.setNoRepair();
this.capacity = FluidContainerRegistry.BUCKET_VOLUME * 2;
this.setContainerItem(this);
}
@Override
public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack)
{
FluidStack fluidStack = this.drain(par1ItemStack, Integer.MAX_VALUE, false);
if (fluidStack != null)
{
return false;
}
return true;
}
@Override
public String getItemDisplayName(ItemStack par1ItemStack)
{
String fluid = "";
FluidStack fluidStack = this.drain(par1ItemStack, Integer.MAX_VALUE, false);
if (fluidStack != null)
{
fluid = fluidStack.getFluid().getLocalizedName();
}
return ("" + (fluid + " " + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(par1ItemStack) + ".name"))).trim();
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
FluidStack fluidStack = this.drain(par1ItemStack, Integer.MAX_VALUE, false);
if (fluidStack != null)
{
par3List.add("Volume: " + fluidStack.amount + "mb");
}
}
@Override
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
par3List.add(new ItemStack(this));
ItemStack waterCan = new ItemStack(this);
this.fill(waterCan, new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME), true);
par3List.add(waterCan);
ItemStack lavaCan = new ItemStack(this);
this.fill(lavaCan, new FluidStack(FluidRegistry.LAVA, FluidContainerRegistry.BUCKET_VOLUME), true);
par3List.add(lavaCan);
}
}

View file

@ -1,112 +0,0 @@
package resonantinduction.mechanical.fluid;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.packet.Packet;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import resonantinduction.core.network.ISimplePacketReceiver;
import resonantinduction.mechanical.fluid.prefab.TileEntityFluidStorage;
import resonantinduction.old.transport.ResonantInductionTransport;
import calclavia.lib.network.PacketHandler;
import com.google.common.io.ByteArrayDataInput;
import cpw.mods.fml.common.network.Player;
import dark.lib.helpers.ColorCode;
public class TileKitchenSink extends TileEntityFluidStorage implements ISimplePacketReceiver
{
@Override
public int getTankSize()
{
return FluidContainerRegistry.BUCKET_VOLUME * 2;
}
@Override
public void updateEntity()
{
if (!worldObj.isRemote)
{
if (ticks % (random.nextInt(5) * 10 + 20) == 0)
{
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
}
}
}
@Override
public Packet getDescriptionPacket()
{
FluidStack stack = new FluidStack(FluidRegistry.WATER, 0);
if (this.getTank().getFluid() != null)
{
stack = this.getTank().getFluid();
}
return PacketHandler.instance().getTilePacket(ResonantInductionTransport.CHANNEL, "FluidLevel", this, stack.writeToNBT(new NBTTagCompound()));
}
@Override
public boolean simplePacket(String id, ByteArrayDataInput data, Player player)
{
try
{
if (id.equalsIgnoreCase("FluidLevel"))
{
this.getTank().setFluid(FluidStack.loadFluidStackFromNBT(PacketHandler.instance().readNBTTagCompound(data)));
return true;
}
}
catch (Exception e)
{
e.printStackTrace();
return true;
}
return false;
}
@Override
public int fill(ForgeDirection side, FluidStack resource, boolean doFill)
{
int f = super.fill(side, resource, doFill);
if (doFill && f > 0)
{
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
}
return f;
}
@Override
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain)
{
// TODO Auto-generated method stub
return null;
}
@Override
public boolean canFill(ForgeDirection from, Fluid fluid)
{
return fluid != null && fluid.getName().equalsIgnoreCase("water") && from != ForgeDirection.UP;
}
@Override
public boolean canDrain(ForgeDirection from, Fluid fluid)
{
// TODO Auto-generated method stub
return false;
}
@Override
public boolean setColor(Object obj)
{
return false;
}
@Override
public ColorCode getColor()
{
return ColorCode.BLUE;
}
}

View file

@ -17,7 +17,7 @@ import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.FluidTankInfo;
import resonantinduction.core.Settings;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.utility.FluidHelper;
@ -28,147 +28,126 @@ import cpw.mods.fml.relauncher.SideOnly;
import dark.lib.helpers.ColorCode;
import dark.lib.helpers.ColorCode.IColorCoded;
public class BlockPipe extends BlockMachine
public class BlockPipe extends BlockRI
{
public static int waterFlowRate = 3000;
public static int waterFlowRate = 3000;
public BlockPipe()
{
super("fluidPipe", Material.iron);
this.setBlockBounds(0.30F, 0.30F, 0.30F, 0.70F, 0.70F, 0.70F);
this.setHardness(1f);
this.setResistance(3f);
public BlockPipe()
{
super(Settings.CONFIGURATION, "FluidPipe", Material.iron);
this.setBlockBounds(0.30F, 0.30F, 0.30F, 0.70F, 0.70F, 0.70F);
this.setHardness(1f);
this.setResistance(3f);
}
}
@Override
public void fillWithRain(World world, int x, int y, int z)
{
int meta = world.getBlockMetadata(x, y, z);
if (meta == FluidPartsMaterial.WOOD.ordinal() || meta == FluidPartsMaterial.STONE.ordinal())
{
// TODO fill pipe since it will have an open top and can gather rain
}
}
@Override
public void fillWithRain(World world, int x, int y, int z)
{
int meta = world.getBlockMetadata(x, y, z);
if (meta == FluidPartsMaterial.WOOD.ordinal() || meta == FluidPartsMaterial.STONE.ordinal())
{
// TODO fill pipe since it will have an open top and can gather rain
}
}
@Override
public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
{
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
TileEntity entity = world.getBlockTileEntity(x, y, z);
if (entity instanceof TileEntityPipe)
{
ret.add(new ItemStack(this, 1, FluidPartsMaterial.getDropItemMeta(world, x, y, z)));
}
return ret;
}
@Override
public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
{
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
TileEntity entity = world.getBlockTileEntity(x, y, z);
if (entity instanceof TileEntityPipe)
{
ret.add(new ItemStack(this, 1, FluidPartsMaterial.getDropItemMeta(world, x, y, z)));
}
return ret;
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
public boolean renderAsNormalBlock()
{
return false;
}
@Override
public boolean renderAsNormalBlock()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderType()
{
return -1;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderType()
{
return -1;
}
@Override
public TileEntity createNewTileEntity(World var1)
{
return new TileEntityPipe();
}
@Override
public TileEntity createNewTileEntity(World var1)
{
return new TileEntityPipe();
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
return new ItemStack(this, 1, FluidPartsMaterial.getDropItemMeta(world, x, y, z));
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
return new ItemStack(this, 1, FluidPartsMaterial.getDropItemMeta(world, x, y, z));
}
@Override
public boolean canSilkHarvest(World world, EntityPlayer player, int x, int y, int z, int metadata)
{
return false;
}
@Override
public boolean canSilkHarvest(World world, EntityPlayer player, int x, int y, int z, int metadata)
{
return false;
}
@Override
public int getLightValue(IBlockAccess world, int x, int y, int z)
{
if (world.getBlockMetadata(x, y, z) == FluidPartsMaterial.HELL.ordinal())
{
return 5;
}
return super.getLightValue(world, x, y, z);
}
@Override
public int getLightValue(IBlockAccess world, int x, int y, int z)
{
if (world.getBlockMetadata(x, y, z) == FluidPartsMaterial.HELL.ordinal())
{
return 5;
}
return super.getLightValue(world, x, y, z);
}
@Override
public boolean isLadder(World world, int x, int y, int z, EntityLivingBase entity)
{
return true;
}
@Override
public boolean isLadder(World world, int x, int y, int z, EntityLivingBase entity)
{
return true;
}
@Override
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
for (FluidPartsMaterial data : FluidPartsMaterial.values())
{
par3List.add(data.getStack());
}
}
@Override
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
for (FluidPartsMaterial data : FluidPartsMaterial.values())
{
par3List.add(data.getStack());
}
}
@Override
public void breakBlock(World world, int x, int y, int z, int par5, int par6)
{
TileEntity entity = world.getBlockTileEntity(x, y, z);
if (entity instanceof TileEntityPipe)
{
FluidTankInfo tank = ((TileEntityPipe) entity).getTankInfo()[0];
if (tank != null && tank.fluid != null && tank.fluid.getFluid() != null && tank.fluid.amount > 0)
{
((TileEntityPipe) entity).getTileNetwork().drainNetworkTank(world, FluidHelper.fillBlock(world, new Vector3(x, y, z), tank.fluid, true), true);
}
}
super.breakBlock(world, x, y, z, par5, par6);
@Override
public void breakBlock(World world, int x, int y, int z, int par5, int par6)
{
TileEntity entity = world.getBlockTileEntity(x, y, z);
if (entity instanceof TileEntityPipe)
{
FluidTankInfo tank = ((TileEntityPipe) entity).getTankInfo()[0];
if (tank != null && tank.fluid != null && tank.fluid.getFluid() != null && tank.fluid.amount > 0)
{
((TileEntityPipe) entity).getTileNetwork().drainNetworkTank(world, FluidHelper.fillBlock(world, new Vector3(x, y, z), tank.fluid, true), true);
}
}
super.breakBlock(world, x, y, z, par5, par6);
}
}
@Override
public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour)
{
if (world.getBlockTileEntity(x, y, z) instanceof IColorCoded)
{
return ((IColorCoded) world.getBlockTileEntity(x, y, z)).setColor(ColorCode.get(colour));
}
return false;
}
@Override
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
{
list.add(new Pair<String, Class<? extends TileEntity>>("FluidPipe", TileEntityPipe.class));
list.add(new Pair<String, Class<? extends TileEntity>>("ColoredPipe", TileEntityPipe.class));
}
@Override
public boolean hasExtraConfigs()
{
return true;
}
@Override
public void loadExtraConfigs(Configuration config)
{
BlockPipe.waterFlowRate = config.get("settings", "FlowRate", BlockPipe.waterFlowRate, "Base value for flow rate is based off of water. It is in milibuckets so 1000 equals one bucket of fluid").getInt();
}
@Override
public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour)
{
if (world.getBlockTileEntity(x, y, z) instanceof IColorCoded)
{
return ((IColorCoded) world.getBlockTileEntity(x, y, z)).setColor(ColorCode.get(colour));
}
return false;
}
}

View file

@ -14,8 +14,8 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import resonantinduction.mechanical.fluid.TileEntityTank;
import resonantinduction.mechanical.fluid.prefab.TileEntityFluidNetworkTile;
import resonantinduction.mechanical.fluid.tank.TileTank;
import resonantinduction.old.core.recipe.RecipeLoader;
import universalelectricity.api.vector.Vector3;
@ -52,10 +52,10 @@ public class ItemBlockPipe extends ItemBlock
public static ItemStack getWrenchedItem(World world, Vector3 vec)
{
TileEntity entity = vec.getTileEntity(world);
if (entity instanceof TileEntityTank && ((TileEntityTank) entity).getTankInfo() != null && ((TileEntityTank) entity).getTankInfo()[0] != null)
if (entity instanceof TileTank && ((TileTank) entity).getTankInfo() != null && ((TileTank) entity).getTankInfo()[0] != null)
{
ItemStack itemStack = new ItemStack(RecipeLoader.blockTank);
FluidStack stack = ((TileEntityTank) entity).getTankInfo()[0].fluid;
FluidStack stack = ((TileTank) entity).getTankInfo()[0].fluid;
if (itemStack.getTagCompound() == null)
{
@ -63,7 +63,7 @@ public class ItemBlockPipe extends ItemBlock
}
if (stack != null)
{
((TileEntityTank) entity).drain(ForgeDirection.UNKNOWN, stack.amount, true);
((TileTank) entity).drain(ForgeDirection.UNKNOWN, stack.amount, true);
itemStack.getTagCompound().setCompoundTag("fluid", stack.writeToNBT(new NBTTagCompound()));
}
return itemStack;

View file

@ -15,7 +15,7 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import resonantinduction.core.Reference;
import resonantinduction.core.Settings;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.core.tilenetwork.prefab.NetworkTileEntities;
import resonantinduction.old.client.render.BlockRenderHelper;
import resonantinduction.old.core.recipe.RecipeLoader;
@ -25,7 +25,7 @@ import com.builtbroken.common.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockConstructionPump extends BlockMachine
public class BlockConstructionPump extends BlockRI
{
public BlockConstructionPump()

View file

@ -16,11 +16,11 @@ import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.core.Reference;
import resonantinduction.core.Settings;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import com.builtbroken.common.Pair;
public class BlockDrain extends BlockMachine
public class BlockDrain extends BlockRI
{
private Icon blockIcon;
private Icon drainIcon;

View file

@ -11,7 +11,7 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.core.Settings;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.old.client.render.BlockRenderHelper;
import resonantinduction.old.core.recipe.RecipeLoader;
@ -20,7 +20,7 @@ import com.builtbroken.common.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockPumpMachine extends BlockMachine
public class BlockPumpMachine extends BlockRI
{
public BlockPumpMachine()

View file

@ -0,0 +1,139 @@
package resonantinduction.mechanical.fluid.tank;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.Configuration;
import resonantinduction.core.Settings;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.mechanical.fluid.pipes.FluidPartsMaterial;
import resonantinduction.mechanical.fluid.pipes.ItemBlockPipe;
import resonantinduction.mechanical.fluid.pipes.TileEntityPipe;
import resonantinduction.old.client.render.BlockRenderHelper;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.utility.FluidHelper;
import calclavia.lib.utility.HelperMethods;
import com.builtbroken.common.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockTank extends BlockRI
{
public static int tankVolume = 16;
public BlockTank()
{
super("tank");
this.setHardness(1f);
this.setResistance(5f);
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean renderAsNormalBlock()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderType()
{
return BlockRenderHelper.renderID;
}
@Override
public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ)
{
return FluidHelper.playerActivatedFluidItem(world, x, y, z, entityplayer, side);
}
@Override
public TileEntity createNewTileEntity(World var1)
{
return new TileTank();
}
@Override
public boolean hasComparatorInputOverride()
{
return true;
}
@Override
public int getComparatorInputOverride(World world, int x, int y, int z, int par5)
{
TileTank tileEntity = (TileTank) world.getBlockTileEntity(x, y, z);
if (tileEntity != null && tileEntity.getTileNetwork().getNetworkTankInfo().fluid != null)
{
return 15 * (tileEntity.getTileNetwork().getNetworkTankInfo().fluid.amount / tileEntity.getTileNetwork().getNetworkTankInfo().capacity);
}
return 0;
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
return new ItemStack(this, 1, FluidPartsMaterial.getDropItemMeta(world, x, y, z));
}
@Override
public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
{
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
TileEntity entity = world.getBlockTileEntity(x, y, z);
if (entity instanceof TileEntityPipe)
{
ret.add(new ItemStack(this, 1, FluidPartsMaterial.getDropItemMeta(world, x, y, z)));
}
return ret;
}
@SuppressWarnings("unchecked")
@Override
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
for (FluidPartsMaterial data : FluidPartsMaterial.values())
{
par3List.add(new ItemStack(this, 1, data.ordinal() * FluidPartsMaterial.spacing));
}
}
@Override
public boolean onSneakMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ)
{
if (!world.isRemote)
{
ItemStack dropStack = ItemBlockPipe.getWrenchedItem(world, new Vector3(x, y, z));
if (dropStack != null)
{
if (entityPlayer.getHeldItem() == null)
{
entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, dropStack);
}
else
{
HelperMethods.dropItemStack(world, new Vector3(x, y, z), dropStack, false);
}
world.setBlockToAir(x, y, z);
}
}
return true;
}
}

View file

@ -1,4 +1,4 @@
package resonantinduction.mechanical.fluid;
package resonantinduction.mechanical.fluid.tank;
import java.util.ArrayList;
import java.util.List;

View file

@ -1,4 +1,4 @@
package resonantinduction.mechanical.fluid;
package resonantinduction.mechanical.fluid.tank;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;

View file

@ -1,4 +1,4 @@
package resonantinduction.mechanical.fluid;
package resonantinduction.mechanical.fluid.tank;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;

View file

@ -1,4 +1,4 @@
package resonantinduction.old.client.render;
package resonantinduction.mechanical.fluid.tank;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
@ -8,7 +8,7 @@ import net.minecraftforge.fluids.FluidStack;
import org.lwjgl.opengl.GL11;
import resonantinduction.mechanical.fluid.TileEntityTank;
import resonantinduction.core.render.RenderFluidHelper;
import resonantinduction.old.client.model.ModelTankSide;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -28,16 +28,16 @@ public class RenderTank extends TileEntitySpecialRenderer
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8)
{
FluidStack liquid = tileEntity instanceof TileEntityTank ? ((TileEntityTank) tileEntity).getTankInfo()[0].fluid : null;
FluidStack liquid = tileEntity instanceof TileTank ? ((TileTank) tileEntity).getTankInfo()[0].fluid : null;
this.renderTank(tileEntity, x, y, z, 0, liquid);
}
public void renderTank(TileEntity tileEntity, double x, double y, double z, int meta, FluidStack liquid)
{
boolean[] render = new boolean[6];
if (tileEntity instanceof TileEntityTank)
if (tileEntity instanceof TileTank)
{
render = ((TileEntityTank) tileEntity).renderConnection;
render = ((TileTank) tileEntity).renderConnection;
}
if (liquid != null && liquid.amount > 100)
{
@ -55,7 +55,7 @@ public class RenderTank extends TileEntitySpecialRenderer
GL11.glTranslatef((float) x, (float) y, (float) z);
GL11.glScalef(1.01F, 1.01F, 1.01F);
int cap = tileEntity instanceof TileEntityTank ? ((TileEntityTank) tileEntity).getTankInfo()[0].capacity : liquid.amount;
int cap = tileEntity instanceof TileTank ? ((TileTank) tileEntity).getTankInfo()[0].capacity : liquid.amount;
GL11.glCallList(displayList[(int) ((float) liquid.amount / (float) (cap) * (RenderFluidHelper.DISPLAY_STAGES - 1))]);
GL11.glPopAttrib();

View file

@ -1,4 +1,4 @@
package resonantinduction.mechanical.fluid;
package resonantinduction.mechanical.fluid.tank;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
@ -8,9 +8,9 @@ import resonantinduction.mechanical.fluid.network.NetworkFluidContainers;
import resonantinduction.mechanical.fluid.prefab.TileEntityFluidNetworkTile;
import resonantinduction.old.api.fluid.INetworkFluidPart;
public class TileEntityTank extends TileEntityFluidNetworkTile
public class TileTank extends TileEntityFluidNetworkTile
{
public TileEntityTank()
public TileTank()
{
super(BlockTank.tankVolume);
}
@ -39,7 +39,7 @@ public class TileEntityTank extends TileEntityFluidNetworkTile
{
if (!this.worldObj.isRemote)
{
if (tileEntity instanceof TileEntityTank)
if (tileEntity instanceof TileTank)
{
if (this.canTileConnect(Connection.NETWORK, side.getOpposite()))
{

View file

@ -8,11 +8,11 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import resonantinduction.mechanical.fluid.TileEntityReleaseValve;
import resonantinduction.mechanical.fluid.TileEntityTank;
import resonantinduction.mechanical.fluid.TileKitchenSink;
import resonantinduction.mechanical.fluid.pipes.TileEntityPipe;
import resonantinduction.mechanical.fluid.pump.TileEntityConstructionPump;
import resonantinduction.mechanical.fluid.pump.TileEntityStarterPump;
import resonantinduction.mechanical.fluid.tank.TileTank;
import resonantinduction.old.client.gui.GuiEncoderCoder;
import resonantinduction.old.client.gui.GuiEncoderHelp;
import resonantinduction.old.client.gui.GuiEncoderInventory;
@ -67,7 +67,7 @@ public class ClientProxy extends CommonProxy
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityReleaseValve.class, new RenderReleaseValve());
ClientRegistry.bindTileEntitySpecialRenderer(TileKitchenSink.class, new RenderSink());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityConstructionPump.class, new RenderConstructionPump());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTank.class, new RenderTank());
ClientRegistry.bindTileEntitySpecialRenderer(TileTank.class, new RenderTank());
MinecraftForgeClient.registerItemRenderer(RecipeLoader.blockPipe.blockID, new ItemPipeRenderer());
MinecraftForgeClient.registerItemRenderer(RecipeLoader.blockTank.blockID, new ItemTankRenderer());

View file

@ -10,7 +10,7 @@ import net.minecraftforge.fluids.FluidStack;
import org.lwjgl.opengl.GL11;
import resonantinduction.core.Reference;
import resonantinduction.mechanical.fluid.BlockTank;
import resonantinduction.mechanical.fluid.tank.BlockTank;
import resonantinduction.old.client.model.ModelTankSide;
import resonantinduction.old.core.recipe.RecipeLoader;
import cpw.mods.fml.client.FMLClientHandler;

View file

@ -2,6 +2,7 @@ package resonantinduction.old.core;
import java.util.List;
import calclavia.lib.content.IExtraInfo.IExtraItemInfo;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
@ -19,7 +20,6 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.lib.EnumMaterial;
import dark.lib.EnumOrePart;
import dark.lib.IExtraInfo.IExtraItemInfo;
/**
* A series of items that are derived from a basic material

View file

@ -32,13 +32,13 @@ import net.minecraftforge.event.entity.player.UseHoeEvent;
import net.minecraftforge.oredict.OreDictionary;
import resonantinduction.core.Reference;
import resonantinduction.core.Settings;
import calclavia.lib.content.IExtraInfo.IExtraItemInfo;
import com.google.common.collect.Multimap;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.lib.EnumMaterial;
import dark.lib.IExtraInfo.IExtraItemInfo;
/**
* Flexible tool class that uses NBT to store damage and effect rather than metadata. Metadata

View file

@ -7,14 +7,13 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.Configuration;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import calclavia.lib.content.IExtraInfo.IExtraBlockInfo;
import com.builtbroken.common.Pair;
import dark.lib.IExtraInfo.IExtraBlockInfo;
/** @author Archadia */
public class BlockApertureExcavator extends BlockMachine implements IExtraBlockInfo
public class BlockApertureExcavator extends BlockRI implements IExtraBlockInfo
{
public BlockApertureExcavator()

View file

@ -8,14 +8,13 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.Configuration;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import calclavia.lib.content.IExtraInfo.IExtraBlockInfo;
import com.builtbroken.common.Pair;
import dark.lib.IExtraInfo.IExtraBlockInfo;
/** @author Archadia */
public class BlockFracker extends BlockMachine implements IExtraBlockInfo
public class BlockFracker extends BlockRI implements IExtraBlockInfo
{
public BlockFracker()

View file

@ -7,15 +7,14 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.Configuration;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.old.client.render.BlockRenderHelper;
import calclavia.lib.content.IExtraInfo.IExtraBlockInfo;
import com.builtbroken.common.Pair;
import dark.lib.IExtraInfo.IExtraBlockInfo;
/** @author Archadia */
public class BlockFrackingPipe extends BlockMachine implements IExtraBlockInfo
public class BlockFrackingPipe extends BlockRI implements IExtraBlockInfo
{
public BlockFrackingPipe()

View file

@ -27,14 +27,14 @@ import resonantinduction.api.events.LaserEvent;
import resonantinduction.old.transport.ResonantInductionTransport;
import universalelectricity.api.item.ItemElectric;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.content.ContentRegistry;
import calclavia.lib.content.IExtraInfo.IExtraItemInfo;
import calclavia.lib.utility.RayTraceHelper;
import com.builtbroken.common.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.lib.CoreRegistry;
import dark.lib.IExtraInfo.IExtraItemInfo;
/**
* Stream laser mining tool, When held down it will slowly mine away at the block in front of it.
@ -184,8 +184,8 @@ public class ItemMiningLaser extends ItemElectric implements IExtraItemInfo
// TODO adjust the laser for the end of the gun
float x = (float) (MathHelper.cos((float) (player.rotationYawHead * 0.0174532925)) * (-.4) - MathHelper.sin((float) (player.rotationYawHead * 0.0174532925)) * (-.1));
float z = (float) (MathHelper.sin((float) (player.rotationYawHead * 0.0174532925)) * (-.4) + MathHelper.cos((float) (player.rotationYawHead * 0.0174532925)) * (-.1));
CoreRegistry.proxy().renderBeam(player.worldObj, new Vector3(p).translate(new Vector3(x, -.25, z)), new Vector3(playerViewOffset), Color.ORANGE, 1);
CoreRegistry.proxy().renderBeam(player.worldObj, new Vector3(p).translate(new Vector3(x, -.45, z)), new Vector3(playerViewOffset), Color.ORANGE, 1);
ContentRegistry.proxy().renderBeam(player.worldObj, new Vector3(p).translate(new Vector3(x, -.25, z)), new Vector3(playerViewOffset), Color.ORANGE, 1);
ContentRegistry.proxy().renderBeam(player.worldObj, new Vector3(p).translate(new Vector3(x, -.45, z)), new Vector3(playerViewOffset), Color.ORANGE, 1);
}
}

View file

@ -10,7 +10,7 @@ import net.minecraftforge.fluids.IFluidBlock;
import net.minecraftforge.fluids.IFluidHandler;
import resonantinduction.core.prefab.tile.TileEntityEnergyMachine;
import resonantinduction.mechanical.fluid.EnumGas;
import resonantinduction.mechanical.fluid.GasTank;
import resonantinduction.mechanical.fluid.tank.GasTank;
import resonantinduction.old.core.recipe.RecipeLoader;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.multiblock.link.IBlockActivate;

View file

@ -13,21 +13,21 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.oredict.OreDictionary;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.mechanical.CommonProxy;
import resonantinduction.old.client.render.MechanicalBlockRenderingHandler;
import resonantinduction.old.client.render.RenderProcessor;
import resonantinduction.old.transport.ResonantInductionTransport;
import calclavia.lib.content.IExtraInfo.IExtraBlockInfo;
import com.builtbroken.common.Pair;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.lib.IExtraInfo.IExtraBlockInfo;
import dark.lib.recipes.ProcessorType;
public class BlockProcessor extends BlockMachine implements IExtraBlockInfo
public class BlockProcessor extends BlockRI implements IExtraBlockInfo
{
public BlockProcessor()

View file

@ -55,7 +55,6 @@ import resonantinduction.electrical.multimeter.ItemReadoutTools;
import resonantinduction.mechanical.belt.BlockConveyorBelt;
import resonantinduction.mechanical.fluid.BlockKitchenSink;
import resonantinduction.mechanical.fluid.BlockReleaseValve;
import resonantinduction.mechanical.fluid.BlockTank;
import resonantinduction.mechanical.fluid.EnumGas;
import resonantinduction.mechanical.fluid.ItemFluidCan;
import resonantinduction.mechanical.fluid.pipes.BlockPipe;
@ -64,6 +63,7 @@ import resonantinduction.mechanical.fluid.pipes.ItemBlockPipe;
import resonantinduction.mechanical.fluid.pump.BlockConstructionPump;
import resonantinduction.mechanical.fluid.pump.BlockDrain;
import resonantinduction.mechanical.fluid.pump.BlockPumpMachine;
import resonantinduction.mechanical.fluid.tank.BlockTank;
import resonantinduction.old.api.coding.TaskRegistry;
import resonantinduction.old.core.ItemOreDirv;
import resonantinduction.old.core.misc.BehaviorDispenseEgg;
@ -84,6 +84,7 @@ import resonantinduction.old.transport.imprinter.ItemImprinter;
import resonantinduction.old.transport.logistic.BlockDetector;
import resonantinduction.old.transport.logistic.BlockManipulator;
import resonantinduction.old.transport.logistic.BlockRejector;
import calclavia.lib.content.ContentRegistry;
import calclavia.lib.ore.OreGenReplaceStone;
import calclavia.lib.ore.OreGenerator;
import calclavia.lib.prefab.item.ItemBlockHolder;
@ -103,7 +104,6 @@ import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
import dark.lib.CoreRegistry;
import dark.lib.EnumMaterial;
import dark.lib.EnumOrePart;
import dark.lib.LaserEntityDamageSource;
@ -257,54 +257,54 @@ public class ResonantInductionTransport
{
/* BLOCKS */
RecipeLoader.blockManipulator = CoreRegistry.createNewBlock("Manipulator", ResonantInductionTransport.MOD_ID, BlockManipulator.class);
RecipeLoader.blockCrate = (BlockCrate) CoreRegistry.createNewBlock("Crate", ResonantInductionTransport.MOD_ID, BlockCrate.class, ItemBlockCrate.class);
RecipeLoader.blockImprinter = CoreRegistry.createNewBlock("Imprinter", ResonantInductionTransport.MOD_ID, BlockImprinter.class);
RecipeLoader.blockDetector = CoreRegistry.createNewBlock("Detector", ResonantInductionTransport.MOD_ID, BlockDetector.class);
RecipeLoader.blockManipulator = ContentRegistry.createNewBlock("Manipulator", ResonantInductionTransport.MOD_ID, BlockManipulator.class);
RecipeLoader.blockCrate = (BlockCrate) ContentRegistry.createNewBlock("Crate", ResonantInductionTransport.MOD_ID, BlockCrate.class, ItemBlockCrate.class);
RecipeLoader.blockImprinter = ContentRegistry.createNewBlock("Imprinter", ResonantInductionTransport.MOD_ID, BlockImprinter.class);
RecipeLoader.blockDetector = ContentRegistry.createNewBlock("Detector", ResonantInductionTransport.MOD_ID, BlockDetector.class);
RecipeLoader.blockRejector = CoreRegistry.createNewBlock("Rejector", ResonantInductionTransport.MOD_ID, BlockRejector.class);
RecipeLoader.blockEncoder = CoreRegistry.createNewBlock("Encoder", ResonantInductionTransport.MOD_ID, BlockEncoder.class);
RecipeLoader.blockArmbot = CoreRegistry.createNewBlock("Armbot", ResonantInductionTransport.MOD_ID, BlockArmbot.class);
RecipeLoader.blockTurntable = CoreRegistry.createNewBlock("Turntable", ResonantInductionTransport.MOD_ID, BlockTurntable.class);
RecipeLoader.processorMachine = CoreRegistry.createNewBlock("ALBlockProcessor", ResonantInductionTransport.MOD_ID, BlockProcessor.class, ItemBlockHolder.class);
RecipeLoader.blockRejector = ContentRegistry.createNewBlock("Rejector", ResonantInductionTransport.MOD_ID, BlockRejector.class);
RecipeLoader.blockEncoder = ContentRegistry.createNewBlock("Encoder", ResonantInductionTransport.MOD_ID, BlockEncoder.class);
RecipeLoader.blockArmbot = ContentRegistry.createNewBlock("Armbot", ResonantInductionTransport.MOD_ID, BlockArmbot.class);
RecipeLoader.blockTurntable = ContentRegistry.createNewBlock("Turntable", ResonantInductionTransport.MOD_ID, BlockTurntable.class);
RecipeLoader.processorMachine = ContentRegistry.createNewBlock("ALBlockProcessor", ResonantInductionTransport.MOD_ID, BlockProcessor.class, ItemBlockHolder.class);
RecipeLoader.blockAdvancedHopper = CoreRegistry.createNewBlock("ALBlockHopper", ResonantInductionTransport.MOD_ID, BlockAdvancedHopper.class, ItemBlockHolder.class);
RecipeLoader.blockPipe = CoreRegistry.createNewBlock("FMBlockPipe", ResonantInductionTransport.MOD_ID, BlockPipe.class, ItemBlockPipe.class);
RecipeLoader.blockPumpMachine = CoreRegistry.createNewBlock("FMBlockPump", ResonantInductionTransport.MOD_ID, BlockPumpMachine.class, ItemBlockHolder.class);
RecipeLoader.blockReleaseValve = CoreRegistry.createNewBlock("FMBlockReleaseValve", ResonantInductionTransport.MOD_ID, BlockReleaseValve.class, ItemBlockHolder.class);
RecipeLoader.blockTank = CoreRegistry.createNewBlock("FMBlockTank", ResonantInductionTransport.MOD_ID, BlockTank.class, ItemBlockPipe.class);
RecipeLoader.blockAdvancedHopper = ContentRegistry.createNewBlock("ALBlockHopper", ResonantInductionTransport.MOD_ID, BlockAdvancedHopper.class, ItemBlockHolder.class);
RecipeLoader.blockPipe = ContentRegistry.createNewBlock("FMBlockPipe", ResonantInductionTransport.MOD_ID, BlockPipe.class, ItemBlockPipe.class);
RecipeLoader.blockPumpMachine = ContentRegistry.createNewBlock("FMBlockPump", ResonantInductionTransport.MOD_ID, BlockPumpMachine.class, ItemBlockHolder.class);
RecipeLoader.blockReleaseValve = ContentRegistry.createNewBlock("FMBlockReleaseValve", ResonantInductionTransport.MOD_ID, BlockReleaseValve.class, ItemBlockHolder.class);
RecipeLoader.blockTank = ContentRegistry.createNewBlock("FMBlockTank", ResonantInductionTransport.MOD_ID, BlockTank.class, ItemBlockPipe.class);
RecipeLoader.blockSink = CoreRegistry.createNewBlock("FMBlockSink", ResonantInductionTransport.MOD_ID, BlockKitchenSink.class, ItemBlockHolder.class);
RecipeLoader.blockDrain = CoreRegistry.createNewBlock("FMBlockDrain", ResonantInductionTransport.MOD_ID, BlockDrain.class, ItemBlockHolder.class);
RecipeLoader.blockConPump = CoreRegistry.createNewBlock("FMBlockConstructionPump", ResonantInductionTransport.MOD_ID, BlockConstructionPump.class, ItemBlockHolder.class);
RecipeLoader.blockSteamGen = CoreRegistry.createNewBlock("DMBlockSteamMachine", ResonantInductionTransport.MOD_ID, BlockSmallSteamGen.class, ItemBlockHolder.class);
RecipeLoader.blockOre = CoreRegistry.createNewBlock("DMBlockOre", ResonantInductionTransport.MOD_ID, BlockOre.class, ItemBlockOre.class);
RecipeLoader.blockSink = ContentRegistry.createNewBlock("FMBlockSink", ResonantInductionTransport.MOD_ID, BlockKitchenSink.class, ItemBlockHolder.class);
RecipeLoader.blockDrain = ContentRegistry.createNewBlock("FMBlockDrain", ResonantInductionTransport.MOD_ID, BlockDrain.class, ItemBlockHolder.class);
RecipeLoader.blockConPump = ContentRegistry.createNewBlock("FMBlockConstructionPump", ResonantInductionTransport.MOD_ID, BlockConstructionPump.class, ItemBlockHolder.class);
RecipeLoader.blockSteamGen = ContentRegistry.createNewBlock("DMBlockSteamMachine", ResonantInductionTransport.MOD_ID, BlockSmallSteamGen.class, ItemBlockHolder.class);
RecipeLoader.blockOre = ContentRegistry.createNewBlock("DMBlockOre", ResonantInductionTransport.MOD_ID, BlockOre.class, ItemBlockOre.class);
RecipeLoader.blockWire = CoreRegistry.createNewBlock("DMBlockWire", ResonantInductionTransport.MOD_ID, BlockWire.class, ItemBlockWire.class);
RecipeLoader.blockDebug = CoreRegistry.createNewBlock("DMBlockDebug", ResonantInductionTransport.MOD_ID, BlockDebug.class, ItemBlockHolder.class);
RecipeLoader.blockStainGlass = CoreRegistry.createNewBlock("DMBlockStainedGlass", ResonantInductionTransport.MOD_ID, BlockColorGlass.class, ItemBlockColored.class);
RecipeLoader.blockColorSand = CoreRegistry.createNewBlock("DMBlockColorSand", ResonantInductionTransport.MOD_ID, BlockColorSand.class, ItemBlockColored.class);
RecipeLoader.blockBasalt = CoreRegistry.createNewBlock("DMBlockBasalt", ResonantInductionTransport.MOD_ID, BlockBasalt.class, ItemBlockColored.class);
RecipeLoader.blockWire = ContentRegistry.createNewBlock("DMBlockWire", ResonantInductionTransport.MOD_ID, BlockWire.class, ItemBlockWire.class);
RecipeLoader.blockDebug = ContentRegistry.createNewBlock("DMBlockDebug", ResonantInductionTransport.MOD_ID, BlockDebug.class, ItemBlockHolder.class);
RecipeLoader.blockStainGlass = ContentRegistry.createNewBlock("DMBlockStainedGlass", ResonantInductionTransport.MOD_ID, BlockColorGlass.class, ItemBlockColored.class);
RecipeLoader.blockColorSand = ContentRegistry.createNewBlock("DMBlockColorSand", ResonantInductionTransport.MOD_ID, BlockColorSand.class, ItemBlockColored.class);
RecipeLoader.blockBasalt = ContentRegistry.createNewBlock("DMBlockBasalt", ResonantInductionTransport.MOD_ID, BlockBasalt.class, ItemBlockColored.class);
RecipeLoader.blockGlowGlass = CoreRegistry.createNewBlock("DMBlockGlowGlass", ResonantInductionTransport.MOD_ID, BlockColorGlowGlass.class, ItemBlockColored.class);
RecipeLoader.blockSolar = CoreRegistry.createNewBlock("DMBlockSolar", ResonantInductionTransport.MOD_ID, BlockSolarPanel.class, ItemBlockHolder.class);
RecipeLoader.blockGas = CoreRegistry.createNewBlock("DMBlockGas", ResonantInductionTransport.MOD_ID, BlockGasOre.class, ItemBlockHolder.class);
RecipeLoader.blockBatBox = CoreRegistry.createNewBlock("DMBlockBatBox", ResonantInductionTransport.MOD_ID, BlockBatteryBox.class, ItemBlockEnergyStorage.class);
RecipeLoader.blockGlowGlass = ContentRegistry.createNewBlock("DMBlockGlowGlass", ResonantInductionTransport.MOD_ID, BlockColorGlowGlass.class, ItemBlockColored.class);
RecipeLoader.blockSolar = ContentRegistry.createNewBlock("DMBlockSolar", ResonantInductionTransport.MOD_ID, BlockSolarPanel.class, ItemBlockHolder.class);
RecipeLoader.blockGas = ContentRegistry.createNewBlock("DMBlockGas", ResonantInductionTransport.MOD_ID, BlockGasOre.class, ItemBlockHolder.class);
RecipeLoader.blockBatBox = ContentRegistry.createNewBlock("DMBlockBatBox", ResonantInductionTransport.MOD_ID, BlockBatteryBox.class, ItemBlockEnergyStorage.class);
/* ITEMS */
RecipeLoader.itemTool = CoreRegistry.createNewItem("DMReadoutTools", ResonantInductionTransport.MOD_ID, ItemReadoutTools.class, true);
RecipeLoader.battery = CoreRegistry.createNewItem("DMItemBattery", ResonantInductionTransport.MOD_ID, ItemBattery.class, true);
RecipeLoader.wrench = CoreRegistry.createNewItem("DMWrench", ResonantInductionTransport.MOD_ID, ItemWrench.class, true);
RecipeLoader.itemGlowingSand = CoreRegistry.createNewItem("DMItemGlowingSand", ResonantInductionTransport.MOD_ID, ItemColoredDust.class, true);
RecipeLoader.itemDiggingTool = CoreRegistry.createNewItem("ItemDiggingTools", ResonantInductionTransport.MOD_ID, ItemCommonTool.class, true);
RecipeLoader.itemTool = ContentRegistry.createNewItem("DMReadoutTools", ResonantInductionTransport.MOD_ID, ItemReadoutTools.class, true);
RecipeLoader.battery = ContentRegistry.createNewItem("DMItemBattery", ResonantInductionTransport.MOD_ID, ItemBattery.class, true);
RecipeLoader.wrench = ContentRegistry.createNewItem("DMWrench", ResonantInductionTransport.MOD_ID, ItemWrench.class, true);
RecipeLoader.itemGlowingSand = ContentRegistry.createNewItem("DMItemGlowingSand", ResonantInductionTransport.MOD_ID, ItemColoredDust.class, true);
RecipeLoader.itemDiggingTool = ContentRegistry.createNewItem("ItemDiggingTools", ResonantInductionTransport.MOD_ID, ItemCommonTool.class, true);
RecipeLoader.itemVehicleTest = CoreRegistry.createNewItem("ItemVehicleTest", ResonantInductionTransport.MOD_ID, ItemVehicleSpawn.class, true);
RecipeLoader.itemVehicleTest = ContentRegistry.createNewItem("ItemVehicleTest", ResonantInductionTransport.MOD_ID, ItemVehicleSpawn.class, true);
RecipeLoader.itemImprint = new ItemImprinter(CONFIGURATION.getItem("Imprint", DarkCore.getNextItemId()).getInt());
RecipeLoader.itemDisk = new ItemDisk(CONFIGURATION.getItem("Disk", DarkCore.getNextItemId()).getInt());
RecipeLoader.itemFluidCan = CoreRegistry.createNewItem("ItemFluidCan", ResonantInductionTransport.MOD_ID, ItemFluidCan.class, true);
RecipeLoader.itemParts = CoreRegistry.createNewItem("DMCraftingParts", ResonantInductionTransport.MOD_ID, ItemParts.class, true);
RecipeLoader.itemFluidCan = ContentRegistry.createNewItem("ItemFluidCan", ResonantInductionTransport.MOD_ID, ItemFluidCan.class, true);
RecipeLoader.itemParts = ContentRegistry.createNewItem("DMCraftingParts", ResonantInductionTransport.MOD_ID, ItemParts.class, true);
RecipeLoader.itemMetals = CoreRegistry.createNewItem("DMOreDirvParts", ResonantInductionTransport.MOD_ID, ItemOreDirv.class, true);
RecipeLoader.itemMetals = ContentRegistry.createNewItem("DMOreDirvParts", ResonantInductionTransport.MOD_ID, ItemOreDirv.class, true);
// ALRecipeLoader.itemMPWire = CoreRegistry.createNewItem("DMMPWire", AssemblyLine.MOD_ID,
// ItemWire.class, true);

View file

@ -6,7 +6,7 @@ import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.old.transport.ResonantInductionTransport;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -17,7 +17,7 @@ import cpw.mods.fml.relauncher.SideOnly;
*
* @author DarkGuardsman
*/
public class BlockCraftingTable extends BlockMachine
public class BlockCraftingTable extends BlockRI
{
@SideOnly(Side.CLIENT)
private Icon workbenchIconTop;

View file

@ -17,7 +17,7 @@ import net.minecraft.util.Icon;
import net.minecraft.world.World;
import resonantinduction.core.Reference;
import resonantinduction.core.Settings;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.old.client.render.RenderCrate;
import universalelectricity.api.UniversalElectricity;
@ -30,7 +30,7 @@ import cpw.mods.fml.relauncher.SideOnly;
* to go on Conveyor Belts
*
* @author DarkGuardsman */
public class BlockCrate extends BlockMachine
public class BlockCrate extends BlockRI
{
Icon adv, elt;

View file

@ -11,7 +11,7 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import resonantinduction.core.Reference;
import resonantinduction.core.Settings;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.mechanical.CommonProxy;
import resonantinduction.old.transport.ResonantInductionTransport;
@ -20,7 +20,7 @@ import com.builtbroken.common.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockEncoder extends BlockMachine
public class BlockEncoder extends BlockRI
{
Icon encoder_side;
Icon encoder_top;

View file

@ -15,7 +15,7 @@ import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import resonantinduction.core.Settings;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.old.client.render.RenderAdvancedHopper;
import com.builtbroken.common.Pair;
@ -28,7 +28,7 @@ import cpw.mods.fml.relauncher.SideOnly;
*
* @author DarkGuardsman
*/
public class BlockAdvancedHopper extends BlockMachine
public class BlockAdvancedHopper extends BlockRI
{
@SideOnly(Side.CLIENT)
public static Icon hopperIcon;

View file

@ -14,7 +14,7 @@ import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import resonantinduction.core.Reference;
import resonantinduction.core.prefab.block.BlockMachine;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.old.transport.ResonantInductionTransport;
import com.builtbroken.common.Pair;
@ -22,7 +22,7 @@ import com.builtbroken.common.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockImprinter extends BlockMachine
public class BlockImprinter extends BlockRI
{
Icon imprinter_side;
Icon imprinter_top;

View file

@ -1,4 +1,4 @@
package resonantinduction.old.client.render;
package resonantinduction.render;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;