import changes

This commit is contained in:
DarkGuardsman 2013-09-03 00:13:10 -04:00
parent 0b09e8bbe5
commit 5040a7a18c
13 changed files with 59 additions and 46 deletions

View file

@ -7,7 +7,7 @@ import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import cpw.mods.fml.common.registry.GameRegistry;
import dark.assembly.common.machine.BlockCrate;
import dark.core.RecipeLoader;
import dark.common.RecipeLoader;
public class ALRecipeLoader extends RecipeLoader
{

View file

@ -51,8 +51,8 @@ import dark.assembly.common.machine.crane.TileEntityCraneRail;
import dark.assembly.common.machine.encoder.BlockEncoder;
import dark.assembly.common.machine.encoder.ItemDisk;
import dark.assembly.common.machine.encoder.TileEntityEncoder;
import dark.core.BlockRegistry.BlockData;
import dark.core.DarkMain;
import dark.common.DarkMain;
import dark.common.BlockRegistry.BlockData;
import dark.prefab.ModPrefab;
@ModstatInfo(prefix = "asmline")

View file

@ -40,9 +40,9 @@ import dark.assembly.common.armbot.command.CommandRotateTo;
import dark.assembly.common.armbot.command.CommandUse;
import dark.assembly.common.machine.TileEntityAssembly;
import dark.assembly.common.machine.encoder.ItemDisk;
import dark.core.DarkMain;
import dark.core.helpers.ItemFindingHelper;
import dark.common.DarkMain;
import dark.prefab.IMultiBlock;
import dark.prefab.helpers.ItemWorldHelper;
public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, IPacketReceiver, IArmbot, IPeripheral
{
@ -842,7 +842,7 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock,
if (object instanceof ItemStack)
{
Vector3 handPosition = this.getHandPosition();
ItemFindingHelper.dropItemStackExact(worldObj, handPosition.x, handPosition.y, handPosition.z, (ItemStack) object);
ItemWorldHelper.dropItemStack(worldObj, handPosition, (ItemStack) object, false);
this.grabbedItems.remove((ItemStack) object);
}
if (object instanceof String)
@ -855,7 +855,7 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock,
while (it.hasNext())
{
ItemFindingHelper.dropItemStackExact(worldObj, handPosition.x, handPosition.y, handPosition.z, it.next());
ItemWorldHelper.dropItemStack(worldObj, handPosition, it.next(),false);
}
this.grabbedEntities.clear();
@ -911,9 +911,9 @@ public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock,
{
if (this.getCurrentCommand() != null)
{
return 2;
return .4;//400w
}
return .1;
return .03;//30w
}
@Override

View file

@ -6,10 +6,10 @@ import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import universalelectricity.core.vector.Vector3;
import dark.core.helpers.ItemFindingHelper;
import dark.prefab.helpers.ItemWorldHelper;
/** Used by arms to break a specific block in a position.
*
*
* @author Calclavia */
public class CommandBreak extends Command
{
@ -33,7 +33,7 @@ public class CommandBreak extends Command
if (!this.keep || items.size() > 1)
{
ItemFindingHelper.dropBlockAsItem(this.world, serachPosition.intX(), serachPosition.intY(), serachPosition.intZ());
ItemWorldHelper.dropBlockAsItem(this.world, serachPosition);
}
else
{

View file

@ -9,7 +9,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import universalelectricity.core.vector.Vector3;
import dark.core.helpers.ItemFindingHelper;
import dark.prefab.helpers.ItemWorldHelper;
public class CommandPowerTo extends Command
{
@ -57,7 +57,7 @@ public class CommandPowerTo extends Command
List<ItemStack> stacks = new ArrayList<ItemStack>();
stacks.add(new ItemStack(Block.torchRedstoneActive, 1, 0));
stacks.add(new ItemStack(Block.torchRedstoneIdle, 1, 0));
if (ItemFindingHelper.filterItems(this.tileEntity.getGrabbedItems(), stacks).size() > 0)
if (ItemWorldHelper.filterItems(this.tileEntity.getGrabbedItems(), stacks).size() > 0)
{
this.powerBlock(true);
}

View file

@ -6,10 +6,10 @@ import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import dark.assembly.common.AssemblyLine;
import dark.core.gui.ISlotWatcher;
import dark.core.gui.SlotCraftingResult;
import dark.core.gui.SlotRestricted;
import dark.core.gui.WatchedSlot;
import dark.prefab.invgui.ISlotWatcher;
import dark.prefab.invgui.SlotCraftingResult;
import dark.prefab.invgui.SlotRestricted;
import dark.prefab.invgui.WatchedSlot;
public class ContainerImprinter extends Container implements ISlotWatcher
{

View file

@ -27,11 +27,11 @@ import com.google.common.io.ByteArrayDataInput;
import dark.assembly.api.IArmbot;
import dark.assembly.api.IArmbotUseable;
import dark.assembly.common.AssemblyLine;
import dark.core.gui.ISlotPickResult;
import dark.core.helpers.AutoCraftingManager;
import dark.core.helpers.IAutoCrafter;
import dark.core.helpers.Pair;
import dark.prefab.TileEntityMulti;
import dark.prefab.helpers.AutoCraftingManager;
import dark.prefab.helpers.AutoCraftingManager.IAutoCrafter;
import dark.prefab.helpers.Pair;
import dark.prefab.invgui.ISlotPickResult;
public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInventory, IArmbotUseable, IPacketReceiver, ISlotPickResult, IAutoCrafter
{
@ -190,7 +190,7 @@ public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInv
}
/** Construct an InventoryCrafting Matrix on the fly.
*
*
* @return */
public InventoryCrafting getCraftingMatrix()
{

View file

@ -1,7 +1,11 @@
package dark.assembly.common.machine;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import dark.assembly.common.AssemblyLine;
import dark.assembly.common.TabAssemblyLine;
import dark.prefab.BlockMachine;
@ -17,4 +21,18 @@ public abstract class BlockAssembly extends BlockMachine
this.setCreativeTab(TabAssemblyLine.INSTANCE);
}
public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ)
{
if(entityPlayer != null && entityPlayer.getHeldItem() != null && entityPlayer.getHeldItem().itemID == Item.stick.itemID)
{
TileEntity entity = world.getBlockTileEntity(x, y, z);
if(entity instanceof TileEntityAssembly)
{
System.out.println(((TileEntityAssembly) entity).getTileNetwork().toString());
}
}
return false;
}
}

View file

@ -3,7 +3,7 @@ package dark.assembly.common.machine;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import dark.prefab.InvChest;
import dark.prefab.invgui.InvChest;
public class InventoryCrate extends InvChest
{

View file

@ -9,18 +9,17 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.ForgeDirection;
import universalelectricity.core.electricity.ElectricityPack;
import universalelectricity.core.vector.Vector3;
import universalelectricity.prefab.network.IPacketReceiver;
import dark.assembly.common.AssemblyLine;
import dark.core.tile.network.NetworkSharedPower;
import dark.core.tile.network.NetworkTileEntities;
import dark.interfaces.INetworkEnergyPart;
import dark.prefab.TileEntityMachine;
import dark.prefab.tilenetwork.NetworkSharedPower;
import dark.prefab.tilenetwork.NetworkTileEntities;
/** A class to be inherited by all machines on the assembly line. This class acts as a single peace
* in a network of similar tiles allowing all to share power from one or more sources
*
* @author DarkGuardsman */
public abstract class TileEntityAssembly extends TileEntityMachine implements IPacketReceiver, INetworkEnergyPart
public abstract class TileEntityAssembly extends TileEntityMachine implements INetworkEnergyPart
{
/** lowest value the network can update at */
public static int refresh_min_rate = 20;
@ -108,7 +107,7 @@ public abstract class TileEntityAssembly extends TileEntityMachine implements IP
@Override
public boolean canTileConnect(TileEntity entity, ForgeDirection dir)
{
return entity != null && entity instanceof TileEntityAssembly;
return true;
}
@Override
@ -165,18 +164,14 @@ public abstract class TileEntityAssembly extends TileEntityMachine implements IP
@Override
public float receiveElectricity(ForgeDirection from, ElectricityPack receive, boolean doReceive)
{
if (this.getInputDirections().contains(from))
{
return this.getTileNetwork().dumpPower(this, receive.getWatts(), doReceive);
}
return 0;
System.out.println("AssemblyTile has recieve power packet: " + (receive != null ? receive.toString() : "null"));
return this.getTileNetwork().dumpPower(this, receive.getWatts(), doReceive);
}
/** Amount of energy this tile runs on per tick */
public double getWattLoad()
{
return 1;
return .1;//100w
}
@Override

View file

@ -96,7 +96,7 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IPacke
@Override
public Packet getDescriptionPacket()
{
return PacketManager.getPacket(AssemblyLine.CHANNEL, this, 3, this.slantType.ordinal());
return PacketManager.getPacket(AssemblyLine.CHANNEL, this, "beltSlant", this.slantType.ordinal());
}
public SlantType getSlant()
@ -155,13 +155,13 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IPacke
}
@Override
public boolean simplePacket(int id, DataInputStream dis, EntityPlayer player)
public boolean simplePacket(String id, DataInputStream dis, EntityPlayer player)
{
if (!super.simplePacket(id, dis, player) && this.worldObj.isRemote)
{
try
{
if (id == 3)
if (id.equalsIgnoreCase("beltSlant"))
{
this.slantType = SlantType.values()[dis.readInt()];
return true;
@ -241,13 +241,13 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IPacke
TileEntity front, rear;
if (this.slantType == SlantType.DOWN)
{
face.add(new Vector3(0, -1, 0));
back.add(new Vector3(0, 1, 0));
face.translate(new Vector3(0, -1, 0));
back.translate(new Vector3(0, 1, 0));
}
else if (this.slantType == SlantType.UP)
{
face.add(new Vector3(0, 1, 0));
back.add(new Vector3(0, -1, 0));
face.translate(new Vector3(0, 1, 0));
back.translate(new Vector3(0, -1, 0));
}
else
{
@ -272,7 +272,7 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IPacke
@Override
public double getWattLoad()
{
return 0.1 + (0.1 * this.getAffectedEntities().size());
return 0.05 + (0.01 * this.getAffectedEntities().size());//50w + (10w * loadSize)
}
}

View file

@ -7,7 +7,7 @@ import net.minecraftforge.common.ForgeDirection;
import universalelectricity.core.vector.Vector3;
import dark.assembly.api.ICraneStructure;
import dark.assembly.common.machine.TileEntityAssembly;
import dark.core.DarkMain;
import dark.common.DarkMain;
public class TileEntityCraneController extends TileEntityAssembly implements ICraneStructure
{

View file

@ -6,7 +6,7 @@ import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import dark.assembly.common.AssemblyLine;
import dark.core.gui.SlotRestricted;
import dark.prefab.invgui.SlotRestricted;
public class ContainerEncoder extends Container
{