Remove deprecated CapacitorBank (#197)
No files matched your search
@@ -103,9 +103,6 @@ import crazypants.enderio.machine.painter.BlockPaintedFenceGateRenderer;
|
||||
import crazypants.enderio.machine.painter.BlockPaintedGlowstone;
|
||||
import crazypants.enderio.machine.painter.PaintedBlockRenderer;
|
||||
import crazypants.enderio.machine.painter.PaintedItemRenderer;
|
||||
import crazypants.enderio.machine.power.BlockCapacitorBank;
|
||||
import crazypants.enderio.machine.power.CapBankRenderer2;
|
||||
import crazypants.enderio.machine.power.CapacitorBankRenderer;
|
||||
import crazypants.enderio.machine.ranged.RangeEntity;
|
||||
import crazypants.enderio.machine.ranged.RangeRenderer;
|
||||
import crazypants.enderio.machine.reservoir.ReservoirRenderer;
|
||||
@@ -321,13 +318,6 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileCapBank.class, newCbr);
|
||||
}
|
||||
|
||||
CapacitorBankRenderer capr = new CapacitorBankRenderer();
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockCapacitorBank), capr);
|
||||
|
||||
BlockCapacitorBank.renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
CapBankRenderer2 cbr2 = new CapBankRenderer2();
|
||||
RenderingRegistry.registerBlockHandler(cbr2);
|
||||
|
||||
BlockVacuumChest.renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
VacuumChestRenderer vcr = new VacuumChestRenderer();
|
||||
RenderingRegistry.registerBlockHandler(vcr);
|
||||
|
||||
@@ -132,7 +132,6 @@ import crazypants.enderio.machine.painter.BlockPaintedStair;
|
||||
import crazypants.enderio.machine.painter.BlockPaintedWall;
|
||||
import crazypants.enderio.machine.painter.BlockPainter;
|
||||
import crazypants.enderio.machine.painter.PaintSourceValidator;
|
||||
import crazypants.enderio.machine.power.BlockCapacitorBank;
|
||||
import crazypants.enderio.machine.ranged.RangeEntity;
|
||||
import crazypants.enderio.machine.reservoir.BlockReservoir;
|
||||
import crazypants.enderio.machine.slicensplice.BlockSliceAndSplice;
|
||||
@@ -286,7 +285,6 @@ public class EnderIO {
|
||||
public static BlockSolarPanel blockSolarPanel;
|
||||
public static BlockReservoir blockReservoir;
|
||||
public static BlockAlloySmelter blockAlloySmelter;
|
||||
public static BlockCapacitorBank blockCapacitorBank;
|
||||
public static BlockCapBank blockCapBank;
|
||||
public static BlockWirelessCharger blockWirelessCharger;
|
||||
public static BlockCrusher blockCrusher;
|
||||
@@ -396,7 +394,6 @@ public class EnderIO {
|
||||
|
||||
blockCrusher = BlockCrusher.create();
|
||||
blockAlloySmelter = BlockAlloySmelter.create();
|
||||
blockCapacitorBank = BlockCapacitorBank.create();
|
||||
blockCapBank = BlockCapBank.create();
|
||||
|
||||
blockPainter = BlockPainter.create();
|
||||
|
||||
@@ -55,7 +55,6 @@ public enum ModObject {
|
||||
blockReservoir,
|
||||
blockAlloySmelter,
|
||||
blockSolarPanel,
|
||||
blockCapacitorBank,
|
||||
blockCapBank,
|
||||
blockSagMill,
|
||||
blockHyperCube,
|
||||
|
||||
@@ -12,8 +12,8 @@ import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.AbstractItemConduit;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.ItemConduitSubtype;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class ItemPowerConduit extends AbstractItemConduit {
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.ItemConduitSubtype;
|
||||
import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.power.ItemPowerConduit;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class ItemPowerConduitEndergy extends ItemPowerConduit {
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ public class GuiEnderface extends GuiScreen {
|
||||
|
||||
if (hit != null) {
|
||||
Block block = world.getBlock(hit.blockX, hit.blockY, hit.blockZ);
|
||||
if (block == EnderIO.blockHyperCube || block == EnderIO.blockCapacitorBank) {
|
||||
if (block == EnderIO.blockHyperCube) {
|
||||
block.onBlockActivated(world, hit.blockX, hit.blockY, hit.blockZ, player, 0, 0, 0, 0);
|
||||
} else {
|
||||
openInterface(hit.blockX, hit.blockY, hit.blockZ, hit.sideHit, hit.hitVec);
|
||||
|
||||
@@ -14,7 +14,7 @@ import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
import crazypants.enderio.machine.generator.stirling.StirlingGeneratorContainer;
|
||||
import crazypants.enderio.machine.generator.stirling.TileEntityStirlingGenerator;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class TooltipHandlerBurnTime implements ITooltipCallback {
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.fluid.FluidFuelRegister;
|
||||
import crazypants.enderio.fluid.IFluidCoolant;
|
||||
import crazypants.enderio.fluid.IFluidFuel;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class TooltipHandlerFluid implements ITooltipCallback {
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.util.BaublesUtil;
|
||||
|
||||
@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles|API")
|
||||
|
||||
@@ -24,10 +24,10 @@ import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.power.NetworkPowerManager;
|
||||
import crazypants.enderio.conduit.power.PowerConduitNetwork;
|
||||
import crazypants.enderio.conduit.power.PowerTracker;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.EnergyHandlerPI;
|
||||
import crazypants.enderio.power.IInternalPowerReceiver;
|
||||
import crazypants.enderio.power.IInternalPoweredTile;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketConduitProbe implements IMessage, IMessageHandler<PacketConduitProbe, IMessage> {
|
||||
|
||||
@@ -34,7 +34,7 @@ import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SpoonUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TravelUpgrade;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.teleport.TravelController;
|
||||
|
||||
public class ItemDarkSteelPickaxe extends ItemPickaxe
|
||||
|
||||
@@ -17,8 +17,8 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IEndSteelItem;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.material.Material;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class EnergyUpgrade extends AbstractUpgrade {
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ import crazypants.enderio.item.skull.BlockEndermanSkull;
|
||||
import crazypants.enderio.machine.buffer.BlockItemBuffer.Type;
|
||||
import crazypants.enderio.machine.capbank.BlockItemCapBank;
|
||||
import crazypants.enderio.machine.capbank.CapBankType;
|
||||
import crazypants.enderio.machine.capbank.ConvertOldRecipe;
|
||||
import crazypants.enderio.machine.light.BlockItemElectricLight;
|
||||
import crazypants.enderio.material.FrankenSkull;
|
||||
import crazypants.enderio.material.MachinePart;
|
||||
@@ -343,9 +342,6 @@ public class MachineRecipes {
|
||||
.createItemStackWithPower(CapBankType.getMetaFromType(CapBankType.VIBRANT), 0);
|
||||
RecipeUtil.addShaped(capBank3, "bcb", "cmc", "bcb", 'b', electricalSteel, 'c', capacitor3, 'm', vibCry);
|
||||
|
||||
ConvertOldRecipe convertRecipe = new ConvertOldRecipe();
|
||||
GameRegistry.addRecipe(convertRecipe);
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
new UpgradeCapBankRecipe(
|
||||
capBank2,
|
||||
|
||||
@@ -11,8 +11,8 @@ import com.enderio.core.client.render.RenderUtil;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiBuffer extends GuiPoweredMachineBase<TileBuffer> {
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@ import crazypants.enderio.machine.capbank.packet.PacketNetworkIdRequest;
|
||||
import crazypants.enderio.machine.capbank.packet.PacketNetworkIdResponse;
|
||||
import crazypants.enderio.machine.capbank.packet.PacketNetworkStateRequest;
|
||||
import crazypants.enderio.machine.capbank.packet.PacketNetworkStateResponse;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import crazypants.enderio.waila.IWailaInfoProvider;
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
package crazypants.enderio.machine.capbank;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.RecipeSorter.Category;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
|
||||
public class ConvertOldRecipe implements IRecipe {
|
||||
|
||||
static {
|
||||
RecipeSorter.register(
|
||||
"EnderIO:convertOldCapBankRecipe",
|
||||
ConvertOldRecipe.class,
|
||||
Category.SHAPELESS,
|
||||
"after:minecraft:shapeless");
|
||||
}
|
||||
|
||||
private ItemStack output;
|
||||
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inv, World world) {
|
||||
ItemStack input = null;
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack checkStack = inv.getStackInSlot(i);
|
||||
if (checkStack != null) {
|
||||
if (input != null) {
|
||||
return false;
|
||||
}
|
||||
if (Block.getBlockFromItem(checkStack.getItem()) == EnderIO.blockCapacitorBank) {
|
||||
input = checkStack;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (input == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
output = new ItemStack(EnderIO.blockCapBank, 1, CapBankType.getMetaFromType(CapBankType.ACTIVATED));
|
||||
PowerHandlerUtil.setStoredEnergyForItem(output, PowerHandlerUtil.getStoredEnergyForItem(input));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting inv) {
|
||||
return output.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return output;
|
||||
}
|
||||
}
|
||||
@@ -30,8 +30,8 @@ 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;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiCapBank extends GuiContainerBaseEIO {
|
||||
|
||||
|
||||
@@ -747,7 +747,7 @@ public class TileCapBank extends TileEntityEio
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return EnderIO.blockCapacitorBank.getUnlocalizedName() + ".name";
|
||||
return EnderIO.blockCapBank.getUnlocalizedName() + ".name";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.enderio.core.client.render.RenderUtil;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.machine.capbank.TileCapBank;
|
||||
import crazypants.enderio.machine.capbank.network.CapBankClientNetwork;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class IoDisplay implements IInfoRenderer {
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.PacketItemBuffer;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiCrafter extends GuiPoweredMachineBase<TileCrafter> {
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.fluid.Fluids;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiCombustionGenerator extends GuiPoweredMachineBase<TileCombustionGenerator> {
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiStirlingGenerator extends GuiPoweredMachineBase<TileEntityStirlingGenerator> {
|
||||
|
||||
@@ -17,7 +17,7 @@ import crazypants.enderio.fluid.Fluids;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
import crazypants.enderio.machine.generator.zombie.TileZombieGenerator.TileEnderGenerator;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiZombieGenerator extends GuiPoweredMachineBase<TileZombieGenerator> {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.enderio.core.client.gui.widget.GuiToolTip;
|
||||
|
||||
import crazypants.enderio.machine.AbstractPoweredMachineEntity;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public abstract class GuiPoweredMachineBase<T extends AbstractPoweredMachineEntity> extends GuiMachineBase<T> {
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.gui.RedstoneModeButton;
|
||||
import crazypants.enderio.machine.hypercube.TileHyperCube.IoMode;
|
||||
import crazypants.enderio.machine.hypercube.TileHyperCube.SubChannel;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiHyperCube extends GuiContainerBaseEIO {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package crazypants.enderio.machine.monitor;
|
||||
|
||||
import static crazypants.enderio.machine.power.PowerDisplayUtil.formatPower;
|
||||
import static crazypants.enderio.machine.power.PowerDisplayUtil.formatPowerFloat;
|
||||
import static crazypants.enderio.power.PowerDisplayUtil.formatPower;
|
||||
import static crazypants.enderio.power.PowerDisplayUtil.formatPowerFloat;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Rectangle;
|
||||
@@ -25,8 +25,8 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.ContainerNoInv;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiPowerMonitor extends GuiContainerBaseEIO {
|
||||
|
||||
|
||||
@@ -1,369 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
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.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.client.handlers.SpecialTooltipHandler;
|
||||
import com.enderio.core.common.TileEntityEnder;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.ChatUtil;
|
||||
import com.enderio.core.common.util.Util;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
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.EnderIO;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import crazypants.enderio.waila.IWailaInfoProvider;
|
||||
|
||||
public class BlockCapacitorBank extends BlockEio implements IGuiHandler, IAdvancedTooltipProvider, IWailaInfoProvider {
|
||||
|
||||
public static int renderId = -1;
|
||||
|
||||
public static BlockCapacitorBank create() {
|
||||
PacketHandler.INSTANCE
|
||||
.registerMessage(PacketClientState.class, PacketClientState.class, PacketHandler.nextID(), Side.SERVER);
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketPowerStorage.class,
|
||||
PacketPowerStorage.class,
|
||||
PacketHandler.nextID(),
|
||||
Side.CLIENT);
|
||||
|
||||
BlockCapacitorBank res = new BlockCapacitorBank();
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
IIcon overlayIcon;
|
||||
IIcon fillBarIcon;
|
||||
|
||||
private IIcon blockIconInput;
|
||||
private IIcon blockIconOutput;
|
||||
private IIcon blockIconLocked;
|
||||
|
||||
protected BlockCapacitorBank() {
|
||||
super(ModObject.blockCapacitorBank.unlocalisedName, TileCapacitorBank.class);
|
||||
setHardness(2.0F);
|
||||
setCreativeTab(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
|
||||
GameRegistry.registerBlock(this, BlockItemCapacitorBank.class, name);
|
||||
if (teClass != null) {
|
||||
GameRegistry.registerTileEntity(teClass, name + "TileEntity");
|
||||
}
|
||||
|
||||
EnderIO.guiHandler.registerGuiHandler(GuiHandler.GUI_ID_CAPACITOR_BANK, this);
|
||||
setLightOpacity(255);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List<ItemStack> list) {}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int par1) {
|
||||
return par1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
list.add(
|
||||
PowerDisplayUtil.formatStoredPower(
|
||||
PowerHandlerUtil.getStoredEnergyForItem(itemstack),
|
||||
TileCapacitorBank.BASE_CAP.getMaxEnergyStored()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
SpecialTooltipHandler.addDetailedTooltipFromResources(list, itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float par7,
|
||||
float par8, float par9) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (!(te instanceof TileCapacitorBank)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ToolUtil.isToolEquipped(entityPlayer)) {
|
||||
|
||||
ForgeDirection faceHit = ForgeDirection.getOrientation(side);
|
||||
TileCapacitorBank tcb = (TileCapacitorBank) te;
|
||||
tcb.toggleIoModeForFace(faceHit);
|
||||
if (world.isRemote) {
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
} else {
|
||||
world.notifyBlocksOfNeighborChange(x, y, z, EnderIO.blockCapacitorBank);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onBlockActivated(world, x, y, z, entityPlayer, side, par7, par8, par9);
|
||||
}
|
||||
|
||||
@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_CAPACITOR_BANK, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
return new ContainerCapacitorBank(player, player.inventory, ((TileCapacitorBank) te).getController());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
return new GuiCapacitorBank(player, player.inventory, ((TileCapacitorBank) te).getController());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister IIconRegister) {
|
||||
blockIcon = IIconRegister.registerIcon("enderio:capacitorBank");
|
||||
blockIconInput = IIconRegister.registerIcon("enderio:capacitorBankInput");
|
||||
blockIconOutput = IIconRegister.registerIcon("enderio:capacitorBankOutput");
|
||||
blockIconLocked = IIconRegister.registerIcon("enderio:capacitorBankLocked");
|
||||
overlayIcon = IIconRegister.registerIcon("enderio:capacitorBankOverlays");
|
||||
fillBarIcon = IIconRegister.registerIcon("enderio:capacitorBankFillBar");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
|
||||
Block i1 = par1IBlockAccess.getBlock(par2, par3, par4);
|
||||
return i1 == this ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess ba, int x, int y, int z, int side) {
|
||||
TileEntity te = ba.getTileEntity(x, y, z);
|
||||
if (!(te instanceof TileCapacitorBank)) {
|
||||
return blockIcon;
|
||||
}
|
||||
TileCapacitorBank cb = (TileCapacitorBank) te;
|
||||
IoMode mode = cb.getIoMode(ForgeDirection.values()[side]);
|
||||
if (mode == null || mode == IoMode.NONE) {
|
||||
return blockIcon;
|
||||
}
|
||||
if (mode == IoMode.PULL) {
|
||||
return blockIconInput;
|
||||
}
|
||||
if (mode == IoMode.PUSH) {
|
||||
return blockIconOutput;
|
||||
}
|
||||
return blockIconLocked;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
if (world.isRemote) {
|
||||
return;
|
||||
}
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
TileCapacitorBank tr = (TileCapacitorBank) te;
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta == 1) {
|
||||
tr.setCreativeMode();
|
||||
}
|
||||
tr.onBlockAdded();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block blockId) {
|
||||
if (world.isRemote) {
|
||||
return;
|
||||
}
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile instanceof TileCapacitorBank) {
|
||||
TileCapacitorBank te = (TileCapacitorBank) tile;
|
||||
te.onNeighborBlockChange(blockId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doNormalDrops(World world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processDrop(World world, int x, int y, int z, TileEntityEnder te, ItemStack drop) {
|
||||
PowerHandlerUtil.setStoredEnergyForItem(drop, ((TileCapacitorBank) te).doGetEnergyStored());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
|
||||
if (world.isRemote) {
|
||||
return;
|
||||
}
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
TileCapacitorBank cb = (TileCapacitorBank) te;
|
||||
cb.addEnergy(PowerHandlerUtil.getStoredEnergyForItem(stack));
|
||||
if (player instanceof EntityPlayerMP) {
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
BlockCoord bc = new BlockCoord(x, y, z);
|
||||
bc = bc.getLocation(dir);
|
||||
te = world.getTileEntity(bc.x, bc.y, bc.z);
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
if (((TileCapacitorBank) te).isMaxSize()) {
|
||||
ChatUtil.sendNoSpam((EntityPlayerMP) player, "Capacitor bank is at maximum size");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random r) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
|
||||
if (!world.isRemote && world.getGameRules().getGameRuleBooleanValue("doTileDrops")) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (!(te instanceof TileCapacitorBank)) {
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
return;
|
||||
}
|
||||
TileCapacitorBank cb = (TileCapacitorBank) te;
|
||||
Util.dropItems(world, cb, x, y, z, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (!(te instanceof TileCapacitorBank)) {
|
||||
return super.getSelectedBoundingBoxFromPool(world, x, y, z);
|
||||
}
|
||||
TileCapacitorBank tr = (TileCapacitorBank) te;
|
||||
if (!tr.isMultiblock()) {
|
||||
return super.getSelectedBoundingBoxFromPool(world, x, y, z);
|
||||
}
|
||||
|
||||
Vector3d min = new Vector3d(Double.MAX_VALUE, Double.MAX_VALUE, Double.MAX_VALUE);
|
||||
Vector3d max = new Vector3d(-Double.MAX_VALUE, -Double.MAX_VALUE, -Double.MAX_VALUE);
|
||||
for (BlockCoord bc : tr.multiblock) {
|
||||
min.x = Math.min(min.x, bc.x);
|
||||
max.x = Math.max(max.x, bc.x + 1);
|
||||
min.y = Math.min(min.y, bc.y);
|
||||
max.y = Math.max(max.y, bc.y + 1);
|
||||
min.z = Math.min(min.z, bc.z);
|
||||
max.z = Math.max(max.z, bc.z + 1);
|
||||
}
|
||||
return AxisAlignedBB.getBoundingBox(min.x, min.y, min.z, max.x, max.y, max.z);
|
||||
}
|
||||
|
||||
@Override
|
||||
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 instanceof TileCapacitorBank) {
|
||||
TileCapacitorBank cap = (TileCapacitorBank) te;
|
||||
String format = Util.TAB + Util.ALIGNRIGHT + EnumChatFormatting.WHITE;
|
||||
|
||||
tooltip.add(
|
||||
String.format(
|
||||
"%s : %s%s%sRF/t ",
|
||||
EnderIO.lang.localize("capbank.maxIO"),
|
||||
format,
|
||||
PowerDisplayUtil.formatPower(cap.getMaxIO()),
|
||||
Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip.add(
|
||||
String.format(
|
||||
"%s : %s%s%sRF/t ",
|
||||
EnderIO.lang.localize("capbank.maxIn"),
|
||||
format,
|
||||
PowerDisplayUtil.formatPower(cap.getMaxInput()),
|
||||
Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip.add(
|
||||
String.format(
|
||||
"%s : %s%s%sRF/t ",
|
||||
EnderIO.lang.localize("capbank.maxOut"),
|
||||
format,
|
||||
PowerDisplayUtil.formatPower(cap.getMaxOutput()),
|
||||
Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip.add("Deprecated. Convert by placing in crafting grid");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultDisplayMask(World world, int x, int y, int z) {
|
||||
return IWailaInfoProvider.BIT_DETAILED;
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
|
||||
public class BlockItemCapacitorBank extends ItemBlock implements IEnergyContainerItem {
|
||||
|
||||
public static ItemStack createItemStackWithPower(int storedEnergy) {
|
||||
ItemStack res = new ItemStack(EnderIO.blockCapacitorBank);
|
||||
PowerHandlerUtil.setStoredEnergyForItem(res, storedEnergy);
|
||||
return res;
|
||||
}
|
||||
|
||||
public BlockItemCapacitorBank() {
|
||||
super(EnderIO.blockCapacitorBank);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
public BlockItemCapacitorBank(Block block) {
|
||||
super(block);
|
||||
setHasSubtypes(true);
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
int meta = par1ItemStack.getItemDamage();
|
||||
String result = super.getUnlocalizedName(par1ItemStack);
|
||||
if (meta == 1) {
|
||||
result += ".creative";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {}
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack itemStack) {
|
||||
return itemStack.getItemDamage() != 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack itemStack) {
|
||||
double stored = getMaxEnergyStored(itemStack) - getEnergyStored(itemStack) + 1;
|
||||
double max = getMaxEnergyStored(itemStack) + 1;
|
||||
return stored / max;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
||||
if (container.stackSize > 1) {
|
||||
return 0;
|
||||
}
|
||||
int energy = getEnergyStored(container);
|
||||
int maxInput = TileCapacitorBank.BASE_CAP.getMaxEnergyReceived();
|
||||
int energyReceived = Math.min(getMaxEnergyStored(container) - energy, Math.min(maxReceive, maxInput));
|
||||
|
||||
if (!simulate && container.getItemDamage() != 1) {
|
||||
energy += energyReceived;
|
||||
PowerHandlerUtil.setStoredEnergyForItem(container, energy);
|
||||
}
|
||||
return energyReceived;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) {
|
||||
if (container.stackSize > 1) {
|
||||
return 0;
|
||||
}
|
||||
int energy = getEnergyStored(container);
|
||||
int maxOutput = TileCapacitorBank.BASE_CAP.getMaxEnergyExtracted();
|
||||
int energyExtracted = Math.min(energy, Math.min(maxExtract, maxOutput));
|
||||
|
||||
if (!simulate && container.getItemDamage() != 1) {
|
||||
energy -= energyExtracted;
|
||||
PowerHandlerUtil.setStoredEnergyForItem(container, energy);
|
||||
}
|
||||
return energyExtracted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ItemStack container) {
|
||||
return PowerHandlerUtil.getStoredEnergyForItem(container);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ItemStack container) {
|
||||
return TileCapacitorBank.BASE_CAP.getMaxEnergyStored();
|
||||
}
|
||||
}
|
||||
@@ -1,280 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.api.client.render.IRenderFace;
|
||||
import com.enderio.core.client.render.ConnectedTextureRenderer;
|
||||
import com.enderio.core.client.render.CustomCubeRenderer;
|
||||
import com.enderio.core.client.render.CustomRenderBlocks;
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.ForgeDirectionOffsets;
|
||||
import com.enderio.core.common.vecmath.Vector2f;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
import com.enderio.core.common.vecmath.Vector4d;
|
||||
import com.enderio.core.common.vecmath.Vector4f;
|
||||
import com.enderio.core.common.vecmath.Vertex;
|
||||
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.machine.power.GaugeBounds.VPos;
|
||||
|
||||
@ThreadSafeISBRH(perThread = true)
|
||||
public class CapBankRenderer2 implements ISimpleBlockRenderingHandler {
|
||||
|
||||
private static final BlockCoord DEFAULT_BC = new BlockCoord(0, 0, 0);
|
||||
private static final BlockCoord[] DEFAULT_MB = new BlockCoord[] { DEFAULT_BC };
|
||||
private static final double PIXEL_SIZE = 1 / 16d;
|
||||
|
||||
private final List<IRenderFace> renderers = new ArrayList<>(2);
|
||||
|
||||
private ConnectedTextureRenderer connectedTexRenderer;
|
||||
|
||||
public CapBankRenderer2() {
|
||||
connectedTexRenderer = new ConnectedTextureRenderer();
|
||||
connectedTexRenderer.setMatchMeta(true);
|
||||
|
||||
GaugueRenderer gaugeRenderer = new GaugueRenderer();
|
||||
renderers.add(connectedTexRenderer);
|
||||
renderers.add(gaugeRenderer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
TileCapacitorBank cb = ((TileCapacitorBank) te);
|
||||
cb.energyAtLastRender = cb.getEnergyStored();
|
||||
}
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta == 1) {
|
||||
connectedTexRenderer.setEdgeTexture(IconUtil.whiteTexture);
|
||||
connectedTexRenderer.setForceAllEdges(true);
|
||||
} else {
|
||||
connectedTexRenderer.setEdgeTexture(EnderIO.blockAlloySmelter.getBlockTextureFromSide(3));
|
||||
connectedTexRenderer.setForceAllEdges(false);
|
||||
}
|
||||
CustomCubeRenderer.get().renderBlock(world, block, x, y, z, renderers);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return BlockCapacitorBank.renderId;
|
||||
}
|
||||
|
||||
private class GaugueRenderer implements IRenderFace {
|
||||
|
||||
@Override
|
||||
public void renderFace(CustomRenderBlocks rb, ForgeDirection face, Block par1Block, double x, double y,
|
||||
double z, IIcon texture, List<Vertex> refVertices, boolean translateToXyz) {
|
||||
// Gauge
|
||||
TileEntity te = rb.blockAccess.getTileEntity((int) x, (int) y, (int) z);
|
||||
if (!(te instanceof TileCapacitorBank)) {
|
||||
return;
|
||||
}
|
||||
TileCapacitorBank capBank = ((TileCapacitorBank) te);
|
||||
List<GaugeBounds> gaugeBounds = null;
|
||||
gaugeBounds = capBank.getGaugeBounds();
|
||||
|
||||
if (gaugeBounds == null || gaugeBounds.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (GaugeBounds gb : gaugeBounds) {
|
||||
if (gb.face == face) {
|
||||
Tessellator tes = Tessellator.instance;
|
||||
tes.addTranslation((float) x, (float) y, (float) z);
|
||||
int b = 0;
|
||||
Vector4f col = new Vector4f();
|
||||
int colCount = 0;
|
||||
for (Vertex v : refVertices) {
|
||||
b += v.brightness;
|
||||
if (v.color != null) {
|
||||
colCount++;
|
||||
col.add(v.color);
|
||||
}
|
||||
}
|
||||
if (b > 0) {
|
||||
b /= 4;
|
||||
tes.setBrightness(b);
|
||||
} else {
|
||||
tes.setBrightness(15 << 20 | 0 << 4);
|
||||
}
|
||||
if (colCount > 0) {
|
||||
col.scale(0.25);
|
||||
tes.setColorRGBA_F(col.x, col.y, col.z, col.w);
|
||||
}
|
||||
renderGaugeOnFace(gb, EnderIO.blockCapacitorBank.overlayIcon, refVertices, x, y, z);
|
||||
renderFillBarOnFace(
|
||||
gb,
|
||||
EnderIO.blockCapacitorBank.fillBarIcon,
|
||||
capBank.getEnergyStoredRatio(),
|
||||
refVertices,
|
||||
x,
|
||||
y,
|
||||
z);
|
||||
capBank.lastRenderStoredRatio = capBank.getEnergyStoredRatio();
|
||||
tes.addTranslation((float) -x, (float) -y, (float) -z);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<GaugeBounds> calculateGaugeBounds(BlockCoord me, BlockCoord[] mb) {
|
||||
List<GaugeBounds> res = new ArrayList<GaugeBounds>();
|
||||
for (ForgeDirection face : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (face != ForgeDirection.UP && face != ForgeDirection.DOWN) {
|
||||
boolean isRight = isRightFace(me, mb, face);
|
||||
if (isRight) {
|
||||
res.add(new GaugeBounds(me, mb, face));
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private void renderGaugeOnFace(GaugeBounds gb, IIcon icon, List<Vertex> vertices, double x, double y,
|
||||
double z) {
|
||||
Tessellator tes = Tessellator.instance;
|
||||
Vector2f u = gb.getMinMaxU(icon);
|
||||
List<Vertex> corners = gb.bb.getCornersWithUvForFace(gb.face, u.x, u.y, icon.getMinV(), icon.getMaxV());
|
||||
for (Vertex coord : corners) {
|
||||
coord.xyz.add(ForgeDirectionOffsets.offsetScaled(gb.face, 0.001f));
|
||||
Vector3d xyz = new Vector3d(coord.xyz);
|
||||
xyz.x += x;
|
||||
xyz.y += y;
|
||||
xyz.z += z;
|
||||
Vertex v = getClosestVertex(vertices, xyz);
|
||||
if (v != null) {
|
||||
if (v.color != null) {
|
||||
tes.setColorRGBA_F(v.color.x, v.color.y, v.color.z, v.color.w);
|
||||
} else {
|
||||
tes.setColorOpaque_F(0.7f, 0.7f, 0.7f);
|
||||
}
|
||||
if (v.brightness > 0) {
|
||||
tes.setBrightness(v.brightness);
|
||||
}
|
||||
}
|
||||
if (coord.uv != null) {
|
||||
tes.addVertexWithUV(coord.x(), coord.y(), coord.z(), coord.u(), coord.v());
|
||||
} else {
|
||||
tes.addVertexWithUV(coord.x(), coord.y(), coord.z(), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void renderFillBarOnFace(GaugeBounds gb, IIcon icon, double filledRatio, List<Vertex> vertices,
|
||||
double x, double y, double z) {
|
||||
|
||||
int totalPixels;
|
||||
if (gb.vInfo.verticalHeight == 1) {
|
||||
totalPixels = VPos.SINGLE_BLOCK.numFillPixels;
|
||||
} else {
|
||||
totalPixels = VPos.BOTTOM.numFillPixels + VPos.TOP.numFillPixels
|
||||
+ (VPos.MIDDLE.numFillPixels * (gb.vInfo.verticalHeight - 2));
|
||||
}
|
||||
|
||||
int targetPixelCount = (int) Math.max(0, Math.round(totalPixels * filledRatio));
|
||||
int pixelsBellowFace;
|
||||
if (gb.vInfo.index < 2) {
|
||||
// either none or a bottom section
|
||||
pixelsBellowFace = gb.vInfo.index * VPos.BOTTOM.numFillPixels;
|
||||
} else { // has middle section
|
||||
pixelsBellowFace = VPos.BOTTOM.numFillPixels + (VPos.MIDDLE.numFillPixels * (gb.vInfo.index - 1));
|
||||
}
|
||||
|
||||
if (pixelsBellowFace >= targetPixelCount) {
|
||||
return;
|
||||
}
|
||||
|
||||
VPos yPos = gb.vInfo.pos;
|
||||
int numPixelsLeft = targetPixelCount - pixelsBellowFace;
|
||||
int fillPixels = Math.min(numPixelsLeft, yPos.numFillPixels);
|
||||
|
||||
double maxY = (yPos.fillOffset * PIXEL_SIZE) + (fillPixels * PIXEL_SIZE);
|
||||
float vWidth = icon.getMaxV() - icon.getMinV();
|
||||
float maxV = icon.getMinV() + ((float) maxY * vWidth);
|
||||
|
||||
Tessellator tes = Tessellator.instance;
|
||||
Vector2f u = gb.getMinMaxU(icon);
|
||||
List<com.enderio.core.common.vecmath.Vertex> corners = gb.bb
|
||||
.getCornersWithUvForFace(gb.face, u.x, u.y, icon.getMinV(), maxV);
|
||||
for (Vertex coord : corners) {
|
||||
coord.xyz.add(ForgeDirectionOffsets.offsetScaled(gb.face, 0.002f));
|
||||
|
||||
Vector3d xyz = new Vector3d(coord.xyz);
|
||||
xyz.x += x;
|
||||
xyz.y += y;
|
||||
xyz.z += z;
|
||||
Vertex v = getClosestVertex(vertices, xyz);
|
||||
if (v != null) {
|
||||
if (v.color != null) {
|
||||
tes.setColorRGBA_F(v.color.x, v.color.y, v.color.z, v.color.w);
|
||||
} else {
|
||||
tes.setColorOpaque_F(0.7f, 0.7f, 0.7f);
|
||||
}
|
||||
if (v.brightness > 0) {
|
||||
tes.setBrightness(v.brightness);
|
||||
}
|
||||
}
|
||||
|
||||
if (coord.uv != null) {
|
||||
tes.addVertexWithUV(coord.x(), Math.min(coord.y(), maxY), coord.z(), coord.u(), coord.v());
|
||||
} else {
|
||||
tes.addVertexWithUV(coord.x(), Math.min(coord.y(), maxY), coord.z(), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isRightFace(BlockCoord me, BlockCoord[] mb, ForgeDirection dir) {
|
||||
Vector4d uPlane = RenderUtil.getUPlaneForFace(dir);
|
||||
|
||||
int myRightVal = (int) uPlane.x * me.x + (int) uPlane.y * me.y + (int) uPlane.z * me.z;
|
||||
int max = myRightVal;
|
||||
for (BlockCoord bc : mb) {
|
||||
int val = (int) uPlane.x * bc.x + (int) uPlane.y * bc.y + (int) uPlane.z * bc.z;
|
||||
if (val > max) {
|
||||
max = val;
|
||||
}
|
||||
}
|
||||
return myRightVal == max;
|
||||
}
|
||||
|
||||
private Vertex getClosestVertex(List<Vertex> vertices, Vector3d corner) {
|
||||
Vertex result = null;
|
||||
double d2 = Double.MAX_VALUE;
|
||||
for (Vertex v : vertices) {
|
||||
double tmp = corner.distanceSquared(v.xyz);
|
||||
if (tmp <= d2) {
|
||||
result = v;
|
||||
d2 = tmp;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------ Inner Classes
|
||||
|
||||
}
|
||||
@@ -1,339 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.CubeRenderer;
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.vecmath.Vector2f;
|
||||
import com.enderio.core.common.vecmath.Vector4d;
|
||||
import com.enderio.core.common.vecmath.Vertex;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class CapacitorBankRenderer extends TileEntitySpecialRenderer implements IItemRenderer {
|
||||
|
||||
private static final BlockCoord DEFAULT_BC = new BlockCoord(0, 0, 0);
|
||||
private static final BlockCoord[] DEFAULT_MB = new BlockCoord[] { DEFAULT_BC };
|
||||
private static final double PIXEL_SIZE = 1 / 16d;
|
||||
|
||||
// ------------------------- Item renderer
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
renderBlock(
|
||||
null,
|
||||
PowerHandlerUtil.getStoredEnergyForItem(item) / TileCapacitorBank.BASE_CAP.getMaxEnergyStored(),
|
||||
item.getItemDamage());
|
||||
}
|
||||
|
||||
// ------------------------- Entity renderer
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
|
||||
if (!(te instanceof TileCapacitorBank)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Minecraft.getMinecraft().entityRenderer.disableLightmap(0);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x, y, z);
|
||||
|
||||
TileCapacitorBank cb = (TileCapacitorBank) te;
|
||||
renderBlock(cb, cb.getEnergyStoredRatio(), 0);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().entityRenderer.enableLightmap(0);
|
||||
}
|
||||
|
||||
private void renderBlock(TileCapacitorBank te, double filledRatio, int meta) {
|
||||
RenderUtil.bindBlockTexture();
|
||||
Tessellator tes = Tessellator.instance;
|
||||
|
||||
BlockCoord myBC;
|
||||
BlockCoord[] mb;
|
||||
if (te != null && te.isMultiblock()) {
|
||||
myBC = new BlockCoord(te);
|
||||
mb = te.multiblock;
|
||||
} else {
|
||||
myBC = DEFAULT_BC;
|
||||
mb = DEFAULT_MB;
|
||||
}
|
||||
|
||||
List<GaugeBounds> gaugeBounds = calculateGaugeBounds(myBC, mb);
|
||||
|
||||
float[] brightness;
|
||||
float maxBrightness = 0;
|
||||
if (te != null) {
|
||||
brightness = new float[6];
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
brightness[dir.ordinal()] = RenderUtil.claculateTotalBrightnessForLocation(
|
||||
te.getWorldObj(),
|
||||
te.xCoord + dir.offsetX,
|
||||
te.yCoord + dir.offsetY,
|
||||
te.zCoord + dir.offsetZ);
|
||||
maxBrightness = Math.max(brightness[dir.ordinal()], maxBrightness);
|
||||
}
|
||||
} else {
|
||||
brightness = new float[] { 1, 1, 1, 1, 1, 1 };
|
||||
maxBrightness = 1;
|
||||
}
|
||||
|
||||
tes.startDrawingQuads();
|
||||
CubeRenderer.get()
|
||||
.render(BoundingBox.UNIT_CUBE, EnderIO.blockCapacitorBank.getIcon(0, 0), null, brightness, true);
|
||||
tes.draw();
|
||||
|
||||
GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
|
||||
GL11.glPolygonOffset(-1.0f, -1.0f);
|
||||
|
||||
tes.startDrawingQuads();
|
||||
tes.setColorRGBA_F(maxBrightness, maxBrightness, maxBrightness, 1);
|
||||
if (te != null) {
|
||||
renderBorder(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, meta);
|
||||
} else {
|
||||
renderBorder(null, 0, 0, 0, meta);
|
||||
}
|
||||
for (GaugeBounds gb : gaugeBounds) {
|
||||
renderGaugeOnFace(gb, EnderIO.blockCapacitorBank.overlayIcon);
|
||||
}
|
||||
tes.draw();
|
||||
|
||||
GL11.glPolygonOffset(-3.0F, -3.0F);
|
||||
tes.startDrawingQuads();
|
||||
tes.setColorRGBA_F(maxBrightness, maxBrightness, maxBrightness, 1);
|
||||
|
||||
for (GaugeBounds gb : gaugeBounds) {
|
||||
renderFillBarOnFace(gb, EnderIO.blockCapacitorBank.fillBarIcon, filledRatio);
|
||||
}
|
||||
tes.draw();
|
||||
|
||||
GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL);
|
||||
}
|
||||
|
||||
private void renderBorder(IBlockAccess blockAccess, int x, int y, int z, int meta) {
|
||||
IIcon texture;
|
||||
if (meta == 0) {
|
||||
texture = EnderIO.blockAlloySmelter.getBlockTextureFromSide(3);
|
||||
} else {
|
||||
texture = IconUtil.whiteTexture;
|
||||
}
|
||||
for (ForgeDirection face : ForgeDirection.VALID_DIRECTIONS) {
|
||||
RenderUtil.renderConnectedTextureFace(
|
||||
blockAccess,
|
||||
EnderIO.blockCapacitorBank,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
face,
|
||||
texture,
|
||||
blockAccess == null,
|
||||
false,
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
||||
private List<GaugeBounds> calculateGaugeBounds(BlockCoord me, BlockCoord[] mb) {
|
||||
List<GaugeBounds> res = new ArrayList<GaugeBounds>();
|
||||
for (ForgeDirection face : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (face != ForgeDirection.UP && face != ForgeDirection.DOWN) {
|
||||
boolean isRight = isRightFace(me, mb, face);
|
||||
if (isRight) {
|
||||
res.add(new GaugeBounds(me, mb, face));
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private void renderGaugeOnFace(GaugeBounds gb, IIcon icon) {
|
||||
Tessellator tes = Tessellator.instance;
|
||||
tes.setNormal(gb.face.offsetX, gb.face.offsetY, gb.face.offsetZ);
|
||||
Vector2f u = gb.getMinMaxU(icon);
|
||||
List<Vertex> corners = gb.bb.getCornersWithUvForFace(gb.face, u.x, u.y, icon.getMinV(), icon.getMaxV());
|
||||
for (Vertex coord : corners) {
|
||||
tes.setNormal(coord.nx(), coord.ny(), coord.nz());
|
||||
if (coord.uv != null) {
|
||||
tes.addVertexWithUV(coord.x(), coord.y(), coord.z(), coord.u(), coord.v());
|
||||
} else {
|
||||
tes.addVertexWithUV(coord.x(), coord.y(), coord.z(), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void renderFillBarOnFace(GaugeBounds gb, IIcon icon, double filledRatio) {
|
||||
|
||||
int totalPixels;
|
||||
if (gb.vInfo.verticalHeight == 1) {
|
||||
totalPixels = VPos.SINGLE_BLOCK.numFillPixels;
|
||||
} else {
|
||||
totalPixels = VPos.BOTTOM.numFillPixels + VPos.TOP.numFillPixels
|
||||
+ (VPos.MIDDLE.numFillPixels * (gb.vInfo.verticalHeight - 2));
|
||||
}
|
||||
|
||||
int targetPixelCount = (int) Math.max(0, Math.round(totalPixels * filledRatio));
|
||||
int pixelsBellowFace;
|
||||
if (gb.vInfo.index < 2) {
|
||||
// either none or a bottom section
|
||||
pixelsBellowFace = gb.vInfo.index * VPos.BOTTOM.numFillPixels;
|
||||
} else { // has middle section
|
||||
pixelsBellowFace = VPos.BOTTOM.numFillPixels + (VPos.MIDDLE.numFillPixels * (gb.vInfo.index - 1));
|
||||
}
|
||||
|
||||
if (pixelsBellowFace >= targetPixelCount) {
|
||||
return;
|
||||
}
|
||||
|
||||
VPos yPos = gb.vInfo.pos;
|
||||
int numPixelsLeft = targetPixelCount - pixelsBellowFace;
|
||||
int fillPixels = Math.min(numPixelsLeft, yPos.numFillPixels);
|
||||
|
||||
double maxY = (yPos.fillOffset * PIXEL_SIZE) + (fillPixels * PIXEL_SIZE);
|
||||
float vWidth = icon.getMaxV() - icon.getMinV();
|
||||
float maxV = icon.getMinV() + ((float) maxY * vWidth);
|
||||
|
||||
Tessellator tes = Tessellator.instance;
|
||||
tes.setNormal(gb.face.offsetX, gb.face.offsetY, gb.face.offsetZ);
|
||||
Vector2f u = gb.getMinMaxU(icon);
|
||||
List<com.enderio.core.common.vecmath.Vertex> corners = gb.bb
|
||||
.getCornersWithUvForFace(gb.face, u.x, u.y, icon.getMinV(), maxV);
|
||||
for (Vertex coord : corners) {
|
||||
if (coord.uv != null) {
|
||||
tes.addVertexWithUV(coord.x(), Math.min(coord.y(), maxY), coord.z(), coord.u(), coord.v());
|
||||
} else {
|
||||
tes.addVertexWithUV(coord.x(), Math.min(coord.y(), maxY), coord.z(), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isRightFace(BlockCoord me, BlockCoord[] mb, ForgeDirection dir) {
|
||||
Vector4d uPlane = RenderUtil.getUPlaneForFace(dir);
|
||||
|
||||
int myRightVal = (int) uPlane.x * me.x + (int) uPlane.y * me.y + (int) uPlane.z * me.z;
|
||||
int max = myRightVal;
|
||||
for (BlockCoord bc : mb) {
|
||||
int val = (int) uPlane.x * bc.x + (int) uPlane.y * bc.y + (int) uPlane.z * bc.z;
|
||||
if (val > max) {
|
||||
max = val;
|
||||
}
|
||||
}
|
||||
return myRightVal == max;
|
||||
}
|
||||
|
||||
// ------------ Inner Classes
|
||||
|
||||
enum VPos {
|
||||
|
||||
SINGLE_BLOCK(0, 10, 3),
|
||||
BOTTOM(0.5f, 13, 3),
|
||||
MIDDLE(0.75f, 16, 0),
|
||||
TOP(0.25f, 13, 0);
|
||||
|
||||
final float uOffset;
|
||||
final int numFillPixels;
|
||||
final int fillOffset;
|
||||
|
||||
private VPos(float uOffset, int numFillPixels, int fillOffset) {
|
||||
this.uOffset = uOffset;
|
||||
this.numFillPixels = numFillPixels;
|
||||
this.fillOffset = fillOffset;
|
||||
}
|
||||
}
|
||||
|
||||
static class VInfo {
|
||||
|
||||
VPos pos;
|
||||
int verticalHeight;
|
||||
int index;
|
||||
|
||||
VInfo(VPos pos, int verticalHeight, int index) {
|
||||
this.pos = pos;
|
||||
this.verticalHeight = verticalHeight;
|
||||
this.index = index;
|
||||
}
|
||||
}
|
||||
|
||||
static class GaugeBounds {
|
||||
|
||||
final BoundingBox bb;
|
||||
final VInfo vInfo;
|
||||
final ForgeDirection face;
|
||||
|
||||
GaugeBounds(BlockCoord me, BlockCoord[] mb, ForgeDirection face) {
|
||||
this.face = face;
|
||||
vInfo = getVPosForFace(me, mb, face);
|
||||
|
||||
Vector4d uPlane = RenderUtil.getUPlaneForFace(face);
|
||||
float scaleX = uPlane.x != 0 ? 0.25f : 1;
|
||||
float scaleY = uPlane.y != 0 ? 0.25f : 1;
|
||||
float scaleZ = uPlane.z != 0 ? 0.25f : 1;
|
||||
bb = BoundingBox.UNIT_CUBE.scale(scaleX, scaleY, scaleZ);
|
||||
}
|
||||
|
||||
Vector2f getMinMaxU(IIcon icon) {
|
||||
VPos yPos = vInfo.pos;
|
||||
float uWidth = icon.getMaxU() - icon.getMinU();
|
||||
float uOffset = yPos.uOffset * uWidth;
|
||||
float minU = icon.getMinU() + uOffset;
|
||||
float maxU = minU + (uWidth * 0.25f);
|
||||
return new Vector2f(minU, maxU);
|
||||
}
|
||||
|
||||
private VInfo getVPosForFace(BlockCoord me, BlockCoord[] mb, ForgeDirection face) {
|
||||
int maxY = me.y;
|
||||
int minY = me.y;
|
||||
for (BlockCoord bc : mb) {
|
||||
if (bc.x == me.x && bc.z == me.z && !containsLocaction(mb, bc.getLocation(face))) {
|
||||
maxY = Math.max(maxY, bc.y);
|
||||
minY = Math.min(minY, bc.y);
|
||||
}
|
||||
}
|
||||
if (maxY == me.y && minY == me.y) {
|
||||
return new VInfo(VPos.SINGLE_BLOCK, 1, 0);
|
||||
}
|
||||
int height = maxY - minY + 1;
|
||||
if (maxY > me.y) {
|
||||
return me.y > minY ? new VInfo(VPos.MIDDLE, height, me.y - minY) : new VInfo(VPos.BOTTOM, height, 0);
|
||||
}
|
||||
return new VInfo(VPos.TOP, height, height - 1);
|
||||
}
|
||||
|
||||
private boolean containsLocaction(BlockCoord[] mb, BlockCoord location) {
|
||||
for (BlockCoord bc : mb) {
|
||||
if (location.equals(bc)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,172 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ContainerCapacitorBank extends Container {
|
||||
|
||||
private final TileCapacitorBank tileEntity;
|
||||
|
||||
public ContainerCapacitorBank(final Entity player, InventoryPlayer playerInv, TileCapacitorBank te) {
|
||||
|
||||
tileEntity = te;
|
||||
int armorOffset = 21;
|
||||
addSlotToContainer(new Slot(tileEntity, 0, 59 + armorOffset, 59) {
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemStack) {
|
||||
return tileEntity.isItemValidForSlot(0, itemStack);
|
||||
}
|
||||
});
|
||||
|
||||
addSlotToContainer(new Slot(tileEntity, 1, 79 + armorOffset, 59) {
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemStack) {
|
||||
return tileEntity.isItemValidForSlot(1, itemStack);
|
||||
}
|
||||
});
|
||||
|
||||
addSlotToContainer(new Slot(tileEntity, 2, 99 + armorOffset, 59) {
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemStack) {
|
||||
return tileEntity.isItemValidForSlot(2, itemStack);
|
||||
}
|
||||
});
|
||||
|
||||
addSlotToContainer(new Slot(tileEntity, 3, 119 + armorOffset, 59) {
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemStack) {
|
||||
return tileEntity.isItemValidForSlot(3, itemStack);
|
||||
}
|
||||
});
|
||||
|
||||
// add players inventory
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, +armorOffset + 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
addSlotToContainer(new Slot(playerInv, i, +armorOffset + 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
// armor slots
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
final int k = i;
|
||||
addSlotToContainer(
|
||||
new Slot(playerInv, playerInv.getSizeInventory() - 1 - i, -15 + armorOffset, 30 + i * 18) {
|
||||
|
||||
@Override
|
||||
public int getSlotStackLimit() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack par1ItemStack) {
|
||||
if (par1ItemStack == null) {
|
||||
return false;
|
||||
}
|
||||
return par1ItemStack.getItem().isValidArmor(par1ItemStack, k, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getBackgroundIconIndex() {
|
||||
return ItemArmor.func_94602_b(k);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer entityPlayer, int slotIndex) {
|
||||
|
||||
int startPlayerSlot = 4;
|
||||
int endPlayerSlot = startPlayerSlot + 26;
|
||||
int startHotBarSlot = endPlayerSlot + 1;
|
||||
int endHotBarSlot = startHotBarSlot + 9;
|
||||
|
||||
ItemStack copystack = null;
|
||||
Slot slot = (Slot) inventorySlots.get(slotIndex);
|
||||
if (slot != null && slot.getHasStack()) {
|
||||
|
||||
ItemStack origStack = slot.getStack();
|
||||
copystack = origStack.copy();
|
||||
|
||||
if (slotIndex < 4) {
|
||||
// merge from machine input slots to inventory
|
||||
if (!mergeItemStackIntoArmor(entityPlayer, origStack, slotIndex)) {
|
||||
if (!mergeItemStack(origStack, startPlayerSlot, endHotBarSlot, false)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
// Check from inv-> charge then inv->hotbar or hotbar->inv
|
||||
if (slotIndex >= startPlayerSlot) {
|
||||
if (!tileEntity.isItemValidForSlot(0, origStack) || !mergeItemStack(origStack, 0, 4, false)) {
|
||||
|
||||
if (slotIndex <= endPlayerSlot) {
|
||||
if (!mergeItemStack(origStack, startHotBarSlot, endHotBarSlot, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (slotIndex >= startHotBarSlot && slotIndex <= endHotBarSlot) {
|
||||
if (!mergeItemStack(origStack, startPlayerSlot, endPlayerSlot, false)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (origStack.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
|
||||
slot.onSlotChanged();
|
||||
|
||||
if (origStack.stackSize == copystack.stackSize) {
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onPickupFromSlot(entityPlayer, origStack);
|
||||
}
|
||||
|
||||
return copystack;
|
||||
}
|
||||
|
||||
private boolean mergeItemStackIntoArmor(EntityPlayer entityPlayer, ItemStack origStack, int slotIndex) {
|
||||
if (origStack == null || !(origStack.getItem() instanceof ItemArmor)) {
|
||||
return false;
|
||||
}
|
||||
ItemArmor armor = (ItemArmor) origStack.getItem();
|
||||
int index = 3 - armor.armorType;
|
||||
ItemStack[] ai = entityPlayer.inventory.armorInventory;
|
||||
if (ai[index] == null) {
|
||||
ai[index] = origStack.copy();
|
||||
origStack.stackSize = 0;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,157 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.vecmath.Vector2f;
|
||||
import com.enderio.core.common.vecmath.Vector4d;
|
||||
|
||||
class GaugeBounds {
|
||||
|
||||
private static final BlockCoord DEFAULT_BC = new BlockCoord(0, 0, 0);
|
||||
private static final BlockCoord[] DEFAULT_MB = new BlockCoord[] { DEFAULT_BC };
|
||||
|
||||
static List<GaugeBounds> calculateGaugeBounds(BlockCoord me, BlockCoord[] mbIn) {
|
||||
|
||||
BlockCoord[] mb;
|
||||
if (mbIn != null) {
|
||||
mb = mbIn;
|
||||
} else {
|
||||
DEFAULT_MB[0] = me;
|
||||
mb = DEFAULT_MB;
|
||||
}
|
||||
|
||||
List<GaugeBounds> res = new ArrayList<GaugeBounds>();
|
||||
for (ForgeDirection face : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (face != ForgeDirection.UP && face != ForgeDirection.DOWN) {
|
||||
boolean isRight = isRightFace(me, mb, face);
|
||||
if (isRight) {
|
||||
res.add(new GaugeBounds(me, mb, face));
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static boolean isRightFace(BlockCoord me, BlockCoord[] mb, ForgeDirection dir) {
|
||||
|
||||
if (me == null || contains(mb, me.getLocation(dir))) {
|
||||
return false;
|
||||
}
|
||||
if (mb == null) {
|
||||
return true;
|
||||
}
|
||||
Vector4d uPlane = RenderUtil.getUPlaneForFace(dir);
|
||||
|
||||
int myRightVal = (int) uPlane.x * me.x + (int) uPlane.y * me.y + (int) uPlane.z * me.z;
|
||||
int max = myRightVal;
|
||||
for (BlockCoord bc : mb) {
|
||||
int val = (int) uPlane.x * bc.x + (int) uPlane.y * bc.y + (int) uPlane.z * bc.z;
|
||||
if (val > max) {
|
||||
max = val;
|
||||
}
|
||||
}
|
||||
return myRightVal == max;
|
||||
}
|
||||
|
||||
private static boolean contains(BlockCoord[] mb, BlockCoord location) {
|
||||
if (mb == null) {
|
||||
return false;
|
||||
}
|
||||
for (BlockCoord bc : mb) {
|
||||
if (location.equals(bc)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
final BoundingBox bb;
|
||||
final VInfo vInfo;
|
||||
final ForgeDirection face;
|
||||
|
||||
GaugeBounds(BlockCoord me, BlockCoord[] mb, ForgeDirection face) {
|
||||
this.face = face;
|
||||
vInfo = getVPosForFace(me, mb, face);
|
||||
|
||||
Vector4d uPlane = RenderUtil.getUPlaneForFace(face);
|
||||
float scaleX = uPlane.x != 0 ? 0.25f : 1;
|
||||
float scaleY = uPlane.y != 0 ? 0.25f : 1;
|
||||
float scaleZ = uPlane.z != 0 ? 0.25f : 1;
|
||||
bb = BoundingBox.UNIT_CUBE.scale(scaleX, scaleY, scaleZ);
|
||||
}
|
||||
|
||||
Vector2f getMinMaxU(IIcon icon) {
|
||||
VPos yPos = vInfo.pos;
|
||||
float uWidth = icon.getMaxU() - icon.getMinU();
|
||||
float uOffset = yPos.uOffset * uWidth;
|
||||
float minU = icon.getMinU() + uOffset;
|
||||
float maxU = minU + (uWidth * 0.25f);
|
||||
return new Vector2f(minU, maxU);
|
||||
}
|
||||
|
||||
private VInfo getVPosForFace(BlockCoord me, BlockCoord[] mb, ForgeDirection face) {
|
||||
int maxY = me.y;
|
||||
int minY = me.y;
|
||||
for (BlockCoord bc : mb) {
|
||||
if (bc.x == me.x && bc.z == me.z && !containsLocaction(mb, bc.getLocation(face))) {
|
||||
maxY = Math.max(maxY, bc.y);
|
||||
minY = Math.min(minY, bc.y);
|
||||
}
|
||||
}
|
||||
if (maxY == me.y && minY == me.y) {
|
||||
return new VInfo(VPos.SINGLE_BLOCK, 1, 0);
|
||||
}
|
||||
int height = maxY - minY + 1;
|
||||
if (maxY > me.y) {
|
||||
return me.y > minY ? new VInfo(VPos.MIDDLE, height, me.y - minY) : new VInfo(VPos.BOTTOM, height, 0);
|
||||
}
|
||||
return new VInfo(VPos.TOP, height, height - 1);
|
||||
}
|
||||
|
||||
private boolean containsLocaction(BlockCoord[] mb, BlockCoord location) {
|
||||
for (BlockCoord bc : mb) {
|
||||
if (location.equals(bc)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
enum VPos {
|
||||
|
||||
SINGLE_BLOCK(0, 10, 3),
|
||||
BOTTOM(0.5f, 13, 3),
|
||||
MIDDLE(0.75f, 16, 0),
|
||||
TOP(0.25f, 13, 0);
|
||||
|
||||
final float uOffset;
|
||||
final int numFillPixels;
|
||||
final int fillOffset;
|
||||
|
||||
private VPos(float uOffset, int numFillPixels, int fillOffset) {
|
||||
this.uOffset = uOffset;
|
||||
this.numFillPixels = numFillPixels;
|
||||
this.fillOffset = fillOffset;
|
||||
}
|
||||
}
|
||||
|
||||
static class VInfo {
|
||||
|
||||
VPos pos;
|
||||
int verticalHeight;
|
||||
int index;
|
||||
|
||||
VInfo(VPos pos, int verticalHeight, int index) {
|
||||
this.pos = pos;
|
||||
this.verticalHeight = verticalHeight;
|
||||
this.index = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,335 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.gui.button.IconButton;
|
||||
import com.enderio.core.client.gui.widget.GuiToolTip;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.gui.RedstoneModeButton;
|
||||
import crazypants.enderio.machine.IRedstoneModeControlable;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.machine.gui.GuiOverlayIoConfig;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
|
||||
public class GuiCapacitorBank extends GuiContainerBaseEIO {
|
||||
|
||||
protected static final int INPUT_BUTTON_ID = 18;
|
||||
protected static final int OUTPUT_BUTTON_ID = 37;
|
||||
|
||||
protected static final int CONFIG_ID = 377996104;
|
||||
|
||||
private static final int POWER_X = 11 + 18;
|
||||
private static final int POWER_Y = 9;
|
||||
private static final int POWER_WIDTH = 10;
|
||||
private static final int POWER_HEIGHT = 68;
|
||||
protected static final int BOTTOM_POWER_Y = POWER_Y + POWER_HEIGHT;
|
||||
|
||||
private int inputX = 78 + 24;
|
||||
private int inputY = 18;
|
||||
|
||||
private int outputX = 78 + 24;
|
||||
private int outputY = 36;
|
||||
|
||||
private int rightMargin = 8 + 24;
|
||||
|
||||
private final TileCapacitorBank capBank;
|
||||
|
||||
private RedstoneModeButton inputRsButton;
|
||||
private RedstoneModeButton outputRsButton;
|
||||
|
||||
private GuiTextField maxInputTF;
|
||||
private GuiTextField maxOutputTF;
|
||||
|
||||
private GuiOverlayIoConfig configOverlay;
|
||||
private IconButton configB;
|
||||
|
||||
public GuiCapacitorBank(Entity player, InventoryPlayer playerInv, TileCapacitorBank te) {
|
||||
super(new ContainerCapacitorBank(player, playerInv, te), "capacitorBank");
|
||||
this.capBank = te;
|
||||
|
||||
xSize = 176 + 42;
|
||||
|
||||
addToolTip(new GuiToolTip(new Rectangle(5, POWER_Y, POWER_WIDTH, POWER_HEIGHT), "") {
|
||||
|
||||
@Override
|
||||
protected void updateText() {
|
||||
text.clear();
|
||||
text.add(PowerDisplayUtil.formatPower(capBank.getEnergyStored()) + " " + PowerDisplayUtil.ofStr());
|
||||
text.add(
|
||||
PowerDisplayUtil.formatPower(capBank.getMaxEnergyStored()) + " "
|
||||
+ PowerDisplayUtil.abrevation());
|
||||
}
|
||||
});
|
||||
|
||||
int x = xSize - rightMargin - GuiPoweredMachineBase.BUTTON_SIZE - 21;
|
||||
int y = inputY;
|
||||
inputRsButton = new RedstoneModeButton(this, -1, x, y, new IRedstoneModeControlable() {
|
||||
|
||||
@Override
|
||||
public void setRedstoneControlMode(RedstoneControlMode mode) {
|
||||
capBank.setInputControlMode(mode);
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketClientState(capBank));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedstoneControlMode getRedstoneControlMode() {
|
||||
return capBank.getInputControlMode();
|
||||
}
|
||||
});
|
||||
inputRsButton.setTooltipKey("enderio.gui.capBank.inputRs");
|
||||
|
||||
y += 18;
|
||||
outputRsButton = new RedstoneModeButton(this, -1, x, y, new IRedstoneModeControlable() {
|
||||
|
||||
@Override
|
||||
public void setRedstoneControlMode(RedstoneControlMode mode) {
|
||||
capBank.setOutputControlMode(mode);
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketClientState(capBank));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedstoneControlMode getRedstoneControlMode() {
|
||||
return capBank.getOutputControlMode();
|
||||
}
|
||||
});
|
||||
outputRsButton.setTooltipKey("enderio.gui.capBank.outputRs");
|
||||
|
||||
y += 20;
|
||||
configB = new IconButton(this, CONFIG_ID, x, y, IconEIO.IO_CONFIG_UP);
|
||||
configB.setToolTip(EnderIO.lang.localize("gui.machine.ioMode.overlay.tooltip"));
|
||||
|
||||
List<BlockCoord> coords = new ArrayList<BlockCoord>();
|
||||
if (te.isMultiblock()) {
|
||||
BlockCoord[] mb = te.getController().multiblock;
|
||||
if (mb != null) {
|
||||
coords.addAll(Arrays.asList(mb));
|
||||
}
|
||||
}
|
||||
|
||||
if (coords.isEmpty()) {
|
||||
coords.add(te.getLocation());
|
||||
}
|
||||
|
||||
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) {
|
||||
return EnderIO.lang.localize("gui.capBank.outputMode");
|
||||
} else if (mode == IoMode.PULL) {
|
||||
return EnderIO.lang.localize("gui.capBank.inputMode");
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
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;
|
||||
maxInputTF = new GuiTextField(fontRenderer, x, y, 68, 16);
|
||||
maxInputTF.setCanLoseFocus(true);
|
||||
maxInputTF.setMaxStringLength(10);
|
||||
maxInputTF.setFocused(false);
|
||||
maxInputTF.setText(PowerDisplayUtil.formatPower(capBank.getMaxInput()));
|
||||
|
||||
x = guiLeft + outputX;
|
||||
y = guiTop + outputY;
|
||||
maxOutputTF = new GuiTextField(fontRenderer, x, y, 68, 16);
|
||||
maxOutputTF.setCanLoseFocus(true);
|
||||
maxOutputTF.setMaxStringLength(10);
|
||||
maxOutputTF.setFocused(true);
|
||||
maxOutputTF.setText(PowerDisplayUtil.formatPower(capBank.getMaxOutput()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char par1, int par2) {
|
||||
super.keyTyped(par1, par2);
|
||||
if (par1 == 'e') {
|
||||
super.keyTyped(par1, 1);
|
||||
}
|
||||
maxInputTF.textboxKeyTyped(par1, par2);
|
||||
maxOutputTF.textboxKeyTyped(par1, par2);
|
||||
updateInputOutput();
|
||||
}
|
||||
|
||||
private void updateInputOutput() {
|
||||
int input = parsePower(maxInputTF);
|
||||
if (input >= 0 && capBank.getMaxInput() != input) {
|
||||
setMaxInput(input);
|
||||
}
|
||||
int output = parsePower(maxOutputTF);
|
||||
if (output >= 0 && capBank.getMaxOutput() != output) {
|
||||
setMaxOutput(output);
|
||||
}
|
||||
}
|
||||
|
||||
private void setMaxOutput(int output) {
|
||||
if (output != capBank.getMaxOutput()) {
|
||||
capBank.setMaxOutput(output);
|
||||
maxOutputTF.setText(PowerDisplayUtil.formatPower(capBank.getMaxOutput()));
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketClientState(capBank));
|
||||
}
|
||||
}
|
||||
|
||||
private void setMaxInput(int input) {
|
||||
if (input != capBank.getMaxInput()) {
|
||||
capBank.setMaxInput(input);
|
||||
maxInputTF.setText(PowerDisplayUtil.formatPower(capBank.getMaxInput()));
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketClientState(capBank));
|
||||
}
|
||||
}
|
||||
|
||||
private int parsePower(GuiTextField tf) {
|
||||
String txt = tf.getText();
|
||||
try {
|
||||
Integer power = PowerDisplayUtil.parsePower(txt);
|
||||
if (power == null) {
|
||||
return -1;
|
||||
}
|
||||
return power.intValue();
|
||||
} catch (Exception e) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int par1, int par2, int par3) {
|
||||
super.mouseClicked(par1, par2, par3);
|
||||
maxInputTF.mouseClicked(par1, par2, par3);
|
||||
maxOutputTF.mouseClicked(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
maxInputTF.updateCursorCounter();
|
||||
maxOutputTF.updateCursorCounter();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
bindGuiTexture();
|
||||
int sx = (width - xSize) / 2;
|
||||
int sy = (height - ySize) / 2;
|
||||
|
||||
drawTexturedModalRect(sx, sy, 0, 0, this.xSize - 21, this.ySize);
|
||||
|
||||
int i1 = capBank.getEnergyStoredScaled(POWER_HEIGHT);
|
||||
drawTexturedModalRect(sx + POWER_X, sy + BOTTOM_POWER_Y - i1, 176 + 21, 0, POWER_WIDTH, i1);
|
||||
|
||||
for (int i = 0; i < buttonList.size(); ++i) {
|
||||
GuiButton guibutton = (GuiButton) this.buttonList.get(i);
|
||||
guibutton.drawButton(this.mc, 0, 0);
|
||||
}
|
||||
|
||||
maxInputTF.drawTextBox();
|
||||
maxOutputTF.drawTextBox();
|
||||
|
||||
int midX = sx + xSize / 2;
|
||||
|
||||
String str = EnderIO.lang.localize("gui.capBank.maxIo") + " "
|
||||
+ PowerDisplayUtil.formatPower(capBank.getMaxIO())
|
||||
+ " "
|
||||
+ PowerDisplayUtil.abrevation()
|
||||
+ PowerDisplayUtil.perTickStr();
|
||||
FontRenderer fontRenderer = getFontRenderer();
|
||||
int swid = fontRenderer.getStringWidth(str);
|
||||
int x = midX - swid / 2;
|
||||
int y = guiTop + 5;
|
||||
|
||||
drawString(fontRenderer, str, x, y, -1);
|
||||
|
||||
str = EnderIO.lang.localize("gui.capBank.maxInput") + ":";
|
||||
swid = fontRenderer.getStringWidth(str);
|
||||
x = guiLeft + inputX - swid - 3;
|
||||
y = guiTop + inputY + 2;
|
||||
drawString(fontRenderer, str, x, y, -1);
|
||||
|
||||
str = EnderIO.lang.localize("gui.capBank.maxOutput") + ":";
|
||||
swid = fontRenderer.getStringWidth(str);
|
||||
x = guiLeft + outputX - swid - 3;
|
||||
y = guiTop + outputY + 2;
|
||||
drawString(fontRenderer, str, x, y, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawHoveringText(List par1List, int par2, int par3, FontRenderer font) {
|
||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT | GL11.GL_LIGHTING_BIT);
|
||||
super.drawHoveringText(par1List, par2 + 24, par3, font);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getGuiLeft() {
|
||||
return guiLeft + 24;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getGuiTop() {
|
||||
return guiTop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getXSize() {
|
||||
return xSize - 42;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOverlayOffsetX() {
|
||||
return 21;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FontRenderer getFontRenderer() {
|
||||
return Minecraft.getMinecraft().fontRenderer;
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
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.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.network.PacketUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketClientState implements IMessage, IMessageHandler<PacketClientState, IMessage> {
|
||||
|
||||
private int x;
|
||||
private int y;
|
||||
private int z;
|
||||
private RedstoneControlMode inputMode;
|
||||
private RedstoneControlMode outputMode;
|
||||
private int maxInput;
|
||||
private int maxOutput;
|
||||
|
||||
public PacketClientState() {}
|
||||
|
||||
public PacketClientState(TileCapacitorBank capBank) {
|
||||
x = capBank.xCoord;
|
||||
y = capBank.yCoord;
|
||||
z = capBank.zCoord;
|
||||
|
||||
inputMode = capBank.getInputControlMode();
|
||||
outputMode = capBank.getOutputControlMode();
|
||||
|
||||
maxInput = capBank.getMaxInput();
|
||||
maxOutput = capBank.getMaxOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf dos) {
|
||||
dos.writeInt(x);
|
||||
dos.writeInt(y);
|
||||
dos.writeInt(z);
|
||||
dos.writeShort((short) inputMode.ordinal());
|
||||
dos.writeShort((short) outputMode.ordinal());
|
||||
dos.writeInt(maxInput);
|
||||
dos.writeInt(maxOutput);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf data) {
|
||||
x = data.readInt();
|
||||
y = data.readInt();
|
||||
z = data.readInt();
|
||||
short inputOrdinal = data.readShort();
|
||||
short outputOrdinal = data.readShort();
|
||||
outputMode = RedstoneControlMode.values()[outputOrdinal];
|
||||
inputMode = RedstoneControlMode.values()[inputOrdinal];
|
||||
|
||||
maxInput = data.readInt();
|
||||
maxOutput = data.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketClientState message, MessageContext ctx) {
|
||||
EntityPlayer player = ctx.getServerHandler().playerEntity;
|
||||
TileEntity te = player.worldObj.getTileEntity(message.x, message.y, message.z);
|
||||
if (PacketUtil.isInvalidPacketForGui(ctx, te, getClass())) return null;
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
TileCapacitorBank cb = (TileCapacitorBank) te;
|
||||
cb.setInputControlMode(message.inputMode);
|
||||
cb.setOutputControlMode(message.outputMode);
|
||||
cb.setMaxInput(message.maxInput);
|
||||
cb.setMaxOutput(message.maxOutput);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
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.enderio.EnderIO;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketPowerStorage implements IMessage, IMessageHandler<PacketPowerStorage, IMessage> {
|
||||
|
||||
private int x;
|
||||
private int y;
|
||||
private int z;
|
||||
private int storedEnergy;
|
||||
|
||||
public PacketPowerStorage() {}
|
||||
|
||||
public PacketPowerStorage(TileCapacitorBank ent) {
|
||||
x = ent.xCoord;
|
||||
y = ent.yCoord;
|
||||
z = ent.zCoord;
|
||||
storedEnergy = ent.storedEnergyRF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
buf.writeInt(x);
|
||||
buf.writeInt(y);
|
||||
buf.writeInt(z);
|
||||
buf.writeInt(storedEnergy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
x = buf.readInt();
|
||||
y = buf.readInt();
|
||||
z = buf.readInt();
|
||||
storedEnergy = buf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketPowerStorage message, MessageContext ctx) {
|
||||
EntityPlayer player = EnderIO.proxy.getClientPlayer();
|
||||
TileEntity te = player.worldObj.getTileEntity(message.x, message.y, message.z);
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
TileCapacitorBank me = (TileCapacitorBank) te;
|
||||
me.storedEnergyRF = message.storedEnergy;
|
||||
|
||||
double dif = Math.abs(me.lastRenderStoredRatio - me.getEnergyStoredRatio());
|
||||
if (dif > 0.025) { // update rendering at a 2.5% diff
|
||||
if (!me.isMultiblock()) {
|
||||
player.worldObj.markBlockForUpdate(message.x, message.y, message.z);
|
||||
} else {
|
||||
BlockCoord[] mb = me.multiblock;
|
||||
for (BlockCoord bc : mb) {
|
||||
updateGaugeRender(player.worldObj, bc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void updateGaugeRender(World worldObj, BlockCoord bc) {
|
||||
TileEntity te = worldObj.getTileEntity(bc.x, bc.y, bc.z);
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
TileCapacitorBank me = (TileCapacitorBank) te;
|
||||
List<GaugeBounds> gb = me.getGaugeBounds();
|
||||
if (gb != null && !gb.isEmpty()) {
|
||||
worldObj.markBlockForUpdate(bc.x, bc.y, bc.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class BlockItemSolarPanel extends ItemBlockWithMetadata
|
||||
implements IAdvancedTooltipProvider, IResourceTooltipProvider {
|
||||
|
||||
@@ -29,8 +29,8 @@ import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.machine.AbstractMachineBlock;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class BlockTank extends AbstractMachineBlock<TileTank> implements IAdvancedTooltipProvider {
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.PacketItemBuffer;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GeneralTab implements ITabPanel {
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.alloy.AlloyRecipeManager;
|
||||
import crazypants.enderio.machine.alloy.GuiAlloySmelter;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.recipe.IRecipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package crazypants.enderio.nei;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IConfigureNEI;
|
||||
@@ -71,7 +70,6 @@ public class NEIEnderIOConfig implements IConfigureNEI {
|
||||
API.hideItem(new ItemStack(EnderIO.itemGasConduit));
|
||||
}
|
||||
API.hideItem(new ItemStack(EnderIO.blockHyperCube));
|
||||
API.hideItem(new ItemStack(EnderIO.blockCapacitorBank, 1, OreDictionary.WILDCARD_VALUE));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,10 +24,10 @@ import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.crusher.CrusherRecipeManager;
|
||||
import crazypants.enderio.machine.crusher.GrindingBall;
|
||||
import crazypants.enderio.machine.crusher.GuiCrusher;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.recipe.Recipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.enderio.machine.recipe.RecipeOutput;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
|
||||
@@ -19,12 +19,12 @@ import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.recipe.IRecipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.enderio.machine.slicensplice.ContainerSliceAndSplice;
|
||||
import crazypants.enderio.machine.slicensplice.GuiSliceAndSplice;
|
||||
import crazypants.enderio.machine.slicensplice.SliceAndSpliceRecipeManager;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class SliceAndSpliceRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@ import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.IMachineRecipe;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.soul.GuiSoulBinder;
|
||||
import crazypants.enderio.machine.soul.ISoulBinderRecipe;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class SoulBinderRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
|
||||
@@ -25,11 +25,11 @@ import codechicken.nei.recipe.GuiUsageRecipe;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.recipe.IRecipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.enderio.machine.vat.GuiVat;
|
||||
import crazypants.enderio.machine.vat.VatRecipeManager;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
package crazypants.enderio.power;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
@@ -16,7 +16,7 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.api.teleport.TravelSource;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class ItemTeleportStaff extends ItemTravelStaff {
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.api.teleport.IItemOfTravel;
|
||||
import crazypants.enderio.api.teleport.TravelSource;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles|API")
|
||||
public class ItemTravelStaff extends ItemEnergyContainer implements IItemOfTravel, IResourceTooltipProvider, IBauble {
|
||||
|
||||
@@ -24,8 +24,8 @@ import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiTelePad extends GuiContainerBaseEIO implements IToggleableGui {
|
||||
|
||||
|
||||
@@ -42,8 +42,8 @@ import crazypants.enderio.machine.IIoConfigurable;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
import crazypants.enderio.machine.capbank.TileCapBank;
|
||||
import crazypants.enderio.machine.invpanel.TileInventoryPanel;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.IInternalPoweredTile;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.util.IFacade;
|
||||
import mcp.mobius.waila.api.ITaggedList;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
|
||||
@@ -238,12 +238,6 @@ item.itemLightInverted.name=Světlo (Obrácené)
|
||||
item.itemLightInverted.tooltip.detailed.line1=Vysílá světlo, vypne se s
|
||||
item.itemLightInverted.tooltip.detailed.line2=ruditovým signálem
|
||||
|
||||
tile.blockCapacitorBank.name=Banka kondenzátorů Bank
|
||||
tile.blockCapacitorBank.creative.name=Kreativní banka kondenzátorů
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=Multi-blokové energetické úložiště.
|
||||
tile.blockCapacitorBank.tooltip.detailed.line2=Umí nabít předměty, které využívají RF.
|
||||
tile.blockCapacitorBank.tooltipPrefix=Obsahuje
|
||||
|
||||
enderio.capbank.maxIO=Maximální I/O
|
||||
enderio.capbank.maxIn=Maximální vstup
|
||||
enderio.capbank.maxOut=Maximální výstup
|
||||
|
||||
@@ -364,12 +364,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line2=Energie versorgt
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=Schalte mit einem Redstonesignal ab.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line4=Kann Energie von Drahtlos-Ladegeräten empfangen.
|
||||
|
||||
tile.blockCapacitorBank.name=Kondensatorbank (Veraltet)
|
||||
tile.blockCapacitorBank.creative.name=Kreative Kondensatorbank (Veraltet)
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=In einen neuen Block umwandeln
|
||||
tile.blockCapacitorBank.tooltip.detailed.line2=durch Platzieren in Fertigungsgitter.
|
||||
tile.blockCapacitorBank.tooltipPrefix=Enthält
|
||||
|
||||
tile.blockCapBank.creative.name=Kreative Kondensatorbank
|
||||
tile.blockCapBank.simple.name=Basis-Kondensatorbank
|
||||
tile.blockCapBank.activated.name=Kondensatorbank
|
||||
|
||||
@@ -441,11 +441,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line2=power.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=Turn off with a redstone signal.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line4=Can receive power from wireless chargers.
|
||||
|
||||
tile.blockCapacitorBank.name=Capacitor Bank (Deprecated)
|
||||
tile.blockCapacitorBank.creative.name=Creative Capacitor Bank (Deprecated)
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=Convert to new block by placing
|
||||
tile.blockCapacitorBank.tooltip.detailed.line2=in a crafting grid
|
||||
tile.blockCapacitorBank.tooltipPrefix=Contains
|
||||
|
||||
tile.blockCapBank.name=Capacitor Bank
|
||||
tile.blockCapBank.creative.name=Creative Capacitor Bank
|
||||
|
||||
@@ -270,11 +270,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line1=Ilumina una gran área cua
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line2=Desactívala con una señal de redstone.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=Puede recibir energía de los cargadores inalámbricos.
|
||||
|
||||
tile.blockCapacitorBank.name=Condensador de Almacenaje (Obsoleto)
|
||||
tile.blockCapacitorBank.creative.name=Condensador de Almacenaje Creativo (Obsoleto)
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=Conviértelo en nuevo poniéndolo en una cuadrícula de fabricación.
|
||||
tile.blockCapacitorBank.tooltipPrefix=Contiene
|
||||
|
||||
tile.blockCapBank.creative.name=Condensador de Almacenaje Creativo
|
||||
tile.blockCapBank.simple.name=Condensador de Almacenaje Básico
|
||||
tile.blockCapBank.activated.name=Condensador de Almacenaje
|
||||
|
||||
@@ -272,11 +272,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line1=Ilumina una gran área cua
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line2=Desactívala con una señal de redstone.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=Puede recibir energía de los cargadores inalámbricos.
|
||||
|
||||
tile.blockCapacitorBank.name=Condensador de Almacenaje (Obsoleto)
|
||||
tile.blockCapacitorBank.creative.name=Condensador de Almacenaje Creativo (Obsoleto)
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=Conviértelo en nuevo poniéndolo en una cuadrícula de fabricación.
|
||||
tile.blockCapacitorBank.tooltipPrefix=Contiene
|
||||
|
||||
tile.blockCapBank.creative.name=Condensador de Almacenaje Creativo
|
||||
tile.blockCapBank.simple.name=Condensador de Almacenaje Básico
|
||||
tile.blockCapBank.activated.name=Condensador de Almacenaje
|
||||
|
||||
@@ -270,11 +270,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line1=Ilumina una gran área cua
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line2=Desactívala con una señal de redstone.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=Puede recibir energía de los cargadores inalámbricos.
|
||||
|
||||
tile.blockCapacitorBank.name=Condensador de Almacenaje (Obsoleto)
|
||||
tile.blockCapacitorBank.creative.name=Condensador de Almacenaje Creativo (Obsoleto)
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=Conviértelo en nuevo poniéndolo en una cuadrícula de fabricación.
|
||||
tile.blockCapacitorBank.tooltipPrefix=Contiene
|
||||
|
||||
tile.blockCapBank.creative.name=Condensador de Almacenaje Creativo
|
||||
tile.blockCapBank.simple.name=Condensador de Almacenaje Básico
|
||||
tile.blockCapBank.activated.name=Condensador de Almacenaje
|
||||
|
||||
@@ -270,11 +270,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line1=Ilumina una gran área cua
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line2=Desactívala con una señal de redstone.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=Puede recibir energía de los cargadores inalámbricos.
|
||||
|
||||
tile.blockCapacitorBank.name=Condensador de Almacenaje (Obsoleto)
|
||||
tile.blockCapacitorBank.creative.name=Condensador de Almacenaje Creativo (Obsoleto)
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=Conviértelo en nuevo poniéndolo en una cuadrícula de fabricación.
|
||||
tile.blockCapacitorBank.tooltipPrefix=Contiene
|
||||
|
||||
tile.blockCapBank.creative.name=Condensador de Almacenaje Creativo
|
||||
tile.blockCapBank.simple.name=Condensador de Almacenaje Básico
|
||||
tile.blockCapBank.activated.name=Condensador de Almacenaje
|
||||
|
||||
@@ -270,11 +270,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line1=Ilumina una gran área cua
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line2=Desactívala con una señal de redstone.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=Puede recibir energía de los cargadores inalámbricos.
|
||||
|
||||
tile.blockCapacitorBank.name=Condensador de Almacenaje (Obsoleto)
|
||||
tile.blockCapacitorBank.creative.name=Condensador de Almacenaje Creativo (Obsoleto)
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=Conviértelo en nuevo poniéndolo en una cuadrícula de fabricación.
|
||||
tile.blockCapacitorBank.tooltipPrefix=Contiene
|
||||
|
||||
tile.blockCapBank.creative.name=Condensador de Almacenaje Creativo
|
||||
tile.blockCapBank.simple.name=Condensador de Almacenaje Básico
|
||||
tile.blockCapBank.activated.name=Condensador de Almacenaje
|
||||
|
||||
@@ -288,12 +288,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line2=en énergie.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=S'éteint avec un signal de redstone.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line4=Peut recevoir de l'énergie d'un Chargeur sans-fil.
|
||||
|
||||
enderio.blockCapacitorBank=Batterie de condensateurs (Obsolète)
|
||||
tile.blockCapacitorBank.creative.name=Batterie de condensateurs Créative (Obsolète)
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=Convertir en nouveau block en la plaçant
|
||||
tile.blockCapacitorBank.tooltip.detailed.line2=sur une grille de craft
|
||||
tile.blockCapacitorBank.tooltipPrefix=Contient
|
||||
|
||||
tile.blockCapBank.creative.name=Batterie de condensateurs Créative
|
||||
tile.blockCapBank.simple.name=Batterie de condensateurs basique
|
||||
tile.blockCapBank.activated.name=Batterie de condensateurs
|
||||
|
||||
@@ -261,12 +261,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line2=넓은 공간을 밝혀
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=레드스톤 신호로 끌 수 있습니다.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line4=무선 충전기로부터 전력을 받을 수 있습니다.
|
||||
|
||||
tile.blockCapacitorBank.name=축전기
|
||||
tile.blockCapacitorBank.creative.name=크리에이티브 축전기
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=멀티블럭 에너지 저장고입니다.
|
||||
tile.blockCapacitorBank.tooltip.detailed.line2=RF를 사용하는 아이템들을 충전할 수 있습니다.
|
||||
tile.blockCapacitorBank.tooltipPrefix=에너지 저장량:
|
||||
|
||||
enderio.capbank.maxIO=최대 입출력
|
||||
enderio.capbank.maxIn=최대 입력
|
||||
enderio.capbank.maxOut=최대 출력
|
||||
|
||||
@@ -86,8 +86,6 @@ tile.enderio.blockReservoir.name=Zbiornik
|
||||
tile.enderio.blockAlloySmelter.name=Piec stopów
|
||||
tile.enderio.blockSolarPanel.name=Ogniwo fotowoltaiczne
|
||||
tile.enderio.blockElectricLight.name=Lampa
|
||||
tile.enderio.blockCapacitorBank.name=Bateria energetyczna
|
||||
tile.enderio.blockCapacitorBank.tooltipPrefix=Zawiera
|
||||
tile.enderio.blockCrusher.name=Rozdrabniarka
|
||||
tile.enderio.blockHyperCube.name=Międzywymiarowy odbiornik
|
||||
tile.enderio.blockPowerMonitor.name=Ekran energetyczny
|
||||
|
||||
@@ -274,12 +274,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line2=com energia.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=Desliga com um sinal de redstone.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line4=Pode receber energia de Carregadores Sem Fio
|
||||
|
||||
tile.blockCapacitorBank.name=Banco de Capacitores (Deprecado)
|
||||
tile.blockCapacitorBank.creative.name=Banco de Capacitores Criativo (Deprecado)
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=Converta a um novo bloco colocando-o
|
||||
tile.blockCapacitorBank.tooltip.detailed.line2=em uma grade de crafting.
|
||||
tile.blockCapacitorBank.tooltipPrefix=Contém
|
||||
|
||||
tile.blockCapBank.creative.name=Banco de Capacitores Criativo
|
||||
tile.blockCapBank.simple.name=Banco de Capacitores Básico
|
||||
tile.blockCapBank.activated.name=Banco de Capacitores
|
||||
|
||||
@@ -276,12 +276,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line2=com energia.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=Desliga com um sinal de redstone.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line4=Pode receber energia de Carregadores Sem Fio
|
||||
|
||||
tile.blockCapacitorBank.name=Banco de Capacitores (Deprecado)
|
||||
tile.blockCapacitorBank.creative.name=Banco de Capacitores Criativo (Deprecado)
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=Converta a um novo bloco colocando-o
|
||||
tile.blockCapacitorBank.tooltip.detailed.line2=em uma grade de crafting.
|
||||
tile.blockCapacitorBank.tooltipPrefix=Contém
|
||||
|
||||
tile.blockCapBank.creative.name=Banco de Capacitores Criativo
|
||||
tile.blockCapBank.simple.name=Banco de Capacitores Básico
|
||||
tile.blockCapBank.activated.name=Banco de Capacitores
|
||||
|
||||
@@ -413,12 +413,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line2=энергии.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=Выключается по сигналу красного камня.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line4=Может получать энергию от беспроводных зарядников.
|
||||
|
||||
tile.blockCapacitorBank.name=Блок конденсаторов (Устаревший)
|
||||
tile.blockCapacitorBank.creative.name=Творческий блок конденсаторов (Устаревший)
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=Переделайте в новый блок, положив
|
||||
tile.blockCapacitorBank.tooltip.detailed.line2=в сетку создания.
|
||||
tile.blockCapacitorBank.tooltipPrefix=Содержит
|
||||
|
||||
tile.blockCapBank.creative.name=Творческий блок конденсаторов
|
||||
tile.blockCapBank.simple.name=Основной блок конденсаторов
|
||||
tile.blockCapBank.activated.name=Блок конденсаторов
|
||||
|
||||
@@ -413,12 +413,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line2=照亮大片区域.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=有红石信号时熄灭
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line4=可从无线充能器接收能量.
|
||||
|
||||
tile.blockCapacitorBank.name=电容储能库
|
||||
tile.blockCapacitorBank.creative.name=创造模式电容储能库
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=多方块能量存储.
|
||||
tile.blockCapacitorBank.tooltip.detailed.line2=可以给使用RF能量的物品充能.
|
||||
tile.blockCapacitorBank.tooltipPrefix=包含
|
||||
|
||||
tile.blockCapBank.creative.name=创造模式电容库
|
||||
tile.blockCapBank.simple.name=基础电容库
|
||||
tile.blockCapBank.activated.name=电容库
|
||||
|
||||
@@ -259,12 +259,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line2=照亮大片區域.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=有紅石信號時熄滅
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line4=可從無線充能器接收能量.
|
||||
|
||||
tile.blockCapacitorBank.name=電容儲能庫
|
||||
tile.blockCapacitorBank.creative.name=創造模式電容儲能庫
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=多方塊能量存儲.
|
||||
tile.blockCapacitorBank.tooltip.detailed.line2=可以給使用RF能量的物品充能.
|
||||
tile.blockCapacitorBank.tooltipPrefix=包含
|
||||
|
||||
tile.blockCapBank.creative.name=創造模式電容儲能庫
|
||||
tile.blockCapBank.simple.name=基本電容儲能庫
|
||||
tile.blockCapBank.activated.name=電容儲能庫
|
||||
|
||||
|
Before Width: | Height: | Size: 175 B |
|
Before Width: | Height: | Size: 467 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 290 B |
|
Before Width: | Height: | Size: 540 B |
|
Before Width: | Height: | Size: 521 B |
|
Before Width: | Height: | Size: 492 B |
|
Before Width: | Height: | Size: 215 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 964 B |
|
Before Width: | Height: | Size: 1.4 KiB |