v5.5.5 Beta #4
*Updated UE API. *Reformatted packet management slightly. *Removed unused fields. *Minor cleanups. *Fixed Factory container.
This commit is contained in:
parent
44926c2621
commit
5133880b68
34 changed files with 152 additions and 128 deletions
|
@ -18,8 +18,6 @@ public class ObjectRenderer
|
|||
public double maxX;
|
||||
public double maxY;
|
||||
public double maxZ;
|
||||
|
||||
public int lightValue;
|
||||
|
||||
public Block baseBlock = Block.sand;
|
||||
|
||||
|
|
|
@ -1,15 +1,9 @@
|
|||
package mekanism.common;
|
||||
|
||||
import static net.minecraftforge.common.ForgeDirection.UP;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.Object3D;
|
||||
import mekanism.client.ClientProxy;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.block.BlockStep;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
@ -22,7 +16,6 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.LiquidContainerRegistry;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
|
|
@ -39,6 +39,7 @@ public class ContainerAdvancedElectricMachine extends Container
|
|||
}
|
||||
|
||||
tileEntity.openChest();
|
||||
tileEntity.playersUsing.add(inventory.player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,12 +47,13 @@ public class ContainerAdvancedElectricMachine extends Container
|
|||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
tileEntity.playersUsing.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -47,10 +47,10 @@ public class ContainerDynamicTank extends Container
|
|||
tileEntity.closeChest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -30,6 +30,7 @@ public class ContainerElectricChest extends Container
|
|||
if(isBlock)
|
||||
{
|
||||
tileEntity.openChest();
|
||||
tileEntity.playersUsing.add(inventory.player);
|
||||
}
|
||||
else {
|
||||
itemInventory.openChest();
|
||||
|
@ -80,6 +81,7 @@ public class ContainerElectricChest extends Container
|
|||
if(isBlock)
|
||||
{
|
||||
tileEntity.closeChest();
|
||||
tileEntity.playersUsing.remove(entityplayer);
|
||||
}
|
||||
else {
|
||||
itemInventory.closeChest();
|
||||
|
@ -87,11 +89,11 @@ public class ContainerElectricChest extends Container
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
if(isBlock)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -38,6 +38,7 @@ public class ContainerElectricMachine extends Container
|
|||
}
|
||||
|
||||
tileEntity.openChest();
|
||||
tileEntity.playersUsing.add(inventory.player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,12 +46,13 @@ public class ContainerElectricMachine extends Container
|
|||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
tileEntity.playersUsing.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -37,6 +37,7 @@ public class ContainerElectricPump extends Container
|
|||
}
|
||||
|
||||
tileEntity.openChest();
|
||||
tileEntity.playersUsing.add(inventory.player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -44,12 +45,13 @@ public class ContainerElectricPump extends Container
|
|||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
tileEntity.playersUsing.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -38,6 +38,7 @@ public class ContainerEnergyCube extends Container
|
|||
}
|
||||
|
||||
tileEntity.openChest();
|
||||
tileEntity.playersUsing.add(inventory.player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,12 +46,13 @@ public class ContainerEnergyCube extends Container
|
|||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
tileEntity.playersUsing.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -91,6 +91,7 @@ public class ContainerFactory extends Container
|
|||
}
|
||||
|
||||
tileEntity.openChest();
|
||||
tileEntity.playersUsing.add(inventory.player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -98,12 +99,13 @@ public class ContainerFactory extends Container
|
|||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
tileEntity.playersUsing.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -130,6 +132,13 @@ public class ContainerFactory extends Container
|
|||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(slotID == 3)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, tileEntity.inventory.length, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if((slotStack.getItem() instanceof IElectricItem && ((IElectricItem)slotStack.getItem()).canProvideEnergy(slotStack)) || (slotStack.getItem() instanceof IItemElectric && ((IItemElectric)slotStack.getItem()).getProvideRequest(slotStack).amperes != 0) || slotStack.itemID == Item.redstone.itemID)
|
||||
{
|
||||
|
@ -152,7 +161,7 @@ public class ContainerFactory extends Container
|
|||
{
|
||||
if(!isInputSlot(slotID))
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 2, 2+tileEntity.tier.processes, false))
|
||||
if(!mergeItemStack(slotStack, 4, 4+tileEntity.tier.processes, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ public class ContainerGasTank extends Container
|
|||
}
|
||||
|
||||
tileEntity.openChest();
|
||||
tileEntity.playersUsing.add(inventory.player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -41,12 +42,13 @@ public class ContainerGasTank extends Container
|
|||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
tileEntity.playersUsing.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -42,6 +42,7 @@ public class ContainerMetallurgicInfuser extends Container
|
|||
}
|
||||
|
||||
tileEntity.openChest();
|
||||
tileEntity.playersUsing.add(inventory.player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -49,12 +50,13 @@ public class ContainerMetallurgicInfuser extends Container
|
|||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
tileEntity.playersUsing.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -34,6 +34,7 @@ public class ContainerTeleporter extends Container
|
|||
}
|
||||
|
||||
tileEntity.openChest();
|
||||
tileEntity.playersUsing.add(inventory.player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -41,12 +42,13 @@ public class ContainerTeleporter extends Container
|
|||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
tileEntity.playersUsing.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
package mekanism.common;
|
||||
|
||||
import universalelectricity.prefab.modifier.IModifier;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemMachineUpgrade extends ItemMekanism implements IModifier
|
||||
public class ItemMachineUpgrade extends ItemMekanism
|
||||
{
|
||||
public ItemMachineUpgrade(int id, int energyBoost, int tickReduction)
|
||||
{
|
||||
|
@ -12,16 +9,4 @@ public class ItemMachineUpgrade extends ItemMekanism implements IModifier
|
|||
setMaxStackSize(8);
|
||||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(ItemStack itemstack)
|
||||
{
|
||||
return itemID == Mekanism.SpeedUpgrade.itemID ? "Speed" : "Capacity";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEffectiveness(ItemStack itemstack)
|
||||
{
|
||||
return itemID == Mekanism.SpeedUpgrade.itemID ? 150 : 1000;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import java.util.HashMap;
|
|||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import mekanism.api.EnumGas;
|
||||
|
|
|
@ -1,17 +1,20 @@
|
|||
package mekanism.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
|
||||
import ic2.api.IWrenchable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import universalelectricity.prefab.tile.TileEntityDisableable;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public abstract class TileEntityBasicBlock extends TileEntityDisableable implements IWrenchable, ITileNetwork
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
|
||||
public abstract class TileEntityBasicBlock extends TileEntity implements IWrenchable, ITileNetwork
|
||||
{
|
||||
/** Whether or not this machine has initialized and registered with other mods. */
|
||||
public boolean initialized;
|
||||
|
@ -19,8 +22,8 @@ public abstract class TileEntityBasicBlock extends TileEntityDisableable impleme
|
|||
/** The direction this block is facing. */
|
||||
public int facing;
|
||||
|
||||
/** The amount of players using this block */
|
||||
public int playersUsing = 0;
|
||||
/** The players currently using this block. */
|
||||
public Set<EntityPlayer> playersUsing = new HashSet<EntityPlayer>();
|
||||
|
||||
/** A timer used to send packets to clients. */
|
||||
public int packetTick;
|
||||
|
@ -28,13 +31,11 @@ public abstract class TileEntityBasicBlock extends TileEntityDisableable impleme
|
|||
@Override
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
|
||||
onUpdate();
|
||||
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
if(playersUsing > 0)
|
||||
if(playersUsing.size() > 0)
|
||||
{
|
||||
PacketHandler.sendTileEntityPacketToClients(this, 50, getNetworkedData(new ArrayList()));
|
||||
}
|
||||
|
|
|
@ -163,16 +163,10 @@ public abstract class TileEntityContainerBlock extends TileEntityBasicBlock impl
|
|||
}
|
||||
|
||||
@Override
|
||||
public void openChest()
|
||||
{
|
||||
playersUsing++;
|
||||
}
|
||||
public void openChest() {}
|
||||
|
||||
@Override
|
||||
public void closeChest()
|
||||
{
|
||||
playersUsing--;
|
||||
}
|
||||
public void closeChest() {}
|
||||
|
||||
@Override
|
||||
public boolean isInvNameLocalized()
|
||||
|
|
|
@ -24,8 +24,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
|
||||
public class TileEntityDynamicTank extends TileEntityContainerBlock
|
||||
{
|
||||
public Set<EntityPlayer> playersUsing = new HashSet<EntityPlayer>();
|
||||
|
||||
/** Unique inventory ID for the dynamic tank, serves as a way to retrieve cached inventories. */
|
||||
public int inventoryID = -1;
|
||||
|
||||
|
|
|
@ -43,16 +43,16 @@ public class TileEntityElectricChest extends TileEntityElectricBlock
|
|||
prevLidAngle = lidAngle;
|
||||
float increment = 0.1F;
|
||||
|
||||
if((playersUsing > 0) && (lidAngle == 0.0F))
|
||||
if((playersUsing.size() > 0) && (lidAngle == 0.0F))
|
||||
{
|
||||
worldObj.playSoundEffect(xCoord + 0.5F, yCoord + 0.5D, zCoord + 0.5F, "random.chestopen", 0.5F, (worldObj.rand.nextFloat()*0.1F) + 0.9F);
|
||||
}
|
||||
|
||||
if((playersUsing == 0 && lidAngle > 0.0F) || (playersUsing > 0 && lidAngle < 1.0F))
|
||||
if((playersUsing.size() == 0 && lidAngle > 0.0F) || (playersUsing.size() > 0 && lidAngle < 1.0F))
|
||||
{
|
||||
float angle = lidAngle;
|
||||
|
||||
if(playersUsing > 0)
|
||||
if(playersUsing.size() > 0)
|
||||
{
|
||||
lidAngle += increment;
|
||||
}
|
||||
|
|
|
@ -551,12 +551,12 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IEnerg
|
|||
|
||||
public int getInputSlot(int operation)
|
||||
{
|
||||
return operation+2;
|
||||
return operation+4;
|
||||
}
|
||||
|
||||
public int getOutputSlot(int operation)
|
||||
{
|
||||
return tier.processes+2+operation;
|
||||
return tier.processes+4+operation;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package mekanism.common;
|
||||
|
||||
import ic2.api.Direction;
|
||||
import ic2.api.ElectricItem;
|
||||
import ic2.api.IElectricItem;
|
||||
import ic2.api.energy.tile.IEnergySink;
|
||||
|
||||
|
@ -17,22 +16,16 @@ import mekanism.api.InfusionOutput;
|
|||
import mekanism.api.InfusionType;
|
||||
import mekanism.api.SideData;
|
||||
import mekanism.client.IHasSound;
|
||||
import mekanism.common.IFactory.RecipeType;
|
||||
import mekanism.common.RecipeHandler.Recipe;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import universalelectricity.core.item.ElectricItemHelper;
|
||||
import universalelectricity.core.item.IItemElectric;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import dan200.computer.api.IComputerAccess;
|
||||
import dan200.computer.api.IPeripheral;
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ public class ContainerBioGenerator extends Container
|
|||
}
|
||||
|
||||
tileEntity.openChest();
|
||||
tileEntity.playersUsing.add(inventory.player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -44,12 +45,13 @@ public class ContainerBioGenerator extends Container
|
|||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
tileEntity.playersUsing.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -43,6 +43,7 @@ public class ContainerElectrolyticSeparator extends Container
|
|||
}
|
||||
|
||||
tileEntity.openChest();
|
||||
tileEntity.playersUsing.add(inventory.player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -50,12 +51,13 @@ public class ContainerElectrolyticSeparator extends Container
|
|||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
tileEntity.playersUsing.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -37,6 +37,7 @@ public class ContainerHeatGenerator extends Container
|
|||
}
|
||||
|
||||
tileEntity.openChest();
|
||||
tileEntity.playersUsing.add(inventory.player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -44,12 +45,13 @@ public class ContainerHeatGenerator extends Container
|
|||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
tileEntity.playersUsing.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -37,6 +37,7 @@ public class ContainerHydrogenGenerator extends Container
|
|||
}
|
||||
|
||||
tileEntity.openChest();
|
||||
tileEntity.playersUsing.add(inventory.player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -44,12 +45,13 @@ public class ContainerHydrogenGenerator extends Container
|
|||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
tileEntity.playersUsing.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -35,6 +35,7 @@ public class ContainerSolarGenerator extends Container
|
|||
}
|
||||
|
||||
tileEntity.openChest();
|
||||
tileEntity.playersUsing.add(inventory.player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,12 +43,13 @@ public class ContainerSolarGenerator extends Container
|
|||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
tileEntity.playersUsing.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -35,6 +35,7 @@ public class ContainerWindTurbine extends Container
|
|||
}
|
||||
|
||||
tileEntity.openChest();
|
||||
tileEntity.playersUsing.add(inventory.player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,12 +43,13 @@ public class ContainerWindTurbine extends Container
|
|||
{
|
||||
super.onCraftGuiClosed(entityplayer);
|
||||
tileEntity.closeChest();
|
||||
tileEntity.playersUsing.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
return tileEntity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -168,7 +168,6 @@ public class MekanismGenerators implements IModule
|
|||
GameRegistry.registerItem(BioFuel, "BioFuel");
|
||||
GameRegistry.registerItem(ElectrolyticCore, "ElectrolyticCore");
|
||||
|
||||
|
||||
//Ore Dictionary
|
||||
OreDictionary.registerOre("itemBioFuel", new ItemStack(BioFuel));
|
||||
}
|
||||
|
|
|
@ -10,12 +10,14 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import universalelectricity.core.block.IConductor;
|
||||
import universalelectricity.core.block.IConnectionProvider;
|
||||
import universalelectricity.core.block.INetworkProvider;
|
||||
import universalelectricity.core.path.Pathfinder;
|
||||
import universalelectricity.core.path.PathfinderChecker;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.core.vector.VectorHelper;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
|
||||
/**
|
||||
|
@ -415,6 +417,21 @@ public class ElectricityNetwork implements IElectricityNetwork
|
|||
{
|
||||
this.getConductors().remove(splitPoint);
|
||||
|
||||
for (ForgeDirection dir : ForgeDirection.values())
|
||||
{
|
||||
if (dir != ForgeDirection.UNKNOWN)
|
||||
{
|
||||
Vector3 splitVec = new Vector3((TileEntity) splitPoint);
|
||||
TileEntity tileAroundSplit = VectorHelper.getTileEntityFromSide(((TileEntity) splitPoint).worldObj, splitVec, dir);
|
||||
|
||||
if (this.producers.containsKey(tileAroundSplit))
|
||||
{
|
||||
this.stopProducing(tileAroundSplit);
|
||||
this.stopRequesting(tileAroundSplit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loop through the connected blocks and attempt to see if there are connections between
|
||||
* the two points elsewhere.
|
||||
|
|
|
@ -96,9 +96,13 @@ public class ElectricityNetworkHelper
|
|||
{
|
||||
if (wattsPerSide > 0 && producingPack.getWatts() > 0)
|
||||
{
|
||||
double amperes = wattsPerSide / voltage;
|
||||
network.startProducing(tileEntity, amperes, voltage);
|
||||
remainingElectricity.amperes -= amperes;
|
||||
double amperes = Math.min(wattsPerSide / voltage, network.getRequest(tileEntity).amperes);
|
||||
|
||||
if (amperes > 0)
|
||||
{
|
||||
network.startProducing(tileEntity, amperes, voltage);
|
||||
remainingElectricity.amperes -= amperes;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -40,7 +40,7 @@ public class ElectricItemHelper
|
|||
}
|
||||
|
||||
/**
|
||||
* Decharge an electric item.
|
||||
* Decharges an electric item.
|
||||
*
|
||||
* @param joules - The joules being withdrawn from the electric item
|
||||
* @param voltage - The voltage in which is used to decharge the electric item
|
||||
|
|
|
@ -58,7 +58,7 @@ public abstract class ItemElectric extends Item implements IItemElectric
|
|||
@Override
|
||||
public void onCreated(ItemStack itemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
itemStack = ElectricItemHelper.getUncharged(itemStack);
|
||||
this.setJoules(0, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,12 +11,17 @@ import net.minecraft.item.ItemStack;
|
|||
public interface IModifier
|
||||
{
|
||||
/**
|
||||
* @return - The name of the modifier.
|
||||
* @return - The type of the modifier.
|
||||
*/
|
||||
public String getName(ItemStack itemstack);
|
||||
public String getType(ItemStack itemstack);
|
||||
|
||||
/**
|
||||
* @return - How much effect does this modifier have?
|
||||
*/
|
||||
public int getEffectiveness(ItemStack itemstack);
|
||||
public double getEffectiveness(ItemStack itemstack);
|
||||
|
||||
/**
|
||||
* @return - What UE tier is the Modifier?
|
||||
*/
|
||||
public int getTier(ItemStack itemstack);
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import net.minecraft.server.MinecraftServer;
|
|||
import cpw.mods.fml.common.network.IConnectionHandler;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
|
||||
@Deprecated
|
||||
public class ConnectionHandler implements IConnectionHandler
|
||||
{
|
||||
private static final List<ISimpleConnectionHandler> simpleConnectionHandlers = new ArrayList<ISimpleConnectionHandler>();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package universalelectricity.prefab.network;
|
||||
|
||||
import universalelectricity.prefab.network.ConnectionHandler.ConnectionType;
|
||||
|
||||
@Deprecated
|
||||
public interface ISimpleConnectionHandler
|
||||
{
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue