Code style fixes
This commit is contained in:
@@ -111,6 +111,7 @@ public class GuiGrid extends GuiBase {
|
|||||||
@Override
|
@Override
|
||||||
public void drawForeground(int mouseX, int mouseY) {
|
public void drawForeground(int mouseX, int mouseY) {
|
||||||
scrollbar.update(this, mouseX, mouseY);
|
scrollbar.update(this, mouseX, mouseY);
|
||||||
|
|
||||||
synchronized (grid.getController()) {
|
synchronized (grid.getController()) {
|
||||||
drawString(7, 7, t("gui.refinedstorage:grid"));
|
drawString(7, 7, t("gui.refinedstorage:grid"));
|
||||||
|
|
||||||
|
@@ -49,16 +49,6 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
|
|||||||
if (!worldObj.isRemote) {
|
if (!worldObj.isRemote) {
|
||||||
int lastEnergy = energy.getEnergyStored();
|
int lastEnergy = energy.getEnergyStored();
|
||||||
|
|
||||||
if(isActive())
|
|
||||||
switch (getType()) {
|
|
||||||
case NORMAL:
|
|
||||||
energy.extractEnergy(energyUsage, false);
|
|
||||||
break;
|
|
||||||
case CREATIVE:
|
|
||||||
energy.setEnergyStored(energy.getMaxEnergyStored());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ticks % 20 == 0) {
|
if (ticks % 20 == 0) {
|
||||||
if (!isActive()) {
|
if (!isActive()) {
|
||||||
disconnectAll();
|
disconnectAll();
|
||||||
@@ -108,13 +98,24 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
|
|||||||
energyUsage += machine.getEnergyUsage();
|
energyUsage += machine.getEnergyUsage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isActive()) {
|
||||||
|
switch (getType()) {
|
||||||
|
case NORMAL:
|
||||||
|
energy.extractEnergy(energyUsage, false);
|
||||||
|
break;
|
||||||
|
case CREATIVE:
|
||||||
|
energy.setEnergyStored(energy.getMaxEnergyStored());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (lastEnergy != energy.getEnergyStored()) {
|
if (lastEnergy != energy.getEnergyStored()) {
|
||||||
worldObj.updateComparatorOutputLevel(pos, RefinedStorageBlocks.CONTROLLER);
|
worldObj.updateComparatorOutputLevel(pos, RefinedStorageBlocks.CONTROLLER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public EnumControllerType getType() {
|
public EnumControllerType getType() {
|
||||||
if (worldObj.getBlockState(pos).getBlock() == RefinedStorageBlocks.CONTROLLER) {
|
if (worldObj.getBlockState(pos).getBlock() == RefinedStorageBlocks.CONTROLLER) {
|
||||||
|
@@ -5,8 +5,6 @@ import net.minecraft.inventory.IInventory;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import powercrystals.minefactoryreloaded.api.IDeepStorageUnit;
|
import powercrystals.minefactoryreloaded.api.IDeepStorageUnit;
|
||||||
import refinedstorage.RefinedStorage;
|
import refinedstorage.RefinedStorage;
|
||||||
import refinedstorage.inventory.InventorySimple;
|
import refinedstorage.inventory.InventorySimple;
|
||||||
@@ -163,7 +161,10 @@ public class TileExternalStorage extends TileMachine implements IStorageProvider
|
|||||||
}
|
}
|
||||||
|
|
||||||
public TileEntity getConnectedTile() {
|
public TileEntity getConnectedTile() {
|
||||||
if(worldObj == null) return null;
|
if (worldObj == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
TileEntity tile = worldObj.getTileEntity(pos.offset(getDirection()));
|
TileEntity tile = worldObj.getTileEntity(pos.offset(getDirection()));
|
||||||
|
|
||||||
if (tile instanceof IInventory || tile instanceof IDeepStorageUnit) {
|
if (tile instanceof IInventory || tile instanceof IDeepStorageUnit) {
|
||||||
|
@@ -42,7 +42,7 @@ public abstract class TileMachine extends TileBase implements INetworkTile, IRed
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
if(worldObj == null) {
|
if (worldObj == null) {
|
||||||
super.update();
|
super.update();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user