mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-25 14:34:28 +00:00
Merge remote-tracking branch 'origin/master' into Weather_Obelisk
Conflicts: resources/assets/enderio/textures/gui/widgets.png src/main/java/crazypants/enderio/gui/IconEIO.java
This commit is contained in:
commit
bbd305a0ab
682 files changed
+7899
-1809
No files matched your search
@@ -0,0 +1 @@
|
||||
/Crap.java
|
||||
@@ -1,19 +0,0 @@
|
||||
package crazypants;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
|
||||
public class Crap {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
BufferedReader br = new BufferedReader(new FileReader("C:\\MyData\\Dev\\Minecraft\\Workspace17\\PamsSeeds.txt"));
|
||||
String line = br.readLine();
|
||||
System.out.println("private static final String[] PAMS_SEEDS = new String[] {");
|
||||
while(line != null) {
|
||||
System.out.println("\"" + line.trim() + "\",");
|
||||
line = br.readLine();
|
||||
}
|
||||
System.out.println("};");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +1,24 @@
|
||||
package crazypants.enderio;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.api.tool.ITool;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
|
||||
public abstract class BlockEio extends Block {
|
||||
|
||||
@@ -60,4 +70,80 @@ public abstract class BlockEio extends Block {
|
||||
blockIcon = iIconRegister.registerIcon("enderio:" + name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
return doNormalDrops(world, x, y, z) ? super.getDrops(world, x, y, z, metadata, fortune) : new ArrayList<ItemStack>();
|
||||
}
|
||||
|
||||
/* Subclass Helpers */
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float par7, float par8, float par9) {
|
||||
|
||||
if(shouldWrench(world, x, y, z, entityPlayer, side) && ToolUtil.breakBlockWithTool(this, world, x, y, z, entityPlayer)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
ITool tool = ToolUtil.getEquippedTool(entityPlayer);
|
||||
if(tool != null && !entityPlayer.isSneaking()) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof AbstractMachineEntity) {
|
||||
((AbstractMachineEntity) te).toggleIoModeForFace(ForgeDirection.getOrientation(side));
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if(entityPlayer.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return openGui(world, x, y, z, entityPlayer, side);
|
||||
}
|
||||
|
||||
protected boolean shouldWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean openGui(World world, int x, int y, int z, EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean doNormalDrops(World world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean doHarvest) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileEntityEio && ((TileEntityEio) te).shouldDrop()) {
|
||||
if(!world.isRemote && !player.capabilities.isCreativeMode && !doNormalDrops(world, x, y, z)) {
|
||||
dropAsItem(world, x, y, z, (TileEntityEio) te);
|
||||
((TileEntityEio) te).preventDrops();
|
||||
} else if(player.capabilities.isCreativeMode) {
|
||||
((TileEntityEio) te).preventDrops();
|
||||
}
|
||||
}
|
||||
return super.removedByPlayer(world, player, x, y, z, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileEntityEio && ((TileEntityEio) te).shouldDrop() && !doNormalDrops(world, x, y, z)) {
|
||||
dropAsItem(world, x, y, z, (TileEntityEio) te);
|
||||
((TileEntityEio)te).preventDrops();
|
||||
}
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
public void dropAsItem(World world, int x, int y, int z, TileEntityEio te) {
|
||||
int meta = damageDropped(world.getBlockMetadata(x, y, z));
|
||||
ItemStack itemStack = new ItemStack(this, 1, meta);
|
||||
processDrop(world, x, y, z, te, itemStack);
|
||||
dropBlockAsItem(world, x, y, z, itemStack);
|
||||
}
|
||||
|
||||
protected void processDrop(World world, int x, int y, int z, @Nullable TileEntityEio te, ItemStack drop) {
|
||||
}
|
||||
}
|
||||
@@ -383,7 +383,7 @@ public class ClientProxy extends CommonProxy {
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockTransceiver), tr);
|
||||
}
|
||||
|
||||
new YetaWrenchOverlayRenderer(EnderIO.itemYetaWench);
|
||||
new YetaWrenchOverlayRenderer();
|
||||
new ConduitProbeOverlayRenderer();
|
||||
if(Config.useSneakMouseWheelYetaWrench) {
|
||||
ToolTickHandler th = new ToolTickHandler();
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package crazypants.enderio;
|
||||
|
||||
import static crazypants.enderio.EnderIO.MODID;
|
||||
import static crazypants.enderio.EnderIO.MOD_NAME;
|
||||
import static crazypants.enderio.EnderIO.VERSION;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
|
||||
import crazypants.enderio.entity.SkeletonHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -23,11 +26,11 @@ import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartedEvent;
|
||||
@@ -63,6 +66,7 @@ import crazypants.enderio.enchantment.Enchantments;
|
||||
import crazypants.enderio.enderface.BlockEnderIO;
|
||||
import crazypants.enderio.enderface.EnderfaceRecipes;
|
||||
import crazypants.enderio.enderface.ItemEnderface;
|
||||
import crazypants.enderio.entity.SkeletonHandler;
|
||||
import crazypants.enderio.fluid.BlockFluidEio;
|
||||
import crazypants.enderio.fluid.FluidFuelRegister;
|
||||
import crazypants.enderio.fluid.Fluids;
|
||||
@@ -150,11 +154,8 @@ import crazypants.enderio.teleport.ItemTravelStaff;
|
||||
import crazypants.enderio.teleport.TeleportRecipes;
|
||||
import crazypants.enderio.teleport.TravelController;
|
||||
import crazypants.util.EntityUtil;
|
||||
import static crazypants.enderio.EnderIO.MODID;
|
||||
import static crazypants.enderio.EnderIO.MOD_NAME;
|
||||
import static crazypants.enderio.EnderIO.VERSION;
|
||||
|
||||
@Mod(modid = MODID, name = MOD_NAME, version = VERSION, dependencies = "required-after:[email protected],);after:MineFactoryReloaded", guiFactory = "crazypants.enderio.config.ConfigFactoryEIO")
|
||||
@Mod(modid = MODID, name = MOD_NAME, version = VERSION, dependencies = "required-after:[email protected],);after:MineFactoryReloaded;after:Waila@[1.5.8,)", guiFactory = "crazypants.enderio.config.ConfigFactoryEIO")
|
||||
public class EnderIO {
|
||||
|
||||
public static final String MODID = "EnderIO";
|
||||
@@ -629,6 +630,7 @@ public class EnderIO {
|
||||
return Config.xpJuiceName;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void addModIntegration() {
|
||||
|
||||
if(Loader.isModLoaded("TConstruct")) {
|
||||
|
||||
@@ -1,26 +1,27 @@
|
||||
package crazypants.enderio;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
|
||||
public final class Log {
|
||||
|
||||
public static final String CHANNEL = EnderIO.MODID;
|
||||
public static final Logger LOGGER = LogManager.getLogger(EnderIO.MODID);
|
||||
|
||||
public static void warn(String msg) {
|
||||
FMLLog.log(CHANNEL, org.apache.logging.log4j.Level.WARN, msg, (Object[])null);
|
||||
LOGGER.warn(msg);
|
||||
}
|
||||
|
||||
public static void error(String msg) {
|
||||
FMLLog.log(CHANNEL, org.apache.logging.log4j.Level.ERROR, msg);
|
||||
LOGGER.error(msg);
|
||||
}
|
||||
|
||||
public static void info(String msg) {
|
||||
FMLLog.log(CHANNEL, org.apache.logging.log4j.Level.INFO, msg);
|
||||
LOGGER.info(msg);
|
||||
}
|
||||
|
||||
public static void debug(String msg) {
|
||||
FMLLog.log(CHANNEL, org.apache.logging.log4j.Level.DEBUG, msg);
|
||||
LOGGER.debug(msg);
|
||||
}
|
||||
|
||||
private Log() {
|
||||
|
||||
@@ -11,6 +11,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||
*/
|
||||
public abstract class TileEntityEio extends TileEntity {
|
||||
|
||||
private boolean shouldDrop = true;
|
||||
|
||||
@Override
|
||||
public final void readFromNBT(NBTTagCompound root) {
|
||||
super.readFromNBT(root);
|
||||
@@ -48,4 +50,12 @@ public abstract class TileEntityEio extends TileEntity {
|
||||
protected boolean isPoweredRedstone() {
|
||||
return worldObj.getStrongestIndirectPower(xCoord, yCoord, zCoord) > 0;
|
||||
}
|
||||
|
||||
public void preventDrops() {
|
||||
shouldDrop = false;
|
||||
}
|
||||
|
||||
public boolean shouldDrop() {
|
||||
return shouldDrop;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package crazypants.enderio.api.tool;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Interface for items which support the overlay and conduit view modes
|
||||
*/
|
||||
public interface IConduitControl extends IHideFacades {
|
||||
|
||||
/**
|
||||
* Controls whether the overlay is shown and the player can change the display
|
||||
* mode.
|
||||
*
|
||||
* @param stack
|
||||
* The itemstack
|
||||
* @param player
|
||||
* The player holding the itemstack
|
||||
* @return True if the overlay should be rendered and the player should be
|
||||
* able to change modes. False otherwise.
|
||||
*/
|
||||
boolean showOverlay(ItemStack stack, EntityPlayer player);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package crazypants.enderio.api.tool;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IHideFacades {
|
||||
|
||||
boolean shouldHideFacades(ItemStack stack, EntityPlayer player);
|
||||
|
||||
}
|
||||
@@ -4,12 +4,10 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
public interface ITool {
|
||||
public interface ITool extends IHideFacades {
|
||||
|
||||
boolean canUse(ItemStack stack, EntityPlayer player, int x, int y, int z);
|
||||
|
||||
void used(ItemStack stack, EntityPlayer player, int x, int y, int z);
|
||||
|
||||
boolean shouldHideFacades(ItemStack stack, EntityPlayer player);
|
||||
|
||||
}
|
||||
@@ -5,8 +5,8 @@ import net.minecraft.block.BlockLadder;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import codechicken.lib.math.MathHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
|
||||
@@ -57,6 +57,11 @@ public class BlockReinforcedObsidian extends BlockEio implements IResourceToolti
|
||||
public String getUnlocalizedNameForTooltip(ItemStack itemStack) {
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWailaInfo(List<String> tooltip, EntityPlayer player, World world, int x, int y, int z) {}
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -26,9 +26,9 @@ import crazypants.util.BlockCoord;
|
||||
|
||||
public abstract class AbstractConduit implements IConduit {
|
||||
|
||||
protected final Set<ForgeDirection> conduitConnections = new HashSet<ForgeDirection>();
|
||||
protected final Set<ForgeDirection> conduitConnections = EnumSet.noneOf(ForgeDirection.class);
|
||||
|
||||
protected final Set<ForgeDirection> externalConnections = new HashSet<ForgeDirection>();
|
||||
protected final Set<ForgeDirection> externalConnections = EnumSet.noneOf(ForgeDirection.class);
|
||||
|
||||
public static final float STUB_WIDTH = 0.2f;
|
||||
|
||||
@@ -52,8 +52,6 @@ public abstract class AbstractConduit implements IConduit {
|
||||
|
||||
private boolean dodgyChangeSinceLastCallFlagForBundle = true;
|
||||
|
||||
private int lastNumConections = -1;
|
||||
|
||||
protected boolean connectionsDirty = true;
|
||||
|
||||
protected AbstractConduit() {
|
||||
@@ -194,11 +192,7 @@ public abstract class AbstractConduit implements IConduit {
|
||||
if(bundle == null) {
|
||||
return null;
|
||||
}
|
||||
TileEntity te = bundle.getEntity();
|
||||
if(te == null) {
|
||||
return null;
|
||||
}
|
||||
return new BlockCoord(te.xCoord, te.yCoord, te.zCoord);
|
||||
return bundle.getLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -225,13 +219,11 @@ public abstract class AbstractConduit implements IConduit {
|
||||
@Override
|
||||
public void conduitConnectionAdded(ForgeDirection fromDirection) {
|
||||
conduitConnections.add(fromDirection);
|
||||
connectionsChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void conduitConnectionRemoved(ForgeDirection fromDirection) {
|
||||
conduitConnections.remove(fromDirection);
|
||||
connectionsChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -275,13 +267,11 @@ public abstract class AbstractConduit implements IConduit {
|
||||
@Override
|
||||
public void externalConnectionAdded(ForgeDirection fromDirection) {
|
||||
externalConnections.add(fromDirection);
|
||||
connectionsChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void externalConnectionRemoved(ForgeDirection fromDirection) {
|
||||
externalConnections.remove(fromDirection);
|
||||
connectionsChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -428,7 +418,8 @@ public abstract class AbstractConduit implements IConduit {
|
||||
connectionsDirty = false;
|
||||
}
|
||||
|
||||
protected void connectionsChanged() {
|
||||
@Override
|
||||
public void connectionsChanged() {
|
||||
collidablesDirty = true;
|
||||
clientStateDirty = true;
|
||||
dodgyChangeSinceLastCallFlagForBundle = true;
|
||||
@@ -463,6 +454,7 @@ public abstract class AbstractConduit implements IConduit {
|
||||
if(neighbour != null && neighbour.canConnectToConduit(dir.getOpposite(), this)) {
|
||||
conduitConnections.add(dir);
|
||||
neighbour.conduitConnectionAdded(dir.getOpposite());
|
||||
neighbour.connectionsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -485,6 +477,7 @@ public abstract class AbstractConduit implements IConduit {
|
||||
IConduit neighbour = ConduitUtil.getConduit(world, te, dir, getBaseConduitType());
|
||||
if(neighbour != null) {
|
||||
neighbour.conduitConnectionRemoved(dir.getOpposite());
|
||||
neighbour.connectionsChanged();
|
||||
}
|
||||
}
|
||||
conduitConnections.clear();
|
||||
@@ -513,7 +506,7 @@ public abstract class AbstractConduit implements IConduit {
|
||||
|
||||
// Check for changes to external connections, connections to conduits are
|
||||
// handled by the bundle
|
||||
Set<ForgeDirection> newCons = new HashSet<ForgeDirection>();
|
||||
Set<ForgeDirection> newCons = EnumSet.noneOf(ForgeDirection.class);
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if(!containsConduitConnection(dir) && canConnectToExternal(dir, false)) {
|
||||
newCons.add(dir);
|
||||
@@ -560,8 +553,6 @@ public abstract class AbstractConduit implements IConduit {
|
||||
}
|
||||
|
||||
List<CollidableComponent> result = new ArrayList<CollidableComponent>();
|
||||
CollidableCache cc = CollidableCache.instance;
|
||||
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
Collection<CollidableComponent> col = getCollidables(dir);
|
||||
if(col != null) {
|
||||
|
||||
@@ -61,12 +61,10 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
TileEntity te = world.getTileEntity(placeAt.x, placeAt.y, placeAt.z);
|
||||
if(te instanceof IConduitBundle) {
|
||||
IConduitBundle bundle = (IConduitBundle) te;
|
||||
if(bundle != null) {
|
||||
bundle.addConduit(createConduit(stack));
|
||||
Block b = EnderIO.blockConduitBundle;
|
||||
world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, b.stepSound.getStepResourcePath(),
|
||||
(b.stepSound.getVolume() + 1.0F) / 2.0F, b.stepSound.getPitch() * 0.8F);
|
||||
}
|
||||
bundle.addConduit(createConduit(stack, player));
|
||||
Block b = EnderIO.blockConduitBundle;
|
||||
world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, b.stepSound.getStepResourcePath(),
|
||||
(b.stepSound.getVolume() + 1.0F) / 2.0F, b.stepSound.getPitch() * 0.8F);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,7 +87,7 @@ public abstract class AbstractItemConduit extends Item implements IConduitItem {
|
||||
System.out.println("AbstractItemConduit.onItemUse: Bundle null");
|
||||
return false;
|
||||
}
|
||||
IConduit con = createConduit(stack);
|
||||
IConduit con = createConduit(stack, player);
|
||||
if(con == null) {
|
||||
System.out.println("AbstractItemConduit.onItemUse: Conduit null.");
|
||||
return false;
|
||||
|
||||
@@ -36,6 +36,7 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.api.tool.ITool;
|
||||
import crazypants.enderio.conduit.facade.ItemConduitFacade.FacadeType;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.ConduitConnectorType;
|
||||
import crazypants.enderio.conduit.gui.ExternalConnectionContainer;
|
||||
@@ -64,6 +65,7 @@ import crazypants.util.Util;
|
||||
public class BlockConduitBundle extends BlockEio implements IGuiHandler, IFacade, IRedNetOmniNode {
|
||||
|
||||
private static final String KEY_CONNECTOR_ICON = "enderIO:conduitConnector";
|
||||
private static final String KEY_CONNECTOR_ICON_EXTERNAL = "enderIO:conduitConnectorExternal";
|
||||
|
||||
public static BlockConduitBundle create() {
|
||||
|
||||
@@ -90,7 +92,7 @@ public class BlockConduitBundle extends BlockEio implements IGuiHandler, IFacade
|
||||
|
||||
public static int rendererId = -1;
|
||||
|
||||
private IIcon connectorIcon;
|
||||
private IIcon connectorIcon, connectorIconExternal;
|
||||
|
||||
private IIcon lastRemovedComponetIcon = null;
|
||||
|
||||
@@ -233,14 +235,15 @@ public class BlockConduitBundle extends BlockEio implements IGuiHandler, IFacade
|
||||
return 0;
|
||||
}
|
||||
|
||||
public IIcon getConnectorIcon() {
|
||||
return connectorIcon;
|
||||
public IIcon getConnectorIcon(Object data) {
|
||||
return data == ConduitConnectorType.EXTERNAL ? connectorIconExternal : connectorIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister IIconRegister) {
|
||||
connectorIcon = IIconRegister.registerIcon(KEY_CONNECTOR_ICON);
|
||||
connectorIconExternal = IIconRegister.registerIcon(KEY_CONNECTOR_ICON_EXTERNAL);
|
||||
blockIcon = connectorIcon;
|
||||
}
|
||||
|
||||
@@ -305,11 +308,35 @@ public class BlockConduitBundle extends BlockEio implements IGuiHandler, IFacade
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public float getBlockHardness(World world, int x, int y, int z) {
|
||||
IConduitBundle te = (IConduitBundle) world.getTileEntity(x, y, z);
|
||||
return te != null && te.getFacadeType() == FacadeType.HARDENED ? blockHardness * 10 : blockHardness;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) {
|
||||
float resist = getExplosionResistance(par1Entity);
|
||||
IConduitBundle te = (IConduitBundle) world.getTileEntity(x, y, z);
|
||||
return te != null && te.getFacadeType() == FacadeType.HARDENED ? resist * 10 : resist;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreakSpeed(BreakSpeed event) {
|
||||
if (event.block == this && event.entityPlayer.getCurrentEquippedItem() == null) {
|
||||
event.newSpeed *= 3;
|
||||
if(event.block == this) {
|
||||
ItemStack held = event.entityPlayer.getCurrentEquippedItem();
|
||||
if(held == null || held.getItem().getHarvestLevel(held, "pickaxe") == -1) {
|
||||
event.newSpeed += 2;
|
||||
}
|
||||
IConduitBundle te = (IConduitBundle) event.entity.worldObj.getTileEntity(event.x, event.y, event.z);
|
||||
if(te != null && te.getFacadeType() == FacadeType.HARDENED) {
|
||||
if(!ConduitUtil.isSolidFacadeRendered(te, event.entityPlayer)) {
|
||||
event.newSpeed *= 6;
|
||||
} else {
|
||||
event.newSpeed *= 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,11 +391,12 @@ public class BlockConduitBundle extends BlockEio implements IGuiHandler, IFacade
|
||||
List<ItemStack> drop = new ArrayList<ItemStack>();
|
||||
if(ConduitUtil.isSolidFacadeRendered(te, player)) {
|
||||
breakBlock = false;
|
||||
ItemStack fac = new ItemStack(EnderIO.itemConduitFacade, 1, 0);
|
||||
ItemStack fac = new ItemStack(EnderIO.itemConduitFacade, 1, te.getFacadeType().ordinal());
|
||||
PainterUtil.setSourceBlock(fac, te.getFacadeId(), te.getFacadeMetadata());
|
||||
drop.add(fac);
|
||||
te.setFacadeId(null);
|
||||
te.setFacadeMetadata(0);
|
||||
te.setFacadeType(FacadeType.BASIC);
|
||||
}
|
||||
|
||||
if(breakBlock) {
|
||||
@@ -591,7 +619,7 @@ public class BlockConduitBundle extends BlockEio implements IGuiHandler, IFacade
|
||||
private boolean handleConduitClick(World world, int x, int y, int z, EntityPlayer player, IConduitBundle bundle, ItemStack stack) {
|
||||
IConduitItem equipped = (IConduitItem) stack.getItem();
|
||||
if(!bundle.hasType(equipped.getBaseConduitType())) {
|
||||
bundle.addConduit(equipped.createConduit(stack));
|
||||
bundle.addConduit(equipped.createConduit(stack, player));
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, stepSound.getStepResourcePath(),
|
||||
(stepSound.getVolume() + 1.0F) / 2.0F, stepSound.getPitch() * 0.8F);
|
||||
@@ -614,6 +642,7 @@ public class BlockConduitBundle extends BlockEio implements IGuiHandler, IFacade
|
||||
|
||||
bundle.setFacadeId(PainterUtil.getSourceBlock(player.getCurrentEquippedItem()));
|
||||
bundle.setFacadeMetadata(PainterUtil.getSourceBlockMetadata(player.getCurrentEquippedItem()));
|
||||
bundle.setFacadeType(FacadeType.values()[player.getCurrentEquippedItem().getItemDamage()]);
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
stack.stackSize--;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.api.tool.IConduitControl;
|
||||
import crazypants.enderio.conduit.gas.GasUtil;
|
||||
import crazypants.enderio.conduit.me.MEUtil;
|
||||
|
||||
@@ -45,20 +46,31 @@ public enum ConduitDisplayMode {
|
||||
return res;
|
||||
}
|
||||
|
||||
private static final String NBT_KEY = "enderio.displaymode";
|
||||
|
||||
public static ConduitDisplayMode getDisplayMode(ItemStack equipped) {
|
||||
if(equipped == null || equipped.getItem() != EnderIO.itemYetaWench) {
|
||||
if(equipped == null || !(equipped.getItem() instanceof IConduitControl)) {
|
||||
return ALL;
|
||||
}
|
||||
int index = equipped.getItemDamage();
|
||||
initDisplayModeTag(equipped);
|
||||
int index = equipped.stackTagCompound.getInteger(NBT_KEY);
|
||||
index = MathHelper.clamp_int(index, 0, ConduitDisplayMode.values().length - 1);
|
||||
return ConduitDisplayMode.values()[index];
|
||||
}
|
||||
|
||||
public static void setDisplayMode(ItemStack equipped, ConduitDisplayMode mode) {
|
||||
if(mode == null || equipped == null) {
|
||||
if(mode == null || equipped == null || !(equipped.getItem() instanceof IConduitControl)) {
|
||||
return;
|
||||
}
|
||||
equipped.setItemDamage(mode.ordinal());
|
||||
initDisplayModeTag(equipped);
|
||||
equipped.stackTagCompound.setInteger(NBT_KEY, mode.ordinal());
|
||||
}
|
||||
|
||||
private static void initDisplayModeTag(ItemStack stack) {
|
||||
if (stack.stackTagCompound == null) {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setInteger(NBT_KEY, ConduitDisplayMode.ALL.ordinal());
|
||||
}
|
||||
}
|
||||
|
||||
public ConduitDisplayMode next() {
|
||||
|
||||
@@ -9,6 +9,7 @@ import appeng.api.AEApi;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.facade.ItemConduitFacade.FacadeType;
|
||||
import crazypants.enderio.conduit.item.filter.ClearFilterRecipe;
|
||||
import crazypants.enderio.conduit.item.filter.CopyFilterRecipe;
|
||||
import crazypants.enderio.conduit.me.MEUtil;
|
||||
@@ -18,7 +19,6 @@ import crazypants.enderio.material.Alloy;
|
||||
import crazypants.enderio.material.BlockFusedQuartz;
|
||||
import crazypants.enderio.material.FrankenSkull;
|
||||
import crazypants.enderio.material.Material;
|
||||
|
||||
import static crazypants.enderio.ModObject.*;
|
||||
|
||||
public class ConduitRecipes {
|
||||
@@ -42,7 +42,8 @@ public class ConduitRecipes {
|
||||
ItemStack zombieController = new ItemStack(EnderIO.itemFrankenSkull, 1, FrankenSkull.ZOMBIE_CONTROLLER.ordinal());
|
||||
|
||||
//Recipes
|
||||
GameRegistry.addShapedRecipe(new ItemStack(EnderIO.itemConduitFacade, 1, 0), "bbb", "b b", "bbb", 'b', conduitBinder);
|
||||
GameRegistry.addShapedRecipe(new ItemStack(EnderIO.itemConduitFacade, 1, FacadeType.BASIC.ordinal()), "bbb", "b b", "bbb", 'b', conduitBinder);
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(EnderIO.itemConduitFacade, 1, FacadeType.HARDENED.ordinal()), " o ", "oFo", " o ", 'F', EnderIO.itemConduitFacade, 'o', "dustObsidian"));
|
||||
|
||||
int numConduits = Config.numConduitsPerRecipe;
|
||||
GameRegistry.addShapedRecipe(new ItemStack(EnderIO.itemLiquidConduit, numConduits, 0), "bbb", "###", "bbb", 'b', conduitBinder, '#', fusedGlass);
|
||||
@@ -89,7 +90,11 @@ public class ConduitRecipes {
|
||||
|
||||
ItemStack speedUpgrade = new ItemStack(EnderIO.itemExtractSpeedUpgrade, 1, 0);
|
||||
GameRegistry.addShapedRecipe(speedUpgrade, "iii","epe","ere", 'p', Blocks.piston, 'e', electricalSteel, 'r', Blocks.redstone_torch, 'i', Items.iron_ingot);
|
||||
|
||||
|
||||
ItemStack speedDowngrade = new ItemStack(EnderIO.itemExtractSpeedUpgrade, 1, 1);
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(speedDowngrade, "iii","ese","ete", 's', "slimeball", 'e', electricalSteel, 't', "stickWood", 'i', Items.iron_ingot));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(speedDowngrade, "iii","ese","ete", 's', "slimeball", 'e', electricalSteel, 't', "woodStick", 'i', Items.iron_ingot));
|
||||
|
||||
if (MEUtil.isMEEnabled()) {
|
||||
addAeRecipes();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.Log;
|
||||
import crazypants.enderio.api.tool.IConduitControl;
|
||||
import crazypants.enderio.api.tool.IHideFacades;
|
||||
import crazypants.enderio.conduit.IConduitBundle.FacadeRenderState;
|
||||
import crazypants.enderio.conduit.gas.GasConduitNetwork;
|
||||
import crazypants.enderio.conduit.gas.IGasConduit;
|
||||
@@ -123,6 +125,10 @@ public class ConduitUtil {
|
||||
if(con.getNetwork() != null) { //this should have been destroyed when destroying the neighbours network but lets just make sure
|
||||
con.getNetwork().destroyNetwork();
|
||||
}
|
||||
con.connectionsChanged();
|
||||
if(neighbour != null) {
|
||||
neighbour.connectionsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public static <T extends IConduit> boolean joinConduits(T con, ForgeDirection faceHit) {
|
||||
@@ -137,6 +143,8 @@ public class ConduitUtil {
|
||||
if(neighbour.getNetwork() != null) {
|
||||
neighbour.getNetwork().destroyNetwork();
|
||||
}
|
||||
con.connectionsChanged();
|
||||
neighbour.connectionsChanged();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -177,7 +185,7 @@ public class ConduitUtil {
|
||||
}
|
||||
|
||||
public static boolean isFacadeHidden(IConduitBundle bundle, EntityPlayer player) {
|
||||
return bundle.getFacadeId() != null && ((ToolUtil.isToolEquipped(player) && (player == null || ToolUtil.getEquippedTool(player).shouldHideFacades(player.getCurrentEquippedItem(), player))) || isConduitEquipped(player) || isProbeEquipped(player));
|
||||
return bundle.getFacadeId() != null && shouldHeldItemHideFacades(player);
|
||||
}
|
||||
|
||||
public static ConduitDisplayMode getDisplayMode(EntityPlayer player) {
|
||||
@@ -190,10 +198,6 @@ public class ConduitUtil {
|
||||
return ConduitDisplayMode.ALL;
|
||||
}
|
||||
|
||||
if(equipped.getItem() != EnderIO.itemYetaWench) {
|
||||
return ConduitDisplayMode.ALL;
|
||||
}
|
||||
|
||||
ConduitDisplayMode result = ConduitDisplayMode.getDisplayMode(equipped);
|
||||
if(result == null) {
|
||||
return ConduitDisplayMode.ALL;
|
||||
@@ -234,6 +238,18 @@ public class ConduitUtil {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean shouldHeldItemHideFacades(EntityPlayer player) {
|
||||
player = player == null ? EnderIO.proxy.getClientPlayer() : player;
|
||||
if(player == null) {
|
||||
return false;
|
||||
}
|
||||
ItemStack held = player.getCurrentEquippedItem();
|
||||
if(held != null && held.getItem() instanceof IHideFacades) {
|
||||
return ((IHideFacades) held.getItem()).shouldHideFacades(held, player);
|
||||
}
|
||||
return ToolUtil.isToolEquipped(player);
|
||||
}
|
||||
|
||||
public static boolean isConduitEquipped(EntityPlayer player) {
|
||||
player = player == null ? EnderIO.proxy.getClientPlayer() : player;
|
||||
if(player == null) {
|
||||
|
||||
@@ -66,6 +66,8 @@ public interface IConduit {
|
||||
|
||||
void conduitConnectionRemoved(ForgeDirection fromDirection);
|
||||
|
||||
void connectionsChanged();
|
||||
|
||||
AbstractConduitNetwork<?, ?> getNetwork();
|
||||
|
||||
boolean setNetwork(AbstractConduitNetwork<?, ?> network);
|
||||
|
||||
@@ -16,6 +16,7 @@ import cofh.api.transport.IItemDuct;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.conduit.facade.ItemConduitFacade.FacadeType;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.Offset;
|
||||
import crazypants.enderio.power.IInternalPowerHandler;
|
||||
@@ -93,12 +94,16 @@ public interface IConduitBundle extends IInternalPowerHandler, IFluidHandler, II
|
||||
|
||||
void setFacadeId(Block block, boolean triggerUpdate);
|
||||
|
||||
Block getFacadeId();
|
||||
|
||||
void setFacadeMetadata(int meta);
|
||||
|
||||
void setFacadeType(FacadeType type);
|
||||
|
||||
Block getFacadeId();
|
||||
|
||||
int getFacadeMetadata();
|
||||
|
||||
|
||||
FacadeType getFacadeType();
|
||||
|
||||
World getWorld();
|
||||
|
||||
void setGridNode(Object node);
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import crazypants.enderio.api.tool.IHideFacades;
|
||||
|
||||
public interface IConduitItem {
|
||||
public interface IConduitItem extends IHideFacades {
|
||||
|
||||
Class<? extends IConduit> getBaseConduitType();
|
||||
|
||||
IConduit createConduit(ItemStack item);
|
||||
IConduit createConduit(ItemStack item, EntityPlayer player);
|
||||
|
||||
}
|
||||
@@ -25,6 +25,7 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.TileEntityEio;
|
||||
import crazypants.enderio.conduit.facade.ItemConduitFacade.FacadeType;
|
||||
import crazypants.enderio.conduit.gas.IGasConduit;
|
||||
import crazypants.enderio.conduit.geom.CollidableCache;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
@@ -50,6 +51,7 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
|
||||
private Block facadeId = null;
|
||||
private int facadeMeta = 0;
|
||||
private FacadeType facadeType = FacadeType.BASIC;
|
||||
|
||||
private boolean facadeChanged;
|
||||
|
||||
@@ -100,6 +102,7 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
nbtRoot.setTag("conduits", conduitTags);
|
||||
if(facadeId != null) {
|
||||
nbtRoot.setString("facadeId", Block.blockRegistry.getNameForObject(facadeId));
|
||||
nbtRoot.setString("facadeType", facadeType.name());
|
||||
} else {
|
||||
nbtRoot.setString("facadeId", "null");
|
||||
}
|
||||
@@ -126,8 +129,12 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
String fs = nbtRoot.getString("facadeId");
|
||||
if(fs == null || "null".equals(fs)) {
|
||||
facadeId = null;
|
||||
facadeType = FacadeType.BASIC;
|
||||
} else {
|
||||
facadeId = Block.getBlockFromName(fs);
|
||||
if(nbtRoot.hasKey("facadeType")) { // backwards compat, never true in freshly placed bundles
|
||||
facadeType = FacadeType.valueOf(nbtRoot.getString("facadeType"));
|
||||
}
|
||||
}
|
||||
facadeMeta = nbtRoot.getInteger("facadeMeta");
|
||||
|
||||
@@ -164,11 +171,21 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
public void setFacadeMetadata(int meta) {
|
||||
facadeMeta = meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacadeType(FacadeType type) {
|
||||
facadeType = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFacadeMetadata() {
|
||||
return facadeMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FacadeType getFacadeType() {
|
||||
return facadeType;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -545,6 +562,24 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Merge all internal conduit connectors into one box
|
||||
BoundingBox conBB = null;
|
||||
for (int i = 0; i < result.size(); i++) {
|
||||
CollidableComponent cc = result.get(i);
|
||||
if (cc.conduitType == null && cc.data == ConduitConnectorType.INTERNAL) {
|
||||
conBB = conBB == null ? cc.bound : conBB.expandBy(cc.bound);
|
||||
result.remove(i);
|
||||
i--;
|
||||
cachedConnectors.remove(cc);
|
||||
}
|
||||
}
|
||||
|
||||
if(conBB != null) {
|
||||
CollidableComponent cc = new CollidableComponent(null, conBB, ForgeDirection.UNKNOWN, ConduitConnectorType.INTERNAL);
|
||||
result.add(cc);
|
||||
cachedConnectors.add(cc);
|
||||
}
|
||||
|
||||
// External Connectors
|
||||
Set<ForgeDirection> externalDirs = new HashSet<ForgeDirection>();
|
||||
@@ -566,7 +601,6 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
}
|
||||
|
||||
connectorsDirty = false;
|
||||
|
||||
}
|
||||
|
||||
private boolean axisOfConnectionsEqual(Set<ForgeDirection> cons) {
|
||||
@@ -875,8 +909,7 @@ public class TileConduitBundle extends TileEntityEio implements IConduitBundle {
|
||||
if (cond == null) {
|
||||
return AECableType.NONE;
|
||||
} else {
|
||||
ConnectionMode mode = cond.getConnectionMode(dir);
|
||||
return mode == ConnectionMode.DISABLED ? AECableType.NONE : AECableType.SMART;
|
||||
return cond.isConnectedTo(dir) ? AECableType.SMART : AECableType.NONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.machine.painter.IPaintedBlock;
|
||||
|
||||
public class BlockConduitFacade extends Block implements IPaintedBlock{
|
||||
public class BlockConduitFacade extends BlockEio implements IPaintedBlock {
|
||||
|
||||
public static BlockConduitFacade create() {
|
||||
BlockConduitFacade result = new BlockConduitFacade();
|
||||
@@ -26,18 +26,11 @@ public class BlockConduitFacade extends Block implements IPaintedBlock{
|
||||
private Block blockOverride;
|
||||
|
||||
private BlockConduitFacade() {
|
||||
super(new Material(MapColor.stoneColor));
|
||||
setHardness(0.5F);
|
||||
super(ModObject.blockConduitFacade.unlocalisedName, null, new Material(MapColor.stoneColor));
|
||||
setStepSound(Block.soundTypeStone);
|
||||
setHarvestLevel("pickaxe", 0);
|
||||
setBlockName(ModObject.blockConduitFacade.unlocalisedName);
|
||||
setCreativeTab(null);
|
||||
}
|
||||
|
||||
private void init() {
|
||||
GameRegistry.registerBlock(this, ModObject.blockConduitFacade.unlocalisedName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister IIconRegister) {
|
||||
blockIcon = IIconRegister.registerIcon("enderio:conduitFacade");
|
||||
|
||||
@@ -92,7 +92,7 @@ public class FacadeRenderer implements IItemRenderer {
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
|
||||
} else {
|
||||
renderBlocks.setOverrideBlockTexture(EnderIO.itemConduitFacade.getIconFromDamage(0));
|
||||
renderBlocks.setOverrideBlockTexture(EnderIO.itemConduitFacade.getIconFromDamage(item.getItemDamage()));
|
||||
renderBlocks.renderBlockAsItem(Blocks.stone, 0, 1.0F);
|
||||
renderBlocks.clearOverrideBlockTexture();
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -20,14 +21,27 @@ import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.gui.IAdvancedTooltipProvider;
|
||||
import crazypants.enderio.gui.IResourceTooltipProvider;
|
||||
import crazypants.enderio.gui.TooltipAddera;
|
||||
import crazypants.enderio.machine.painter.BasicPainterTemplate;
|
||||
import crazypants.enderio.machine.painter.IPaintedBlock;
|
||||
import crazypants.enderio.machine.painter.PaintSourceValidator;
|
||||
import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import crazypants.util.Util;
|
||||
import crazypants.util.Lang;
|
||||
|
||||
public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider {
|
||||
public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider, IResourceTooltipProvider {
|
||||
|
||||
public static enum FacadeType {
|
||||
BASIC,
|
||||
HARDENED;
|
||||
|
||||
public String getUnlocName(Item me) {
|
||||
return this == BASIC ? me.getUnlocalizedName() : me.getUnlocalizedName() + ".hardened";
|
||||
}
|
||||
}
|
||||
|
||||
private IIcon[] icons;
|
||||
|
||||
public static ItemConduitFacade create() {
|
||||
ItemConduitFacade result = new ItemConduitFacade();
|
||||
@@ -39,17 +53,37 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider
|
||||
|
||||
protected ItemConduitFacade() {
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
setUnlocalizedName("enderio." + ModObject.itemConduitFacade.name());
|
||||
setMaxStackSize(64);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerItem(this, ModObject.itemConduitFacade.unlocalisedName);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs p_150895_2_, List list) {
|
||||
for (FacadeType t : FacadeType.values()) {
|
||||
list.add(new ItemStack(item, 1, t.ordinal()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return FacadeType.values()[stack.getItemDamage()].getUnlocName(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return "item.enderio." + ModObject.itemConduitFacade.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister IIconRegister) {
|
||||
itemIcon = IIconRegister.registerIcon("enderio:conduitFacade");
|
||||
icons = new IIcon[FacadeType.values().length];
|
||||
icons[0] = itemIcon = IIconRegister.registerIcon("enderio:conduitFacade");
|
||||
icons[1] = IIconRegister.registerIcon("enderio:conduitFacadeHardened");
|
||||
overlayIcon = IIconRegister.registerIcon("enderio:conduitFacadeOverlay");
|
||||
}
|
||||
|
||||
@@ -57,6 +91,16 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider
|
||||
return overlayIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
return icons[damage % icons.length];
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||
return getIconFromDamage(stack.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float par8,
|
||||
float par9, float par10) {
|
||||
@@ -77,6 +121,7 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider
|
||||
IConduitBundle bundle = (IConduitBundle) world.getTileEntity(placeX, placeY, placeZ);
|
||||
bundle.setFacadeId(PainterUtil.getSourceBlock(itemStack));
|
||||
bundle.setFacadeMetadata(PainterUtil.getSourceBlockMetadata(itemStack));
|
||||
bundle.setFacadeType(FacadeType.values()[itemStack.getItemDamage()]);
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
itemStack.stackSize--;
|
||||
}
|
||||
@@ -91,7 +136,7 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider
|
||||
public boolean isFull3D() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public ItemStack createItemStackForSourceBlock(Block id, int itemDamage) {
|
||||
if(id == null) {
|
||||
id = EnderIO.blockConduitFacade;
|
||||
@@ -101,34 +146,45 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider
|
||||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack item, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
super.addInformation(item, par2EntityPlayer, list, par4);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameForTooltip(ItemStack itemStack) {
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
if(PainterUtil.getSourceBlock(itemstack) == null) {
|
||||
list.add("Not Painted");
|
||||
list.add(Lang.localize("item.itemConduitFacade.tooltip.notpainted"));
|
||||
} else {
|
||||
list.add(PainterUtil.getTooltTipText(itemstack));
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
TooltipAddera.addDetailedTooltipFromResources(list, itemstack);
|
||||
if(itemstack.getItemDamage() == FacadeType.HARDENED.ordinal()) {
|
||||
list.add("");
|
||||
list.add(Lang.localize(getUnlocalizedName(itemstack) + ".tooltip", false));
|
||||
}
|
||||
}
|
||||
|
||||
public final class FacadePainterRecipe extends BasicPainterTemplate {
|
||||
@@ -156,11 +212,11 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider
|
||||
}
|
||||
return block.getRenderType() == 0 || block.isOpaqueCube() || block.isNormalCube();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isValidTarget(ItemStack target) {
|
||||
return target != null && target.getItem() == ItemConduitFacade.this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -115,7 +115,7 @@ public class GasConduitRenderer extends DefaultConduitRenderer {
|
||||
}
|
||||
|
||||
if(conduit.getConnectionMode(component.dir) == ConnectionMode.DISABLED) {
|
||||
tex = EnderIO.blockConduitBundle.getConnectorIcon();
|
||||
tex = EnderIO.blockConduitBundle.getConnectorIcon(component.data);
|
||||
List<Vertex> corners = component.bound.getCornersWithUvForFace(component.dir, tex.getMinU(), tex.getMaxU(), tex.getMinV(), tex.getMaxV());
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
for (Vertex c : corners) {
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ItemGasConduit extends AbstractItemConduit implements IAdvancedTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConduit createConduit(ItemStack stack) {
|
||||
public IConduit createConduit(ItemStack stack, EntityPlayer player) {
|
||||
return new GasConduit();
|
||||
}
|
||||
|
||||
@@ -65,5 +65,10 @@ public class ItemGasConduit extends AbstractItemConduit implements IAdvancedTool
|
||||
list.add(Lang.localize("itemGasConduit.tooltip.maxIo") + " " + maxIo + gpt);
|
||||
TooltipAddera.addDetailedTooltipFromResources(list, "enderio.itemGasConduit");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldHideFacades(ItemStack stack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -140,7 +140,7 @@ public class BaseSettingsPanel implements ITabPanel {
|
||||
x += gap + leftArrow.getWidth() + fr.getStringWidth(modeLabel) + gap;
|
||||
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
IconEIO icon = new IconEIO(10, 60, 64, 20);
|
||||
IconEIO icon = new IconEIO(10, 48, 64, 16);
|
||||
icon.renderIcon(x - gap, y - (fr.FONT_HEIGHT / 2) - 1, getLongestModeStringWidth() + gap * 2, leftArrow.getHeight(), 0, true);
|
||||
|
||||
int move = (getLongestModeStringWidth() - fr.getStringWidth(modeString)) / 2;
|
||||
|
||||
@@ -11,10 +11,12 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.gui.item.InventoryFilterUpgrade;
|
||||
import crazypants.enderio.conduit.gui.item.InventorySpeedUpgrades;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
import crazypants.enderio.conduit.item.SpeedUpgrade;
|
||||
import crazypants.enderio.conduit.item.filter.IItemFilter;
|
||||
|
||||
public class ExternalConnectionContainer extends Container {
|
||||
@@ -24,6 +26,7 @@ public class ExternalConnectionContainer extends Container {
|
||||
private ForgeDirection dir;
|
||||
private IItemConduit itemConduit;
|
||||
|
||||
private int speedUpgradeSlotLimit = 15;
|
||||
private IItemFilter inputFilter;
|
||||
private IItemFilter outputFilter;
|
||||
|
||||
@@ -86,7 +89,11 @@ public class ExternalConnectionContainer extends Container {
|
||||
public boolean isItemValid(ItemStack par1ItemStack) {
|
||||
return si.isItemValidForSlot(0, par1ItemStack);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getSlotStackLimit() {
|
||||
return speedUpgradeSlotLimit;
|
||||
}
|
||||
});
|
||||
slotLocations.add(new Point(x, y));
|
||||
|
||||
@@ -193,6 +200,11 @@ public class ExternalConnectionContainer extends Container {
|
||||
|
||||
@Override
|
||||
public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer) {
|
||||
ItemStack st = par4EntityPlayer.inventory.getItemStack();
|
||||
if(st != null && st.getItem() == EnderIO.itemExtractSpeedUpgrade) {
|
||||
SpeedUpgrade speedUpgrade = EnderIO.itemExtractSpeedUpgrade.getSpeedUpgrade(st);
|
||||
speedUpgradeSlotLimit = speedUpgrade.maxStackSize;
|
||||
}
|
||||
if(par4EntityPlayer.worldObj != null) {
|
||||
if(par1 >= startFilterSlot && itemConduit != null) {
|
||||
itemConduit.setInputFilter(dir, inputFilter);
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -27,6 +28,8 @@ import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.gui.GuiContainerBase;
|
||||
import crazypants.render.RenderUtil;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
|
||||
public class GuiExternalConnection extends GuiContainerBase {
|
||||
|
||||
private static final int TAB_HEIGHT = 24;
|
||||
@@ -69,9 +72,9 @@ public class GuiExternalConnection extends GuiContainerBase {
|
||||
ySize = 166 + 29;
|
||||
xSize = 206;
|
||||
|
||||
getContainer().setInputSlotsVisible(false);
|
||||
getContainer().setOutputSlotsVisible(false);
|
||||
getContainer().setInventorySlotsVisible(false);
|
||||
container.setInputSlotsVisible(false);
|
||||
container.setOutputSlotsVisible(false);
|
||||
container.setInventorySlotsVisible(false);
|
||||
|
||||
List<IConduit> cons = new ArrayList<IConduit>(bundle.getConduits());
|
||||
Collections.sort(cons, new Comparator<IConduit>() {
|
||||
@@ -94,6 +97,7 @@ public class GuiExternalConnection extends GuiContainerBase {
|
||||
|
||||
for (IConduit con : cons) {
|
||||
if(con.containsExternalConnection(dir) || con.canConnectToExternal(dir, true)) {
|
||||
@SuppressWarnings("LeakingThisInConstructor")
|
||||
ITabPanel tab = TabFactory.instance.createPanelForConduit(this, con);
|
||||
if(tab != null) {
|
||||
conduits.add(con);
|
||||
@@ -173,7 +177,7 @@ public class GuiExternalConnection extends GuiContainerBase {
|
||||
RenderUtil.bindTexture(IconEIO.TEXTURE);
|
||||
IconEIO.INACTIVE_TAB.renderIcon(tabX, sy + tabYOffset + (i * 24));
|
||||
IconEIO icon = tabs.get(i).getIcon();
|
||||
icon.renderIcon(tabX + 4, sy + tabYOffset + (i * TAB_HEIGHT) + 7, 10, 10, 0, false);
|
||||
icon.renderIcon(tabX + 4, sy + tabYOffset + (i * TAB_HEIGHT) + 6, 11, 11, 0, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +192,7 @@ public class GuiExternalConnection extends GuiContainerBase {
|
||||
|
||||
if(tabs.size() > 0) {
|
||||
IconEIO icon = tabs.get(activeTab).getIcon();
|
||||
icon.renderIcon(tabX + 4, sy + tabYOffset + (activeTab * TAB_HEIGHT) + 7, 10, 10, 0, false);
|
||||
icon.renderIcon(tabX - 1, sy + tabYOffset + (activeTab * TAB_HEIGHT) + 4);
|
||||
tes.draw();
|
||||
tabs.get(activeTab).render(par1, par2, par3);
|
||||
} else {
|
||||
@@ -205,4 +209,18 @@ public class GuiExternalConnection extends GuiContainerBase {
|
||||
return container;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "NotEnoughItems")
|
||||
public boolean hideItemPanelSlot(GuiContainer gc, int x, int y, int w, int h) {
|
||||
if(tabs.size() > 0) {
|
||||
int sx = (width - xSize) / 2;
|
||||
int sy = (height - ySize) / 2;
|
||||
int tabX = sx + xSize - 3;
|
||||
int tabY = sy + tabYOffset;
|
||||
|
||||
return (x+w) >= tabX && x < (tabX + 14) && (y+h) >= tabY && y < (tabY + tabs.size()*TAB_HEIGHT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -263,7 +263,7 @@ public class LiquidSettings extends BaseSettingsPanel {
|
||||
if(isEnder && isFilterVisible()) {
|
||||
|
||||
if(conduit.getConnectionMode(gui.getDir()) == ConnectionMode.IN_OUT) {
|
||||
String inOutStr = inOutShowIn ? "Extract" : "Insert";
|
||||
String inOutStr = inOutShowIn ? Lang.localize("gui.conduit.ioMode.input") : Lang.localize("gui.conduit.ioMode.output");
|
||||
int x = gui.getGuiLeft() + gui.getXSize() - 20 - 5 - gui.getFontRenderer().getStringWidth(inOutStr);
|
||||
int y = top;
|
||||
gui.getFontRenderer().drawString(inOutStr, x, y, ColorUtil.getRGB(Color.DARK_GRAY));
|
||||
|
||||
@@ -102,10 +102,10 @@ public class ExistingItemFilterGui implements IItemFilterGui {
|
||||
useOreDictB.setUnselectedToolTip(Lang.localize("gui.conduit.item.oreDicDisabled"));
|
||||
useOreDictB.setPaintSelectedBorder(false);
|
||||
|
||||
snapshotB = new GuiButton(ID_SNAPSHOT, 0, 0, 60, 20, "Snapshot");
|
||||
mergeB = new GuiButton(ID_MERGE, 0, 0, 40, 20, "Merge");
|
||||
clearB = new GuiButton(ID_CLEAR, 0, 0, 60, 20, "Clear");
|
||||
showB = new GuiButton(ID_SHOW, 0, 0, 40, 20, "Show");
|
||||
snapshotB = new GuiButton(ID_SNAPSHOT, 0, 0, 60, 20, Lang.localize("gui.conduit.button.snap"));
|
||||
mergeB = new GuiButton(ID_MERGE, 0, 0, 40, 20, Lang.localize("gui.conduit.button.merge"));
|
||||
clearB = new GuiButton(ID_CLEAR, 0, 0, 60, 20, Lang.localize("gui.conduit.button.clear"));
|
||||
showB = new GuiButton(ID_SHOW, 0, 0, 40, 20, Lang.localize("gui.conduit.button.show"));
|
||||
|
||||
snapshotOverlay = new SnapshotOverlay();
|
||||
gui.addOverlay(snapshotOverlay);
|
||||
|
||||
@@ -134,6 +134,8 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
loopB.setUnselectedToolTip(Lang.localize("gui.conduit.item.selfFeedDisabled"));
|
||||
loopB.setPaintSelectedBorder(false);
|
||||
|
||||
priorityTooltip = new GuiToolTip(new Rectangle(priLeft + 9, y, priWidth, 16), Lang.localize("gui.conduit.item.priority"));
|
||||
|
||||
x = priLeft + priWidth + 9;
|
||||
priUpB = new IconButtonEIO(gui, ID_PRIORITY_UP, x, y, IconEIO.ADD_BUT);
|
||||
priUpB.setSize(8, 8);
|
||||
@@ -142,8 +144,6 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
priDownB = new IconButtonEIO(gui, ID_PRIORITY_DOWN, x, y, IconEIO.MINUS_BUT);
|
||||
priDownB.setSize(8, 8);
|
||||
|
||||
priorityTooltip = new GuiToolTip(new Rectangle(priLeft + 9, y, priWidth, 20), Lang.localize("gui.conduit.item.priority"));
|
||||
|
||||
gui.getContainer().addFilterListener(new FilterChangeListener() {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,20 +20,23 @@ import crazypants.render.RenderUtil;
|
||||
|
||||
public class ModItemFilterGui implements IItemFilterGui {
|
||||
|
||||
|
||||
private IItemConduit itemConduit;
|
||||
private GuiExternalConnection gui;
|
||||
private static final int MOD_NAME_COLOR = ColorUtil.getRGB(Color.white);
|
||||
|
||||
private final IItemConduit itemConduit;
|
||||
private final GuiExternalConnection gui;
|
||||
|
||||
boolean isInput;
|
||||
|
||||
private ModItemFilter filter;
|
||||
private final ModItemFilter filter;
|
||||
|
||||
private Rectangle[] inputBounds;
|
||||
private final Rectangle[] inputBounds;
|
||||
|
||||
private IconButtonEIO[] deleteButs;
|
||||
private final IconButtonEIO[] deleteButs;
|
||||
|
||||
private int inputOffsetX;
|
||||
private int tfWidth;
|
||||
private final int inputOffsetX;
|
||||
private final int tfWidth;
|
||||
private final int tfTextureX;
|
||||
private final int tfTextureY;
|
||||
|
||||
public ModItemFilterGui(GuiExternalConnection gui, IItemConduit itemConduit, boolean isInput) {
|
||||
this.gui = gui;
|
||||
@@ -44,18 +47,22 @@ public class ModItemFilterGui implements IItemFilterGui {
|
||||
if(isInput) {
|
||||
filter = (ModItemFilter) itemConduit.getInputFilter(gui.getDir());
|
||||
inputOffsetX = 50;
|
||||
tfWidth = 86;
|
||||
tfWidth = 96;
|
||||
tfTextureX = 120;
|
||||
tfTextureY = 214;
|
||||
} else {
|
||||
filter = (ModItemFilter) itemConduit.getOutputFilter(gui.getDir());
|
||||
inputOffsetX = 32;
|
||||
tfWidth = 104;
|
||||
tfWidth = 114;
|
||||
tfTextureX = 120;
|
||||
tfTextureY = 238;
|
||||
}
|
||||
|
||||
|
||||
inputBounds = new Rectangle[] {
|
||||
new Rectangle(inputOffsetX,48,16,16),
|
||||
new Rectangle(inputOffsetX,69,16,16),
|
||||
new Rectangle(inputOffsetX,90,16,16)
|
||||
new Rectangle(inputOffsetX,47,16,16),
|
||||
new Rectangle(inputOffsetX,68,16,16),
|
||||
new Rectangle(inputOffsetX,89,16,16)
|
||||
};
|
||||
|
||||
deleteButs = new IconButtonEIO[inputBounds.length];
|
||||
@@ -98,11 +105,9 @@ public class ModItemFilterGui implements IItemFilterGui {
|
||||
RenderUtil.bindTexture("enderio:textures/gui/externalConduitConnection.png");
|
||||
for(Rectangle r : inputBounds) {
|
||||
//slot
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + r.x - 1, gui.getGuiTop() + r.y - 1, 24, 238, 18, 18);
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + r.x - 1, gui.getGuiTop() + r.y - 1, 24, 214, 18, 18);
|
||||
//text box
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + r.x + 38, gui.getGuiTop() + r.y - 1, 24, 238, 4, 18);
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + r.x + 42, gui.getGuiTop() + r.y - 1, 120, 238, tfWidth, 18);
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + r.x + 42 + tfWidth, gui.getGuiTop() + r.y - 1, 38, 238, 4, 18);
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + r.x + 38, gui.getGuiTop() + r.y - 1, tfTextureX, tfTextureY, tfWidth, 18);
|
||||
}
|
||||
|
||||
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
|
||||
@@ -110,17 +115,10 @@ public class ModItemFilterGui implements IItemFilterGui {
|
||||
String mod = filter.getModAt(i);
|
||||
if(mod != null) {
|
||||
Rectangle r = inputBounds[i];
|
||||
fr.drawStringWithShadow(mod, gui.getGuiLeft() + r.x + 41, gui.getGuiTop() + r.y + 4 , ColorUtil.getRGB(Color.white));
|
||||
mod = fr.trimStringToWidth(mod, tfWidth - 6);
|
||||
fr.drawStringWithShadow(mod, gui.getGuiLeft() + r.x + 41, gui.getGuiTop() + r.y + 4, MOD_NAME_COLOR);
|
||||
}
|
||||
}
|
||||
|
||||
RenderUtil.bindTexture("enderio:textures/gui/externalConduitConnection.png");
|
||||
int edge = inputBounds[0].x + tfWidth + 46;
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + edge, gui.getGuiTop() + inputBounds[0].y, edge, 20, 30, 60);
|
||||
for(Rectangle r : inputBounds) {
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + edge - 1, gui.getGuiTop() + r.y - 1, 41, 238, 1, 18);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
@@ -76,6 +76,7 @@ public class PacketExistingItemFilterSnapshot extends AbstractConduitPacket<IIte
|
||||
case SET: {
|
||||
ItemConduitNetwork icn = (ItemConduitNetwork)conduit.getNetwork();
|
||||
NetworkedInventory inv = icn.getInventory(conduit, message.dir);
|
||||
inv.updateInventory();
|
||||
filter.setSnapshot(inv);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ import crazypants.enderio.tool.ToolUtil;
|
||||
import crazypants.render.IconUtil;
|
||||
import crazypants.util.BlockCoord;
|
||||
import crazypants.util.DyeColor;
|
||||
import crazypants.util.ItemUtil;
|
||||
|
||||
public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
|
||||
@@ -250,8 +251,13 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
return item;
|
||||
} else if(network == null) {
|
||||
return item;
|
||||
} else {
|
||||
IItemFilter filter = inputFilters.get(from);
|
||||
ItemConduitNetwork network = (ItemConduitNetwork) getNetwork();
|
||||
if(filter != null && !filter.doesItemPassFilter(network.getInventory(this, from.getOpposite()), item)) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
return network.sendItems(this, item, from);
|
||||
}
|
||||
|
||||
@@ -404,26 +410,18 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
|
||||
@Override
|
||||
public int getMaximumExtracted(ForgeDirection dir) {
|
||||
int numUpgrades = getNumSpeedUpgrades(dir);
|
||||
//int res = (int)Math.pow(4, numUpgrades);
|
||||
int res = 4 + (numUpgrades * 4);
|
||||
return res;
|
||||
ItemStack stack = speedUpgrades.get(dir);
|
||||
if(stack == null) {
|
||||
return SpeedUpgrade.BASE_MAX_EXTRACTED;
|
||||
}
|
||||
SpeedUpgrade speedUpgrade = EnderIO.itemExtractSpeedUpgrade.getSpeedUpgrade(stack);
|
||||
return speedUpgrade.getMaximumExtracted(stack.stackSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTickTimePerItem(ForgeDirection dir) {
|
||||
int numUpgrades = getNumSpeedUpgrades(dir);
|
||||
float maxExtract = 10f / getMaximumExtracted(dir);
|
||||
return maxExtract;
|
||||
|
||||
}
|
||||
|
||||
private int getNumSpeedUpgrades(ForgeDirection dir) {
|
||||
ItemStack stack = speedUpgrades.get(dir);
|
||||
if(stack == null) {
|
||||
return 0;
|
||||
}
|
||||
return stack.stackSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
package crazypants.enderio.conduit.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -11,7 +16,11 @@ import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.gui.IResourceTooltipProvider;
|
||||
|
||||
public class ItemExtractSpeedUpgrade extends Item implements IResourceTooltipProvider {
|
||||
|
||||
|
||||
private static final SpeedUpgrade UPGRADES[] = SpeedUpgrade.values();
|
||||
|
||||
private final IIcon[] icons;
|
||||
|
||||
public static ItemExtractSpeedUpgrade create() {
|
||||
ItemExtractSpeedUpgrade result = new ItemExtractSpeedUpgrade();
|
||||
result.init();
|
||||
@@ -21,22 +30,52 @@ public class ItemExtractSpeedUpgrade extends Item implements IResourceTooltipPro
|
||||
protected ItemExtractSpeedUpgrade() {
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
setUnlocalizedName(ModObject.itemExtractSpeedUpgrade.unlocalisedName);
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
setMaxStackSize(64);
|
||||
|
||||
icons = new IIcon[UPGRADES.length];
|
||||
}
|
||||
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerItem(this, ModObject.itemExtractSpeedUpgrade.unlocalisedName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
damage = MathHelper.clamp_int(damage, 0, icons.length - 1);
|
||||
return icons[damage];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister IIconRegister) {
|
||||
itemIcon = IIconRegister.registerIcon("enderio:extractSpeedUpgrade");
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
for (int i = 0; i < UPGRADES.length; i++) {
|
||||
icons[i] = iconRegister.registerIcon(UPGRADES[i].iconName);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
return getSpeedUpgrade(par1ItemStack).unlocName;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int j = 0; j < UPGRADES.length; ++j) {
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
}
|
||||
}
|
||||
|
||||
public SpeedUpgrade getSpeedUpgrade(ItemStack par1ItemStack) {
|
||||
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, UPGRADES.length - 1);
|
||||
return UPGRADES[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameForTooltip(ItemStack itemStack) {
|
||||
return getUnlocalizedName();
|
||||
return getUnlocalizedName(itemStack);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.enderio.conduit.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.AbstractItemConduit;
|
||||
@@ -32,8 +33,12 @@ public class ItemItemConduit extends AbstractItemConduit {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConduit createConduit(ItemStack item) {
|
||||
public IConduit createConduit(ItemStack item, EntityPlayer player) {
|
||||
return new ItemConduit(item.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldHideFacades(ItemStack stack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,6 @@ public class NetworkedInventory {
|
||||
}
|
||||
|
||||
public void onTick(long tick) {
|
||||
int transfered;
|
||||
if(tickDeficit > 0 || !canExtract() || !con.isExtractionRedstoneConditionMet(conDir)) {
|
||||
//do nothing
|
||||
} else {
|
||||
@@ -244,8 +243,7 @@ public class NetworkedInventory {
|
||||
return sendPriority;
|
||||
}
|
||||
|
||||
private void updateInventory() {
|
||||
|
||||
public final void updateInventory() {
|
||||
TileEntity te = world.getTileEntity(location.x, location.y, location.z);
|
||||
if(te instanceof ISidedInventory) {
|
||||
inv = (ISidedInventory) te;
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package crazypants.enderio.conduit.item;
|
||||
|
||||
public enum SpeedUpgrade {
|
||||
|
||||
UPGRADE("enderio:extractSpeedUpgrade", "item.itemExtractSpeedUpgrade", 15) {
|
||||
@Override
|
||||
public int getMaximumExtracted(int stackSize) {
|
||||
return BASE_MAX_EXTRACTED + Math.min(stackSize, maxStackSize) * 4;
|
||||
}
|
||||
},
|
||||
DOWNGRADE("enderio:extractSpeedDowngrade", "item.itemExtractSpeedDowngrade", 1) {
|
||||
@Override
|
||||
public int getMaximumExtracted(int stackSize) {
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
|
||||
public static final int BASE_MAX_EXTRACTED = 4;
|
||||
|
||||
public final String iconName;
|
||||
public final String unlocName;
|
||||
public final int maxStackSize;
|
||||
|
||||
private SpeedUpgrade(String iconName, String unlocName, int maxStackSize) {
|
||||
this.iconName = iconName;
|
||||
this.unlocName = unlocName;
|
||||
this.maxStackSize = maxStackSize;
|
||||
}
|
||||
|
||||
public abstract int getMaximumExtracted(int stackSize);
|
||||
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.item.FilterRegister;
|
||||
import crazypants.enderio.gui.IResourceTooltipProvider;
|
||||
import crazypants.enderio.gui.TooltipAddera;
|
||||
import crazypants.util.ItemUtil;
|
||||
import crazypants.util.Lang;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -59,8 +60,9 @@ public class ItemExistingItemFilter extends Item implements IItemFilterUpgrade,
|
||||
if(player.isSneaking()) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof IInventory) {
|
||||
IInventory inv = ItemUtil.getInventory((IInventory)te);
|
||||
ExistingItemFilter filter = (ExistingItemFilter)createFilterFromStack(item);
|
||||
if(filter.mergeSnapshot((IInventory)te)) {
|
||||
if(filter.mergeSnapshot(inv)) {
|
||||
player.addChatComponentMessage(new ChatComponentText(Lang.localize("item.itemExistingItemFilter.filterUpdated")));
|
||||
} else {
|
||||
player.addChatComponentMessage(new ChatComponentText(Lang.localize("item.itemExistingItemFilter.filterNotUpdated")));
|
||||
|
||||
@@ -118,7 +118,7 @@ public class AdvancedLiquidConduitRenderer extends DefaultConduitRenderer {
|
||||
}
|
||||
|
||||
if(conduit.getConnectionMode(component.dir) == ConnectionMode.DISABLED) {
|
||||
tex = EnderIO.blockConduitBundle.getConnectorIcon();
|
||||
tex = EnderIO.blockConduitBundle.getConnectorIcon(component.data);
|
||||
List<Vertex> corners = component.bound.getCornersWithUvForFace(component.dir, tex.getMinU(), tex.getMaxU(), tex.getMinV(), tex.getMaxV());
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
for (Vertex c : corners) {
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ItemLiquidConduit extends AbstractItemConduit implements IAdvancedT
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConduit createConduit(ItemStack stack) {
|
||||
public IConduit createConduit(ItemStack stack, EntityPlayer player) {
|
||||
if(stack.getItemDamage() == 1) {
|
||||
return new AdvancedLiquidConduit();
|
||||
} else if(stack.getItemDamage() == 2) {
|
||||
@@ -88,6 +88,9 @@ public class ItemLiquidConduit extends AbstractItemConduit implements IAdvancedT
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldHideFacades(ItemStack stack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -341,7 +341,7 @@ public class LiquidConduit extends AbstractTankConduit {
|
||||
// -----------------------------
|
||||
|
||||
@Override
|
||||
protected void connectionsChanged() {
|
||||
public void connectionsChanged() {
|
||||
super.connectionsChanged();
|
||||
updateTank();
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer {
|
||||
}
|
||||
|
||||
if(conduit.getConnectionMode(component.dir) == ConnectionMode.DISABLED) {
|
||||
tex = EnderIO.blockConduitBundle.getConnectorIcon();
|
||||
tex = EnderIO.blockConduitBundle.getConnectorIcon(component.data);
|
||||
List<Vertex> corners = component.bound.getCornersWithUvForFace(component.dir, tex.getMinU(), tex.getMaxU(), tex.getMinV(), tex.getMaxV());
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
for (Vertex c : corners) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package crazypants.enderio.conduit.me;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.AbstractItemConduit;
|
||||
@@ -31,7 +33,14 @@ public class ItemMEConduit extends AbstractItemConduit {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConduit createConduit(ItemStack item) {
|
||||
return new MEConduit(item.getItemDamage());
|
||||
public IConduit createConduit(ItemStack item, EntityPlayer player) {
|
||||
MEConduit con = new MEConduit(item.getItemDamage());
|
||||
con.setPlayerID(AEApi.instance().registries().players().getID(player));
|
||||
return con;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldHideFacades(ItemStack stack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,15 @@
|
||||
package crazypants.enderio.conduit.me;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.networking.IGridHost;
|
||||
@@ -29,6 +24,7 @@ import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.RaytraceResult;
|
||||
import crazypants.enderio.conduit.TileConduitBundle;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
@@ -45,8 +41,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
public static IIcon[] longTextures;
|
||||
|
||||
private boolean isDense;
|
||||
|
||||
EnumSet<ForgeDirection> validConnections = EnumSet.copyOf(Arrays.asList(ForgeDirection.VALID_DIRECTIONS));
|
||||
private int playerID = -1;
|
||||
|
||||
public MEConduit() {
|
||||
this(0);
|
||||
@@ -107,39 +102,32 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtRoot) {
|
||||
super.writeToNBT(nbtRoot);
|
||||
NBTTagList list = new NBTTagList();
|
||||
for (ForgeDirection dir : validConnections) {
|
||||
NBTTagString name = new NBTTagString(dir.name());
|
||||
list.appendTag(name);
|
||||
}
|
||||
nbtRoot.setTag("validConnections", list);
|
||||
nbtRoot.setBoolean("isDense", isDense);
|
||||
nbtRoot.setInteger("playerID", playerID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtRoot, short nbtVersion) {
|
||||
super.readFromNBT(nbtRoot, nbtVersion);
|
||||
if(nbtRoot.hasKey("validConnections")) {
|
||||
validConnections.clear();
|
||||
NBTTagList connections = nbtRoot.getTagList("validConnections", Constants.NBT.TAG_STRING);
|
||||
for (int i = 0; i < connections.tagCount(); i++) {
|
||||
validConnections.add(ForgeDirection.valueOf(connections.getStringTagAt(i)));
|
||||
}
|
||||
}
|
||||
isDense = nbtRoot.getBoolean("isDense");
|
||||
if(nbtRoot.hasKey("playerID")) {
|
||||
playerID = nbtRoot.getInteger("playerID");
|
||||
} else {
|
||||
playerID = -1;
|
||||
}
|
||||
}
|
||||
|
||||
public void setPlayerID(int playerID) {
|
||||
this.playerID = playerID;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "appliedenergistics2")
|
||||
public boolean canConnectToExternal(ForgeDirection dir, boolean ignoreConnectionMode) {
|
||||
public boolean canConnectToExternal(ForgeDirection dir, boolean ignoreDisabled) {
|
||||
World world = getBundle().getWorld();
|
||||
BlockCoord pos = getLocation();
|
||||
TileEntity te = world.getTileEntity(pos.x + dir.offsetX, pos.y + dir.offsetY, pos.z + dir.offsetZ);
|
||||
|
||||
if(!ignoreConnectionMode && getConnectionMode(dir) == ConnectionMode.DISABLED) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(te instanceof IPartHost) {
|
||||
IPart part = ((IPartHost) te).getPart(dir.getOpposite());
|
||||
if(part == null) {
|
||||
@@ -178,6 +166,7 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
if(getNode() == null && !worldObj.isRemote) {
|
||||
IGridNode node = AEApi.instance().createGridNode(grid);
|
||||
if(node != null) {
|
||||
node.setPlayerID(playerID);
|
||||
getBundle().setGridNode(node);
|
||||
getNode().updateState();
|
||||
}
|
||||
@@ -193,58 +182,31 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
return mode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConnectionMode getConnectionMode(ForgeDirection dir) {
|
||||
return validConnections.contains(dir) ? ConnectionMode.IN_OUT : ConnectionMode.DISABLED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConnectionMode(ForgeDirection dir, ConnectionMode mode) {
|
||||
super.setConnectionMode(dir, mode);
|
||||
if(mode == ConnectionMode.DISABLED) {
|
||||
validConnections.remove(dir);
|
||||
} else {
|
||||
validConnections.add(dir);
|
||||
}
|
||||
if(hasNode()) {
|
||||
getNode().updateState();
|
||||
getNode().getWorld().markBlockForUpdate(getLocation().x, getLocation().y, getLocation().z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectToConduit(ForgeDirection direction, IConduit conduit) {
|
||||
if(conduit == null) {
|
||||
if(!super.canConnectToConduit(direction, conduit)) {
|
||||
return false;
|
||||
}
|
||||
return conduit instanceof IMEConduit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void conduitConnectionAdded(ForgeDirection fromDirection) {
|
||||
super.conduitConnectionAdded(fromDirection);
|
||||
validConnections.add(fromDirection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void conduitConnectionRemoved(ForgeDirection fromDirection) {
|
||||
super.conduitConnectionRemoved(fromDirection);
|
||||
// validConnections.remove(fromDirection); // this causes more annoying behavior than wanted behavior. Let's leave it out for now.
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "appliedenergistics2")
|
||||
protected void connectionsChanged() {
|
||||
public void connectionsChanged() {
|
||||
super.connectionsChanged();
|
||||
onNodeChanged();
|
||||
if(getNode() != null) {
|
||||
getNode().updateState();
|
||||
BlockCoord loc = getLocation();
|
||||
if(loc != null) {
|
||||
onNodeChanged(loc);
|
||||
IGridNode node = getNode();
|
||||
if(node != null) {
|
||||
node.updateState();
|
||||
node.getWorld().markBlockForUpdate(loc.x, loc.y, loc.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(EntityPlayer player, RaytraceResult res, List<RaytraceResult> all) {
|
||||
super.onBlockActivated(player, res, all);
|
||||
if(ToolUtil.isToolEquipped(player)) {
|
||||
if(!getBundle().getEntity().getWorldObj().isRemote) {
|
||||
if(res != null && res.component != null) {
|
||||
@@ -252,20 +214,15 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
ForgeDirection faceHit = ForgeDirection.getOrientation(res.movingObjectPosition.sideHit);
|
||||
if(connDir == ForgeDirection.UNKNOWN || connDir == faceHit) {
|
||||
if(getConnectionMode(faceHit) == ConnectionMode.DISABLED) {
|
||||
setConnectionMode(faceHit, getNextConnectionMode(faceHit));
|
||||
setConnectionMode(faceHit, ConnectionMode.IN_OUT);
|
||||
return true;
|
||||
}
|
||||
// Attempt to join networks
|
||||
boolean retVal = ConduitUtil.joinConduits(this, faceHit);
|
||||
if(retVal) {
|
||||
onNodeChanged();
|
||||
}
|
||||
return retVal;
|
||||
return ConduitUtil.joinConduits(this, faceHit);
|
||||
} else if(externalConnections.contains(connDir)) {
|
||||
setConnectionMode(connDir, getNextConnectionMode(connDir));
|
||||
return true;
|
||||
} else if(containsConduitConnection(connDir)) {
|
||||
ConduitUtil.disconectConduits(this, connDir);
|
||||
onNodeChanged();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -275,14 +232,12 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
}
|
||||
|
||||
@Method(modid = "appliedenergistics2")
|
||||
public void onNodeChanged() {
|
||||
boolean foundConnection = false;
|
||||
|
||||
private void onNodeChanged(BlockCoord location) {
|
||||
World world = getBundle().getWorld();
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
TileEntity te = getBundle().getLocation().getLocation(dir).getTileEntity(getBundle().getWorld());
|
||||
if(te != null && te instanceof IGridHost) {
|
||||
TileEntity te = location.getLocation(dir).getTileEntity(world);
|
||||
if(te != null && te instanceof IGridHost && !(te instanceof IConduitBundle)) {
|
||||
IGridNode node = ((IGridHost) te).getGridNode(ForgeDirection.UNKNOWN);
|
||||
foundConnection |= validConnections.contains(dir);
|
||||
if(node == null) {
|
||||
node = ((IGridHost) te).getGridNode(dir.getOpposite());
|
||||
}
|
||||
@@ -291,9 +246,6 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!foundConnection && hasNode()) {
|
||||
getNode().destroy();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -318,6 +270,16 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
getBundle().setGridNode(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "appliedenergistics2")
|
||||
public void onChunkUnload(World worldObj) {
|
||||
super.onChunkUnload(worldObj);
|
||||
if(getNode() != null) {
|
||||
getNode().destroy();
|
||||
getBundle().setGridNode(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MEConduitGrid getGrid() {
|
||||
return grid;
|
||||
@@ -328,21 +290,18 @@ public class MEConduit extends AbstractConduit implements IMEConduit {
|
||||
return getBundle().getGridNode(null);
|
||||
}
|
||||
|
||||
private boolean hasNode() {
|
||||
return getNode() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<ForgeDirection> getConnections() {
|
||||
Set<ForgeDirection> cons = getConduitConnections();
|
||||
cons.addAll(getExternalConnections());
|
||||
if(cons.isEmpty()) {
|
||||
return EnumSet.noneOf(ForgeDirection.class);
|
||||
EnumSet<ForgeDirection> cons = EnumSet.noneOf(ForgeDirection.class);
|
||||
cons.addAll(getConduitConnections());
|
||||
for(ForgeDirection dir : getExternalConnections()) {
|
||||
if(getConnectionMode(dir) != ConnectionMode.DISABLED) {
|
||||
cons.add(dir);
|
||||
}
|
||||
}
|
||||
return EnumSet.copyOf(cons);
|
||||
// return validConnections;
|
||||
return cons;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isDense() {
|
||||
return isDense;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ItemPowerConduit extends AbstractItemConduit {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConduit createConduit(ItemStack stack) {
|
||||
public IConduit createConduit(ItemStack stack, EntityPlayer player) {
|
||||
return new PowerConduit(stack.getItemDamage());
|
||||
}
|
||||
|
||||
@@ -56,5 +56,9 @@ public class ItemPowerConduit extends AbstractItemConduit {
|
||||
ICapacitor cap = PowerConduit.getCapacitors()[itemStack.getItemDamage()];
|
||||
list.add(PREFIX + PowerDisplayUtil.formatPower(cap.getMaxEnergyExtracted()) + POSTFIX);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldHideFacades(ItemStack stack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -197,6 +197,8 @@ public class InsulatedRedstoneConduit extends RedstoneConduit implements IInsula
|
||||
}
|
||||
neighbour.conduitConnectionRemoved(connDir.getOpposite());
|
||||
conduitConnectionRemoved(connDir);
|
||||
neighbour.connectionsChanged();
|
||||
connectionsChanged();
|
||||
updateNetwork();
|
||||
neighbour.updateNetwork();
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.enderio.conduit.redstone;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.AbstractItemConduit;
|
||||
@@ -31,7 +32,7 @@ public class ItemRedstoneConduit extends AbstractItemConduit {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConduit createConduit(ItemStack stack) {
|
||||
public IConduit createConduit(ItemStack stack, EntityPlayer player) {
|
||||
if(stack.getItemDamage() == 0) {
|
||||
return new RedstoneConduit();
|
||||
}
|
||||
@@ -42,4 +43,8 @@ public class ItemRedstoneConduit extends AbstractItemConduit {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldHideFacades(ItemStack stack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.ConduitConnectorType;
|
||||
import crazypants.enderio.conduit.geom.ConduitGeometryUtil;
|
||||
import crazypants.enderio.conduit.render.ConduitBundleRenderer;
|
||||
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
|
||||
@@ -54,7 +55,7 @@ public class RedstoneSwitchRenderer extends DefaultConduitRenderer {
|
||||
|
||||
IIcon[] icons = new IIcon[6];
|
||||
for (int i = 0; i < icons.length; i++) {
|
||||
icons[i] = EnderIO.blockConduitBundle.getConnectorIcon();
|
||||
icons[i] = EnderIO.blockConduitBundle.getConnectorIcon(ConduitConnectorType.INTERNAL);
|
||||
}
|
||||
icons[3] = sw.getSwitchIcon();
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ import crazypants.enderio.conduit.IConduitBundle.FacadeRenderState;
|
||||
import crazypants.enderio.conduit.TileConduitBundle;
|
||||
import crazypants.enderio.conduit.facade.BlockConduitFacade;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.ConduitConnectorType;
|
||||
import crazypants.enderio.conduit.geom.ConduitGeometryUtil;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.render.BoundingBox;
|
||||
@@ -119,8 +120,8 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
IConduitBundle bundle = (IConduitBundle) world.getTileEntity(x, y, z);
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
boolean renderedFacade = !renderFacade(x, y, z, rb, bundle, player);
|
||||
boolean renderConduit = !renderedFacade && (BlockConduitBundle.theRenderPass == 0 || rb.hasOverrideBlockTexture());
|
||||
boolean renderedFacade = renderFacade(x, y, z, rb, bundle, player);
|
||||
boolean renderConduit = !renderedFacade;
|
||||
|
||||
if(renderConduit) {
|
||||
BlockCoord loc = bundle.getLocation();
|
||||
@@ -138,31 +139,32 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
}
|
||||
|
||||
private boolean renderFacade(int x, int y, int z, RenderBlocks rb, IConduitBundle bundle, EntityClientPlayerMP player) {
|
||||
boolean res = true;
|
||||
boolean res = false;
|
||||
if(bundle.hasFacade()) {
|
||||
|
||||
Block facadeId = bundle.getFacadeId();
|
||||
if(ConduitUtil.isFacadeHidden(bundle, player)) {
|
||||
Tessellator.instance.setColorOpaque_F(1, 1, 1);
|
||||
bundle.setFacadeId(null, false);
|
||||
bundle.setFacadeRenderAs(FacadeRenderState.WIRE_FRAME);
|
||||
|
||||
BlockConduitFacade facb = EnderIO.blockConduitFacade;
|
||||
facb.setBlockOverride(bundle);
|
||||
facb.setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
rb.setRenderBoundsFromBlock(facb);
|
||||
rb.renderStandardBlock(facb, x, y, z);
|
||||
if(!rb.hasOverrideBlockTexture()) {
|
||||
rb.setRenderBoundsFromBlock(facb);
|
||||
rb.renderStandardBlock(facb, x, y, z);
|
||||
}
|
||||
facb.setBlockOverride(null);
|
||||
|
||||
bundle.setFacadeId(facadeId, false);
|
||||
|
||||
|
||||
} else if(facadeId != null) {
|
||||
bundle.setFacadeRenderAs(FacadeRenderState.FULL);
|
||||
boolean isFacadeOpaque = facadeId.isOpaqueCube();
|
||||
res = !isFacadeOpaque;
|
||||
res = isFacadeOpaque;
|
||||
|
||||
if((isFacadeOpaque && BlockConduitBundle.theRenderPass == 0) ||
|
||||
(!isFacadeOpaque && BlockConduitBundle.theRenderPass == 1)) {
|
||||
(rb.hasOverrideBlockTexture() || (!isFacadeOpaque && BlockConduitBundle.theRenderPass == 1))) {
|
||||
IBlockAccess origBa = rb.blockAccess;
|
||||
rb.blockAccess = new FacadeAccessWrapper(origBa);
|
||||
try {
|
||||
@@ -178,7 +180,6 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
bundle.setFacadeRenderAs(FacadeRenderState.NONE);
|
||||
}
|
||||
@@ -190,7 +191,7 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
tessellator.addTranslation((float) x, (float) y, (float) z);
|
||||
|
||||
|
||||
// Conduits
|
||||
Set<ForgeDirection> externals = new HashSet<ForgeDirection>();
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
@@ -244,30 +245,27 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
}
|
||||
|
||||
} else if(ConduitUtil.getDisplayMode(player) == ConduitDisplayMode.ALL && !rb.hasOverrideBlockTexture()) {
|
||||
IIcon tex = EnderIO.blockConduitBundle.getConnectorIcon();
|
||||
IIcon tex = EnderIO.blockConduitBundle.getConnectorIcon(component.data);
|
||||
CubeRenderer.render(component.bound, tex);
|
||||
}
|
||||
}
|
||||
//render these after the 'normal' conduits so help with proper blending
|
||||
for (BoundingBox wireBound : wireBounds) {
|
||||
Tessellator.instance.setColorRGBA_F(1, 1, 1, 0.25f);
|
||||
CubeRenderer.render(wireBound, EnderIO.blockConduitFacade.getIcon(0, 0));
|
||||
}
|
||||
|
||||
if(!rb.hasOverrideBlockTexture()) {
|
||||
//render these after the 'normal' conduits so help with proper blending
|
||||
for (BoundingBox wireBound : wireBounds) {
|
||||
Tessellator.instance.setColorRGBA_F(1, 1, 1, 0.25f);
|
||||
CubeRenderer.render(wireBound, EnderIO.blockConduitFacade.getIcon(0, 0));
|
||||
}
|
||||
|
||||
Tessellator.instance.setColorRGBA_F(1, 1, 1, 1f);
|
||||
// External connection terminations
|
||||
for (ForgeDirection dir : externals) {
|
||||
renderExternalConnection(dir);
|
||||
}
|
||||
Tessellator.instance.setColorRGBA_F(1, 1, 1, 1f);
|
||||
// External connection terminations
|
||||
for (ForgeDirection dir : externals) {
|
||||
renderExternalConnection(dir);
|
||||
}
|
||||
tessellator.addTranslation(-(float) x, -(float) y, -(float) z);
|
||||
|
||||
}
|
||||
|
||||
private void renderExternalConnection(ForgeDirection dir) {
|
||||
IIcon tex = EnderIO.blockConduitBundle.getConnectorIcon();
|
||||
IIcon tex = EnderIO.blockConduitBundle.getConnectorIcon(ConduitConnectorType.EXTERNAL);
|
||||
BoundingBox[] bbs = ConduitGeometryUtil.instance.getExternalConnectorBoundingBoxes(dir);
|
||||
for (BoundingBox bb : bbs) {
|
||||
CubeRenderer.render(bb, tex, true);
|
||||
|
||||
@@ -80,7 +80,7 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
drawSection(bb, tex.getMinU(), tex.getMaxU(), tex.getMinV(), tex.getMaxV(), component.dir, false);
|
||||
|
||||
if(conduit.getConnectionMode(component.dir) == ConnectionMode.DISABLED) {
|
||||
tex = EnderIO.blockConduitBundle.getConnectorIcon();
|
||||
tex = EnderIO.blockConduitBundle.getConnectorIcon(component.data);
|
||||
List<Vertex> corners = component.bound.getCornersWithUvForFace(component.dir, tex.getMinU(), tex.getMaxU(), tex.getMinV(), tex.getMaxV());
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
for (Vertex c : corners) {
|
||||
|
||||
@@ -269,16 +269,22 @@ public final class Config {
|
||||
public static boolean farmEssenceBerriesEnabled = true;
|
||||
public static boolean farmManaBeansEnabled = false;
|
||||
public static boolean farmHarvestJungleWhenCocoa = false;
|
||||
public static String[] hoeStrings = new String[] {
|
||||
"minecraft:wooden_hoe", "minecraft:stone_hoe", "minecraft:iron_hoe", "minecraft:diamond_hoe", "minecraft:golden_hoe",
|
||||
"MekanismTools:ObsidianHoe", "MekanismTools:LapisLazuliHoe", "MekanismTools:OsmiumHoe", "MekanismTools:BronzeHoe", "MekanismTools:GlowstoneHoe", "MekanismTools:SteelHoe",
|
||||
"Steamcraft:hoeBrass", "Steamcraft:hoeGildedGold",
|
||||
"Railcraft:tool.steel.hoe",
|
||||
"TConstruct:mattock",
|
||||
"appliedenergistics2:item.ToolCertusQuartzHoe", "appliedenergistics2:item.ToolNetherQuartzHoe",
|
||||
"ProjRed|Exploration:projectred.exploration.hoeruby", "ProjRed|Exploration:projectred.exploration.hoesapphire", "ProjRed|Exploration:projectred.exploration.hoeperidot",
|
||||
"magicalcrops:magicalcrops_AccioHoe", "magicalcrops:magicalcrops_CrucioHoe", "magicalcrops:magicalcrops_ImperioHoe",
|
||||
// disabled as it is currently not unbreaking as advertised "magicalcrops:magicalcrops_ZivicioHoe",
|
||||
public static String[] hoeStrings = new String[] {
|
||||
"minecraft:wooden_hoe", "minecraft:stone_hoe", "minecraft:iron_hoe", "minecraft:diamond_hoe", "minecraft:golden_hoe",
|
||||
"MekanismTools:ObsidianHoe", "MekanismTools:LapisLazuliHoe", "MekanismTools:OsmiumHoe", "MekanismTools:BronzeHoe", "MekanismTools:GlowstoneHoe",
|
||||
"MekanismTools:SteelHoe",
|
||||
"Steamcraft:hoeBrass", "Steamcraft:hoeGildedGold",
|
||||
"Railcraft:tool.steel.hoe",
|
||||
"TConstruct:mattock",
|
||||
"appliedenergistics2:item.ToolCertusQuartzHoe", "appliedenergistics2:item.ToolNetherQuartzHoe",
|
||||
"ProjRed|Exploration:projectred.exploration.hoeruby", "ProjRed|Exploration:projectred.exploration.hoesapphire",
|
||||
"ProjRed|Exploration:projectred.exploration.hoeperidot",
|
||||
"magicalcrops:magicalcrops_AccioHoe", "magicalcrops:magicalcrops_CrucioHoe", "magicalcrops:magicalcrops_ImperioHoe",
|
||||
// disabled as it is currently not unbreaking as advertised "magicalcrops:magicalcrops_ZivicioHoe",
|
||||
"BiomesOPlenty:hoeAmethyst", "BiomesOPlenty:hoeMud",
|
||||
"Eln:Eln.Copper Hoe",
|
||||
"Thaumcraft:ItemHoeThaumium", "Thaumcraft:ItemHoeElemental", "Thaumcraft:ItemHoeVoid",
|
||||
"ThermalExpansion:tool.hoeInvar"
|
||||
};
|
||||
public static List<ItemStack> farmHoes = new ArrayList<ItemStack>();
|
||||
|
||||
@@ -567,22 +573,22 @@ public final class Config {
|
||||
"The range of the wireless charger").getInt(wirelessChargerRange);
|
||||
|
||||
fluidConduitExtractRate = config.get(sectionEfficiency.name, "fluidConduitExtractRate", fluidConduitExtractRate,
|
||||
"Number of millibuckects per tick extracted by a fluid conduits auto extracting").getInt(fluidConduitExtractRate);
|
||||
"Number of millibuckets per tick extracted by a fluid conduits auto extracting").getInt(fluidConduitExtractRate);
|
||||
|
||||
fluidConduitMaxIoRate = config.get(sectionEfficiency.name, "fluidConduitMaxIoRate", fluidConduitMaxIoRate,
|
||||
"Number of millibuckects per tick that can pass through a single connection to a fluid conduit.").getInt(fluidConduitMaxIoRate);
|
||||
"Number of millibuckets per tick that can pass through a single connection to a fluid conduit.").getInt(fluidConduitMaxIoRate);
|
||||
|
||||
advancedFluidConduitExtractRate = config.get(sectionEfficiency.name, "advancedFluidConduitExtractRate", advancedFluidConduitExtractRate,
|
||||
"Number of millibuckects per tick extracted by pressurised fluid conduits auto extracting").getInt(advancedFluidConduitExtractRate);
|
||||
"Number of millibuckets per tick extracted by pressurised fluid conduits auto extracting").getInt(advancedFluidConduitExtractRate);
|
||||
|
||||
advancedFluidConduitMaxIoRate = config.get(sectionEfficiency.name, "advancedFluidConduitMaxIoRate", advancedFluidConduitMaxIoRate,
|
||||
"Number of millibuckects per tick that can pass through a single connection to an pressurised fluid conduit.").getInt(advancedFluidConduitMaxIoRate);
|
||||
"Number of millibuckets per tick that can pass through a single connection to an pressurised fluid conduit.").getInt(advancedFluidConduitMaxIoRate);
|
||||
|
||||
enderFluidConduitExtractRate = config.get(sectionEfficiency.name, "enderFluidConduitExtractRate", enderFluidConduitExtractRate,
|
||||
"Number of millibuckects per tick extracted by ender fluid conduits auto extracting").getInt(enderFluidConduitExtractRate);
|
||||
"Number of millibuckets per tick extracted by ender fluid conduits auto extracting").getInt(enderFluidConduitExtractRate);
|
||||
|
||||
enderFluidConduitMaxIoRate = config.get(sectionEfficiency.name, "enderFluidConduitMaxIoRate", enderFluidConduitMaxIoRate,
|
||||
"Number of millibuckects per tick that can pass through a single connection to an ender fluid conduit.").getInt(enderFluidConduitMaxIoRate);
|
||||
"Number of millibuckets per tick that can pass through a single connection to an ender fluid conduit.").getInt(enderFluidConduitMaxIoRate);
|
||||
|
||||
gasConduitExtractRate = config.get(sectionEfficiency.name, "gasConduitExtractRate", gasConduitExtractRate,
|
||||
"Amount of gas per tick extracted by gas conduits auto extracting").getInt(gasConduitExtractRate);
|
||||
@@ -598,7 +604,7 @@ public final class Config {
|
||||
transceiverUpkeepCostRF = config.get(sectionPower.name, "transceiverUpkeepCostRF", transceiverUpkeepCostRF,
|
||||
"Number of RF/t required to keep a Dimensional Transceiver connection open").getInt(transceiverUpkeepCostRF);
|
||||
transceiverMaxIoRF = config.get(sectionPower.name, "transceiverMaxIoRF", transceiverMaxIoRF,
|
||||
"Maximum RF/t sent and recieved by a Dimensional Transceiver per tick. Input and output limits are not cumulative").getInt(transceiverMaxIoRF);
|
||||
"Maximum RF/t sent and received by a Dimensional Transceiver per tick. Input and output limits are not cumulative").getInt(transceiverMaxIoRF);
|
||||
transceiverBucketTransmissionCostRF = config.get(sectionEfficiency.name, "transceiverBucketTransmissionCostRF", transceiverBucketTransmissionCostRF,
|
||||
"The cost in RF of transporting a bucket of fluid via a Dimensional Transceiver.").getInt(transceiverBucketTransmissionCostRF);
|
||||
|
||||
@@ -684,7 +690,7 @@ public final class Config {
|
||||
|
||||
|
||||
enderIoRange = config.get(sectionEfficiency.name, "enderIoRange", enderIoRange,
|
||||
"Range accessable (in blocks) when using the Ender IO.").getInt(enderIoRange);
|
||||
"Range accessible (in blocks) when using the Ender IO.").getInt(enderIoRange);
|
||||
|
||||
enderIoMeAccessEnabled = config.get(sectionPersonal.name, "enderIoMeAccessEnabled", enderIoMeAccessEnabled,
|
||||
"If false: you will not be able to access a ME access or crafting terminal using the Ender IO.").getBoolean(enderIoMeAccessEnabled);
|
||||
@@ -697,7 +703,7 @@ public final class Config {
|
||||
|
||||
darkSteelPowerDamgeAbsorptionRatios = config
|
||||
.get(sectionDarkSteel.name, "darkSteelPowerDamgeAbsorptionRatios", darkSteelPowerDamgeAbsorptionRatios,
|
||||
"A list of the amount of durabilty damage absorbed when items are powered. In order of upgrade level. 1=100% so items take no durablity damage when powered.")
|
||||
"A list of the amount of durability damage absorbed when items are powered. In order of upgrade level. 1=100% so items take no durability damage when powered.")
|
||||
.getDoubleList();
|
||||
darkSteelPowerStorageBase = config.get(sectionDarkSteel.name, "darkSteelPowerStorageBase", darkSteelPowerStorageBase,
|
||||
"Base amount of power stored by dark steel items.").getInt(darkSteelPowerStorageBase);
|
||||
@@ -755,9 +761,9 @@ public final class Config {
|
||||
darkSteelWalkPowerCost = config.get(sectionDarkSteel.name, "darkSteelWalkPowerCost", darkSteelWalkPowerCost,
|
||||
"Amount of power stored (RF) per block walked when wearing the dark steel boots.").getInt(darkSteelWalkPowerCost);
|
||||
darkSteelSprintPowerCost = config.get(sectionDarkSteel.name, "darkSteelSprintPowerCost", darkSteelWalkPowerCost,
|
||||
"Amount of power stored (RF) per block walked when wearing the dark stell boots.").getInt(darkSteelSprintPowerCost);
|
||||
"Amount of power stored (RF) per block walked when wearing the dark steel boots.").getInt(darkSteelSprintPowerCost);
|
||||
darkSteelDrainPowerFromInventory = config.get(sectionDarkSteel.name, "darkSteelDrainPowerFromInventory", darkSteelDrainPowerFromInventory,
|
||||
"If true, dark steel armor will drain power stored (RF) in power containers in the players invenotry.").getBoolean(darkSteelDrainPowerFromInventory);
|
||||
"If true, dark steel armor will drain power stored (RF) in power containers in the players inventory.").getBoolean(darkSteelDrainPowerFromInventory);
|
||||
|
||||
darkSteelBootsJumpPowerCost = config.get(sectionDarkSteel.name, "darkSteelBootsJumpPowerCost", darkSteelBootsJumpPowerCost,
|
||||
"Base amount of power used per jump (RF) dark steel boots. The second jump in a 'double jump' uses 2x this etc").getInt(darkSteelBootsJumpPowerCost);
|
||||
@@ -834,7 +840,7 @@ public final class Config {
|
||||
vanillaSwordSkullLootingModifier);
|
||||
|
||||
ticCleaverSkullDropChance = (float) config.get(sectionDarkSteel.name, "ticCleaverSkullDropChance", ticCleaverSkullDropChance,
|
||||
"The base chance that an enderman skull will be dropped when using TiC Cleaver").getDouble(
|
||||
"The base chance that an Enderman Skull will be dropped when using TiC Cleaver").getDouble(
|
||||
ticCleaverSkullDropChance);
|
||||
ticBeheadingSkullModifier = (float) config.get(sectionPersonal.name, "ticBeheadingSkullModifier", ticBeheadingSkullModifier,
|
||||
"The chance per level of Beheading that a skull will be dropped when using a TiC weapon").getDouble(
|
||||
@@ -863,7 +869,7 @@ public final class Config {
|
||||
darkSteelPickPowerUseObsidian = config.get(sectionDarkSteel.name, "darkSteelPickPowerUseObsidian", darkSteelPickPowerUseObsidian,
|
||||
"The amount of power (RF) used to break an obsidian block.").getInt(darkSteelPickPowerUseObsidian);
|
||||
darkSteelPickEffeciencyObsidian = config.get(sectionDarkSteel.name, "darkSteelPickEffeciencyObsidian", darkSteelPickEffeciencyObsidian,
|
||||
"The effeciency when breaking obsidian with a powered Dark Pickaxe.").getInt(darkSteelPickEffeciencyObsidian);
|
||||
"The efficiency when breaking obsidian with a powered Dark Pickaxe.").getInt(darkSteelPickEffeciencyObsidian);
|
||||
darkSteelPickApplyObsidianEffeciencyAtHardess = (float) config.get(sectionDarkSteel.name, "darkSteelPickApplyObsidianEffeciencyAtHardess",
|
||||
darkSteelPickApplyObsidianEffeciencyAtHardess,
|
||||
"If set to a value > 0, the obsidian speed and power use will be used for all blocks with hardness >= to this value.").getDouble(
|
||||
@@ -871,7 +877,7 @@ public final class Config {
|
||||
darkSteelPickPowerUsePerDamagePoint = config.get(sectionDarkSteel.name, "darkSteelPickPowerUsePerDamagePoint", darkSteelPickPowerUsePerDamagePoint,
|
||||
"Power use (RF) per damage/durability point avoided.").getInt(darkSteelPickPowerUsePerDamagePoint);
|
||||
darkSteelPickEffeciencyBoostWhenPowered = (float) config.get(sectionDarkSteel.name, "darkSteelPickEffeciencyBoostWhenPowered",
|
||||
darkSteelPickEffeciencyBoostWhenPowered, "The increase in effciency when powered.").getDouble(darkSteelPickEffeciencyBoostWhenPowered);
|
||||
darkSteelPickEffeciencyBoostWhenPowered, "The increase in efficiency when powered.").getDouble(darkSteelPickEffeciencyBoostWhenPowered);
|
||||
darkSteelPickMinesTiCArdite = config.getBoolean("darkSteelPickMinesTiCArdite", sectionDarkSteel.name, darkSteelPickMinesTiCArdite,
|
||||
"When true the dark steel pick will be able to mine TiC Ardite and Cobalt");
|
||||
|
||||
@@ -884,7 +890,7 @@ public final class Config {
|
||||
darkSteelAxeSpeedPenaltyMultiHarvest,
|
||||
"How much slower shift-harvesting logs is.").getDouble(darkSteelAxeSpeedPenaltyMultiHarvest);
|
||||
darkSteelAxeEffeciencyBoostWhenPowered = (float) config.get(sectionDarkSteel.name, "darkSteelAxeEffeciencyBoostWhenPowered",
|
||||
darkSteelAxeEffeciencyBoostWhenPowered, "The increase in effciency when powered.").getDouble(darkSteelAxeEffeciencyBoostWhenPowered);
|
||||
darkSteelAxeEffeciencyBoostWhenPowered, "The increase in efficiency when powered.").getDouble(darkSteelAxeEffeciencyBoostWhenPowered);
|
||||
|
||||
darkSteelAnvilDamageChance = (float) config.get(sectionDarkSteel.name, "darkSteelAnvilDamageChance", darkSteelAnvilDamageChance, "Chance that the dark steel anvil will take damage after repairing something.").getDouble();
|
||||
|
||||
@@ -1094,7 +1100,7 @@ public final class Config {
|
||||
spawnGuardPowerPerTickLevelThree = config.get(sectionAttractor.name, "spawnGuardPowerPerTickLevelThree", spawnGuardPowerPerTickLevelThree,
|
||||
"The RF/t power use of a levele 3 spawn guard").getInt(spawnGuardPowerPerTickLevelThree);
|
||||
spawnGuardStopAllSlimesDebug = config.getBoolean("spawnGuardStopAllSlimesDebug", sectionAttractor.name, spawnGuardStopAllSlimesDebug,
|
||||
"When true slimes wont be alowed to spawn at all. Only added to aid testing in super flat worlds.");
|
||||
"When true slimes wont be allowed to spawn at all. Only added to aid testing in super flat worlds.");
|
||||
spawnGuardStopAllSquidSpawning = config.getBoolean("spawnGuardStopAllSquidSpawning", sectionAttractor.name, spawnGuardStopAllSquidSpawning,
|
||||
"When true no squid will be spawned.");
|
||||
|
||||
@@ -1114,9 +1120,9 @@ public final class Config {
|
||||
|
||||
enderRailEnabled = config.getBoolean("enderRailEnabled", sectionRailConfig.name, enderRailEnabled, "Wether Ender Rails are enabled");
|
||||
enderRailPowerRequireCrossDimensions = config.get(sectionRailConfig.name, "enderRailPowerRequireCrossDimensions", enderRailPowerRequireCrossDimensions,
|
||||
"The amount of power required to transpoer a cart accross dimensions").getInt(enderRailPowerRequireCrossDimensions);
|
||||
"The amount of power required to transport a cart across dimensions").getInt(enderRailPowerRequireCrossDimensions);
|
||||
enderRailPowerRequiredPerBlock = config.get(sectionRailConfig.name, "enderRailPowerRequiredPerBlock", enderRailPowerRequiredPerBlock,
|
||||
"The amout of power required to teleport a cart per block in the same dimension").getInt(enderRailPowerRequiredPerBlock);
|
||||
"The amount of power required to teleport a cart per block in the same dimension").getInt(enderRailPowerRequiredPerBlock);
|
||||
enderRailCapSameDimensionPowerAtCrossDimensionCost = config.getBoolean("enderRailCapSameDimensionPowerAtCrossDimensionCost", sectionRailConfig.name, enderRailCapSameDimensionPowerAtCrossDimensionCost,
|
||||
"When set to true the RF cost of sending a cart within the same dimension will be capped to the cross dimension cost");
|
||||
enderRailTicksBeforeForceSpawningLinkedCarts = config.get(sectionRailConfig.name, "enderRailTicksBeforeForceSpawningLinkedCarts", enderRailTicksBeforeForceSpawningLinkedCarts,
|
||||
|
||||
@@ -87,19 +87,14 @@ public class BlockEnderIO extends BlockEio implements IResourceTooltipProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) {
|
||||
if(entityPlayer.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
public boolean openGui(World world, int x, int y, int z, EntityPlayer entityPlayer, int side) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof ITravelAccessable) {
|
||||
ITravelAccessable ta = (ITravelAccessable) te;
|
||||
if(ta.canUiBeAccessed(entityPlayer)) {
|
||||
if(!world.isRemote) {
|
||||
entityPlayer.openGui(EnderIO.instance, GuiHandler.GUI_ID_TRAVEL_ACCESSABLE, world, x, y, z);
|
||||
}
|
||||
entityPlayer.openGui(EnderIO.instance, GuiHandler.GUI_ID_TRAVEL_ACCESSABLE, world, x, y, z);
|
||||
} else {
|
||||
if(world.isRemote) {
|
||||
if(world.isRemote && !entityPlayer.isSneaking()) {
|
||||
entityPlayer.addChatComponentMessage(new ChatComponentText(Lang.localize("gui.travelAccessable.privateBlock1") + " " + ta.getPlacedBy() + " "
|
||||
+ Lang.localize("gui.travelAccessable.privateBlock2")));
|
||||
}
|
||||
@@ -146,11 +141,4 @@ public class BlockEnderIO extends BlockEio implements IResourceTooltipProvider {
|
||||
public String getUnlocalizedNameForTooltip(ItemStack stack) {
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int p_149749_6_) {
|
||||
super.breakBlock(world, x, y, z, block, p_149749_6_);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,55 +1,93 @@
|
||||
package crazypants.enderio.entity;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IEntityLivingData;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.util.EntityUtil;
|
||||
|
||||
import java.util.Calendar;
|
||||
public class EntityWitherSkeleton extends EntitySkeleton {
|
||||
public EntityWitherSkeleton(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public class EntityWitherSkeleton extends EntitySkeleton
|
||||
{
|
||||
public EntityWitherSkeleton(World world)
|
||||
{
|
||||
super(world);
|
||||
public EntityWitherSkeleton(EntitySkeleton entity) {
|
||||
this(entity.worldObj);
|
||||
this.copyLocationAndAnglesFrom(entity);
|
||||
for (int i = 0; i < entity.getLastActiveItems().length; i++) {
|
||||
this.setCurrentItemOrArmor(i, entity.getEquipmentInSlot(i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFire(int p_70015_1_) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEntityLivingData onSpawnWithEgg(IEntityLivingData entityData) {
|
||||
this.getEntityAttribute(SharedMonsterAttributes.followRange)
|
||||
.applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextGaussian() * 0.05D, 1));
|
||||
this.setSkeletonType(1);
|
||||
this.setCurrentItemOrArmor(0, new ItemStack(Items.stone_sword));
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(4.0D);
|
||||
this.setCombatTask();
|
||||
this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * this.worldObj.func_147462_b(this.posX, this.posY, this.posZ));
|
||||
|
||||
if(this.getEquipmentInSlot(4) == null) {
|
||||
Calendar calendar = this.worldObj.getCurrentDate();
|
||||
|
||||
if(calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F) {
|
||||
this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin : Blocks.pumpkin));
|
||||
this.equipmentDropChances[4] = 0.0F;
|
||||
}
|
||||
}
|
||||
|
||||
public EntityWitherSkeleton(EntitySkeleton entity)
|
||||
{
|
||||
this(entity.worldObj);
|
||||
this.copyLocationAndAnglesFrom(entity);
|
||||
}
|
||||
return entityData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFire(int p_70015_1_)
|
||||
{
|
||||
}
|
||||
@Override
|
||||
public int getSkeletonType() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEntityLivingData onSpawnWithEgg(IEntityLivingData entityData)
|
||||
{
|
||||
this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextGaussian() * 0.05D, 1));
|
||||
this.setSkeletonType(1);
|
||||
this.setCurrentItemOrArmor(0, new ItemStack(Items.stone_sword));
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(4.0D);
|
||||
this.setCombatTask();
|
||||
this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * this.worldObj.func_147462_b(this.posX, this.posY, this.posZ));
|
||||
|
||||
if (this.getEquipmentInSlot(4) == null)
|
||||
{
|
||||
Calendar calendar = this.worldObj.getCurrentDate();
|
||||
|
||||
if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F)
|
||||
{
|
||||
this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin : Blocks.pumpkin));
|
||||
this.equipmentDropChances[4] = 0.0F;
|
||||
}
|
||||
@Override
|
||||
public void onDeath(DamageSource source) {
|
||||
super.onDeath(source);
|
||||
if(source.damageType.equals("player")) {
|
||||
EntityPlayer player = (EntityPlayer) source.getEntity();
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if(stack != null && stack.hasTagCompound()) {
|
||||
Item cleaver = GameRegistry.findItem("TConstruct", "cleaver");
|
||||
int beheading = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Beheading");
|
||||
if(stack.getItem() == cleaver) {
|
||||
beheading += 2;
|
||||
}
|
||||
|
||||
return entityData;
|
||||
System.out.println(beheading);
|
||||
if(beheading > 0 && worldObj.rand.nextInt(100) < beheading * 10) {
|
||||
EntityUtil.spawnItemInWorldWithRandomMotion(worldObj, new ItemStack(Items.skull, 1, 1), posX, posY, posZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(source.getEntity() instanceof EntityLivingBase) {
|
||||
int lootingLevel = EnchantmentHelper.getLootingModifier((EntityLivingBase) source.getEntity());
|
||||
if(worldObj.rand.nextInt(Math.max(1, 1 - lootingLevel)) == 0) {
|
||||
Item necroticBone = GameRegistry.findItem("TConstruct", "materials");
|
||||
if(necroticBone != null) {
|
||||
EntityUtil.spawnItemInWorldWithRandomMotion(worldObj, new ItemStack(necroticBone, 1, 8), posX, posY, posZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,41 @@
|
||||
package crazypants.enderio.entity;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
||||
|
||||
public class SkeletonHandler
|
||||
{
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void skeletonJoinWorld(EntityJoinWorldEvent event)
|
||||
{
|
||||
if (event.entity.getClass() == EntitySkeleton.class && ((EntitySkeleton)event.entity).getSkeletonType()==1)
|
||||
{
|
||||
event.setCanceled(true);
|
||||
event.world.spawnEntityInWorld(new EntityWitherSkeleton((EntitySkeleton)event.entity));
|
||||
}
|
||||
}
|
||||
public class SkeletonHandler {
|
||||
|
||||
public static void registerSkeleton(EnderIO mod)
|
||||
{
|
||||
int entityID = EntityRegistry.findGlobalUniqueEntityId();
|
||||
EntityRegistry.registerGlobalEntityID(EntityWitherSkeleton.class,"witherSkeleton", entityID, 0x00003D, 0x751947);
|
||||
EntityRegistry.registerModEntity(EntityWitherSkeleton.class,"witherSkeleton",entityID,mod,64,3,true);
|
||||
MinecraftForge.EVENT_BUS.register(new SkeletonHandler());
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void skeletonJoinWorld(LivingSpawnEvent event) {
|
||||
if(isWitherSkele(event.entity)) {
|
||||
event.entity.setDead();
|
||||
event.world.spawnEntityInWorld(new EntityWitherSkeleton((EntitySkeleton) event.entity));
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void skeletonJoinWorld(EntityJoinWorldEvent event) {
|
||||
if(isWitherSkele(event.entity)) {
|
||||
event.setCanceled(true);
|
||||
event.world.spawnEntityInWorld(new EntityWitherSkeleton((EntitySkeleton) event.entity));
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isWitherSkele(Entity entity) {
|
||||
return entity.getClass() == EntitySkeleton.class && ((EntitySkeleton) entity).getSkeletonType() == 1;
|
||||
}
|
||||
|
||||
public static void registerSkeleton(EnderIO mod) {
|
||||
int entityID = EntityRegistry.findGlobalUniqueEntityId();
|
||||
EntityRegistry.registerGlobalEntityID(EntityWitherSkeleton.class, "witherSkeleton", entityID, 0x00003D, 0x751947);
|
||||
EntityRegistry.registerModEntity(EntityWitherSkeleton.class, "witherSkeleton", entityID, mod, 64, 3, true);
|
||||
MinecraftForge.EVENT_BUS.register(new SkeletonHandler());
|
||||
}
|
||||
}
|
||||
@@ -9,126 +9,121 @@ import crazypants.render.RenderUtil;
|
||||
|
||||
public final class IconEIO {
|
||||
|
||||
public static final IconEIO TICK = new IconEIO(0, 100);
|
||||
public static final IconEIO MINUS = new IconEIO(16, 100);
|
||||
public static final IconEIO PUBLIC = new IconEIO(32, 100);
|
||||
public static final IconEIO PRIVATE = new IconEIO(48, 100);
|
||||
public static final IconEIO CROSS = new IconEIO(64, 100);
|
||||
public static final IconEIO PLUS = new IconEIO(80, 100);
|
||||
public static final IconEIO ARROWS = new IconEIO(178, 100);
|
||||
public static final IconEIO TICK = new IconEIO(0, 192);
|
||||
public static final IconEIO MINUS = new IconEIO(16, 192);
|
||||
public static final IconEIO PUBLIC = new IconEIO(32, 192);
|
||||
public static final IconEIO PRIVATE = new IconEIO(48, 192);
|
||||
public static final IconEIO CROSS = new IconEIO(64, 192);
|
||||
public static final IconEIO PLUS = new IconEIO(80, 192);
|
||||
public static final IconEIO ARROWS = new IconEIO(176, 192);
|
||||
|
||||
public static final IconEIO BUTTON = new IconEIO(0, 116);
|
||||
public static final IconEIO CHECKED_BUTTON = new IconEIO(0, 132);
|
||||
public static final IconEIO BUTTON_HIGHLIGHT = new IconEIO(16, 116);
|
||||
public static final IconEIO BUTTON_DISABLED = new IconEIO(32, 116);
|
||||
public static final IconEIO BUTTON_DOWN = new IconEIO(48, 116);
|
||||
public static final IconEIO BUTTON_DOWN_HIGHLIGHT = new IconEIO(64, 116);
|
||||
public static final IconEIO BUTTON = new IconEIO(0, 208);
|
||||
public static final IconEIO BUTTON_HIGHLIGHT = new IconEIO(16, 208);
|
||||
public static final IconEIO BUTTON_DISABLED = new IconEIO(32, 208);
|
||||
public static final IconEIO BUTTON_DOWN = new IconEIO(48, 208);
|
||||
public static final IconEIO BUTTON_DOWN_HIGHLIGHT = new IconEIO(64, 208);
|
||||
public static final IconEIO CHECKED_BUTTON = new IconEIO(112, 208);
|
||||
|
||||
public static final IconEIO WRENCH_OVERLAY_POWER = new IconEIO(0, 148, 32, 32);
|
||||
public static final IconEIO WRENCH_OVERLAY_POWER_OFF = new IconEIO(0 + 96, 148, 32, 32);
|
||||
public static final IconEIO WRENCH_OVERLAY_POWER = new IconEIO(0, 112);
|
||||
public static final IconEIO WRENCH_OVERLAY_POWER_OFF = new IconEIO(0 + 48, 112);
|
||||
|
||||
public static final IconEIO WRENCH_OVERLAY_REDSTONE = new IconEIO(32, 148, 32, 32);
|
||||
public static final IconEIO WRENCH_OVERLAY_REDSTONE_OFF = new IconEIO(32 + 96, 148, 32, 32);
|
||||
public static final IconEIO WRENCH_OVERLAY_REDSTONE = new IconEIO(16, 112);
|
||||
public static final IconEIO WRENCH_OVERLAY_REDSTONE_OFF = new IconEIO(16 + 48, 112);
|
||||
|
||||
public static final IconEIO WRENCH_OVERLAY_FLUID = new IconEIO(0, 180, 32, 32);
|
||||
public static final IconEIO WRENCH_OVERLAY_FLUID_OFF = new IconEIO(96, 180, 32, 32);
|
||||
public static final IconEIO WRENCH_OVERLAY_FLUID = new IconEIO(0, 128);
|
||||
public static final IconEIO WRENCH_OVERLAY_FLUID_OFF = new IconEIO(0 + 48, 128);
|
||||
|
||||
public static final IconEIO WRENCH_OVERLAY_ITEM = new IconEIO(32, 180, 32, 32);
|
||||
public static final IconEIO WRENCH_OVERLAY_ITEM_OFF = new IconEIO(32 + 96, 180, 32, 32);
|
||||
public static final IconEIO WRENCH_OVERLAY_ITEM = new IconEIO(16, 128);
|
||||
public static final IconEIO WRENCH_OVERLAY_ITEM_OFF = new IconEIO(16 + 48, 128);
|
||||
|
||||
public static final IconEIO WRENCH_OVERLAY_GAS = new IconEIO(64, 148, 32, 32);
|
||||
public static final IconEIO WRENCH_OVERLAY_GAS_OFF = new IconEIO(64 + 96, 148, 32, 32);
|
||||
public static final IconEIO WRENCH_OVERLAY_GAS = new IconEIO(32, 112);
|
||||
public static final IconEIO WRENCH_OVERLAY_GAS_OFF = new IconEIO(32 + 48, 112);
|
||||
|
||||
public static final IconEIO WRENCH_OVERLAY_ME = new IconEIO(64, 180, 32, 32);
|
||||
public static final IconEIO WRENCH_OVERLAY_ME_OFF = new IconEIO(64 + 96, 180, 32, 32);
|
||||
public static final IconEIO WRENCH_OVERLAY_ME = new IconEIO(32, 128);
|
||||
public static final IconEIO WRENCH_OVERLAY_ME_OFF = new IconEIO(32 + 48, 128);
|
||||
|
||||
public static final IconEIO PROBE_OVERLAY_PROBE = new IconEIO(112, 100, 32, 16);
|
||||
public static final IconEIO PROBE_OVERLAY_COPY = new IconEIO(144, 100, 32, 16);
|
||||
public static final IconEIO PROBE_OVERLAY_PROBE = new IconEIO(112, 192, 32, 16);
|
||||
public static final IconEIO PROBE_OVERLAY_COPY = new IconEIO(144, 192, 32, 16);
|
||||
|
||||
public static final IconEIO ACTIVE_TAB = new IconEIO(237, 0, 19, 24);
|
||||
public static final IconEIO INACTIVE_TAB = new IconEIO(237, 25, 19, 24);
|
||||
public static final IconEIO ACTIVE_TAB = new IconEIO(205, 0, 19, 24);
|
||||
public static final IconEIO INACTIVE_TAB = new IconEIO(237, 0, 19, 24);
|
||||
|
||||
public static final IconEIO LEFT_ARROW = new IconEIO(217, 0, 16, 32);
|
||||
public static final IconEIO RIGHT_ARROW = new IconEIO(201, 0, 16, 32);
|
||||
public static final IconEIO RIGHT_ARROW = new IconEIO(192, 48, 16, 32);
|
||||
public static final IconEIO LEFT_ARROW = new IconEIO(208, 48, 16, 32);
|
||||
|
||||
public static final IconEIO REDSTONE_MODE_ALWAYS = new IconEIO(200, 60, 20, 20);
|
||||
public static final IconEIO REDSTONE_MODE_WITH_SIGNAL = new IconEIO(220, 60, 20, 20);
|
||||
public static final IconEIO REDSTONE_MODE_WITHOUT_SIGNAL = new IconEIO(200, 80, 20, 20);
|
||||
public static final IconEIO REDSTONE_MODE_NEVER = new IconEIO(220, 80, 20, 20);
|
||||
public static final IconEIO REDSTONE_MODE_WITHOUT_SIGNAL = new IconEIO(64, 224);
|
||||
public static final IconEIO REDSTONE_MODE_WITH_SIGNAL = new IconEIO(80, 224);
|
||||
public static final IconEIO REDSTONE_MODE_ALWAYS = new IconEIO(96, 224);
|
||||
public static final IconEIO REDSTONE_MODE_NEVER = new IconEIO(112, 224);
|
||||
|
||||
public static final IconEIO FILTER_META = new IconEIO(0, 212, 22, 22);
|
||||
public static final IconEIO FILTER_NBT = new IconEIO(22, 212, 22, 22);
|
||||
public static final IconEIO FILTER_ORE_DICT = new IconEIO(44, 212, 22, 22);
|
||||
public static final IconEIO FILTER_WHITELIST = new IconEIO(0, 234, 22, 22);
|
||||
public static final IconEIO FILTER_BLACKLIST = new IconEIO(22, 234, 22, 22);
|
||||
public static final IconEIO FILTER_STICKY = new IconEIO(44, 234, 22, 22);
|
||||
public static final IconEIO FILTER_STICKY_OFF = new IconEIO(64, 234, 22, 22);
|
||||
public static final IconEIO FILTER_META = new IconEIO(160, 224);
|
||||
public static final IconEIO FILTER_NBT = new IconEIO(176, 224);
|
||||
public static final IconEIO FILTER_ORE_DICT = new IconEIO(192, 224);
|
||||
public static final IconEIO FILTER_WHITELIST = new IconEIO(0, 224);
|
||||
public static final IconEIO FILTER_BLACKLIST = new IconEIO(0, 240);
|
||||
public static final IconEIO FILTER_STICKY = new IconEIO(16, 240);
|
||||
public static final IconEIO FILTER_STICKY_OFF = new IconEIO(32, 240);
|
||||
|
||||
public static final IconEIO FILTER_META_OFF = new IconEIO(64, 212, 22, 22);
|
||||
public static final IconEIO FILTER_NBT_OFF = new IconEIO(64 + 22, 212, 22, 22);
|
||||
public static final IconEIO FILTER_ORE_DICT_OFF = new IconEIO(64 + 44, 212, 22, 22);
|
||||
public static final IconEIO FILTER_META_OFF = new IconEIO(208, 224);
|
||||
public static final IconEIO FILTER_NBT_OFF = new IconEIO(224, 224);
|
||||
public static final IconEIO FILTER_ORE_DICT_OFF = new IconEIO(240, 224);
|
||||
|
||||
public static final IconEIO INPUT = new IconEIO(128, 197 + 32, 30, 14);
|
||||
public static final IconEIO INPUT_SMALL = new IconEIO(159, 220, 16, 8);
|
||||
public static final IconEIO INPUT_SMALL_INV = new IconEIO(159, 228, 16, 8);
|
||||
public static final IconEIO DISABLED = new IconEIO(159, 236, 16, 8);
|
||||
@Deprecated
|
||||
public static final IconEIO INPUT_OLD = new IconEIO(128, 197 + 32, 30, 14);
|
||||
@Deprecated
|
||||
public static final IconEIO OUTPUT_OLD = new IconEIO(128, 180 + 32, 30, 14);
|
||||
|
||||
public static final IconEIO OUTPUT = new IconEIO(128, 180 + 32, 30, 14);
|
||||
public static final IconEIO OUTPUT_SMALL = new IconEIO(177, 220, 16, 8);
|
||||
public static final IconEIO OUTPUT_SMALL_INV = new IconEIO(177, 228, 16, 8);
|
||||
public static final IconEIO INPUT = new IconEIO(224, 64, 16, 8);
|
||||
public static final IconEIO OUTPUT = new IconEIO(240, 64, 16, 8);
|
||||
public static final IconEIO INPUT_OUTPUT = new IconEIO(224, 48, 32, 16);
|
||||
public static final IconEIO DISABLED = new IconEIO(48, 240);
|
||||
|
||||
public static final IconEIO INPUT_OUTPUT = new IconEIO(159, 212, 30, 8);
|
||||
public static final IconEIO LOOP = new IconEIO(224, 96);
|
||||
public static final IconEIO LOOP_OFF = new IconEIO(240, 96);
|
||||
|
||||
public static final IconEIO INPUT_OFF = new IconEIO(188, 180 + 32, 30, 14);
|
||||
public static final IconEIO OUTPUT_OFF = new IconEIO(188, 197 + 32, 30, 14);
|
||||
public static final IconEIO INPUT_OUTPUT_OFF = new IconEIO(218 + 32, 180, 30, 8);
|
||||
public static final IconEIO ROUND_ROBIN = new IconEIO(64, 240);
|
||||
public static final IconEIO ROUND_ROBIN_OFF = new IconEIO(80, 240);
|
||||
|
||||
public static final IconEIO LOOP = new IconEIO(217, 236, 20, 20);
|
||||
public static final IconEIO LOOP_OFF = new IconEIO(236, 236, 20, 20);
|
||||
public static final IconEIO IO_CONFIG_UP = new IconEIO(16, 224);
|
||||
public static final IconEIO IO_CONFIG_DOWN = new IconEIO(32, 224);
|
||||
public static final IconEIO IO_WHATSIT = new IconEIO(128, 208);
|
||||
|
||||
public static final IconEIO ROUND_ROBIN = new IconEIO(86, 236, 20, 20);
|
||||
public static final IconEIO ROUND_ROBIN_OFF = new IconEIO(106, 236, 20, 20);
|
||||
public static final IconEIO RECIPE = new IconEIO(0, 224);
|
||||
public static final IconEIO RECIPE_BUTTON = new IconEIO(80, 208);
|
||||
|
||||
public static final IconEIO IO_CONFIG_UP = new IconEIO(80, 116, 24, 24);
|
||||
public static final IconEIO IO_CONFIG_DOWN = new IconEIO(104, 116, 24, 24);
|
||||
public static final IconEIO ADD_BUT = new IconEIO(208, 32, 8, 8);
|
||||
public static final IconEIO MINUS_BUT = new IconEIO(208, 40, 8, 8);
|
||||
|
||||
public static final IconEIO IO_WHATSIT = new IconEIO(192, 148, 13, 13);
|
||||
public static final IconEIO SOUND = new IconEIO(176, 208);
|
||||
|
||||
public static final IconEIO RECIPE = new IconEIO(16, 132, 16, 16);
|
||||
public static final IconEIO RECIPE_BUTTON = new IconEIO(128, 116, 24, 24);
|
||||
public static final IconEIO XP = new IconEIO(128, 224);
|
||||
public static final IconEIO XP_PLUS = new IconEIO(144, 224);
|
||||
|
||||
public static final IconEIO ADD_BUT = new IconEIO(139, 246, 10, 10);
|
||||
public static final IconEIO MINUS_BUT = new IconEIO(129, 246, 10, 10);
|
||||
public static final IconEIO SINGLE_PLUS = new IconEIO(240, 192);
|
||||
public static final IconEIO DOUBLE_PLUS = new IconEIO(224, 192);
|
||||
public static final IconEIO TRIPLE_PLUS = new IconEIO(208, 192);
|
||||
public static final IconEIO SINGLE_MINUS = new IconEIO(240, 208);
|
||||
public static final IconEIO DOUBLE_MINUS = new IconEIO(224, 208);
|
||||
public static final IconEIO TRIPLE_MINUS = new IconEIO(208, 208);
|
||||
|
||||
public static final IconEIO SOUND = new IconEIO(209, 172, 22, 22);
|
||||
public static final IconEIO ENDER_RAIL = new IconEIO(192, 208);
|
||||
|
||||
public static final IconEIO XP = new IconEIO(235, 60, 22, 22);
|
||||
public static final IconEIO XP_PLUS = new IconEIO(235, 82, 22, 22);
|
||||
public static final IconEIO FILTER = new IconEIO(192, 192);
|
||||
|
||||
public static final IconEIO SINGLE_PLUS = new IconEIO(234, 100);
|
||||
public static final IconEIO DOUBLE_PLUS = new IconEIO(218, 100);
|
||||
public static final IconEIO TRIPLE_PLUS = new IconEIO(202, 100);
|
||||
public static final IconEIO SINGLE_MINUS = new IconEIO(206, 116);
|
||||
public static final IconEIO DOUBLE_MINUS = new IconEIO(190, 116);
|
||||
public static final IconEIO TRIPLE_MINUS = new IconEIO(174, 116);
|
||||
|
||||
public static final IconEIO ENDER_RAIL = new IconEIO(235, 175);
|
||||
|
||||
public static final IconEIO FILTER = new IconEIO(203, 31);
|
||||
|
||||
public static final IconEIO ITEM_SINGLE = new IconEIO(220, 32);
|
||||
public static final IconEIO ITEM_STACK = new IconEIO(220, 48);
|
||||
public static final IconEIO ITEM_STACK = new IconEIO(144, 208);
|
||||
public static final IconEIO ITEM_SINGLE = new IconEIO(160, 208);
|
||||
|
||||
public static final IconEIO FARM_UNLOCK = new IconEIO(128, 240);
|
||||
public static final IconEIO FARM_LOCK = new IconEIO(144, 240);
|
||||
|
||||
public static final IconEIO SUN = new IconEIO(160, 240);
|
||||
public static final IconEIO RAIN = new IconEIO(176, 240);
|
||||
public static final IconEIO THUNDER = new IconEIO(192, 240);
|
||||
|
||||
// Texture size is actually 512 but everything is aligned to a 256 grid
|
||||
private static final int TEX_SIZE = 256;
|
||||
private static final double PIX_SIZE = 1d / TEX_SIZE;
|
||||
|
||||
public static final IconEIO UNLOCKED = new IconEIO(150, 245, 10, 10);
|
||||
public static final IconEIO LOCKED = new IconEIO(162, 245, 10, 10);
|
||||
|
||||
public static final IconEIO SUN = new IconEIO(32, 132);
|
||||
public static final IconEIO RAIN = new IconEIO(48, 132);
|
||||
public static final IconEIO THUNDER = new IconEIO(64, 132);
|
||||
|
||||
public final double minU;
|
||||
public final double maxU;
|
||||
public final double minV;
|
||||
@@ -136,7 +131,7 @@ public final class IconEIO {
|
||||
public final double width;
|
||||
public final double height;
|
||||
|
||||
public static final ResourceLocation TEXTURE = new ResourceLocation("enderio:textures/gui/widgets.png");
|
||||
public static final ResourceLocation TEXTURE = new ResourceLocation("enderio:textures/gui/widgetsv2.png");
|
||||
|
||||
public IconEIO(int x, int y) {
|
||||
this(x, y, 16, 16);
|
||||
|
||||
@@ -230,6 +230,7 @@ public class IoConfigRenderer {
|
||||
if(!updateCamera(partialTick, vp.x, vp.y, vp.width, vp.height)) {
|
||||
return;
|
||||
}
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
applyCamera(partialTick);
|
||||
TravelController.instance.setSelectionEnabled(false);
|
||||
renderScene();
|
||||
@@ -237,6 +238,7 @@ public class IoConfigRenderer {
|
||||
renderSelection();
|
||||
|
||||
renderOverlay(par1, par2);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
private void renderSelection() {
|
||||
@@ -287,6 +289,7 @@ public class IoConfigRenderer {
|
||||
|
||||
mx -= vpx;
|
||||
my -= vpy;
|
||||
|
||||
if(mx >= x && mx <= x + IconEIO.IO_WHATSIT.width &&
|
||||
my >= y && my <= y + IconEIO.IO_WHATSIT.height) {
|
||||
RenderUtil.renderQuad2D(x, y, 0, IconEIO.IO_WHATSIT.width, IconEIO.IO_WHATSIT.height, new Vector4f(0.4f,0.4f,0.4f,0.6f));
|
||||
@@ -298,15 +301,14 @@ public class IoConfigRenderer {
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
IconEIO.IO_WHATSIT.renderIcon(x, y, true);
|
||||
|
||||
|
||||
if(selection != null) {
|
||||
IconEIO ioIcon = null;
|
||||
// INPUT
|
||||
IoMode mode = selection.config.getIoMode(selection.face);
|
||||
if(mode == IoMode.PULL) {
|
||||
ioIcon = IconEIO.INPUT_SMALL_INV;
|
||||
ioIcon = IconEIO.INPUT;
|
||||
} else if(mode == IoMode.PUSH) {
|
||||
ioIcon = IconEIO.OUTPUT_SMALL_INV;
|
||||
ioIcon = IconEIO.OUTPUT;
|
||||
} else if(mode == IoMode.PUSH_PULL) {
|
||||
ioIcon = IconEIO.INPUT_OUTPUT;
|
||||
} else if(mode == IoMode.DISABLED) {
|
||||
|
||||
@@ -6,8 +6,8 @@ import crazypants.gui.IGuiScreen;
|
||||
public class ToggleButtonEIO extends IconButtonEIO {
|
||||
|
||||
private boolean selected;
|
||||
private IconEIO unselectedIcon;
|
||||
private IconEIO selectedIcon;
|
||||
private final IconEIO unselectedIcon;
|
||||
private final IconEIO selectedIcon;
|
||||
|
||||
private String[] selectedTooltip;
|
||||
private String[] unselectedTooltip;
|
||||
@@ -52,12 +52,15 @@ public class ToggleButtonEIO extends IconButtonEIO {
|
||||
|
||||
@Override
|
||||
public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) {
|
||||
boolean result = super.mousePressed(par1Minecraft, par2, par3);
|
||||
if(result) {
|
||||
setSelected(!selected);
|
||||
if(super.mousePressed(par1Minecraft, par2, par3)) {
|
||||
return toggleSelected();
|
||||
}
|
||||
return result;
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean toggleSelected() {
|
||||
setSelected(!selected);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setSelectedToolTip(String... tt) {
|
||||
|
||||
@@ -44,10 +44,10 @@ import crazypants.util.Lang;
|
||||
|
||||
public class TooltipAddera {
|
||||
|
||||
public static TooltipAddera instance = new TooltipAddera();
|
||||
public static final TooltipAddera instance = new TooltipAddera();
|
||||
|
||||
//TODO: Need to decouple this stuff with a callback
|
||||
private BallTipProvider btp = new BallTipProvider();
|
||||
private final BallTipProvider btp = new BallTipProvider();
|
||||
|
||||
static {
|
||||
MinecraftForge.EVENT_BUS.register(instance);
|
||||
@@ -62,7 +62,7 @@ public class TooltipAddera {
|
||||
if(!addStirlinGeneratorTooltip(evt)) {
|
||||
int time = TileEntityFurnace.getItemBurnTime(evt.itemStack);
|
||||
if(time > 0) {
|
||||
evt.toolTip.add("Burn time " + time);
|
||||
evt.toolTip.add(Lang.localize("tooltip.burntime") + " " + time);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -96,11 +96,11 @@ public class TooltipAddera {
|
||||
IGrindingMultiplier gb = CrusherRecipeManager.getInstance().getGrindballFromStack(evt.itemStack);
|
||||
if(gb != null) {
|
||||
btp.ball = gb;
|
||||
TooltipAddera.instance.addInformation(btp, evt.itemStack, evt.entityPlayer, evt.toolTip, false);
|
||||
addInformation(btp, evt.itemStack, evt.entityPlayer, evt.toolTip, false);
|
||||
}
|
||||
|
||||
if(Config.addRegisterdNameTooltip) {
|
||||
UniqueIdentifier uid = null;
|
||||
UniqueIdentifier uid;
|
||||
Block block = Block.getBlockFromItem(evt.itemStack.getItem());
|
||||
if(block != null && block != Blocks.air) {
|
||||
uid = GameRegistry.findUniqueIdentifierFor(block);
|
||||
@@ -108,7 +108,7 @@ public class TooltipAddera {
|
||||
uid = GameRegistry.findUniqueIdentifierFor(evt.itemStack.getItem());
|
||||
}
|
||||
if(uid != null) {
|
||||
evt.toolTip.add(EnumChatFormatting.AQUA + "UID: " + uid.toString() + " Meta: " + evt.itemStack.getItemDamage());
|
||||
evt.toolTip.add(EnumChatFormatting.AQUA + Lang.localize("tooltip.uid") + " " + uid.toString() + " " + Lang.localize("tooltip.meta") + " " + evt.itemStack.getItemDamage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,9 +116,9 @@ public class TooltipAddera {
|
||||
int[] ids = OreDictionary.getOreIDs(evt.itemStack);
|
||||
if(ids != null && ids.length > 0) {
|
||||
if(ids.length == 1) {
|
||||
evt.toolTip.add(EnumChatFormatting.AQUA + "Ore Dictionary: " + OreDictionary.getOreName(ids[0]));
|
||||
evt.toolTip.add(EnumChatFormatting.AQUA + Lang.localize("tooltip.oredict") + " " + OreDictionary.getOreName(ids[0]));
|
||||
} else {
|
||||
evt.toolTip.add(EnumChatFormatting.AQUA + "Ore Dictionary:");
|
||||
evt.toolTip.add(EnumChatFormatting.AQUA + Lang.localize("tooltip.oredict"));
|
||||
for (int id : ids) {
|
||||
String name = OreDictionary.getOreName(id);
|
||||
evt.toolTip.add(EnumChatFormatting.AQUA + " " + name);
|
||||
@@ -130,7 +130,7 @@ public class TooltipAddera {
|
||||
}
|
||||
|
||||
private static boolean addStirlinGeneratorTooltip(ItemTooltipEvent evt) {
|
||||
if(evt.entityPlayer.openContainer instanceof StirlingGeneratorContainer) {
|
||||
if(evt.entityPlayer != null && evt.entityPlayer.openContainer instanceof StirlingGeneratorContainer) {
|
||||
AbstractMachineEntity te = ((StirlingGeneratorContainer)evt.entityPlayer.openContainer).getTileEntity();
|
||||
if(te instanceof TileEntityStirlingGenerator) {
|
||||
TileEntityStirlingGenerator gen = (TileEntityStirlingGenerator) te;
|
||||
@@ -259,19 +259,18 @@ public class TooltipAddera {
|
||||
}
|
||||
|
||||
public static void addDetailedTooltipFromResources(List list, String unlocalizedName) {
|
||||
addTooltipFromResources(list, unlocalizedName, ".tooltip.detailed.line");
|
||||
addTooltipFromResources(list, unlocalizedName.concat(".tooltip.detailed.line"));
|
||||
}
|
||||
|
||||
public static void addBasicTooltipFromResources(List list, String unlocalizedName) {
|
||||
addTooltipFromResources(list, unlocalizedName, ".tooltip.basic.line");
|
||||
addTooltipFromResources(list, unlocalizedName.concat(".tooltip.basic.line"));
|
||||
}
|
||||
|
||||
public static void addCommonTooltipFromResources(List list, String unlocalizedName) {
|
||||
addTooltipFromResources(list, unlocalizedName, ".tooltip.common.line");
|
||||
addTooltipFromResources(list, unlocalizedName.concat(".tooltip.common.line"));
|
||||
}
|
||||
|
||||
public static void addTooltipFromResources(List list, String unlocalizedName, String tooltipTag) {
|
||||
String keyBase = unlocalizedName + tooltipTag;
|
||||
public static void addTooltipFromResources(List list, String keyBase) {
|
||||
boolean done = false;
|
||||
int line = 1;
|
||||
while (!done) {
|
||||
@@ -290,15 +289,19 @@ public class TooltipAddera {
|
||||
if(itemstack.getItem() == null) {
|
||||
return;
|
||||
}
|
||||
String unlock = null;
|
||||
String unloc = null;
|
||||
// Block blk = Block.getBlockFromItem(itemstack.getItem());
|
||||
// if(blk != null && blk != Blocks.air) {
|
||||
// unlock = blk.getUnlocalizedName();
|
||||
// }
|
||||
if(unlock == null) {
|
||||
unlock = itemstack.getItem().getUnlocalizedName();
|
||||
|
||||
if (itemstack.getItem() instanceof IResourceTooltipProvider) {
|
||||
unloc = ((IResourceTooltipProvider)itemstack.getItem()).getUnlocalizedNameForTooltip(itemstack);
|
||||
}
|
||||
addDetailedTooltipFromResources(list, unlock);
|
||||
if(unloc == null) {
|
||||
unloc = itemstack.getItem().getUnlocalizedName(itemstack);
|
||||
}
|
||||
addDetailedTooltipFromResources(list, unloc);
|
||||
}
|
||||
|
||||
private static class BallTipProvider implements IAdvancedTooltipProvider {
|
||||
|
||||
@@ -2,12 +2,8 @@ package crazypants.enderio.item;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -19,18 +15,15 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.api.tool.IHideFacades;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.redstone.IInsulatedRedstoneConduit;
|
||||
import crazypants.enderio.gui.IResourceTooltipProvider;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
|
||||
public class ItemConduitProbe extends Item implements IResourceTooltipProvider {
|
||||
public class ItemConduitProbe extends Item implements IResourceTooltipProvider, IHideFacades {
|
||||
|
||||
private static final NumberFormat NF = NumberFormat.getIntegerInstance();
|
||||
|
||||
@@ -124,5 +117,9 @@ public class ItemConduitProbe extends Item implements IResourceTooltipProvider {
|
||||
public boolean doesSneakBypassUse(World world, int x, int y, int z, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldHideFacades(ItemStack stack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -364,7 +364,7 @@ public class ItemSoulVessel extends Item implements IResourceTooltipProvider {
|
||||
if(mobName != null) {
|
||||
par3List.add(EntityUtil.getDisplayNameForEntity(mobName));
|
||||
} else {
|
||||
par3List.add("Empty");
|
||||
par3List.add(Lang.localize("item.itemSoulVessel.tooltip.empty"));
|
||||
}
|
||||
|
||||
float health = getHealthFromStack(par1ItemStack);
|
||||
|
||||
@@ -2,6 +2,7 @@ package crazypants.enderio.item;
|
||||
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -17,17 +18,19 @@ import org.lwjgl.input.Keyboard;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.api.tool.IConduitControl;
|
||||
import crazypants.enderio.api.tool.ITool;
|
||||
import crazypants.enderio.conduit.ConduitDisplayMode;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.gui.IAdvancedTooltipProvider;
|
||||
import crazypants.enderio.gui.TooltipAddera;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import crazypants.util.Lang;
|
||||
|
||||
public class ItemYetaWrench extends Item implements ITool, IAdvancedTooltipProvider, InvocationHandler {
|
||||
public class ItemYetaWrench extends Item implements ITool, IConduitControl, IAdvancedTooltipProvider, InvocationHandler {
|
||||
|
||||
public static ItemYetaWrench create() {
|
||||
if(Config.useSneakMouseWheelYetaWrench) {
|
||||
@@ -83,7 +86,13 @@ public class ItemYetaWrench extends Item implements ITool, IAdvancedTooltipProvi
|
||||
ConduitDisplayMode.setDisplayMode(equipped, newMode);
|
||||
return equipped;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) {
|
||||
Block block = player.worldObj.getBlock(x, y, z);
|
||||
return block == EnderIO.blockConduitBundle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFull3D() {
|
||||
return true;
|
||||
@@ -107,29 +116,33 @@ public class ItemYetaWrench extends Item implements ITool, IAdvancedTooltipProvi
|
||||
public boolean shouldHideFacades(ItemStack stack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showOverlay(ItemStack stack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* IAdvancedTooltipProvider */
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
int line = 1;
|
||||
String unloc = getUnlocalizedName() + ".tooltip.detailed.line", loc = null;
|
||||
while (!(loc = Lang.localize(unloc + line, false)).equals(unloc + line++)) {
|
||||
list.add(String.format(loc, Keyboard.getKeyName(KeyTracker.instance.getYetaWrenchMode().getKeyCode())));
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
; // none
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
; // none
|
||||
ArrayList<String> tmp = new ArrayList<String>();
|
||||
TooltipAddera.addDetailedTooltipFromResources(tmp, getUnlocalizedName());
|
||||
String keyName = Keyboard.getKeyName(KeyTracker.instance.getYetaWrenchMode().getKeyCode());
|
||||
for(String line : tmp) {
|
||||
list.add(String.format(line, keyName));
|
||||
}
|
||||
}
|
||||
|
||||
/* InvocationHandler */
|
||||
|
||||
@@ -15,6 +15,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
import crazypants.enderio.api.tool.IConduitControl;
|
||||
import crazypants.enderio.conduit.ConduitDisplayMode;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelController;
|
||||
import crazypants.enderio.item.darksteel.GogglesOfRevealingUpgrade;
|
||||
@@ -143,7 +144,7 @@ public class KeyTracker {
|
||||
if(equipped == null) {
|
||||
return;
|
||||
}
|
||||
if(equipped.getItem() == EnderIO.itemYetaWench) {
|
||||
if(equipped.getItem() instanceof IConduitControl) {
|
||||
ConduitDisplayMode curMode = ConduitDisplayMode.getDisplayMode(equipped);
|
||||
if(curMode == null) {
|
||||
curMode = ConduitDisplayMode.ALL;
|
||||
|
||||
@@ -2,6 +2,7 @@ package crazypants.enderio.item;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
@@ -12,6 +13,7 @@ import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.api.tool.IConduitControl;
|
||||
import crazypants.enderio.conduit.ConduitDisplayMode;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
|
||||
@@ -47,8 +49,8 @@ public class ToolTickHandler {
|
||||
}
|
||||
if(stack.getItem() == EnderIO.itemConduitProbe) {
|
||||
changeConduitProbeMode(stack);
|
||||
} else if(stack.getItem() ==EnderIO.itemYetaWench) {
|
||||
changeYetaWrenchMode(stack);
|
||||
} else if(stack.getItem() instanceof IConduitControl) {
|
||||
changeDisplayMode(stack, player);
|
||||
}
|
||||
}
|
||||
slotSelected = -1;
|
||||
@@ -57,7 +59,10 @@ public class ToolTickHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private void changeYetaWrenchMode(ItemStack stack) {
|
||||
private void changeDisplayMode(ItemStack stack, EntityPlayer player) {
|
||||
if (!((IConduitControl)stack.getItem()).showOverlay(stack, player)) {
|
||||
return;
|
||||
}
|
||||
ConduitDisplayMode curMode = ConduitDisplayMode.getDisplayMode(stack);
|
||||
if(curMode == null) {
|
||||
curMode = ConduitDisplayMode.ALL;
|
||||
@@ -85,7 +90,7 @@ public class ToolTickHandler {
|
||||
|
||||
private boolean isToolSelected(EntityClientPlayerMP player) {
|
||||
return player != null && player.getCurrentEquippedItem() != null &&
|
||||
(player.getCurrentEquippedItem().getItem() == EnderIO.itemYetaWench || player.getCurrentEquippedItem().getItem() == EnderIO.itemConduitProbe);
|
||||
(player.getCurrentEquippedItem().getItem() instanceof IConduitControl || player.getCurrentEquippedItem().getItem() == EnderIO.itemConduitProbe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import java.util.Map;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
@@ -14,6 +15,7 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import crazypants.enderio.api.tool.IConduitControl;
|
||||
import crazypants.enderio.conduit.ConduitDisplayMode;
|
||||
import crazypants.enderio.conduit.gas.GasUtil;
|
||||
import crazypants.enderio.conduit.me.MEUtil;
|
||||
@@ -21,15 +23,12 @@ import crazypants.enderio.gui.IconEIO;
|
||||
|
||||
public class YetaWrenchOverlayRenderer {
|
||||
|
||||
private ItemYetaWrench wrench;
|
||||
|
||||
private IconEIO[] onIcons;
|
||||
private IconEIO[] offIcons;
|
||||
private Point[] iconOffsets;
|
||||
private Map<ConduitDisplayMode, Integer> indices = new EnumMap<ConduitDisplayMode, Integer>(ConduitDisplayMode.class);
|
||||
|
||||
public YetaWrenchOverlayRenderer(ItemYetaWrench wrench) {
|
||||
this.wrench = wrench;
|
||||
public YetaWrenchOverlayRenderer() {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@@ -42,9 +41,10 @@ public class YetaWrenchOverlayRenderer {
|
||||
}
|
||||
|
||||
private ItemStack getEquippedWrench() {
|
||||
ItemStack equipped = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem();
|
||||
if(equipped != null && equipped.getItem() == wrench) {
|
||||
return equipped;
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
ItemStack equipped = player.getCurrentEquippedItem();
|
||||
if(equipped != null && equipped.getItem() instanceof IConduitControl) {
|
||||
return ((IConduitControl) equipped.getItem()).showOverlay(equipped, player) ? equipped : null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ public class DarkSteelRecipeManager {
|
||||
}
|
||||
}
|
||||
if(!applyableUpgrades.isEmpty()) {
|
||||
list.add(EnumChatFormatting.YELLOW + "Anvil Upgrades: ");
|
||||
list.add(EnumChatFormatting.YELLOW + Lang.localize("tooltip.anvilupgrades") + " ");
|
||||
for (IDarkSteelUpgrade up : applyableUpgrades) {
|
||||
list.add(EnumChatFormatting.DARK_AQUA + "" + "" + Lang.localize(up.getUnlocalizedName() + ".name", false) + ": ");
|
||||
list.add(EnumChatFormatting.DARK_AQUA + "" + EnumChatFormatting.ITALIC + " " + up.getUpgradeItemName() + " + " + up.getLevelCost()
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Set;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -12,12 +13,10 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
@@ -33,8 +32,6 @@ import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.teleport.IItemOfTravel;
|
||||
import crazypants.enderio.teleport.TravelController;
|
||||
import crazypants.enderio.teleport.TravelSource;
|
||||
import crazypants.render.BoundingBox;
|
||||
import crazypants.util.BlockCoord;
|
||||
import crazypants.util.ItemUtil;
|
||||
import crazypants.util.Lang;
|
||||
|
||||
@@ -116,48 +113,43 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe implements IEnergyContaine
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack item, EntityPlayer player, World world, int x, int y, int z, int side, float par8, float par9, float par10) {
|
||||
if(!isTravelUpgradeActive(player, item)) {
|
||||
return doRightClickItemPlace(player, world, x, y, z, side, par8, par9, par10);
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack item, EntityPlayer player, World world,
|
||||
int x, int y, int z, int side, float par8, float par9, float par10) {
|
||||
if (!isTravelUpgradeActive(player, item) && world.isRemote) {
|
||||
return doRightClickItemPlace(player, world, x, y, z, side, par8,
|
||||
par9, par10);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static boolean doRightClickItemPlace(EntityPlayer player, World world, int x, int y, int z, int side, float par8, float par9, float par10) {
|
||||
int current = player.inventory.currentItem;
|
||||
int slot = current == 0 && Config.slotZeroPlacesEight ? 8 : current + 1;
|
||||
if(slot < 9 && player.inventory.mainInventory[slot] != null && !(player.inventory.mainInventory[slot].getItem() instanceof IDarkSteelItem)) {
|
||||
|
||||
if(!canPlaceBlockOnRightClick(player, world, x, y, z, side, slot)) {
|
||||
return false;
|
||||
}
|
||||
boolean ret = player.inventory.mainInventory[slot].getItem().onItemUse(player.inventory.mainInventory[slot], player, world, x, y, z, side, par8,
|
||||
par9, par10);
|
||||
if(player.inventory.mainInventory[slot].stackSize <= 0) {
|
||||
player.inventory.mainInventory[slot] = null;
|
||||
}
|
||||
return ret;
|
||||
@SideOnly(Side.CLIENT)
|
||||
static boolean doRightClickItemPlace(EntityPlayer player, World world,
|
||||
int x, int y, int z, int side, float par8, float par9, float par10) {
|
||||
int current = player.inventory.currentItem;
|
||||
int slot = current == 0 && Config.slotZeroPlacesEight ? 8 : current + 1;
|
||||
if (slot < 9
|
||||
&& player.inventory.mainInventory[slot] != null
|
||||
&& !(player.inventory.mainInventory[slot].getItem() instanceof IDarkSteelItem)) {
|
||||
/*
|
||||
* this will not work with buckets unless we don't switch back to
|
||||
* the current item (the pick); there's probably some client <->
|
||||
* server event thing going on with buckets, so our item-switch
|
||||
* within the same tick would be a problem.
|
||||
*/
|
||||
player.inventory.currentItem = slot;
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
boolean result = mc.playerController.onPlayerRightClick(
|
||||
mc.thePlayer, mc.theWorld,
|
||||
player.inventory.mainInventory[slot],
|
||||
mc.objectMouseOver.blockX, mc.objectMouseOver.blockY,
|
||||
mc.objectMouseOver.blockZ, mc.objectMouseOver.sideHit,
|
||||
mc.objectMouseOver.hitVec);
|
||||
player.inventory.currentItem = current;
|
||||
return (result);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static boolean canPlaceBlockOnRightClick(EntityPlayer player, World world, int x, int y, int z, int side, int slot) {
|
||||
BlockCoord placeCoord = new BlockCoord(x, y, z).getLocation(ForgeDirection.getOrientation(side));
|
||||
ItemStack toUse = player.inventory.mainInventory[slot];
|
||||
AxisAlignedBB aabb;
|
||||
Block blk = Block.getBlockFromItem(toUse.getItem());
|
||||
if(blk != null) {
|
||||
aabb = blk.getCollisionBoundingBoxFromPool(world, placeCoord.x, placeCoord.y, placeCoord.z);
|
||||
} else {
|
||||
BoundingBox bb = new BoundingBox(placeCoord);
|
||||
aabb = bb.getAxisAlignedBB();
|
||||
}
|
||||
if(aabb != null && aabb.intersectsWith(player.boundingBox)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void applyDamage(EntityLivingBase entity, ItemStack stack, int damage) {
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.enderio.item.skull;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -13,8 +14,10 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.ModObject;
|
||||
import thaumcraft.api.crafting.IInfusionStabiliser;
|
||||
|
||||
public class BlockEndermanSkull extends BlockEio {
|
||||
@Optional.Interface(iface = "thaumcraft.api.crafting.IInfusionStabiliser", modid = "Thaumcraft")
|
||||
public class BlockEndermanSkull extends BlockEio implements IInfusionStabiliser {
|
||||
|
||||
public static int renderId = -1;
|
||||
|
||||
@@ -118,4 +121,10 @@ public class BlockEndermanSkull extends BlockEio {
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "Thaumcraft")
|
||||
public boolean canStabaliseInfusion(World world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,10 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -18,22 +16,23 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.ClientProxy;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.TileEntityEio;
|
||||
import crazypants.enderio.api.tool.ITool;
|
||||
import crazypants.enderio.gui.IResourceTooltipProvider;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import crazypants.enderio.waila.IWailaInfoProvider;
|
||||
|
||||
public abstract class AbstractMachineBlock<T extends AbstractMachineEntity> extends BlockContainer implements IGuiHandler, IResourceTooltipProvider,
|
||||
public abstract class AbstractMachineBlock<T extends AbstractMachineEntity> extends BlockEio implements IGuiHandler, IResourceTooltipProvider,
|
||||
IWailaInfoProvider {
|
||||
|
||||
public static int renderId;
|
||||
@@ -53,8 +52,6 @@ public abstract class AbstractMachineBlock<T extends AbstractMachineEntity> exte
|
||||
|
||||
protected final ModObject modObject;
|
||||
|
||||
protected final Class<T> teClass;
|
||||
|
||||
static {
|
||||
PacketHandler.INSTANCE.registerMessage(PacketIoMode.class, PacketIoMode.class, PacketHandler.nextID(), Side.SERVER);
|
||||
PacketHandler.INSTANCE.registerMessage(PacketItemBuffer.class, PacketItemBuffer.class, PacketHandler.nextID(), Side.SERVER);
|
||||
@@ -63,12 +60,10 @@ public abstract class AbstractMachineBlock<T extends AbstractMachineEntity> exte
|
||||
}
|
||||
|
||||
protected AbstractMachineBlock(ModObject mo, Class<T> teClass, Material mat) {
|
||||
super(mat);
|
||||
super(mo.unlocalisedName, teClass, mat);
|
||||
modObject = mo;
|
||||
this.teClass = teClass;
|
||||
setHardness(2.0F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setBlockName(mo.unlocalisedName);
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
setHarvestLevel("pickaxe", 0);
|
||||
random = new Random();
|
||||
@@ -85,46 +80,17 @@ public abstract class AbstractMachineBlock<T extends AbstractMachineEntity> exte
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2) {
|
||||
try {
|
||||
return teClass.newInstance();
|
||||
} catch (Exception e) {
|
||||
FMLCommonHandler.instance().raiseException(e, "Could not create tile entity from class " + teClass, true);
|
||||
return null;
|
||||
}
|
||||
public int getRenderType() {
|
||||
return renderId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float par7, float par8, float par9) {
|
||||
|
||||
if(ToolUtil.breakBlockWithTool(this, world, x, y, z, entityPlayer)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
ITool tool = ToolUtil.getEquippedTool(entityPlayer);
|
||||
if(tool != null && !entityPlayer.isSneaking()) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof AbstractMachineEntity) {
|
||||
((AbstractMachineEntity) te).toggleIoModeForFace(ForgeDirection.getOrientation(side));
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if(entityPlayer.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
public boolean openGui(World world, int x, int y, int z, EntityPlayer entityPlayer, int side) {
|
||||
if(!world.isRemote) {
|
||||
entityPlayer.openGui(EnderIO.instance, getGuiId(), world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canSilkHarvest(World world, EntityPlayer player, int x, int y, int z, int metadata) {
|
||||
return false;
|
||||
@@ -211,35 +177,15 @@ public abstract class AbstractMachineBlock<T extends AbstractMachineEntity> exte
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random r) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected boolean shouldDropDefaultItem(World world, EntityPlayer player, int x, int y, int z) {
|
||||
return true;
|
||||
public boolean doNormalDrops(World world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean doHarvest) {
|
||||
if(!world.isRemote && (!player.capabilities.isCreativeMode)) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof AbstractMachineEntity && shouldDropDefaultItem(world, player, x, y, z)) {
|
||||
AbstractMachineEntity machineEntity = (AbstractMachineEntity) te;
|
||||
int meta = damageDropped(world.getBlockMetadata(x, y, z));
|
||||
ItemStack itemStack = new ItemStack(this, 1, meta);
|
||||
machineEntity.writeToItemStack(itemStack);
|
||||
|
||||
float f = 0.7F;
|
||||
double d0 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
|
||||
double d1 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
|
||||
double d2 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
|
||||
EntityItem entityitem = new EntityItem(world, x + d0, y + d1, z + d2, itemStack);
|
||||
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
protected void processDrop(World world, int x, int y, int z, TileEntityEio te, ItemStack stack) {
|
||||
if(te != null) {
|
||||
((AbstractMachineEntity) te).writeToItemStack(stack);
|
||||
}
|
||||
return super.removedByPlayer(world, player, x, y, z, doHarvest);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -108,6 +108,16 @@ public abstract class AbstractMachineEntity extends TileEntityEio implements ISi
|
||||
updateBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearAllIoModes() {
|
||||
if(faceModes != null) {
|
||||
faceModes = null;
|
||||
forceClientUpdate = true;
|
||||
notifyNeighbours = true;
|
||||
updateBlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoMode getIoMode(ForgeDirection face) {
|
||||
if(faceModes == null) {
|
||||
|
||||
@@ -22,6 +22,7 @@ public abstract class AbstractPoweredTaskEntity extends AbstractPowerConsumerEnt
|
||||
protected boolean startFailed = false;
|
||||
|
||||
protected int lastProgressScaled = -1;
|
||||
protected int ticksSinceLastProgressUpdate;
|
||||
|
||||
public AbstractPoweredTaskEntity(SlotDefinition slotDefinition) {
|
||||
super(slotDefinition);
|
||||
@@ -124,6 +125,7 @@ public abstract class AbstractPoweredTaskEntity extends AbstractPowerConsumerEnt
|
||||
|
||||
protected void sendTaskProgressPacket() {
|
||||
PacketHandler.sendToAllAround(new PacketCurrentTaskProgress(this), this);
|
||||
ticksSinceLastProgressUpdate = 0;
|
||||
}
|
||||
|
||||
protected boolean checkProgress(boolean redstoneChecksPassed) {
|
||||
@@ -140,7 +142,7 @@ public abstract class AbstractPoweredTaskEntity extends AbstractPowerConsumerEnt
|
||||
}
|
||||
|
||||
int curScaled = getProgressScaled(16);
|
||||
if(curScaled != lastProgressScaled) {
|
||||
if(++ticksSinceLastProgressUpdate >= 20 || curScaled != lastProgressScaled) {
|
||||
sendTaskProgressPacket();
|
||||
lastProgressScaled = curScaled;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ public interface IIoConfigurable {
|
||||
|
||||
public IoMode getIoMode(ForgeDirection face) ;
|
||||
|
||||
public void clearAllIoModes();
|
||||
|
||||
BlockCoord getLocation();
|
||||
|
||||
}
|
||||
@@ -135,16 +135,19 @@ public class MachineRecipes {
|
||||
|
||||
//capacitor bank
|
||||
|
||||
ItemStack capBank = BlockItemCapBank.createItemStackWithPower(CapBankType.getMetaFromType(CapBankType.SIMPLE), 0);
|
||||
GameRegistry.addShapedRecipe(capBank, "bcb", "cmc", "bcb", 'b', Items.iron_ingot, 'c', capacitor, 'm', Blocks.redstone_block);
|
||||
capBank = BlockItemCapBank.createItemStackWithPower(CapBankType.getMetaFromType(CapBankType.ACTIVATED), 0);
|
||||
GameRegistry.addShapedRecipe(capBank, "bcb", "cmc", "bcb", 'b', electricSteel, 'c', capacitor2, 'm', Blocks.redstone_block);
|
||||
capBank = BlockItemCapBank.createItemStackWithPower(CapBankType.getMetaFromType(CapBankType.VIBRANT), 0);
|
||||
GameRegistry.addShapedRecipe(capBank, "bcb", "cmc", "bcb", 'b', electricSteel, 'c', capacitor3, 'm', vibCry);
|
||||
ItemStack capBank1 = BlockItemCapBank.createItemStackWithPower(CapBankType.getMetaFromType(CapBankType.SIMPLE), 0);
|
||||
GameRegistry.addShapedRecipe(capBank1, "bcb", "cmc", "bcb", 'b', Items.iron_ingot, 'c', capacitor, 'm', Blocks.redstone_block);
|
||||
ItemStack capBank2 = BlockItemCapBank.createItemStackWithPower(CapBankType.getMetaFromType(CapBankType.ACTIVATED), 0);
|
||||
GameRegistry.addShapedRecipe(capBank2, "bcb", "cmc", "bcb", 'b', electricSteel, 'c', capacitor2, 'm', Blocks.redstone_block);
|
||||
ItemStack capBank3 = BlockItemCapBank.createItemStackWithPower(CapBankType.getMetaFromType(CapBankType.VIBRANT), 0);
|
||||
GameRegistry.addShapedRecipe(capBank3, "bcb", "cmc", "bcb", 'b', electricSteel, 'c', capacitor3, 'm', vibCry);
|
||||
|
||||
ConvertOldRecipe convertRecipe = new ConvertOldRecipe();
|
||||
GameRegistry.addRecipe(convertRecipe);
|
||||
|
||||
GameRegistry.addRecipe(new UpgradeCapBankRecipe(capBank2, "eee", "bcb", "eee", 'e', energeticAlloy, 'b', capBank1, 'c', capacitor2));
|
||||
GameRegistry.addRecipe(new UpgradeCapBankRecipe(capBank3, "vov", "NcN", "vov", 'v', phasedGold, 'o', capacitor3, 'N', capBank2, 'c', vibCry));
|
||||
|
||||
//painter
|
||||
ItemStack painter = new ItemStack(EnderIO.blockPainter, 1, 0);
|
||||
if(Config.useHardRecipes) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.util.BlockCoord;
|
||||
|
||||
public class PacketIoMode implements IMessage, IMessageHandler<PacketIoMode, IMessage> {
|
||||
|
||||
@@ -19,10 +20,20 @@ public class PacketIoMode implements IMessage, IMessageHandler<PacketIoMode, IMe
|
||||
public PacketIoMode() {
|
||||
}
|
||||
|
||||
public PacketIoMode(IIoConfigurable cont) {
|
||||
BlockCoord location = cont.getLocation();
|
||||
this.x = location.x;
|
||||
this.y = location.y;
|
||||
this.z = location.z;
|
||||
this.mode = IoMode.NONE;
|
||||
this.face = ForgeDirection.UNKNOWN;
|
||||
}
|
||||
|
||||
public PacketIoMode(IIoConfigurable cont, ForgeDirection face) {
|
||||
this.x = cont.getLocation().x;
|
||||
this.y = cont.getLocation().y;
|
||||
this.z = cont.getLocation().z;
|
||||
BlockCoord location = cont.getLocation();
|
||||
this.x = location.x;
|
||||
this.y = location.y;
|
||||
this.z = location.z;
|
||||
this.face = face;
|
||||
mode = cont.getIoMode(face);
|
||||
}
|
||||
@@ -52,7 +63,11 @@ public class PacketIoMode implements IMessage, IMessageHandler<PacketIoMode, IMe
|
||||
TileEntity te = player.worldObj.getTileEntity(message.x, message.y, message.z);
|
||||
if(te instanceof IIoConfigurable) {
|
||||
IIoConfigurable me = (IIoConfigurable) te;
|
||||
me.setIoMode(message.face, message.mode);
|
||||
if(message.face == ForgeDirection.UNKNOWN) {
|
||||
me.clearAllIoModes();
|
||||
} else {
|
||||
me.setIoMode(message.face, message.mode);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package crazypants.enderio.machine;
|
||||
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
|
||||
public class UpgradeCapBankRecipe extends ShapedOreRecipe {
|
||||
|
||||
public UpgradeCapBankRecipe(ItemStack result, Object... recipe) {
|
||||
super(result, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting var1) {
|
||||
long energy = 0;
|
||||
for(int y=0 ; y<3 ; y++) {
|
||||
for(int x=0 ; x<3 ; x++) {
|
||||
ItemStack st = var1.getStackInRowAndColumn(x, y);
|
||||
if(st != null) {
|
||||
energy += PowerHandlerUtil.getStoredEnergyForItem(st);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack res = super.getCraftingResult(var1);
|
||||
PowerHandlerUtil.setStoredEnergyForItem(res, (int)Math.min(Integer.MAX_VALUE, energy));
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -2,16 +2,18 @@ package crazypants.enderio.machine.alloy;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.AchievementList;
|
||||
import crazypants.enderio.machine.gui.AbstractMachineContainer;
|
||||
import crazypants.util.Util;
|
||||
|
||||
public class ContainerAlloySmelter extends AbstractMachineContainer {
|
||||
|
||||
private EntityPlayer thePlayer;
|
||||
private TileAlloySmelter smelter;
|
||||
private final EntityPlayer thePlayer;
|
||||
private final TileAlloySmelter smelter;
|
||||
|
||||
public ContainerAlloySmelter(InventoryPlayer playerInv, TileAlloySmelter te) {
|
||||
super(playerInv, te);
|
||||
@@ -85,18 +87,21 @@ public class ContainerAlloySmelter extends AbstractMachineContainer {
|
||||
@Override
|
||||
protected void onCrafting(ItemStack output) {
|
||||
output.onCrafting(thePlayer.worldObj, thePlayer, numResults);
|
||||
if(output != null) {
|
||||
if(!thePlayer.worldObj.isRemote) {
|
||||
ItemStack outputSized = output.copy();
|
||||
outputSized.stackSize = numResults;
|
||||
float experience = smelter.getExperienceForOutput(outputSized);
|
||||
Util.giveExperience(thePlayer, experience);
|
||||
}
|
||||
|
||||
if(!thePlayer.worldObj.isRemote) {
|
||||
ItemStack outputSized = output.copy();
|
||||
outputSized.stackSize = numResults;
|
||||
float experience = smelter.getExperienceForOutput(outputSized);
|
||||
Util.giveExperience(thePlayer, experience);
|
||||
}
|
||||
numResults = 0;
|
||||
}
|
||||
|
||||
if(output.getItem() == Items.iron_ingot) {
|
||||
thePlayer.addStat(AchievementList.acquireIron, 1);
|
||||
}
|
||||
if(output.getItem() == Items.cooked_fished) {
|
||||
thePlayer.addStat(AchievementList.cookFish, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package crazypants.enderio.machine.alloy;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
@@ -20,35 +21,21 @@ import crazypants.vecmath.Vector4f;
|
||||
|
||||
public class GuiAlloySmelter extends GuiPoweredMachineBase<TileAlloySmelter> {
|
||||
|
||||
private IconButton vanillaFurnaceButton;
|
||||
private final IconButton vanillaFurnaceButton;
|
||||
private final GuiToolTip vanillaFurnaceTooltip;
|
||||
|
||||
protected static final int SMELT_MODE_BUTTON_ID = 76;
|
||||
|
||||
public GuiAlloySmelter(InventoryPlayer par1InventoryPlayer, TileAlloySmelter furnaceInventory) {
|
||||
super(furnaceInventory, new ContainerAlloySmelter(par1InventoryPlayer, furnaceInventory));
|
||||
|
||||
addToolTip(new GuiToolTip(new Rectangle(0, 0, 0, 0), "") {
|
||||
vanillaFurnaceButton = new IconButton(getFontRenderer(), SMELT_MODE_BUTTON_ID, 0, 0, null, RenderUtil.BLOCK_TEX);
|
||||
vanillaFurnaceButton.setSize(BUTTON_SIZE, BUTTON_SIZE);
|
||||
|
||||
@Override
|
||||
protected void updateText() {
|
||||
text.clear();
|
||||
text.add(Lang.localize("gui.alloy.mode.heading"));
|
||||
String txt = Lang.localize("gui.alloy.mode.all");
|
||||
if(getTileEntity().getMode() == Mode.ALLOY) {
|
||||
txt = Lang.localize("gui.alloy.mode.alloy");
|
||||
} else if(getTileEntity().getMode() == Mode.FURNACE) {
|
||||
txt = Lang.localize("gui.alloy.mode.furnace");
|
||||
}
|
||||
text.add(txt);
|
||||
}
|
||||
vanillaFurnaceTooltip = new GuiToolTip(new Rectangle(xSize - 5 - BUTTON_SIZE, 62, BUTTON_SIZE, BUTTON_SIZE), (String[])null);
|
||||
|
||||
@Override
|
||||
public void onTick(int mouseX, int mouseY) {
|
||||
bounds.setBounds(xSize - 5 - BUTTON_SIZE, 60, BUTTON_SIZE, BUTTON_SIZE);
|
||||
super.onTick(mouseX, mouseY);
|
||||
}
|
||||
|
||||
});
|
||||
addProgressTooltip(55, 35, 14, 14);
|
||||
addProgressTooltip(103, 35, 14, 14);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -56,13 +43,13 @@ public class GuiAlloySmelter extends GuiPoweredMachineBase<TileAlloySmelter> {
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
int x = guiLeft + xSize - 5 - BUTTON_SIZE;
|
||||
int y = guiTop + 62;
|
||||
|
||||
vanillaFurnaceButton = new IconButton(getFontRenderer(), SMELT_MODE_BUTTON_ID, x, y, getIconForMode(), RenderUtil.BLOCK_TEX);
|
||||
vanillaFurnaceButton.setSize(BUTTON_SIZE, BUTTON_SIZE);
|
||||
vanillaFurnaceButton.xPosition = guiLeft + vanillaFurnaceTooltip.getBounds().x;
|
||||
vanillaFurnaceButton.yPosition = guiTop + vanillaFurnaceTooltip.getBounds().y;
|
||||
|
||||
buttonList.add(vanillaFurnaceButton);
|
||||
addToolTip(vanillaFurnaceTooltip);
|
||||
|
||||
updateVanillaFurnaceButton();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -78,21 +65,27 @@ public class GuiAlloySmelter extends GuiPoweredMachineBase<TileAlloySmelter> {
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
if(par1GuiButton.id == SMELT_MODE_BUTTON_ID) {
|
||||
getTileEntity().setMode(getTileEntity().getMode().next());
|
||||
vanillaFurnaceButton.setIcon(getIconForMode());
|
||||
updateVanillaFurnaceButton();
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketClientState(getTileEntity()));
|
||||
} else {
|
||||
super.actionPerformed(par1GuiButton);
|
||||
}
|
||||
}
|
||||
|
||||
private IIcon getIconForMode() {
|
||||
private void updateVanillaFurnaceButton() {
|
||||
IIcon icon = EnderIO.blockAlloySmelter.vanillaSmeltingOn;
|
||||
String unlocText = "gui.alloy.mode.all";
|
||||
if(getTileEntity().getMode() == Mode.ALLOY) {
|
||||
icon = EnderIO.blockAlloySmelter.vanillaSmeltingOff;
|
||||
unlocText = "gui.alloy.mode.alloy";
|
||||
} else if(getTileEntity().getMode() == Mode.FURNACE) {
|
||||
icon = EnderIO.blockAlloySmelter.vanillaSmeltingOnly;
|
||||
unlocText = "gui.alloy.mode.furnace";
|
||||
}
|
||||
return icon;
|
||||
vanillaFurnaceButton.setIcon(icon);
|
||||
vanillaFurnaceTooltip.setToolTipText(
|
||||
Lang.localize("gui.alloy.mode.heading"),
|
||||
Lang.localize(unlocText));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,15 +96,13 @@ public class GuiAlloySmelter extends GuiPoweredMachineBase<TileAlloySmelter> {
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderUtil.bindTexture("enderio:textures/gui/alloySmelter.png");
|
||||
int sx = (width - xSize) / 2;
|
||||
int sy = (height - ySize) / 2;
|
||||
int sx = guiLeft;
|
||||
int sy = guiTop;
|
||||
|
||||
drawTexturedModalRect(sx, sy, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int scaled;
|
||||
|
||||
if(getTileEntity().getProgress() < 1 && getTileEntity().getProgress() > 0) {
|
||||
scaled = getTileEntity().getProgressScaled(14) + 1;
|
||||
if(shouldRenderProgress()) {
|
||||
int scaled = getTileEntity().getProgressScaled(14) + 1;
|
||||
drawTexturedModalRect(sx + 55, sy + 49 - scaled, 176, 14 - scaled, 14, scaled);
|
||||
drawTexturedModalRect(sx + 103, sy + 49 - scaled, 176, 14 - scaled, 14, scaled);
|
||||
}
|
||||
|
||||
@@ -38,11 +38,11 @@ public class BlockBuffer extends AbstractMachineBlock<TileBuffer> implements IFa
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
private static final String[] textureNames = new String[] { "blockBufferItem", "blockBufferPower", "blockBufferOmni", "blockBufferCreative" };
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] textures;
|
||||
|
||||
|
||||
private BlockBuffer() {
|
||||
super(ModObject.blockBuffer, TileBuffer.class);
|
||||
}
|
||||
@@ -77,7 +77,7 @@ public class BlockBuffer extends AbstractMachineBlock<TileBuffer> implements IFa
|
||||
protected int getGuiId() {
|
||||
return GuiHandler.GUI_ID_BUFFER;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iIconRegister) {
|
||||
@@ -87,7 +87,7 @@ public class BlockBuffer extends AbstractMachineBlock<TileBuffer> implements IFa
|
||||
textures[i] = iIconRegister.registerIcon("enderio:" + textureNames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected String getMachineFrontIconKey(boolean active) {
|
||||
return getSideIconKey(active);
|
||||
@@ -97,7 +97,7 @@ public class BlockBuffer extends AbstractMachineBlock<TileBuffer> implements IFa
|
||||
public IIcon getIcon(int blockSide, int blockMeta) {
|
||||
return blockSide > 1 ? textures[blockMeta] : super.getIcon(blockSide, blockMeta);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int blockSide) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
@@ -105,7 +105,7 @@ public class BlockBuffer extends AbstractMachineBlock<TileBuffer> implements IFa
|
||||
TileBuffer tef = (TileBuffer) te;
|
||||
if(tef.getSourceBlock() != null) {
|
||||
return tef.getSourceBlock().getIcon(blockSide, tef.getSourceBlockMetadata());
|
||||
} else if (blockSide > 1){
|
||||
} else if(blockSide > 1) {
|
||||
return textures[world.getBlockMetadata(x, y, z)];
|
||||
}
|
||||
}
|
||||
@@ -127,29 +127,10 @@ public class BlockBuffer extends AbstractMachineBlock<TileBuffer> implements IFa
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
return Lists.newArrayList();
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldDropDefaultItem(World world, EntityPlayer player, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
if(!world.isRemote) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileBuffer) {
|
||||
TileBuffer cb = (TileBuffer) te;
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
dropBlockAsItem(world, x, y, z, createDrop(cb));
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.removedByPlayer(world, player, x, y, z, willHarvest);
|
||||
}
|
||||
|
||||
// TODO refactor machines so all have this functionality
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
|
||||
@@ -53,7 +53,7 @@ public class TileBuffer extends AbstractPowerConsumerEntity implements IPaintabl
|
||||
|
||||
@Override
|
||||
protected boolean processTasks(boolean redstoneCheckPassed) {
|
||||
if(getEnergyStored() <= 0) {
|
||||
if(getEnergyStored() <= 0 || !redstoneCheckPassed) {
|
||||
return false;
|
||||
}
|
||||
if(dist == null) {
|
||||
@@ -74,6 +74,14 @@ public class TileBuffer extends AbstractPowerConsumerEntity implements IPaintabl
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearAllIoModes() {
|
||||
super.clearAllIoModes();
|
||||
if(dist != null) {
|
||||
dist.neighboursChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slot, ItemStack var2, int side) {
|
||||
return hasInventory() && getIoMode(ForgeDirection.VALID_DIRECTIONS[side]).canRecieveInput() && isMachineItemValidForSlot(slot, var2);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package crazypants.enderio.machine.capbank;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
@@ -9,7 +8,6 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -30,6 +28,7 @@ import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.TileEntityEio;
|
||||
import crazypants.enderio.api.redstone.IRedstoneConnectable;
|
||||
import crazypants.enderio.gui.IAdvancedTooltipProvider;
|
||||
import crazypants.enderio.gui.TooltipAddera;
|
||||
@@ -152,10 +151,6 @@ public class BlockCapBank extends BlockEio implements IGuiHandler, IAdvancedTool
|
||||
return false;
|
||||
}
|
||||
|
||||
if(ToolUtil.breakBlockWithTool(this, world, x, y, z, entityPlayer)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
TileCapBank tcb = (TileCapBank) te;
|
||||
ForgeDirection faceHit = ForgeDirection.getOrientation(side);
|
||||
|
||||
@@ -170,11 +165,7 @@ public class BlockCapBank extends BlockEio implements IGuiHandler, IAdvancedTool
|
||||
return true;
|
||||
}
|
||||
|
||||
if(entityPlayer.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(ToolUtil.isToolEquipped(entityPlayer)) {
|
||||
if(!entityPlayer.isSneaking() && ToolUtil.isToolEquipped(entityPlayer)) {
|
||||
|
||||
IoMode ioMode = tcb.getIoMode(faceHit);
|
||||
if(faceHit.offsetY == 0) {
|
||||
@@ -201,6 +192,16 @@ public class BlockCapBank extends BlockEio implements IGuiHandler, IAdvancedTool
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onBlockActivated(world, x, y, z, entityPlayer, side, par7, par8, par9);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doNormalDrops(World world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean openGui(World world, int x, int y, int z, EntityPlayer entityPlayer, int side) {
|
||||
if(!world.isRemote) {
|
||||
entityPlayer.openGui(EnderIO.instance, GuiHandler.GUI_ID_CAP_BANK, world, x, y, z);
|
||||
}
|
||||
@@ -420,52 +421,23 @@ public class BlockCapBank extends BlockEio implements IGuiHandler, IAdvancedTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
if(!world.isRemote) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileCapBank) {
|
||||
TileCapBank cb = (TileCapBank) te;
|
||||
ret.add(createItemStack(world, x, y, z, cb));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean doHarvest) {
|
||||
if(!world.isRemote && (!player.capabilities.isCreativeMode)) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileCapBank) {
|
||||
TileCapBank cb = (TileCapBank) te;
|
||||
cb.moveInventoryToNetwork();
|
||||
|
||||
ItemStack itemStack = createItemStack(world, x, y, z, cb);
|
||||
|
||||
//Clear in the inventory as its now in the item stack
|
||||
for (int i = 0; i < cb.getInventory().length; i++) {
|
||||
cb.getInventory()[i] = null;
|
||||
}
|
||||
|
||||
float f = 0.7F;
|
||||
double d0 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
|
||||
double d1 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
|
||||
double d2 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
|
||||
EntityItem entityitem = new EntityItem(world, x + d0, y + d1, z + d2, itemStack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
return super.removedByPlayer(world, player, x, y, z);
|
||||
return super.removedByPlayer(world, player, x, y, z, doHarvest);
|
||||
}
|
||||
|
||||
protected ItemStack createItemStack(World world, int x, int y, int z, TileCapBank cb) {
|
||||
int meta = damageDropped(world.getBlockMetadata(x, y, z));
|
||||
ItemStack itemStack = new ItemStack(this, 1, meta);
|
||||
itemStack.stackTagCompound = new NBTTagCompound();
|
||||
cb.writeCommonNBT(itemStack.stackTagCompound);
|
||||
return itemStack;
|
||||
@Override
|
||||
protected void processDrop(World world, int x, int y, int z, TileEntityEio te, ItemStack drop) {
|
||||
drop.stackTagCompound = new NBTTagCompound();
|
||||
if(te != null) {
|
||||
((TileCapBank) te).writeCommonNBT(drop.stackTagCompound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -473,16 +445,12 @@ public class BlockCapBank extends BlockEio implements IGuiHandler, IAdvancedTool
|
||||
if(!world.isRemote) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(!(te instanceof TileCapBank)) {
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
return;
|
||||
}
|
||||
TileCapBank cb = (TileCapBank) te;
|
||||
cb.onBreakBlock();
|
||||
if(world.getGameRules().getGameRuleBooleanValue("doTileDrops")) {
|
||||
Util.dropItems(world, cb.getInventory(), x, y, z, true);
|
||||
}
|
||||
}
|
||||
world.removeTileEntity(x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -577,7 +545,7 @@ public class BlockCapBank extends BlockEio implements IGuiHandler, IAdvancedTool
|
||||
}
|
||||
|
||||
/* IRedstoneConnectable */
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldRedstoneConduitConnect(World world, int x, int y, int z, ForgeDirection from) {
|
||||
return true;
|
||||
|
||||
@@ -15,8 +15,6 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.gui.IconButtonEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.gui.RedstoneModeButton;
|
||||
import crazypants.enderio.machine.IRedstoneModeControlable;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
@@ -25,6 +23,7 @@ import crazypants.enderio.machine.capbank.network.CapBankClientNetwork;
|
||||
import crazypants.enderio.machine.capbank.network.NetworkState;
|
||||
import crazypants.enderio.machine.capbank.packet.PacketGuiChange;
|
||||
import crazypants.enderio.machine.capbank.packet.PacketNetworkStateRequest;
|
||||
import crazypants.enderio.machine.gui.GuiButtonIoConfig;
|
||||
import crazypants.enderio.machine.gui.GuiOverlayIoConfig;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
@@ -69,8 +68,8 @@ public class GuiCapBank extends GuiContainerBase {
|
||||
private GuiTextField maxInputTF;
|
||||
private GuiTextField maxOutputTF;
|
||||
|
||||
private GuiOverlayIoConfig configOverlay;
|
||||
private IconButtonEIO configB;
|
||||
private final GuiOverlayIoConfig configOverlay;
|
||||
private final GuiButtonIoConfig configB;
|
||||
|
||||
private CapBankClientNetwork network;
|
||||
|
||||
@@ -144,10 +143,6 @@ public class GuiCapBank extends GuiContainerBase {
|
||||
});
|
||||
outputRsButton.setTooltipKey("enderio.gui.capBank.outputRs");
|
||||
|
||||
y += 20;
|
||||
configB = new IconButtonEIO(this, CONFIG_ID, x, y, IconEIO.IO_CONFIG_UP);
|
||||
configB.setToolTip(Lang.localize("gui.machine.ioMode.overlay.tooltip"));
|
||||
|
||||
List<BlockCoord> coords = new ArrayList<BlockCoord>();
|
||||
if(network != null && network.getMembers().size() < 200) {
|
||||
for (TileCapBank cb : network.getMembers()) {
|
||||
@@ -160,13 +155,6 @@ public class GuiCapBank extends GuiContainerBase {
|
||||
|
||||
|
||||
configOverlay = new GuiOverlayIoConfig(coords) {
|
||||
|
||||
@Override
|
||||
public void setVisible(boolean visible) {
|
||||
super.setVisible(visible);
|
||||
configB.setIcon(visible ? IconEIO.IO_CONFIG_DOWN : IconEIO.IO_CONFIG_UP);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getLabelForMode(IoMode mode) {
|
||||
if(mode == IoMode.PUSH) {
|
||||
@@ -176,19 +164,11 @@ public class GuiCapBank extends GuiContainerBase {
|
||||
}
|
||||
return super.getLabelForMode(mode);
|
||||
}
|
||||
|
||||
};
|
||||
addOverlay(configOverlay);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton b) {
|
||||
super.actionPerformed(b);
|
||||
if(b.id == CONFIG_ID) {
|
||||
boolean vis = !configOverlay.isVisible();
|
||||
configOverlay.setVisible(vis);
|
||||
}
|
||||
y += 20;
|
||||
configB = new GuiButtonIoConfig(this, CONFIG_ID, x, y, te, configOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -197,16 +177,13 @@ public class GuiCapBank extends GuiContainerBase {
|
||||
|
||||
configB.onGuiInit();
|
||||
|
||||
int x = guiLeft + xSize - rightMargin - GuiPoweredMachineBase.BUTTON_SIZE;
|
||||
int y = guiTop + inputY;
|
||||
|
||||
FontRenderer fontRenderer = getFontRenderer();
|
||||
|
||||
inputRsButton.onGuiInit();
|
||||
outputRsButton.onGuiInit();
|
||||
|
||||
x = guiLeft + inputX;
|
||||
y = guiTop + inputY;
|
||||
int x = guiLeft + inputX;
|
||||
int y = guiTop + inputY;
|
||||
maxInputTF = new GuiTextField(fontRenderer, x, y, 68, 16);
|
||||
maxInputTF.setCanLoseFocus(true);
|
||||
maxInputTF.setMaxStringLength(10);
|
||||
|
||||
@@ -300,6 +300,23 @@ public class TileCapBank extends TileEntityEio implements IInternalPowerHandler,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearAllIoModes() {
|
||||
if(network != null) {
|
||||
for(TileCapBank cb : network.getMembers()) {
|
||||
cb.doClearAllIoModes();
|
||||
}
|
||||
} else {
|
||||
doClearAllIoModes();
|
||||
}
|
||||
}
|
||||
|
||||
private void doClearAllIoModes() {
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
setDefaultIoMode(dir);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IoMode getIoMode(ForgeDirection face) {
|
||||
if(faceModes == null) {
|
||||
|
||||
@@ -74,7 +74,7 @@ public class CapBankClientNetwork implements ICapBankNetwork {
|
||||
BlockCoord bc = state.getInventoryImplLocation();
|
||||
if(bc == null) {
|
||||
inventory.setCapBank(null);
|
||||
} else {
|
||||
} else if(world != null) {
|
||||
TileEntity te = world.getTileEntity(bc.x, bc.y, bc.z);
|
||||
if(te instanceof TileCapBank) {
|
||||
inventory.setCapBank((TileCapBank) te);
|
||||
|
||||
@@ -16,6 +16,7 @@ import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.render.RenderUtil;
|
||||
import crazypants.util.Lang;
|
||||
|
||||
public class GuiCrafter extends GuiPoweredMachineBase<TileCrafter> {
|
||||
|
||||
@@ -28,8 +29,8 @@ public class GuiCrafter extends GuiPoweredMachineBase<TileCrafter> {
|
||||
int x = getXSize() - 5 - 16;
|
||||
int y = 43;
|
||||
bufferSizeB = new ToggleButtonEIO(this, 4327, x, y, IconEIO.ITEM_SINGLE, IconEIO.ITEM_STACK);
|
||||
bufferSizeB.setSelectedToolTip("Buffering item stacks");
|
||||
bufferSizeB.setUnselectedToolTip("Buffering single items");
|
||||
bufferSizeB.setSelectedToolTip(Lang.localize("gui.machine.bufferingstacks"));
|
||||
bufferSizeB.setUnselectedToolTip(Lang.localize("gui.machine.bufferingsingle"));
|
||||
bufferSizeB.setSelected(te.isBufferStacks());
|
||||
}
|
||||
|
||||
@@ -71,7 +72,7 @@ public class GuiCrafter extends GuiPoweredMachineBase<TileCrafter> {
|
||||
@Override
|
||||
protected void updatePowerBarTooltip(List<String> text) {
|
||||
text.add(PowerDisplayUtil.formatPower(Config.crafterRfPerCraft) + " " + PowerDisplayUtil.abrevation()
|
||||
+ " Per Craft");
|
||||
+ " " + Lang.localize("gui.machine.percraft"));
|
||||
super.updatePowerBarTooltip(text);
|
||||
}
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ public class CrusherRecipeManager {
|
||||
public void addCustomRecipes(String xmlDef) {
|
||||
RecipeConfig config;
|
||||
try {
|
||||
config = RecipeConfigParser.parse(xmlDef, null);
|
||||
config = RecipeConfigParser.parse(xmlDef, new GrindingBallTagHandler());
|
||||
} catch (Exception e) {
|
||||
Log.error("Error parsing custom xml");
|
||||
return;
|
||||
|
||||
@@ -22,6 +22,8 @@ public class GuiCrusher extends GuiPoweredMachineBase<TileCrusher> {
|
||||
text.add(getTileEntity().getBallDurationScaled(100) + "%");
|
||||
}
|
||||
});
|
||||
|
||||
addProgressTooltip(79, 31, 18, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,15 +34,15 @@ public class GuiCrusher extends GuiPoweredMachineBase<TileCrusher> {
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderUtil.bindTexture("enderio:textures/gui/crusher.png");
|
||||
int guiLeft = (width - xSize) / 2;
|
||||
int guiTop = (height - ySize) / 2;
|
||||
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
int barHeight = getTileEntity().getProgressScaled(24);
|
||||
drawTexturedModalRect(guiLeft + 79, guiTop + 31, 200, 0, 18, barHeight + 1);
|
||||
if(shouldRenderProgress()) {
|
||||
int barHeight = getTileEntity().getProgressScaled(24);
|
||||
drawTexturedModalRect(guiLeft + 79, guiTop + 31, 200, 0, 18, barHeight + 1);
|
||||
}
|
||||
|
||||
barHeight = getTileEntity().getBallDurationScaled(16);
|
||||
int barHeight = getTileEntity().getBallDurationScaled(16);
|
||||
if(barHeight > 0) {
|
||||
drawTexturedModalRect(guiLeft + 142, guiTop + 23 + (16 - barHeight), 186, 31, 4, barHeight);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.api.tool.ITool;
|
||||
import crazypants.enderio.gui.IResourceTooltipProvider;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import crazypants.util.Util;
|
||||
|
||||
@@ -68,21 +69,9 @@ public class BlockEnchanter extends BlockEio implements IGuiHandler, IResourceTo
|
||||
}
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float par7, float par8, float par9) {
|
||||
|
||||
ITool tool = ToolUtil.getEquippedTool(entityPlayer);
|
||||
if(tool != null) {
|
||||
if(entityPlayer.isSneaking() && tool.canUse(entityPlayer.getCurrentEquippedItem(), entityPlayer, x, y, z)) {
|
||||
removedByPlayer(world, entityPlayer, x, y, z, false);
|
||||
tool.used(entityPlayer.getCurrentEquippedItem(), entityPlayer, x, y, z);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if(entityPlayer.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
protected boolean openGui(World world, int x, int y, int z, EntityPlayer entityPlayer, int side) {
|
||||
if(!world.isRemote) {
|
||||
entityPlayer.openGui(EnderIO.instance, GuiHandler.GUI_ID_ENCHANTER, world, x, y, z);
|
||||
}
|
||||
@@ -90,31 +79,25 @@ public class BlockEnchanter extends BlockEio implements IGuiHandler, IResourceTo
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean harvested) {
|
||||
if(!world.isRemote) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileEnchanter) {
|
||||
TileEnchanter enchanter = (TileEnchanter) te;
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
ItemStack itemStack = new ItemStack(this);
|
||||
float f = 0.7F;
|
||||
double d0 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
|
||||
double d1 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
|
||||
double d2 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
|
||||
EntityItem entityitem = new EntityItem(world, x + d0, y + d1, z + d2, itemStack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
|
||||
if(enchanter.getStackInSlot(0) != null) {
|
||||
Util.dropItems(world, enchanter.getStackInSlot(0), x, y, z, true);
|
||||
}
|
||||
if(enchanter.getStackInSlot(1) != null) {
|
||||
Util.dropItems(world, enchanter.getStackInSlot(1), x, y, z, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileEnchanter) {
|
||||
dropItems(world, x, y, z, (TileEnchanter) te);
|
||||
}
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
public boolean doNormalDrops(World world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void dropItems(World world, int x, int y, int z, TileEnchanter te) {
|
||||
if(te.getStackInSlot(0) != null) {
|
||||
Util.dropItems(world, te.getStackInSlot(0), x, y, z, true);
|
||||
}
|
||||
if(te.getStackInSlot(1) != null) {
|
||||
Util.dropItems(world, te.getStackInSlot(1), x, y, z, true);
|
||||
}
|
||||
return super.removedByPlayer(world, player, x, y, z, harvested);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -154,13 +137,7 @@ public class BlockEnchanter extends BlockEio implements IGuiHandler, IResourceTo
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int p_149749_6_) {
|
||||
super.breakBlock(world, x, y, z, block, p_149749_6_);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameForTooltip(ItemStack itemStack) {
|
||||
return getUnlocalizedName();
|
||||
|
||||
@@ -39,7 +39,7 @@ public class GuiFarmStation extends GuiPoweredMachineBase<TileFarmStation> {
|
||||
|
||||
private int id = 0;
|
||||
private IconButtonEIO createButton(int x, int y) {
|
||||
return new ToggleButtonEIO(this, id, x, y, IconEIO.UNLOCKED, IconEIO.LOCKED).setSelected(getTileEntity().lockedSlots.contains(id++ + getTileEntity().minSupSlot)).setIconMargin(3, 3);
|
||||
return new ToggleButtonEIO(this, id, x, y, IconEIO.FARM_UNLOCK, IconEIO.FARM_LOCK).setSelected(getTileEntity().lockedSlots.contains(id++ + getTileEntity().minSupSlot));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,7 +68,7 @@ public class GuiFarmStation extends GuiPoweredMachineBase<TileFarmStation> {
|
||||
|
||||
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
fr.drawString("SW", sx + 55, sy + 41, ColorUtil.getARGB(1f,1f,0.35f,1f), true);
|
||||
fr.drawString("NW", sx + 55, sy + 59, ColorUtil.getARGB(1f,1f,0.35f,1f), true);
|
||||
fr.drawString("SE", sx + 73, sy + 41, ColorUtil.getARGB(1f,1f,0.35f,1f), true);
|
||||
|
||||
+2
-2
@@ -102,7 +102,7 @@ public class GuiCombustionGenerator extends GuiPoweredMachineBase<TileCombustion
|
||||
RenderUtil.renderGuiTank(gen.getCoolantTank().getFluid(), 4000, gen.getCoolantTank().getFluidAmount() - 1000, x, y, zLevel, 15, 47);
|
||||
|
||||
if(gen.isActive()) {
|
||||
txt = gen.getNumTicksPerMbCoolant() + " t/MB";
|
||||
txt = gen.getNumTicksPerMbCoolant() + " " + Lang.localize("power.tmb");
|
||||
sw = fr.getStringWidth(txt);
|
||||
fr.drawStringWithShadow(txt, x - sw / 2 + 7, y + fr.FONT_HEIGHT / 2 + 47, ColorUtil.getRGB(Color.WHITE));
|
||||
}
|
||||
@@ -124,7 +124,7 @@ public class GuiCombustionGenerator extends GuiPoweredMachineBase<TileCombustion
|
||||
RenderUtil.renderGuiTank(gen.getFuelTank().getFluid(), 4000, gen.getFuelTank().getFluidAmount() - 1000, x, y, zLevel, 15, 47);
|
||||
|
||||
if(gen.isActive()) {
|
||||
txt = gen.getNumTicksPerMbFuel() + " t/MB";
|
||||
txt = gen.getNumTicksPerMbFuel() + " " + Lang.localize("power.tmb");
|
||||
sw = fr.getStringWidth(txt);
|
||||
fr.drawStringWithShadow(txt, x - sw / 2 + 7, y + fr.FONT_HEIGHT / 2 + 47, ColorUtil.getRGB(Color.WHITE));
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import crazypants.enderio.machine.AbstractMachineBlock;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.util.FluidUtil;
|
||||
import crazypants.util.Util;
|
||||
import crazypants.util.Lang;
|
||||
|
||||
public class BlockZombieGenerator extends AbstractMachineBlock<TileZombieGenerator> {
|
||||
|
||||
@@ -151,7 +152,7 @@ public class BlockZombieGenerator extends AbstractMachineBlock<TileZombieGenerat
|
||||
public void getWailaInfo(List<String> tooltip, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te != null && te instanceof TileZombieGenerator) {
|
||||
tooltip.add(((TileZombieGenerator) te).getFluidStored(ForgeDirection.UNKNOWN) + " mB");
|
||||
tooltip.add(((TileZombieGenerator) te).getFluidStored(ForgeDirection.UNKNOWN) + " " + Lang.localize("fluid.millibucket.abr"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ public class GuiZombieGenerator extends GuiPoweredMachineBase<TileZombieGenerato
|
||||
RenderUtil.renderGuiTank(gen.fuelTank.getFluid(), gen.fuelTank.getCapacity(), gen.fuelTank.getFluidAmount(), x, y, zLevel, 16, 47);
|
||||
|
||||
if(gen.isActive()) {
|
||||
txt = gen.tickPerBucketOfFuel / 1000 + " t/Mb";
|
||||
txt = gen.tickPerBucketOfFuel / 1000 + " " + Lang.localize("power.tmb");
|
||||
sw = fr.getStringWidth(txt);
|
||||
fr.drawStringWithShadow(txt, x - sw / 2 + 7, y + fr.FONT_HEIGHT / 2 + 46, ColorUtil.getRGB(Color.WHITE));
|
||||
}
|
||||
|
||||
@@ -60,8 +60,6 @@ public abstract class AbstractMachineContainer extends Container {
|
||||
addSlotToContainer(slot);
|
||||
playerSlotLocations.put(slot, loc);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package crazypants.enderio.machine.gui;
|
||||
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.gui.ToggleButtonEIO;
|
||||
import crazypants.enderio.gui.TooltipAddera;
|
||||
import crazypants.enderio.machine.IIoConfigurable;
|
||||
import crazypants.enderio.machine.PacketIoMode;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.gui.IGuiScreen;
|
||||
import crazypants.util.Lang;
|
||||
import java.util.ArrayList;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
public class GuiButtonIoConfig extends ToggleButtonEIO {
|
||||
|
||||
private final IIoConfigurable config;
|
||||
private final GuiOverlayIoConfig configOverlay;
|
||||
|
||||
@SuppressWarnings("LeakingThisInConstructor")
|
||||
public GuiButtonIoConfig(IGuiScreen gui, int id, int x, int y, IIoConfigurable config, GuiOverlayIoConfig configOverlay) {
|
||||
super(gui, id, x, y, IconEIO.IO_CONFIG_UP, IconEIO.IO_CONFIG_DOWN);
|
||||
this.config = config;
|
||||
this.configOverlay = configOverlay;
|
||||
this.configOverlay.setConfigB(this);
|
||||
|
||||
String configTooltip = Lang.localize("gui.machine.ioMode.overlay.tooltip");
|
||||
setUnselectedToolTip(configTooltip);
|
||||
|
||||
ArrayList<String> list = new ArrayList<String>();
|
||||
list.add(configTooltip);
|
||||
TooltipAddera.addTooltipFromResources(list, "enderio.gui.machine.ioMode.overlay.tooltip.visible.line");
|
||||
if(list.size() > 1) {
|
||||
setSelectedToolTip(list.toArray(new String[list.size()]));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean toggleSelected() {
|
||||
if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
|
||||
if(!configOverlay.isVisible()) {
|
||||
return false;
|
||||
}
|
||||
config.clearAllIoModes();
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketIoMode(config));
|
||||
} else {
|
||||
boolean vis = !configOverlay.isVisible();
|
||||
configOverlay.setVisible(vis);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,10 @@
|
||||
package crazypants.enderio.machine.gui;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
@@ -11,11 +16,11 @@ import crazypants.enderio.gui.IconButtonEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.gui.IoConfigRenderer.SelectedFace;
|
||||
import crazypants.enderio.gui.RedstoneModeButton;
|
||||
import crazypants.enderio.gui.ToggleButtonEIO;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
import crazypants.enderio.machine.SlotDefinition;
|
||||
import crazypants.gui.GuiContainerBase;
|
||||
import crazypants.gui.GuiToolTip;
|
||||
import crazypants.render.RenderUtil;
|
||||
import crazypants.util.BlockCoord;
|
||||
import crazypants.util.Lang;
|
||||
@@ -30,57 +35,41 @@ public abstract class GuiMachineBase<T extends AbstractMachineEntity> extends Gu
|
||||
private static final int CONFIG_ID = 8962349;
|
||||
private static final int RECIPE_ID = CONFIG_ID + 1;
|
||||
|
||||
private T tileEntity;
|
||||
private final T tileEntity;
|
||||
|
||||
protected RedstoneModeButton redstoneButton;
|
||||
|
||||
private GuiOverlayIoConfig configOverlay;
|
||||
private final GuiOverlayIoConfig configOverlay;
|
||||
|
||||
protected ToggleButtonEIO configB;
|
||||
protected final GuiButtonIoConfig configB;
|
||||
|
||||
protected IconButtonEIO recipeButton;
|
||||
|
||||
protected List<GuiToolTip> progressTooltips;
|
||||
protected int lastProgressTooltipValue = -1;
|
||||
|
||||
protected GuiMachineBase(T machine, Container par1Container) {
|
||||
super(par1Container);
|
||||
tileEntity = machine;
|
||||
|
||||
|
||||
xSize = getXSize();
|
||||
ySize = getYSize();
|
||||
int x = getXSize() - 5 - BUTTON_SIZE;
|
||||
int y = 5;
|
||||
redstoneButton = new RedstoneModeButton(this, -1, x, y, tileEntity, new BlockCoord(tileEntity));
|
||||
|
||||
y += 19;
|
||||
configB = new ToggleButtonEIO(this, CONFIG_ID, x, y, IconEIO.IO_CONFIG_UP, IconEIO.IO_CONFIG_DOWN);
|
||||
configB.setToolTip(Lang.localize("gui.machine.ioMode.overlay.tooltip"));
|
||||
|
||||
configOverlay = new GuiOverlayIoConfig(machine) {
|
||||
|
||||
@Override
|
||||
public void setVisible(boolean visible) {
|
||||
super.setVisible(visible);
|
||||
configB.setSelected(visible);
|
||||
}
|
||||
|
||||
};
|
||||
configOverlay = new GuiOverlayIoConfig(machine);
|
||||
addOverlay(configOverlay);
|
||||
|
||||
|
||||
y += 19;
|
||||
configB = new GuiButtonIoConfig(this, CONFIG_ID, x, y, machine, configOverlay);
|
||||
|
||||
y += 19;
|
||||
|
||||
recipeButton = new IconButtonEIO(this, RECIPE_ID, x, y, IconEIO.RECIPE);
|
||||
recipeButton.visible = false;
|
||||
recipeButton.setIconMargin(3, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton b) {
|
||||
super.actionPerformed(b);
|
||||
if(b.id == CONFIG_ID) {
|
||||
boolean vis = !configOverlay.isVisible();
|
||||
configOverlay.setVisible(vis);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
@@ -151,4 +140,45 @@ public abstract class GuiMachineBase<T extends AbstractMachineEntity> extends Gu
|
||||
protected T getTileEntity() {
|
||||
return tileEntity;
|
||||
}
|
||||
|
||||
protected void addProgressTooltip(int x, int y, int w, int h) {
|
||||
if(progressTooltips == null) {
|
||||
progressTooltips = new ArrayList<GuiToolTip>();
|
||||
}
|
||||
|
||||
GuiToolTip tt = new GuiToolTip(new Rectangle(x, y, w, h), (String[])null);
|
||||
progressTooltips.add(tt);
|
||||
addToolTip(tt);
|
||||
}
|
||||
|
||||
private void updateProgressTooltips(int progress) {
|
||||
if(lastProgressTooltipValue == progress || progressTooltips == null) {
|
||||
return;
|
||||
}
|
||||
lastProgressTooltipValue = progress;
|
||||
|
||||
if(progress < 0) {
|
||||
for(GuiToolTip tt : progressTooltips) {
|
||||
tt.setVisible(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
String msg = MessageFormat.format(Lang.localize("gui.progress"), progress);
|
||||
for(GuiToolTip tt : progressTooltips) {
|
||||
tt.setToolTipText(msg);
|
||||
tt.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean shouldRenderProgress() {
|
||||
float progress = tileEntity.getProgress();
|
||||
if(progress > 0 && progress < 1) {
|
||||
updateProgressTooltips((int)(progress * 100));
|
||||
return true;
|
||||
} else {
|
||||
updateProgressTooltips(-1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.client.gui.ScaledResolution;
|
||||
import crazypants.enderio.gui.IGuiOverlay;
|
||||
import crazypants.enderio.gui.IoConfigRenderer;
|
||||
import crazypants.enderio.gui.IoConfigRenderer.SelectedFace;
|
||||
import crazypants.enderio.gui.ToggleButtonEIO;
|
||||
import crazypants.enderio.machine.IIoConfigurable;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
import crazypants.gui.IGuiScreen;
|
||||
@@ -21,6 +22,7 @@ import crazypants.util.BlockCoord;
|
||||
public class GuiOverlayIoConfig implements IGuiOverlay {
|
||||
|
||||
private boolean visible = false;
|
||||
private ToggleButtonEIO configB;
|
||||
|
||||
private IGuiScreen screen;
|
||||
|
||||
@@ -39,6 +41,10 @@ public class GuiOverlayIoConfig implements IGuiOverlay {
|
||||
coords.addAll(bc);
|
||||
}
|
||||
|
||||
public void setConfigB(ToggleButtonEIO configB) {
|
||||
this.configB = configB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(IGuiScreen screen) {
|
||||
this.screen = screen;
|
||||
@@ -98,7 +104,9 @@ public class GuiOverlayIoConfig implements IGuiOverlay {
|
||||
@Override
|
||||
public void setVisible(boolean visible) {
|
||||
this.visible = visible;
|
||||
|
||||
if(configB != null) {
|
||||
configB.setSelected(visible);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,6 +2,7 @@ package crazypants.enderio.machine.gui;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.List;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import net.minecraft.inventory.Container;
|
||||
|
||||
@@ -37,7 +38,7 @@ public abstract class GuiPoweredMachineBase<T extends AbstractPoweredMachineEnti
|
||||
}
|
||||
|
||||
protected String getPowerOutputLabel() {
|
||||
return "Max: ";
|
||||
return StatCollector.translateToLocal("enderio.gui.max");
|
||||
}
|
||||
|
||||
protected int getPowerOutputValue() {
|
||||
|
||||
@@ -255,25 +255,13 @@ public class BlockHyperCube extends BlockEio implements IGuiHandler, IResourceTo
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) {
|
||||
if(ToolUtil.breakBlockWithTool(this, world, x, y, z, entityPlayer)) {
|
||||
return true;
|
||||
}
|
||||
if(entityPlayer.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(!(te instanceof TileHyperCube)) {
|
||||
return false;
|
||||
}
|
||||
protected boolean openGui(World world, int x, int y, int z, EntityPlayer entityPlayer, int side) {
|
||||
if(!world.isRemote) {
|
||||
entityPlayer.openGui(EnderIO.instance, GuiHandler.GUI_ID_HYPER_CUBE, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerHyperCube();
|
||||
@@ -293,11 +281,4 @@ public class BlockHyperCube extends BlockEio implements IGuiHandler, IResourceTo
|
||||
public String getUnlocalizedNameForTooltip(ItemStack stack) {
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int p_149749_6_) {
|
||||
super.breakBlock(world, x, y, z, block, p_149749_6_);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -389,28 +389,28 @@ public class GuiHyperCube extends GuiContainerBase {
|
||||
|
||||
x = 163;
|
||||
if(itemMode.isRecieveEnabled()) {
|
||||
IconEIO.INPUT.renderIcon(guiLeft + x + 15, guiTop + 4 + 7, -15, -7, 0, true);
|
||||
IconEIO.INPUT_OLD.renderIcon(guiLeft + x + 15, guiTop + 4 + 7, -15, -7, 0, true);
|
||||
}
|
||||
x += 18;
|
||||
if(powerMode.isRecieveEnabled()) {
|
||||
IconEIO.INPUT.renderIcon(guiLeft + x + 15, guiTop + 4 + 7, -15, -7, 0, true);
|
||||
IconEIO.INPUT_OLD.renderIcon(guiLeft + x + 15, guiTop + 4 + 7, -15, -7, 0, true);
|
||||
}
|
||||
x += 18;
|
||||
if(fluidMode.isRecieveEnabled()) {
|
||||
IconEIO.INPUT.renderIcon(guiLeft + x + 15, guiTop + 4 + 7, -15, -7, 0, true);
|
||||
IconEIO.INPUT_OLD.renderIcon(guiLeft + x + 15, guiTop + 4 + 7, -15, -7, 0, true);
|
||||
}
|
||||
|
||||
x = 163;
|
||||
if(itemMode.isSendEnabled()) {
|
||||
IconEIO.OUTPUT.renderIcon(guiLeft + x, guiTop + 29, 15, 7, 0, true);
|
||||
IconEIO.OUTPUT_OLD.renderIcon(guiLeft + x, guiTop + 29, 15, 7, 0, true);
|
||||
}
|
||||
x += 18;
|
||||
if(powerMode.isSendEnabled()) {
|
||||
IconEIO.OUTPUT.renderIcon(guiLeft + x, guiTop + 29, 15, 7, 0, true);
|
||||
IconEIO.OUTPUT_OLD.renderIcon(guiLeft + x, guiTop + 29, 15, 7, 0, true);
|
||||
}
|
||||
x += 18;
|
||||
if(fluidMode.isSendEnabled()) {
|
||||
IconEIO.OUTPUT.renderIcon(guiLeft + x, guiTop + 29, 15, 7, 0, true);
|
||||
IconEIO.OUTPUT_OLD.renderIcon(guiLeft + x, guiTop + 29, 15, 7, 0, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loaded 100 of 682 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user