diff --git a/src/com/builtbroken/minecraft/ClientRegistryProxy.java b/src/com/builtbroken/minecraft/ClientRegistryProxy.java index 27699a96..3c681cc6 100644 --- a/src/com/builtbroken/minecraft/ClientRegistryProxy.java +++ b/src/com/builtbroken/minecraft/ClientRegistryProxy.java @@ -20,7 +20,7 @@ import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -@SideOnly(Side.CLIENT) + public class ClientRegistryProxy extends RegistryProxy { @Override @@ -38,13 +38,6 @@ public class ClientRegistryProxy extends RegistryProxy } } - @Override - public void regiserTileEntity(String name, Class clazz) - { - super.regiserTileEntity(name, clazz); - - } - @Override public void renderBeam(World world, Vector3 position, Vector3 target, Color color, int age) { diff --git a/src/com/builtbroken/minecraft/CoreRegistry.java b/src/com/builtbroken/minecraft/CoreRegistry.java index b39840d3..fe59ca91 100644 --- a/src/com/builtbroken/minecraft/CoreRegistry.java +++ b/src/com/builtbroken/minecraft/CoreRegistry.java @@ -22,10 +22,9 @@ import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; /** Handler to make registering all parts of a mod's objects that are loaded into the game by forge - * + * * @author DarkGuardsman */ public class CoreRegistry { @@ -54,7 +53,7 @@ public class CoreRegistry 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 */ @@ -64,7 +63,7 @@ public class CoreRegistry } /** 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 @@ -75,7 +74,7 @@ public class CoreRegistry } /** 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 @@ -86,7 +85,7 @@ public class CoreRegistry } /** 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 @@ -149,7 +148,7 @@ public class CoreRegistry } /** Method to get block via name - * + * * @param blockName * @return Block requested */ public static Block getBlock(String blockName) @@ -166,7 +165,7 @@ public class CoreRegistry } /** 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 */ @@ -199,7 +198,7 @@ public class CoreRegistry /** 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 diff --git a/src/com/builtbroken/minecraft/IndustryTabs.java b/src/com/builtbroken/minecraft/IndustryTabs.java deleted file mode 100644 index e7f9c59f..00000000 --- a/src/com/builtbroken/minecraft/IndustryTabs.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.builtbroken.minecraft; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public class IndustryTabs extends CreativeTabs -{ - public ItemStack itemStack = new ItemStack(Item.ingotIron, 1, 0); - - private static IndustryTabs tabAutomation; - private static IndustryTabs tabIndustrial; - private static IndustryTabs tabHydrualic; - private static IndustryTabs tabMining; - private static IndustryTabs tabWar; - - public IndustryTabs(String label) - { - super(label); - } - - @Override - public ItemStack getIconItemStack() - { - return this.itemStack; - } - - public void setIconItemStack(ItemStack stack) - { - this.itemStack = stack; - } - - public static IndustryTabs tabAutomation() - { - if (tabAutomation == null) - { - tabAutomation = new IndustryTabs("Automation"); - } - return tabAutomation; - } - - public static IndustryTabs tabWar() - { - if (tabWar == null) - { - tabWar = new IndustryTabs("War"); - } - return tabWar; - } - - public static IndustryTabs tabIndustrial() - { - if (tabIndustrial == null) - { - tabIndustrial = new IndustryTabs("Industrial"); - } - return tabIndustrial; - } - - public static IndustryTabs tabHydraulic() - { - if (tabHydrualic == null) - { - tabHydrualic = new IndustryTabs("Hydraulic"); - } - return tabHydrualic; - } -} diff --git a/src/com/builtbroken/minecraft/LaserEvent.java b/src/com/builtbroken/minecraft/LaserEvent.java index 69fbe4a2..ec1bbfd9 100644 --- a/src/com/builtbroken/minecraft/LaserEvent.java +++ b/src/com/builtbroken/minecraft/LaserEvent.java @@ -21,7 +21,7 @@ import net.minecraftforge.event.Cancelable; import net.minecraftforge.event.Event; import universalelectricity.api.vector.Vector3; -import com.builtbroken.minecraft.helpers.DarksHelper; +import com.builtbroken.minecraft.helpers.HelperMethods; /** An event triggered by entities or tiles that create lasers * @@ -265,7 +265,7 @@ public class LaserEvent extends Event items = event.items; for (ItemStack stack : items) { - DarksHelper.dropItemStack(world, vec.translate(0.5), stack, false); + HelperMethods.dropItemStack(world, vec.translate(0.5), stack, false); } } } diff --git a/src/com/builtbroken/minecraft/MachineMiningEvent.java b/src/com/builtbroken/minecraft/MachineMiningEvent.java deleted file mode 100644 index f4ea875b..00000000 --- a/src/com/builtbroken/minecraft/MachineMiningEvent.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.builtbroken.minecraft; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.Cancelable; -import net.minecraftforge.event.Event; -import universalelectricity.api.vector.Vector3; - -public class MachineMiningEvent extends Event -{ - public final World world; - public final Vector3 spot; - public final TileEntity machine; - - public MachineMiningEvent(World world, Vector3 spot, TileEntity machine) - { - this.world = world; - this.spot = spot; - this.machine = machine; - } - - @Cancelable - public static class PreMine extends MachineMiningEvent - { - public PreMine(World world, Vector3 spot, TileEntity machine) - { - super(world, spot, machine); - } - } - - public static class MiningDrop extends MachineMiningEvent - { - List items; - - public MiningDrop(World world, Vector3 spot, TileEntity machine, List items) - { - super(world, spot, machine); - this.items = items; - } - } - - public static class PostMine extends MachineMiningEvent - { - public PostMine(World world, Vector3 spot, TileEntity machine) - { - super(world, spot, machine); - } - } - - public static boolean doMachineMiningCheck(World world, Vector3 target, TileEntity machine) - { - Block block = Block.blocksList[target.getBlockID(world)]; - - return block != null && target.getTileEntity(world) == null && !block.isAirBlock(world, target.intX(), target.intY(), target.intZ()) && block.getBlockHardness(world, target.intX(), target.intY(), target.intZ()) >= 0; - - } - - public static List getItemsMined(World world, Vector3 target, TileEntity machine) - { - Block block = Block.blocksList[target.getBlockID(world)]; - if (block != null) - { - List items = block.getBlockDropped(world, target.intX(), target.intY(), target.intZ(), target.getBlockMetadata(world), 1); - if (items != null) - { - MiningDrop event = new MiningDrop(world, target, machine, items); - MinecraftForge.EVENT_BUS.post(event); - items = event.items; - return items; - } - } - return null; - } -} diff --git a/src/com/builtbroken/minecraft/helpers/DarksHelper.java b/src/com/builtbroken/minecraft/helpers/HelperMethods.java similarity index 99% rename from src/com/builtbroken/minecraft/helpers/DarksHelper.java rename to src/com/builtbroken/minecraft/helpers/HelperMethods.java index 443c7a3f..7e76f1a0 100644 --- a/src/com/builtbroken/minecraft/helpers/DarksHelper.java +++ b/src/com/builtbroken/minecraft/helpers/HelperMethods.java @@ -17,7 +17,7 @@ import universalelectricity.api.vector.Vector3; /** Class full of generic re-usable methods * * @author DarkGuardsman */ -public class DarksHelper +public class HelperMethods { /** Used to find all tileEntities sounding the location you will have to filter for selective * tileEntities diff --git a/src/com/builtbroken/minecraft/prefab/ItemBlockHolder.java b/src/com/builtbroken/minecraft/prefab/ItemBlockHolder.java index b49e8a4f..65afbed3 100644 --- a/src/com/builtbroken/minecraft/prefab/ItemBlockHolder.java +++ b/src/com/builtbroken/minecraft/prefab/ItemBlockHolder.java @@ -4,8 +4,8 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -/** Simple itemBlock class for quick use with a block - * +/** Simple itemBlock class for quick use with a block for controlling metadata + * * @author Darkguardsman */ public class ItemBlockHolder extends ItemBlock { diff --git a/src/com/builtbroken/minecraft/tilenetwork/IMotionPath.java b/src/com/builtbroken/minecraft/tilenetwork/IMotionPath.java deleted file mode 100644 index 48624428..00000000 --- a/src/com/builtbroken/minecraft/tilenetwork/IMotionPath.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.builtbroken.minecraft.tilenetwork; - -import net.minecraft.entity.Entity; -import universalelectricity.api.vector.Vector3; - -/** Use by tiles to control the path of motion of an item threw a tile network such as items pipes - * - * @author DarkGuardsman */ -public interface IMotionPath -{ - - /** Gets the motion applied to the entity while its on the tile **/ - public Vector3 getMotion(Entity entity); - - /** Can the path controller move the entity over this tile. Make sure to check the position of - * the tile as the controller doesn't know the range of control of the tile. Though it does - * limit itself to blocks around the entity. So if your tile only effects entities above it - * within its bound then make sure the tile is inside those bounds - * - * @param entity - entity in question - * @param from - direction the entity came from - * @return true if it can, false if something is wrong like no power, or solid side */ - public boolean canMoveEntity(Entity entity); -} diff --git a/src/com/builtbroken/minecraft/tilenetwork/prefab/NetworkItemSupply.java b/src/com/builtbroken/minecraft/tilenetwork/prefab/NetworkItemSupply.java deleted file mode 100644 index 81d3960f..00000000 --- a/src/com/builtbroken/minecraft/tilenetwork/prefab/NetworkItemSupply.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.builtbroken.minecraft.tilenetwork.prefab; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import universalelectricity.api.vector.Vector3; - -import com.builtbroken.common.Pair; -import com.builtbroken.minecraft.tilenetwork.IMotionPath; -import com.builtbroken.minecraft.tilenetwork.INetworkPart; - - -/** Class that acts like the redpower pipes system. Each item is marked with a destination. Intended - * use it to improve the assembly line network - * - * @author DarkGuardsman */ -public class NetworkItemSupply extends NetworkTileEntities -{ - List> trackingList = new ArrayList>(); - List ignoreList = new ArrayList(); - /** Same as valid directions from forge direction enum but Unknown was added so that is gets - * check and checked first */ - public static final ForgeDirection[] VALID_DIRECTIONS = { ForgeDirection.UNKNOWN, ForgeDirection.DOWN, ForgeDirection.UP, ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.WEST, ForgeDirection.EAST }; - - public NetworkItemSupply(INetworkPart... parts) - { - super(parts); - } - - @Override - public void updateTick() - { - Iterator> it = trackingList.iterator(); - while (it.hasNext()) - { - Pair entry = it.next(); - if (entry.left() == null || !this.isOnPath(entry.left())) - { - it.remove(); - } - else - { - if (entry.right() == null) - { - entry.setRight(new Vector3(entry.left())); - } - else - { - entry.left().setPosition(entry.right().x, entry.right().y, entry.right().z); - } - } - } - - } - - @Override - public int getUpdateRate() - { - return 1; - } - - /** Remove an entity from the tracking list */ - public void removeEntity(Entity entity) - { - this.trackingList.remove(entity); - } - - /** Ignores an entity so that is can be controlled by something else for a while. Eg armbots, and - * drones */ - public void ignoreEntity(Entity entity) - { - if (!this.ignoreList.contains(entity)) - { - this.ignoreList.add(entity); - } - } - - /** Add and entity to the tracking list */ - public void addEntity(Entity entity) - { - if (!this.trackingList.contains(entity)) - { - this.trackingList.add(new Pair(entity, new Vector3(entity))); - } - } - - public boolean isTrackingEntity(Entity entity) - { - return this.trackingList.contains(entity); - } - - public boolean isOnPath(Entity entity) - { - if (entity != null) - { - Vector3 ent = new Vector3(entity); - //Check all directions including the current position of the entity - for (ForgeDirection direction : NetworkItemSupply.VALID_DIRECTIONS) - { - TileEntity a = ent.clone().modifyPositionFromSide(direction).getTileEntity(entity.worldObj); - if (a instanceof IMotionPath && ((IMotionPath) a).canMoveEntity(entity) && this.networkMembers.contains(a)) - { - return true; - } - } - } - return false; - } - - @Override - public boolean isValidMember(INetworkPart part) - { - return super.isValidMember(part) && part instanceof IMotionPath; - } - -}