mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-10-26 14:24:40 +00:00
Wootly woota. Conduits and storage finally behaving themselves.
Updated version to next release.
This commit is contained in:
1 parent
9e61125950
commit
ebbb6397e6
13 files changed
+249
-53
No files matched your search
@@ -19,7 +19,7 @@
|
||||
|
||||
<property name="mc.version" value="1.6.2"/>
|
||||
<property name="forge.version" value="9.10.0.828"/>
|
||||
<property name="project.version" value="0.1.13"/>
|
||||
<property name="project.version" value="0.1.14"/>
|
||||
|
||||
<property name="forge.name" value="minecraftforge-src-${mc.version}-${forge.version}.zip"/>
|
||||
|
||||
|
||||
@@ -1,16 +1,27 @@
|
||||
package crazypants.enderio;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import cpw.mods.fml.common.registry.TickRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.util.DebugGuiTPS;
|
||||
|
||||
public class CommonProxy {
|
||||
|
||||
private final ServerTickHandler serverTickHandler = new ServerTickHandler();
|
||||
|
||||
private static final DecimalFormat FORMAT = new DecimalFormat("########0.000");
|
||||
|
||||
private boolean showTpdGUI = false;
|
||||
|
||||
public World getClientWorld() {
|
||||
return null;
|
||||
}
|
||||
@@ -21,6 +32,11 @@ public class CommonProxy {
|
||||
|
||||
public void load() {
|
||||
TickRegistry.registerTickHandler(serverTickHandler, Side.SERVER);
|
||||
|
||||
if (showTpdGUI) {
|
||||
DebugGuiTPS.showTpsGUI();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ConduitRenderer getRendererForConduit(IConduit conduit) {
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package crazypants.enderio;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import cpw.mods.fml.common.ITickHandler;
|
||||
import cpw.mods.fml.common.TickType;
|
||||
|
||||
public class DebugTickHandler implements ITickHandler {
|
||||
|
||||
long tickStart = -1;
|
||||
|
||||
LinkedList<Entry> serverTicks;
|
||||
|
||||
@Override
|
||||
public void tickStart(EnumSet<TickType> type, Object... tickData) {
|
||||
tickStart = System.nanoTime();
|
||||
if(type.contains(TickType.SERVER)) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tickEnd(EnumSet<TickType> type, Object... tickData) {
|
||||
long tickDuration = System.nanoTime() - tickStart;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<TickType> ticks() {
|
||||
return EnumSet.of(TickType.SERVER, TickType.WORLD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
private static class Entry {
|
||||
|
||||
long atTimeMilli;
|
||||
long tickDurationNano;
|
||||
|
||||
Entry(long atTimeMilli, long tickDurationNano) {
|
||||
this.atTimeMilli = atTimeMilli;
|
||||
this.tickDurationNano = tickDurationNano;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -49,7 +49,7 @@ import crazypants.enderio.material.ItemIndustrialBinder;
|
||||
import crazypants.enderio.material.ItemYetaWrench;
|
||||
import crazypants.enderio.material.MaterialRecipes;
|
||||
|
||||
@Mod(name = "EnderIO", modid = "EnderIO", version = "0.1.13", dependencies = "required-after:Forge@[9.10.0.800,)")
|
||||
@Mod(name = "EnderIO", modid = "EnderIO", version = "0.1.14", dependencies = "required-after:Forge@[9.10.0.800,)")
|
||||
@NetworkMod(clientSideRequired = true, serverSideRequired = true, channels = { "EnderIO" }, packetHandler = PacketHandler.class)
|
||||
public class EnderIO {
|
||||
|
||||
|
||||
@@ -336,7 +336,7 @@ public class LiquidConduit extends AbstractConduit implements ILiquidConduit {
|
||||
}
|
||||
|
||||
private int pushLiquid(ForgeDirection from, int amount, boolean doPush, int token) {
|
||||
if (token == currentPushToken || amount <= 0 || tank.getFluid() == null) {
|
||||
if (token == currentPushToken || amount <= 0 || tank.getFluid() == null || tank.getFluid().getFluid() == null) {
|
||||
return 0;
|
||||
}
|
||||
currentPushToken = token;
|
||||
|
||||
@@ -46,8 +46,7 @@ public class ItemPowerConduit extends AbstractItemConduit {
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
super.addInformation(itemStack, par2EntityPlayer, list, par4);
|
||||
ICapacitor cap = PowerConduit.CAPACITORS[itemStack.getItemDamage()];
|
||||
list.add(String.format("I/O %d MJ/t", cap.getMaxEnergyExtracted()));
|
||||
list.add(String.format("Storage %d MJ", cap.getMaxEnergyStored()));
|
||||
list.add(String.format("Max Ouput %d MJ/t", cap.getMaxEnergyExtracted()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -29,9 +29,10 @@ public class NetworkPowerManager {
|
||||
private int inactiveTicks = 100;
|
||||
|
||||
private final List<ReceptorEntry> receptors = new ArrayList<PowerConduitNetwork.ReceptorEntry>();
|
||||
//private final List<ReceptorEntry> storageReceptors = new ArrayList<PowerConduitNetwork.ReceptorEntry>();
|
||||
private ListIterator<ReceptorEntry> receptorIterator = receptors.listIterator();
|
||||
|
||||
private final List<ReceptorEntry> storageReceptors = new ArrayList<ReceptorEntry>();
|
||||
|
||||
private boolean lastActiveValue = false;
|
||||
private int ticksWithNoPower = 0;
|
||||
|
||||
@@ -58,9 +59,9 @@ public class NetworkPowerManager {
|
||||
|
||||
public void applyRecievedPower() {
|
||||
|
||||
updateStorage();
|
||||
validateStorage();
|
||||
|
||||
float extracted = extractRecievedEnergy();
|
||||
float extracted = extractRecievedEnergy();
|
||||
addEnergy(extracted);
|
||||
checkReserves();
|
||||
float quantity = energyStored;
|
||||
@@ -88,7 +89,8 @@ public class NetworkPowerManager {
|
||||
|
||||
int appliedCount = 0;
|
||||
int numReceptors = receptors.size();
|
||||
int numEngines = 0;
|
||||
storageReceptors.clear();
|
||||
|
||||
while (quantity > 0 && appliedCount < numReceptors) {
|
||||
|
||||
if (!receptors.isEmpty() && !receptorIterator.hasNext()) {
|
||||
@@ -100,7 +102,10 @@ public class NetworkPowerManager {
|
||||
|
||||
PowerReceiver pp = r.powerReceptor.getPowerReceiver(r.direction);
|
||||
if (pp != null) {
|
||||
if (pp.getType() != Type.ENGINE) {
|
||||
if (pp.getType() == Type.STORAGE) {
|
||||
// only apply energy to these guys if there is any left over
|
||||
storageReceptors.add(r);
|
||||
} else if (pp.getType() != Type.ENGINE) {
|
||||
|
||||
float used = 0;
|
||||
float nonReservedPower = quantity - reserved;
|
||||
@@ -117,29 +122,47 @@ public class NetworkPowerManager {
|
||||
} else if (r.powerReceptor instanceof IInternalPowerReceptor) {
|
||||
used = PowerHandlerUtil.transmitInternal((IInternalPowerReceptor) r.powerReceptor, pp, canOffer, Type.PIPE, r.direction);
|
||||
} else {
|
||||
used = pp.receiveEnergy(Type.PIPE, Math.min(requested, canOffer), r.direction);
|
||||
float offer = Math.min(requested, canOffer);
|
||||
used = pp.receiveEnergy(Type.PIPE, offer, r.direction);
|
||||
}
|
||||
|
||||
}
|
||||
quantity -= used;
|
||||
|
||||
} else if (pp.getType() == Type.ENGINE && !(r.powerReceptor instanceof IInternalPowerReceptor)) {
|
||||
numEngines++;
|
||||
}
|
||||
|
||||
}
|
||||
if (quantity <= 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
appliedCount++;
|
||||
}
|
||||
float leaveForBlowingUpEngines = numEngines * 8;
|
||||
if (leaveForBlowingUpEngines > maxEnergyStored) {
|
||||
leaveForBlowingUpEngines = maxEnergyStored;
|
||||
|
||||
//send any energy left over to the storage
|
||||
if (quantity > 0 && !storageReceptors.isEmpty()) {
|
||||
for (ReceptorEntry r : storageReceptors) {
|
||||
PowerReceiver pp = r.powerReceptor.getPowerReceiver(r.direction);
|
||||
if (pp != null) {
|
||||
float used = 0;
|
||||
float available = quantity - reserved;
|
||||
//NB: We are using the max energy the the conduit can receive here rather than the amount they can output
|
||||
//as we always want to be able to give back as much as we received if we haven't used it or we will
|
||||
//leak energy
|
||||
float canOffer = Math.min(r.emmiter.getCapacitor().getMaxEnergyReceived(), available);
|
||||
float requested = pp.powerRequest();
|
||||
if (r.powerReceptor instanceof IInternalPowerReceptor) {
|
||||
used = PowerHandlerUtil.transmitInternal((IInternalPowerReceptor) r.powerReceptor, pp, canOffer, Type.PIPE, r.direction);
|
||||
} else {
|
||||
used = pp.receiveEnergy(Type.PIPE, Math.min(requested, canOffer), r.direction);
|
||||
}
|
||||
quantity -= used;
|
||||
}
|
||||
if (quantity <= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
energyStored = Math.min(quantity, maxEnergyStored - leaveForBlowingUpEngines);
|
||||
energyStored = quantity;
|
||||
updateConduitStorage();
|
||||
}
|
||||
|
||||
@@ -166,6 +189,7 @@ public class NetworkPowerManager {
|
||||
}
|
||||
|
||||
private void updateConduitStorage() {
|
||||
//TODO: Even this out or we end up with some blocked up conduits!!
|
||||
float energyLeft = energyStored;
|
||||
for (IPowerConduit con : network.getConduits()) {
|
||||
float give = con.getCapacitor().getMaxEnergyStored();
|
||||
@@ -181,7 +205,7 @@ public class NetworkPowerManager {
|
||||
return energyStored > 0;
|
||||
}
|
||||
|
||||
private void updateStorage() {
|
||||
private void validateStorage() {
|
||||
maxEnergyStored = 0;
|
||||
energyStored = 0;
|
||||
for (IPowerConduit con : network.getConduits()) {
|
||||
@@ -206,7 +230,7 @@ public class NetworkPowerManager {
|
||||
return extracted;
|
||||
}
|
||||
|
||||
public void receptorsChanged() {
|
||||
public void receptorsChanged() {
|
||||
receptors.clear();
|
||||
receptors.addAll(network.getPowerReceptors());
|
||||
receptorIterator = receptors.listIterator();
|
||||
|
||||
@@ -31,11 +31,11 @@ import crazypants.vecmath.Vector3d;
|
||||
public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
|
||||
static final Map<String, Icon> ICONS = new HashMap<String, Icon>();
|
||||
|
||||
|
||||
static final ICapacitor[] CAPACITORS = new BasicCapacitor[] {
|
||||
new BasicCapacitor(0, 64, 128, 0, 0, 0, 256),
|
||||
new BasicCapacitor(0, 128, 256, 0, 0, 0, 1024),
|
||||
new BasicCapacitor(0, 1024, 1024, 0, 0, 0, 2048)
|
||||
new BasicCapacitor(250, 1500, 128),
|
||||
new BasicCapacitor(350, 3000, 512),
|
||||
new BasicCapacitor(500, 5000, 2048)
|
||||
};
|
||||
|
||||
static final String[] POSTFIX = new String[] { "", "Enhanced", "Ender" };
|
||||
|
||||
@@ -16,6 +16,8 @@ import buildcraft.api.power.PowerHandler.PowerReceiver;
|
||||
import buildcraft.api.power.PowerHandler.Type;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
import crazypants.enderio.power.BasicCapacitor;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import crazypants.enderio.power.IInternalPowerReceptor;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
import crazypants.util.BlockCoord;
|
||||
@@ -34,6 +36,17 @@ public class TileEntityStirlingGenerator extends AbstractMachineEntity implement
|
||||
|
||||
public TileEntityStirlingGenerator() {
|
||||
super(1, Type.ENGINE);
|
||||
configurePowerHandler();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCapacitor(Capacitors capacitorType) {
|
||||
super.setCapacitor(capacitorType);
|
||||
configurePowerHandler();
|
||||
}
|
||||
|
||||
void configurePowerHandler() {
|
||||
powerHandler.configure(0, 0, 0, capacitorType.capacitor.getMaxEnergyStored());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -41,10 +41,10 @@ public class TileCapacitorBank extends TileEntity implements IInternalPowerRecep
|
||||
|
||||
private RedstoneControlMode inputControlMode;
|
||||
|
||||
private RedstoneControlMode outputControlMode;
|
||||
|
||||
private RedstoneControlMode outputControlMode;
|
||||
|
||||
private boolean outputEnabled;
|
||||
|
||||
|
||||
private boolean inputEnabled;
|
||||
|
||||
private final List<Receptor> receptors = new ArrayList<Receptor>();
|
||||
@@ -85,23 +85,29 @@ public class TileCapacitorBank extends TileEntity implements IInternalPowerRecep
|
||||
// do the required tick to keep BC API happy
|
||||
float stored = powerHandler.getEnergyStored();
|
||||
powerHandler.update();
|
||||
|
||||
// do a dummy recieve of power to force the updating of what is an isn't a
|
||||
// power source as we rely on this
|
||||
// to make sure we dont both send and recieve to the same source
|
||||
powerHandler.getPowerReceiver().receiveEnergy(Type.STORAGE, 1, null);
|
||||
|
||||
powerHandler.setEnergy(stored);
|
||||
|
||||
boolean requiresClientSync = false;
|
||||
|
||||
boolean hasSignal = isRecievingRedstoneSignal();
|
||||
if(inputControlMode == RedstoneControlMode.IGNORE) {
|
||||
if (inputControlMode == RedstoneControlMode.IGNORE) {
|
||||
inputEnabled = true;
|
||||
} else {
|
||||
inputEnabled = (inputControlMode == RedstoneControlMode.ON && hasSignal) || (inputControlMode == RedstoneControlMode.OFF && !hasSignal);
|
||||
inputEnabled = (inputControlMode == RedstoneControlMode.ON && hasSignal) || (inputControlMode == RedstoneControlMode.OFF && !hasSignal);
|
||||
}
|
||||
if(outputControlMode == RedstoneControlMode.IGNORE) {
|
||||
if (outputControlMode == RedstoneControlMode.IGNORE) {
|
||||
outputEnabled = true;
|
||||
} else {
|
||||
outputEnabled = (outputControlMode == RedstoneControlMode.ON && hasSignal) || (outputControlMode == RedstoneControlMode.OFF && !hasSignal);
|
||||
outputEnabled = (outputControlMode == RedstoneControlMode.ON && hasSignal) || (outputControlMode == RedstoneControlMode.OFF && !hasSignal);
|
||||
}
|
||||
|
||||
if(outputEnabled) {
|
||||
if (outputEnabled) {
|
||||
transmitEnergy();
|
||||
}
|
||||
|
||||
@@ -112,7 +118,7 @@ public class TileCapacitorBank extends TileEntity implements IInternalPowerRecep
|
||||
|
||||
if (requiresClientSync) {
|
||||
lastSyncPowerStored = storedEnergy;
|
||||
|
||||
|
||||
// this will cause 'getPacketDescription()' to be called and its result
|
||||
// will be sent to the PacketHandler on the other end of
|
||||
// client/server connection
|
||||
@@ -143,7 +149,7 @@ public class TileCapacitorBank extends TileEntity implements IInternalPowerRecep
|
||||
|
||||
Receptor receptor = receptorIterator.next();
|
||||
PowerReceiver pp = receptor.receptor.getPowerReceiver(receptor.fromDir);
|
||||
if (pp != null && pp.getMinEnergyReceived() <= canTransmit && pp.getType() != Type.ENGINE) {
|
||||
if (pp != null && pp.getMinEnergyReceived() <= canTransmit && pp.getType() != Type.ENGINE && !powerHandler.isPowerSource(receptor.fromDir)) {
|
||||
float used;
|
||||
if (receptor.receptor instanceof IInternalPowerReceptor) {
|
||||
// System.out.println("TileEntityStirlingGenerator.transmitEnergy: Sending "
|
||||
@@ -254,41 +260,41 @@ public class TileCapacitorBank extends TileEntity implements IInternalPowerRecep
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public RedstoneControlMode getInputControlMode() {
|
||||
return inputControlMode;
|
||||
}
|
||||
|
||||
public void setInputControlMode(RedstoneControlMode inputControlMode) {
|
||||
if(!isMultiblock()) {
|
||||
if (!isMultiblock()) {
|
||||
this.inputControlMode = inputControlMode;
|
||||
} else {
|
||||
for(BlockCoord bc : multiblock) {
|
||||
for (BlockCoord bc : multiblock) {
|
||||
TileCapacitorBank cp = getCapBank(bc);
|
||||
if(cp != null) {
|
||||
if (cp != null) {
|
||||
cp.inputControlMode = inputControlMode;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public RedstoneControlMode getOutputControlMode() {
|
||||
return outputControlMode;
|
||||
}
|
||||
|
||||
public void setOutputControlMode(RedstoneControlMode outputControlMode) {
|
||||
if(!isMultiblock()) {
|
||||
if (!isMultiblock()) {
|
||||
this.outputControlMode = outputControlMode;
|
||||
} else {
|
||||
for(BlockCoord bc : multiblock) {
|
||||
for (BlockCoord bc : multiblock) {
|
||||
TileCapacitorBank cp = getCapBank(bc);
|
||||
if(cp != null) {
|
||||
if (cp != null) {
|
||||
cp.outputControlMode = outputControlMode;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ------------ Multiblock implementations
|
||||
|
||||
|
||||
@@ -301,15 +307,15 @@ public class TileCapacitorBank extends TileEntity implements IInternalPowerRecep
|
||||
}
|
||||
|
||||
PowerHandler doGetPowerHandler() {
|
||||
if(inputEnabled) {
|
||||
if (inputEnabled) {
|
||||
return powerHandler;
|
||||
}
|
||||
}
|
||||
return getDisabledPowerHandler();
|
||||
}
|
||||
|
||||
private PowerHandler getDisabledPowerHandler() {
|
||||
if(disabledPowerHandler == null) {
|
||||
disabledPowerHandler = PowerHandlerUtil.createHandler(new BasicCapacitor(0,0), this, Type.STORAGE);
|
||||
if (disabledPowerHandler == null) {
|
||||
disabledPowerHandler = PowerHandlerUtil.createHandler(new BasicCapacitor(0, 0), this, Type.STORAGE);
|
||||
}
|
||||
return disabledPowerHandler;
|
||||
}
|
||||
@@ -349,7 +355,7 @@ public class TileCapacitorBank extends TileEntity implements IInternalPowerRecep
|
||||
|
||||
private void updatePowerHandler() {
|
||||
powerHandler = PowerHandlerUtil.createHandler(new BasicCapacitor(maxIO, maxStoredEnergy), this, Type.STORAGE);
|
||||
if(storedEnergy > maxStoredEnergy) {
|
||||
if (storedEnergy > maxStoredEnergy) {
|
||||
storedEnergy = maxStoredEnergy;
|
||||
}
|
||||
powerHandler.setEnergy(storedEnergy);
|
||||
|
||||
@@ -31,7 +31,7 @@ public class TileEntitySolarPanel extends TileEntity implements IInternalPowerRe
|
||||
private float energyPerTick = 1;
|
||||
|
||||
public TileEntitySolarPanel() {
|
||||
capacitor = new BasicCapacitor();
|
||||
capacitor = new BasicCapacitor(0,10,10000);
|
||||
powerHandler = PowerHandlerUtil.createHandler(capacitor, this, Type.ENGINE);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package crazypants.util;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.Timer;
|
||||
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
public class DebugGuiTPS extends JFrame {
|
||||
|
||||
public static void showTpsGUI() {
|
||||
DebugGuiTPS g = new DebugGuiTPS();
|
||||
g.setVisible(true);
|
||||
}
|
||||
|
||||
private static final DecimalFormat FORMAT = new DecimalFormat("########0.000");
|
||||
|
||||
|
||||
private JPanel contentPane = new JPanel();
|
||||
|
||||
private DebugGuiTPS() {
|
||||
Timer timer = new Timer(2000, new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
updateTps();
|
||||
}
|
||||
});
|
||||
timer.setRepeats(true);
|
||||
timer.start();
|
||||
|
||||
|
||||
|
||||
contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
|
||||
|
||||
setTitle("TPS");
|
||||
setLayout(new BorderLayout());
|
||||
add(contentPane, BorderLayout.CENTER);
|
||||
setSize(200, 120);
|
||||
}
|
||||
|
||||
private void updateTps() {
|
||||
|
||||
contentPane.removeAll();
|
||||
|
||||
MinecraftServer server = MinecraftServer.getServer();
|
||||
if(server == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String s = "Avg tick: " + FORMAT.format(average(server.tickTimeArray) * 1.0E-6D) + " ms";
|
||||
JLabel l = new JLabel(s);
|
||||
contentPane.add(l);
|
||||
|
||||
if (server.worldServers != null) {
|
||||
for (Integer id : DimensionManager.getIDs()) {
|
||||
s = "Lvl " + id + " tick: " + FORMAT.format(average(server.worldTickTimes.get(id)) * 1.0E-6D) + " ms";
|
||||
l = new JLabel(s);
|
||||
contentPane.add(l);
|
||||
}
|
||||
}
|
||||
revalidate();
|
||||
repaint();
|
||||
|
||||
}
|
||||
|
||||
private double average(long[] values) {
|
||||
long i = 0L;
|
||||
for (int j = 0; j < values.length; ++j) {
|
||||
i += values[j];
|
||||
}
|
||||
return (double) i / (double) values.length;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
"modid": "EnderIO",
|
||||
"name": "Ender IO",
|
||||
"description": "Compact conduits, painted things and access to your stuff through an eye of ender.",
|
||||
"version": "0.1.13",
|
||||
"version": "0.1.14",
|
||||
"mcversion": "1.6.2",
|
||||
"url": "http://www.minecraftforum.net/topic/1937619-162152-ender-io-how-many-pipes-in-one-block-updated-198/",
|
||||
"updateUrl": "",
|
||||
|
||||
Reference in new issue
Block a user