aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/metatileentity/implementations
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity/implementations')
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java21
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java132
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java5
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java23
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java87
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java6
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java228
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java70
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java180
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java96
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java100
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java38
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java10
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java6
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java12
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java11
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java76
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java32
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java52
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java121
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java4
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java563
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SpecialFilter.java120
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java12
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java10
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java3
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java7
27 files changed, 1277 insertions, 748 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
index e2e0b13f12..790d4d6c1f 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java
@@ -205,7 +205,9 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
@Override
public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
if (!isConnectedAtSide(aSide) && aSide != 6) return 0;
- if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide).letsEnergyIn()) return 0;
+ if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide)
+ .letsEnergyIn())
+ return 0;
final HashSet<TileEntity> nul = null;
return transferElectricity(aSide, aVoltage, aAmperage, nul);
}
@@ -245,9 +247,11 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
if (aBaseMetaTileEntity.isServerSide()) {
lastAmperage = new int[16];
- lastWorldTick = aBaseMetaTileEntity.getWorld().getTotalWorldTime() - 1; // sets initial value -1 since it is
- // in the same tick as first on post
- // tick
+ lastWorldTick = aBaseMetaTileEntity.getWorld()
+ .getTotalWorldTime()
+ - 1; // sets initial value -1 since it is
+ // in the same tick as first on post
+ // tick
}
}
@@ -546,8 +550,13 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
if ((tConn & (1 << ForgeDirection.WEST.ordinal())) != 0) tSide4 = 0f;
if ((tConn & (1 << ForgeDirection.EAST.ordinal())) != 0) tSide5 = 1f;
- return AxisAlignedBB
- .getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
+ return AxisAlignedBB.getBoundingBox(
+ aX + tSide4,
+ aY + tSide0,
+ aZ + tSide2,
+ aX + tSide5,
+ aY + tSide1,
+ aZ + tSide3);
}
@Override
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
index 29237218a1..a3e44640e8 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Fluid.java
@@ -263,7 +263,8 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
&& aEntity instanceof EntityLivingBase) {
for (FluidStack tFluid : mFluids) {
if (tFluid != null) {
- final int tTemperature = tFluid.getFluid().getTemperature(tFluid);
+ final int tTemperature = tFluid.getFluid()
+ .getTemperature(tFluid);
if (tTemperature > 320 && !isCoverOnSide(
(BaseMetaPipeEntity) getBaseMetaTileEntity(),
(EntityLivingBase) aEntity)) {
@@ -314,7 +315,8 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
final FluidStack tFluid = mFluids[index];
if (tFluid != null && tFluid.amount > 0) {
- final int tTemperature = tFluid.getFluid().getTemperature(tFluid);
+ final int tTemperature = tFluid.getFluid()
+ .getTemperature(tFluid);
if (tTemperature > mHeatResistance) {
if (aBaseMetaTileEntity.getRandomNumber(100) == 0) {
// Poof
@@ -341,21 +343,28 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
+ " DIMID: "
+ aBaseMetaTileEntity.getWorld().provider.dimensionId);
}
- if (!mGasProof && tFluid.getFluid().isGaseous(tFluid)) {
+ if (!mGasProof && tFluid.getFluid()
+ .isGaseous(tFluid)) {
tFluid.amount -= 5;
sendSound((byte) 9);
if (tTemperature > 320) {
try {
for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld()
- .getEntitiesWithinAABB(
- EntityLivingBase.class,
- AxisAlignedBB.getBoundingBox(
- getBaseMetaTileEntity().getXCoord() - 2,
- getBaseMetaTileEntity().getYCoord() - 2,
- getBaseMetaTileEntity().getZCoord() - 2,
- getBaseMetaTileEntity().getXCoord() + 3,
- getBaseMetaTileEntity().getYCoord() + 3,
- getBaseMetaTileEntity().getZCoord() + 3))) {
+ .getEntitiesWithinAABB(
+ EntityLivingBase.class,
+ AxisAlignedBB.getBoundingBox(
+ getBaseMetaTileEntity().getXCoord()
+ - 2,
+ getBaseMetaTileEntity().getYCoord()
+ - 2,
+ getBaseMetaTileEntity().getZCoord()
+ - 2,
+ getBaseMetaTileEntity().getXCoord()
+ + 3,
+ getBaseMetaTileEntity().getYCoord()
+ + 3,
+ getBaseMetaTileEntity().getZCoord()
+ + 3))) {
GT_Utility.applyHeatDamage(tLiving, (tTemperature - 300) / 25.0F);
}
} catch (Throwable e) {
@@ -364,15 +373,21 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
} else if (tTemperature < 260) {
try {
for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld()
- .getEntitiesWithinAABB(
- EntityLivingBase.class,
- AxisAlignedBB.getBoundingBox(
- getBaseMetaTileEntity().getXCoord() - 2,
- getBaseMetaTileEntity().getYCoord() - 2,
- getBaseMetaTileEntity().getZCoord() - 2,
- getBaseMetaTileEntity().getXCoord() + 3,
- getBaseMetaTileEntity().getYCoord() + 3,
- getBaseMetaTileEntity().getZCoord() + 3))) {
+ .getEntitiesWithinAABB(
+ EntityLivingBase.class,
+ AxisAlignedBB.getBoundingBox(
+ getBaseMetaTileEntity().getXCoord()
+ - 2,
+ getBaseMetaTileEntity().getYCoord()
+ - 2,
+ getBaseMetaTileEntity().getZCoord()
+ - 2,
+ getBaseMetaTileEntity().getXCoord()
+ + 3,
+ getBaseMetaTileEntity().getYCoord()
+ + 3,
+ getBaseMetaTileEntity().getZCoord()
+ + 3))) {
GT_Utility.applyFrostDamage(tLiving, (270 - tTemperature) / 12.5F);
}
} catch (Throwable e) {
@@ -402,8 +417,10 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
if (isConnectedAtSide(aSide) && tTank != null
&& (mLastReceivedFrom & (1 << aSide)) == 0
- && getBaseMetaTileEntity().getCoverInfoAtSide(aSide).letsFluidOut(tFluid.getFluid())
- && (gTank == null || gTank.getCoverInfoAtSide(tSide).letsFluidIn(tFluid.getFluid()))) {
+ && getBaseMetaTileEntity().getCoverInfoAtSide(aSide)
+ .letsFluidOut(tFluid.getFluid())
+ && (gTank == null || gTank.getCoverInfoAtSide(tSide)
+ .letsFluidIn(tFluid.getFluid()))) {
if (tTank.fill(ForgeDirection.getOrientation(tSide), tFluid, false) > 0) {
tTanks.add(new MutableTriple<>(tTank, ForgeDirection.getOrientation(tSide), 0));
}
@@ -435,8 +452,10 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
if (tEntry.right <= 0) continue;
- final int tFilledAmount = tEntry.left
- .fill(tEntry.middle, drainFromIndex(tEntry.right, false, index), false);
+ final int tFilledAmount = tEntry.left.fill(
+ tEntry.middle,
+ drainFromIndex(tEntry.right, false, index),
+ false);
if (tFilledAmount > 0) tEntry.left.fill(tEntry.middle, drainFromIndex(tFilledAmount, true, index), true);
@@ -510,7 +529,9 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
public boolean canConnect(byte aSide, TileEntity tTileEntity) {
if (tTileEntity == null) return false;
- final byte tSide = (byte) ForgeDirection.getOrientation(aSide).getOpposite().ordinal();
+ final byte tSide = (byte) ForgeDirection.getOrientation(aSide)
+ .getOpposite()
+ .ordinal();
final IGregTechTileEntity baseMetaTile = getBaseMetaTileEntity();
if (baseMetaTile == null) return false;
@@ -559,19 +580,19 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
if (aIndex == 9) {
GT_Utility.doSoundAtClient(SoundResource.RANDOM_FIZZ, 5, 1.0F, aX, aY, aZ);
- new ParticleEventBuilder().setIdentifier(ParticleFX.CLOUD).setWorld(getBaseMetaTileEntity().getWorld())
- .<ParticleEventBuilder>times(
- 6,
- (x, i) -> x
- .setMotion(
- ForgeDirection.getOrientation(i).offsetX / 5.0,
- ForgeDirection.getOrientation(i).offsetY / 5.0,
- ForgeDirection.getOrientation(i).offsetZ / 5.0)
- .setPosition(
- aX - 0.5 + XSTR_INSTANCE.nextFloat(),
- aY - 0.5 + XSTR_INSTANCE.nextFloat(),
- aZ - 0.5 + XSTR_INSTANCE.nextFloat())
- .run());
+ new ParticleEventBuilder().setIdentifier(ParticleFX.CLOUD)
+ .setWorld(getBaseMetaTileEntity().getWorld())
+ .<ParticleEventBuilder>times(
+ 6,
+ (x, i) -> x.setMotion(
+ ForgeDirection.getOrientation(i).offsetX / 5.0,
+ ForgeDirection.getOrientation(i).offsetY / 5.0,
+ ForgeDirection.getOrientation(i).offsetZ / 5.0)
+ .setPosition(
+ aX - 0.5 + XSTR_INSTANCE.nextFloat(),
+ aY - 0.5 + XSTR_INSTANCE.nextFloat(),
+ aZ - 0.5 + XSTR_INSTANCE.nextFloat())
+ .run());
}
}
@@ -625,16 +646,21 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
@Override
public final int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
- if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0;
+ if (aFluid == null || aFluid.getFluid()
+ .getID()
+ <= 0)
+ return 0;
int index = -1;
for (int i = 0; i < mPipeAmount; i++) {
if (mFluids[i] != null && mFluids[i].isFluidEqual(aFluid)) {
index = i;
break;
- } else if ((mFluids[i] == null || mFluids[i].getFluid().getID() <= 0) && index < 0) {
- index = i;
- }
+ } else if ((mFluids[i] == null || mFluids[i].getFluid()
+ .getID()
+ <= 0) && index < 0) {
+ index = i;
+ }
}
return fill_default_intoIndex(aSide, aFluid, doFill, index);
@@ -642,9 +668,14 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
private int fill_default_intoIndex(ForgeDirection aSide, FluidStack aFluid, boolean doFill, int index) {
if (index < 0 || index >= mPipeAmount) return 0;
- if (aFluid == null || aFluid.getFluid().getID() <= 0) return 0;
-
- if (mFluids[index] == null || mFluids[index].getFluid().getID() <= 0) {
+ if (aFluid == null || aFluid.getFluid()
+ .getID()
+ <= 0)
+ return 0;
+
+ if (mFluids[index] == null || mFluids[index].getFluid()
+ .getID()
+ <= 0) {
if (aFluid.amount * mPipeAmount <= getCapacity()) {
if (doFill) {
mFluids[index] = aFluid.copy();
@@ -811,8 +842,13 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
if ((tConn & (1 << ForgeDirection.WEST.ordinal())) != 0) tSide4 = 0f;
if ((tConn & (1 << ForgeDirection.EAST.ordinal())) != 0) tSide5 = 1f;
- return AxisAlignedBB
- .getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
+ return AxisAlignedBB.getBoundingBox(
+ aX + tSide4,
+ aY + tSide0,
+ aZ + tSide2,
+ aX + tSide5,
+ aY + tSide1,
+ aZ + tSide3);
}
@Override
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java
index e449921d1d..302155a186 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java
@@ -19,8 +19,9 @@ import gregtech.api.util.GT_OreDictUnificator;
public class GT_MetaPipeEntity_Frame extends MetaPipeEntity {
- private static final String localizedDescFormat = GT_LanguageManager
- .addStringLocalization("gt.blockmachines.gt_frame.desc.format", "Just something you can put covers on.");
+ private static final String localizedDescFormat = GT_LanguageManager.addStringLocalization(
+ "gt.blockmachines.gt_frame.desc.format",
+ "Just something you can put covers on.");
public final Materials mMaterial;
public GT_MetaPipeEntity_Frame(int aID, String aName, String aNameRegional, Materials aMaterial) {
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java
index 5d2211528b..9e55aa94c7 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java
@@ -228,10 +228,9 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
for (boolean temp = true; temp && !isInventoryEmpty() && pipeCapacityCheck();) {
temp = false;
tPipeList.clear();
- for (IMetaTileEntityItemPipe tTileEntity : GT_Utility
- .sortMapByValuesAcending(
- IMetaTileEntityItemPipe.Util.scanPipes(this, new HashMap<>(), 0, false, false))
- .keySet()) {
+ for (IMetaTileEntityItemPipe tTileEntity : GT_Utility.sortMapByValuesAcending(
+ IMetaTileEntityItemPipe.Util.scanPipes(this, new HashMap<>(), 0, false, false))
+ .keySet()) {
if (temp) break;
tPipeList.add(tTileEntity);
while (!temp && !isInventoryEmpty() && tTileEntity.sendItemStack(aBaseMetaTileEntity))
@@ -308,7 +307,9 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
: null;
if (gTileEntity != null) {
if (gTileEntity.getMetaTileEntity() == null) return false;
- if (gTileEntity.getMetaTileEntity().connectsToItemPipe(tSide)) return true;
+ if (gTileEntity.getMetaTileEntity()
+ .connectsToItemPipe(tSide))
+ return true;
connectable = true;
}
@@ -355,7 +356,8 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
@Override
public boolean insertItemStackIntoTileEntity(Object aSender, byte aSide) {
- if (getBaseMetaTileEntity().getCoverInfoAtSide(aSide).letsItemsOut(-1)) {
+ if (getBaseMetaTileEntity().getCoverInfoAtSide(aSide)
+ .letsItemsOut(-1)) {
final TileEntity tInventory = getBaseMetaTileEntity().getTileEntityAtSide(aSide);
if (tInventory != null && !(tInventory instanceof BaseMetaPipeEntity)) {
if ((!(tInventory instanceof TileEntityHopper) && !(tInventory instanceof TileEntityDispenser))
@@ -510,8 +512,13 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
if ((tConn & (1 << ForgeDirection.WEST.ordinal())) != 0) tSide4 = 0f;
if ((tConn & (1 << ForgeDirection.EAST.ordinal())) != 0) tSide5 = 1f;
- return AxisAlignedBB
- .getBoundingBox(aX + tSide4, aY + tSide0, aZ + tSide2, aX + tSide5, aY + tSide1, aZ + tSide3);
+ return AxisAlignedBB.getBoundingBox(
+ aX + tSide4,
+ aY + tSide0,
+ aZ + tSide2,
+ aX + tSide5,
+ aY + tSide1,
+ aZ + tSide3);
}
@Override
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java
index 7eb396a293..7b2a4fa232 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java
@@ -237,7 +237,8 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
@Override
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- if (GT_ModHandler.isElectricItem(aStack) && aStack.getUnlocalizedName().startsWith("gt.metaitem.01.")) {
+ if (GT_ModHandler.isElectricItem(aStack) && aStack.getUnlocalizedName()
+ .startsWith("gt.metaitem.01.")) {
String name = aStack.getUnlocalizedName();
if (name.equals("gt.metaitem.01.32510") || name.equals("gt.metaitem.01.32511")
|| name.equals("gt.metaitem.01.32520")
@@ -383,47 +384,67 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
switch (mInventory.length) {
case 4:
builder.widget(
- SlotGroup.ofItemHandler(inventoryHandler, 2).startFromSlot(0).endAtSlot(3)
- .slotCreator(index -> new BaseSlot(inventoryHandler, index) {
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
- }).background(getGUITextureSet().getItemSlot()).build().setPos(70, 25));
+ SlotGroup.ofItemHandler(inventoryHandler, 2)
+ .startFromSlot(0)
+ .endAtSlot(3)
+ .slotCreator(index -> new BaseSlot(inventoryHandler, index) {
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+ })
+ .background(getGUITextureSet().getItemSlot())
+ .build()
+ .setPos(70, 25));
break;
case 9:
builder.widget(
- SlotGroup.ofItemHandler(inventoryHandler, 3).startFromSlot(0).endAtSlot(8)
- .slotCreator(index -> new BaseSlot(inventoryHandler, index) {
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
- }).background(getGUITextureSet().getItemSlot()).build().setPos(61, 16));
+ SlotGroup.ofItemHandler(inventoryHandler, 3)
+ .startFromSlot(0)
+ .endAtSlot(8)
+ .slotCreator(index -> new BaseSlot(inventoryHandler, index) {
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+ })
+ .background(getGUITextureSet().getItemSlot())
+ .build()
+ .setPos(61, 16));
break;
case 16:
builder.widget(
- SlotGroup.ofItemHandler(inventoryHandler, 4).startFromSlot(0).endAtSlot(15)
- .slotCreator(index -> new BaseSlot(inventoryHandler, index) {
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
- }).background(getGUITextureSet().getItemSlot()).build().setPos(52, 7));
+ SlotGroup.ofItemHandler(inventoryHandler, 4)
+ .startFromSlot(0)
+ .endAtSlot(15)
+ .slotCreator(index -> new BaseSlot(inventoryHandler, index) {
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+ })
+ .background(getGUITextureSet().getItemSlot())
+ .build()
+ .setPos(52, 7));
break;
default:
builder.widget(
- SlotGroup.ofItemHandler(inventoryHandler, 1).startFromSlot(0).endAtSlot(0)
- .slotCreator(index -> new BaseSlot(inventoryHandler, index) {
-
- @Override
- public int getSlotStackLimit() {
- return 1;
- }
- }).background(getGUITextureSet().getItemSlot()).build().setPos(79, 34));
+ SlotGroup.ofItemHandler(inventoryHandler, 1)
+ .startFromSlot(0)
+ .endAtSlot(0)
+ .slotCreator(index -> new BaseSlot(inventoryHandler, index) {
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+ })
+ .background(getGUITextureSet().getItemSlot())
+ .build()
+ .setPos(79, 34));
break;
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java
index 669b3c9495..a71b94b916 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java
@@ -278,8 +278,10 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
// solid...
!(stack.getItem() instanceof IFluidHandler) && // when the item is a fluid handler its not a
// solid...
- !stack.getItem().getUnlocalizedName().contains("bucket"); // since we cant really check for
- // buckets...
+ !stack.getItem()
+ .getUnlocalizedName()
+ .contains("bucket"); // since we cant really check for
+ // buckets...
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java
index 7ff173615a..78fc68ee81 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java
@@ -503,8 +503,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
public void initDefaultModes(NBTTagCompound aNBT) {
mMainFacing = -1;
if (!getBaseMetaTileEntity().getWorld().isRemote) {
- GT_ClientPreference tPreference = GT_Mod.gregtechproxy
- .getClientPreference(getBaseMetaTileEntity().getOwnerUuid());
+ GT_ClientPreference tPreference = GT_Mod.gregtechproxy.getClientPreference(
+ getBaseMetaTileEntity().getOwnerUuid());
if (tPreference != null) {
mDisableFilter = !tPreference.isSingleBlockInitialFilterEnabled();
mDisableMultiStack = !tPreference.isSingleBlockInitialMultiStackEnabled();
@@ -569,8 +569,9 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
if (mProgresstime < 0 || drainEnergyForProcess(mEUt)) {
if (++mProgresstime >= mMaxProgresstime) {
for (int i = 0; i < mOutputItems.length; i++)
- for (int j = 0; j < mOutputItems.length; j++) if (aBaseMetaTileEntity
- .addStackToSlot(getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i]))
+ for (int j = 0; j < mOutputItems.length; j++) if (aBaseMetaTileEntity.addStackToSlot(
+ getOutputSlot() + ((j + i) % mOutputItems.length),
+ mOutputItems[i]))
break;
if (mOutputFluid != null)
if (getDrainableStack() == null) setDrainableStack(mOutputFluid.copy());
@@ -731,8 +732,10 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
if (ItemList.Display_Fluid.isStackEqual(mInventory[tDisplayStackSlot], true, true))
mInventory[tDisplayStackSlot] = null;
} else {
- mInventory[tDisplayStackSlot] = GT_Utility
- .getFluidDisplayStack(getFillableStack(), true, !displaysStackSize());
+ mInventory[tDisplayStackSlot] = GT_Utility.getFluidDisplayStack(
+ getFillableStack(),
+ true,
+ !displaysStackSize());
}
}
}
@@ -1058,11 +1061,26 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
public static boolean isValidForLowGravity(GT_Recipe tRecipe, int dimId) {
return // TODO check or get a better solution
- DimensionManager.getProvider(dimId).getClass().getName().contains("Orbit")
- || DimensionManager.getProvider(dimId).getClass().getName().endsWith("Space")
- || DimensionManager.getProvider(dimId).getClass().getName().endsWith("Asteroids")
- || DimensionManager.getProvider(dimId).getClass().getName().endsWith("SS")
- || DimensionManager.getProvider(dimId).getClass().getName().contains("SpaceStation");
+ DimensionManager.getProvider(dimId)
+ .getClass()
+ .getName()
+ .contains("Orbit")
+ || DimensionManager.getProvider(dimId)
+ .getClass()
+ .getName()
+ .endsWith("Space")
+ || DimensionManager.getProvider(dimId)
+ .getClass()
+ .getName()
+ .endsWith("Asteroids")
+ || DimensionManager.getProvider(dimId)
+ .getClass()
+ .getName()
+ .endsWith("SS")
+ || DimensionManager.getProvider(dimId)
+ .getClass()
+ .getName()
+ .contains("SpaceStation");
}
/**
@@ -1213,12 +1231,14 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
currenttip.add(
String.format(
"Machine Facing: %s",
- ForgeDirection.getOrientation(tag.getInteger("mainFacingSingleBlock")).name()));
+ ForgeDirection.getOrientation(tag.getInteger("mainFacingSingleBlock"))
+ .name()));
currenttip.add(
String.format(
"Output Facing: %s",
- ForgeDirection.getOrientation(tag.getInteger("outputFacingSingleBlock")).name()));
+ ForgeDirection.getOrientation(tag.getInteger("outputFacingSingleBlock"))
+ .name()));
}
@Override
@@ -1267,8 +1287,9 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
getRecipeList().addGregTechLogoUI(builder, new Pos2d(0, 0));
} else {
builder.widget(
- new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17)
- .setPos(152, 63));
+ new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo())
+ .setSize(17, 17)
+ .setPos(152, 63));
}
}
@@ -1331,7 +1352,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
*/
protected SlotWidget createItemInputSlot(int index, IDrawable[] backgrounds, Pos2d pos) {
return (SlotWidget) new SlotWidget(inventoryHandler, getInputSlot() + index).setAccess(true, true)
- .setBackground(backgrounds).setPos(pos);
+ .setBackground(backgrounds)
+ .setPos(pos);
}
/**
@@ -1339,7 +1361,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
*/
protected SlotWidget createItemOutputSlot(int index, IDrawable[] backgrounds, Pos2d pos) {
return (SlotWidget) new SlotWidget(inventoryHandler, getOutputSlot() + index).setAccess(true, false)
- .setBackground(backgrounds).setPos(pos);
+ .setBackground(backgrounds)
+ .setPos(pos);
}
/**
@@ -1347,46 +1370,71 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
*/
protected SlotWidget createSpecialSlot(IDrawable[] backgrounds, Pos2d pos) {
return (SlotWidget) new SlotWidget(inventoryHandler, getSpecialSlotIndex()).setAccess(true, true)
- .disableShiftInsert()
- .setGTTooltip(
- () -> mTooltipCache.getData(
- getRecipeList() != null && getRecipeList().usesSpecialSlot() ? SPECIAL_SLOT_TOOLTIP
- : UNUSED_SLOT_TOOLTIP))
- .setTooltipShowUpDelay(TOOLTIP_DELAY).setBackground(backgrounds).setPos(pos);
+ .disableShiftInsert()
+ .setGTTooltip(
+ () -> mTooltipCache.getData(
+ getRecipeList()
+ != null
+ && getRecipeList().usesSpecialSlot()
+ ? SPECIAL_SLOT_TOOLTIP
+ : UNUSED_SLOT_TOOLTIP))
+ .setTooltipShowUpDelay(TOOLTIP_DELAY)
+ .setBackground(backgrounds)
+ .setPos(pos);
}
protected FluidDisplaySlotWidget createFluidInputSlot(IDrawable[] backgrounds, Pos2d pos) {
return (FluidDisplaySlotWidget) new FluidDisplaySlotWidget(
inventoryHandler,
OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length)
- .setFluidAccessConstructor(() -> constructFluidAccess(true)).setIHasFluidDisplay(this)
- .setCanDrain(true).setCanFill(true).setActionRealClick(FluidDisplaySlotWidget.Action.TRANSFER)
- .setBeforeRealClick((clickData, widget) -> {
- if (NetworkUtils.isClient()) {
- // propagate display item content to actual fluid stored in this tank
- setFillableStack(GT_Utility.getFluidFromDisplayStack(widget.getMcSlot().getStack()));
- }
- return true;
- }).setUpdateFluidDisplayItem(this::updateFluidInputDisplayItem)
- .setGTTooltip(
- () -> mTooltipCache
- .getData(FLUID_INPUT_TOOLTIP, GT_Utility.formatNumbers(getCapacity())))
- .setTooltipShowUpDelay(TOOLTIP_DELAY).setBackground(backgrounds).setPos(pos);
+ .setFluidAccessConstructor(
+ () -> constructFluidAccess(true))
+ .setIHasFluidDisplay(this)
+ .setCanDrain(true)
+ .setCanFill(true)
+ .setActionRealClick(
+ FluidDisplaySlotWidget.Action.TRANSFER)
+ .setBeforeRealClick((clickData, widget) -> {
+ if (NetworkUtils.isClient()) {
+ // propagate display item content to
+ // actual fluid stored in this tank
+ setFillableStack(
+ GT_Utility.getFluidFromDisplayStack(
+ widget.getMcSlot()
+ .getStack()));
+ }
+ return true;
+ })
+ .setUpdateFluidDisplayItem(
+ this::updateFluidInputDisplayItem)
+ .setGTTooltip(
+ () -> mTooltipCache.getData(
+ FLUID_INPUT_TOOLTIP,
+ GT_Utility.formatNumbers(
+ getCapacity())))
+ .setTooltipShowUpDelay(TOOLTIP_DELAY)
+ .setBackground(backgrounds)
+ .setPos(pos);
}
protected FluidDisplaySlotWidget createFluidOutputSlot(IDrawable[] backgrounds, Pos2d pos) {
- return (FluidDisplaySlotWidget) createDrainableFluidSlot()
- .setUpdateFluidDisplayItem(this::updateFluidOutputDisplayItem)
- .setGTTooltip(
- () -> mTooltipCache.getData(FLUID_OUTPUT_TOOLTIP, GT_Utility.formatNumbers(getCapacity())))
- .setTooltipShowUpDelay(TOOLTIP_DELAY).setBackground(backgrounds).setPos(pos);
+ return (FluidDisplaySlotWidget) createDrainableFluidSlot().setUpdateFluidDisplayItem(
+ this::updateFluidOutputDisplayItem)
+ .setGTTooltip(
+ () -> mTooltipCache.getData(
+ FLUID_OUTPUT_TOOLTIP,
+ GT_Utility.formatNumbers(
+ getCapacity())))
+ .setTooltipShowUpDelay(TOOLTIP_DELAY)
+ .setBackground(backgrounds)
+ .setPos(pos);
}
@Override
protected SlotWidget createChargerSlot(int x, int y) {
if (isSteampowered()) {
- return (SlotWidget) createChargerSlot(x, y, UNUSED_SLOT_TOOLTIP, new String[0])
- .setBackground(getGUITextureSet().getItemSlot());
+ return (SlotWidget) createChargerSlot(x, y, UNUSED_SLOT_TOOLTIP, new String[0]).setBackground(
+ getGUITextureSet().getItemSlot());
} else {
return super.createChargerSlot(x, y);
}
@@ -1394,25 +1442,36 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
protected CycleButtonWidget createItemAutoOutputButton() {
return (CycleButtonWidget) new CycleButtonWidget().setToggle(() -> mItemTransfer, val -> mItemTransfer = val)
- .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_ITEM)
- .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE)
- .setGTTooltip(() -> mTooltipCache.getData(ITEM_TRANSFER_TOOLTIP)).setTooltipShowUpDelay(TOOLTIP_DELAY)
- .setPos(25, 62).setSize(18, 18);
+ .setStaticTexture(
+ GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_ITEM)
+ .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE)
+ .setGTTooltip(
+ () -> mTooltipCache.getData(ITEM_TRANSFER_TOOLTIP))
+ .setTooltipShowUpDelay(TOOLTIP_DELAY)
+ .setPos(25, 62)
+ .setSize(18, 18);
}
protected CycleButtonWidget createFluidAutoOutputButton() {
return (CycleButtonWidget) new CycleButtonWidget().setToggle(() -> mFluidTransfer, val -> mFluidTransfer = val)
- .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_FLUID)
- .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE)
- .setGTTooltip(() -> mTooltipCache.getData(FLUID_TRANSFER_TOOLTIP)).setTooltipShowUpDelay(TOOLTIP_DELAY)
- .setPos(7, 62).setSize(18, 18);
+ .setStaticTexture(
+ GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_FLUID)
+ .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE)
+ .setGTTooltip(
+ () -> mTooltipCache.getData(FLUID_TRANSFER_TOOLTIP))
+ .setTooltipShowUpDelay(TOOLTIP_DELAY)
+ .setPos(7, 62)
+ .setSize(18, 18);
}
protected ProgressBar createProgressBar(UITexture texture, int imageSize, ProgressBar.Direction direction,
Pos2d pos, Size size) {
final ProgressBar ret = new ProgressBar();
ret.setProgress(() -> maxProgresstime() != 0 ? (float) getProgresstime() / maxProgresstime() : 0)
- .setTexture(texture, imageSize).setDirection(direction).setPos(pos).setSize(size);
+ .setTexture(texture, imageSize)
+ .setDirection(direction)
+ .setPos(pos)
+ .setSize(size);
return ret;
}
@@ -1425,11 +1484,13 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
final Power powerInfo = getPower();
final String transferRectTooltip;
if (isSteampowered()) {
- transferRectTooltip = StatCollector
- .translateToLocalFormatted(NEI_TRANSFER_STEAM_TOOLTIP, powerInfo.getTierString());
+ transferRectTooltip = StatCollector.translateToLocalFormatted(
+ NEI_TRANSFER_STEAM_TOOLTIP,
+ powerInfo.getTierString());
} else {
- transferRectTooltip = StatCollector
- .translateToLocalFormatted(NEI_TRANSFER_VOLTAGE_TOOLTIP, powerInfo.getTierString());
+ transferRectTooltip = StatCollector.translateToLocalFormatted(
+ NEI_TRANSFER_VOLTAGE_TOOLTIP,
+ powerInfo.getTierString());
}
widget.setNEITransferRect(transferRectID, new Object[] { powerInfo }, transferRectTooltip);
}
@@ -1440,34 +1501,53 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
if (isSteampowered()) {
for (Pair<SteamTexture, Pair<Size, Pos2d>> specialTexture : getRecipeList().specialTexturesSteam) {
builder.widget(
- new DrawableWidget().setDrawable(specialTexture.getLeft().get(getSteamVariant()))
- .setSize(specialTexture.getRight().getLeft())
- .setPos(specialTexture.getRight().getRight()));
+ new DrawableWidget().setDrawable(
+ specialTexture.getLeft()
+ .get(getSteamVariant()))
+ .setSize(
+ specialTexture.getRight()
+ .getLeft())
+ .setPos(
+ specialTexture.getRight()
+ .getRight()));
}
} else {
for (Pair<IDrawable, Pair<Size, Pos2d>> specialTexture : getRecipeList().specialTextures) {
builder.widget(
new DrawableWidget().setDrawable(specialTexture.getLeft())
- .setSize(specialTexture.getRight().getLeft())
- .setPos(specialTexture.getRight().getRight()));
+ .setSize(
+ specialTexture.getRight()
+ .getLeft())
+ .setPos(
+ specialTexture.getRight()
+ .getRight()));
}
}
}
protected DrawableWidget createErrorStatusArea(ModularWindow.Builder builder, IDrawable picture) {
- return (DrawableWidget) new DrawableWidget().setDrawable(picture).setTooltipShowUpDelay(TOOLTIP_DELAY)
- .setEnabled(widget -> !widget.getTooltip().isEmpty()).dynamicTooltip(this::getErrorDescriptions)
- .dynamicTooltipShift(this::getErrorDescriptionsShift).setPos(79, 44).setSize(18, 18)
- .attachSyncer(
- new FakeSyncWidget.BooleanSyncer(() -> mStuttering, val -> mStuttering = val),
- builder,
- (widget, val) -> widget.notifyTooltipChange())
- .attachSyncer(
- new FakeSyncWidget.IntegerSyncer(
- () -> getBaseMetaTileEntity().getErrorDisplayID(),
- val -> getBaseMetaTileEntity().setErrorDisplayID(val)),
- builder,
- (widget, val) -> widget.notifyTooltipChange());
+ return (DrawableWidget) new DrawableWidget().setDrawable(picture)
+ .setTooltipShowUpDelay(TOOLTIP_DELAY)
+ .setEnabled(
+ widget -> !widget.getTooltip()
+ .isEmpty())
+ .dynamicTooltip(this::getErrorDescriptions)
+ .dynamicTooltipShift(this::getErrorDescriptionsShift)
+ .setPos(79, 44)
+ .setSize(18, 18)
+ .attachSyncer(
+ new FakeSyncWidget.BooleanSyncer(
+ () -> mStuttering,
+ val -> mStuttering = val),
+ builder,
+ (widget, val) -> widget.notifyTooltipChange())
+ .attachSyncer(
+ new FakeSyncWidget.IntegerSyncer(
+ () -> getBaseMetaTileEntity().getErrorDisplayID(),
+ val -> getBaseMetaTileEntity().setErrorDisplayID(
+ val)),
+ builder,
+ (widget, val) -> widget.notifyTooltipChange());
}
protected List<String> getErrorDescriptions() {
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java
index 4098831e48..934554dfbc 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java
@@ -174,18 +174,30 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE
mNeedsSteamVenting = false;
try {
for (EntityLivingBase tLiving : (ArrayList<EntityLivingBase>) getBaseMetaTileEntity().getWorld()
- .getEntitiesWithinAABB(
- EntityLivingBase.class,
- AxisAlignedBB.getBoundingBox(
- getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1),
- getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1),
- getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1),
- getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 1)
- + 1,
- getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 1)
- + 1,
- getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 1)
- + 1))) {
+ .getEntitiesWithinAABB(
+ EntityLivingBase.class,
+ AxisAlignedBB.getBoundingBox(
+ getBaseMetaTileEntity().getOffsetX(
+ getBaseMetaTileEntity().getFrontFacing(),
+ 1),
+ getBaseMetaTileEntity().getOffsetY(
+ getBaseMetaTileEntity().getFrontFacing(),
+ 1),
+ getBaseMetaTileEntity().getOffsetZ(
+ getBaseMetaTileEntity().getFrontFacing(),
+ 1),
+ getBaseMetaTileEntity().getOffsetX(
+ getBaseMetaTileEntity().getFrontFacing(),
+ 1)
+ + 1,
+ getBaseMetaTileEntity().getOffsetY(
+ getBaseMetaTileEntity().getFrontFacing(),
+ 1)
+ + 1,
+ getBaseMetaTileEntity().getOffsetZ(
+ getBaseMetaTileEntity().getFrontFacing(),
+ 1)
+ + 1))) {
GT_Utility.applyHeatDamage(tLiving, getSteamDamage());
}
} catch (Throwable e) {
@@ -230,17 +242,22 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE
if (aIndex == 9) {
GT_Utility.doSoundAtClient(SoundResource.RANDOM_FIZZ, 5, 1.0F, aX, aY, aZ);
- new ParticleEventBuilder().setIdentifier(ParticleFX.CLOUD).setWorld(getBaseMetaTileEntity().getWorld())
- .setMotion(
- ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetX / 5.0,
- ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetY / 5.0,
- ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetZ / 5.0)
- .<ParticleEventBuilder>times(
- 8,
- x -> x.setPosition(
- aX - 0.5 + XSTR_INSTANCE.nextFloat(),
- aY - 0.5 + XSTR_INSTANCE.nextFloat(),
- aZ - 0.5 + XSTR_INSTANCE.nextFloat()).run());
+ new ParticleEventBuilder().setIdentifier(ParticleFX.CLOUD)
+ .setWorld(getBaseMetaTileEntity().getWorld())
+ .setMotion(
+ ForgeDirection.getOrientation(
+ getBaseMetaTileEntity().getFrontFacing()).offsetX / 5.0,
+ ForgeDirection.getOrientation(
+ getBaseMetaTileEntity().getFrontFacing()).offsetY / 5.0,
+ ForgeDirection.getOrientation(
+ getBaseMetaTileEntity().getFrontFacing()).offsetZ / 5.0)
+ .<ParticleEventBuilder>times(
+ 8,
+ x -> x.setPosition(
+ aX - 0.5 + XSTR_INSTANCE.nextFloat(),
+ aY - 0.5 + XSTR_INSTANCE.nextFloat(),
+ aZ - 0.5 + XSTR_INSTANCE.nextFloat())
+ .run());
}
}
@@ -251,7 +268,8 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE
@Override
public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
- return GregTech_API.getCoverBehaviorNew(aCoverID.toStack()).isSimpleCover()
+ return GregTech_API.getCoverBehaviorNew(aCoverID.toStack())
+ .isSimpleCover()
&& super.allowCoverOnSide(aSide, aCoverID);
}
@@ -370,7 +388,9 @@ public abstract class GT_MetaTileEntity_BasicMachine_Bronze extends GT_MetaTileE
@Override
public void addGregTechLogo(ModularWindow.Builder builder) {
builder.widget(
- new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17).setPos(152, 63));
+ new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo())
+ .setSize(17, 17)
+ .setPos(152, 63));
}
@Override
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java
index e51da3bbdc..5331f67dca 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java
@@ -81,84 +81,92 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
"basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
+ "/OVERLAY_SIDE_ACTIVE")),
TextureFactory.builder()
- .addIcon(
- (new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_SIDE_ACTIVE_GLOW")))
- .glow().build()),
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
+ + "/OVERLAY_SIDE_ACTIVE_GLOW")))
+ .glow()
+ .build()),
TextureFactory.of(
TextureFactory.of(
new CustomIcon(
"basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE")),
TextureFactory.builder()
- .addIcon(
- (new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_SIDE_GLOW")))
- .glow().build()),
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
+ + "/OVERLAY_SIDE_GLOW")))
+ .glow()
+ .build()),
TextureFactory.of(
TextureFactory.of(
new CustomIcon(
"basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
+ "/OVERLAY_FRONT_ACTIVE")),
TextureFactory.builder()
- .addIcon(
- (new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_FRONT_ACTIVE_GLOW")))
- .glow().build()),
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
+ + "/OVERLAY_FRONT_ACTIVE_GLOW")))
+ .glow()
+ .build()),
TextureFactory.of(
TextureFactory.of(
new CustomIcon(
"basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT")),
TextureFactory.builder()
- .addIcon(
- (new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_FRONT_GLOW")))
- .glow().build()),
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
+ + "/OVERLAY_FRONT_GLOW")))
+ .glow()
+ .build()),
TextureFactory.of(
TextureFactory.of(
new CustomIcon(
"basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
+ "/OVERLAY_TOP_ACTIVE")),
TextureFactory.builder()
- .addIcon(
- (new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_TOP_ACTIVE_GLOW")))
- .glow().build()),
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
+ + "/OVERLAY_TOP_ACTIVE_GLOW")))
+ .glow()
+ .build()),
TextureFactory.of(
TextureFactory.of(
new CustomIcon(
"basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP")),
TextureFactory.builder()
- .addIcon(
- (new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_TOP_GLOW")))
- .glow().build()),
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
+ + "/OVERLAY_TOP_GLOW")))
+ .glow()
+ .build()),
TextureFactory.of(
TextureFactory.of(
new CustomIcon(
"basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
+ "/OVERLAY_BOTTOM_ACTIVE")),
TextureFactory.builder()
- .addIcon(
- (new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_BOTTOM_ACTIVE_GLOW")))
- .glow().build()),
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
+ + "/OVERLAY_BOTTOM_ACTIVE_GLOW")))
+ .glow()
+ .build()),
TextureFactory.of(
TextureFactory.of(
new CustomIcon(
"basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM")),
TextureFactory.builder()
- .addIcon(
- (new CustomIcon(
- "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
- + "/OVERLAY_BOTTOM_GLOW")))
- .glow().build()));
+ .addIcon(
+ (new CustomIcon(
+ "basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH)
+ + "/OVERLAY_BOTTOM_GLOW")))
+ .glow()
+ .build()));
this.mSharedTank = aSharedTank;
this.mTankCapacity = aTankCapacity;
this.mSpecialEffect = aSpecialEffect;
@@ -1058,23 +1066,11 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
case 0:
return false;
case 1:
- if (this.getFillableStack() == null)
- return !this.mRequiresFluidForFiltering && this.getRecipeList().containsInput(aStack);
- else return this.getRecipeList().findRecipe(
- this.getBaseMetaTileEntity(),
- this.mLastRecipe,
- true,
- true,
- V[this.mTier],
- new FluidStack[] { this.getFillableStack() },
- this.getSpecialSlot(),
- appendSelectedCircuit(aStack)) != null;
- case 2:
- return (!this.mRequiresFluidForFiltering || this.getFillableStack() != null) && (((this.getInputAt(0)
- != null && this.getInputAt(1) != null)
- || (this.getInputAt(0) == null && this.getInputAt(1) == null
- ? this.getRecipeList().containsInput(aStack)
- : (this.getRecipeList().containsInput(aStack) && this.getRecipeList().findRecipe(
+ if (this.getFillableStack() == null) return !this.mRequiresFluidForFiltering && this.getRecipeList()
+ .containsInput(
+ aStack);
+ else return this.getRecipeList()
+ .findRecipe(
this.getBaseMetaTileEntity(),
this.mLastRecipe,
true,
@@ -1082,12 +1078,31 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
V[this.mTier],
new FluidStack[] { this.getFillableStack() },
this.getSpecialSlot(),
- aIndex == this.getInputSlot()
- ? appendSelectedCircuit(aStack, this.getInputAt(1))
- : appendSelectedCircuit(this.getInputAt(0), aStack))
- != null))));
+ appendSelectedCircuit(aStack))
+ != null;
+ case 2:
+ return (!this.mRequiresFluidForFiltering || this.getFillableStack() != null) && (((this.getInputAt(0)
+ != null && this.getInputAt(1) != null)
+ || (this.getInputAt(0) == null && this.getInputAt(1) == null ? this.getRecipeList()
+ .containsInput(aStack)
+ : (this.getRecipeList()
+ .containsInput(aStack)
+ && this.getRecipeList()
+ .findRecipe(
+ this.getBaseMetaTileEntity(),
+ this.mLastRecipe,
+ true,
+ true,
+ V[this.mTier],
+ new FluidStack[] { this.getFillableStack() },
+ this.getSpecialSlot(),
+ aIndex == this.getInputSlot()
+ ? appendSelectedCircuit(aStack, this.getInputAt(1))
+ : appendSelectedCircuit(this.getInputAt(0), aStack))
+ != null))));
default: {
- int tID = this.getBaseMetaTileEntity().getMetaTileID();
+ int tID = this.getBaseMetaTileEntity()
+ .getMetaTileID();
if (tID >= 211 && tID <= 218 || tID >= 1180 && tID <= 1187 || tID >= 10780 && tID <= 10786) { // assembler
// lv-iv;
// circuit
@@ -1097,10 +1112,13 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
// assemblers
// luv-uev
if (GT_Utility.isStackValid(aStack)) for (int oreID : OreDictionary.getOreIDs(aStack)) {
- if (OreDictionary.getOreName(oreID).startsWith("circuit")) return true;
+ if (OreDictionary.getOreName(oreID)
+ .startsWith("circuit"))
+ return true;
}
}
- return this.getRecipeList().containsInput(aStack);
+ return this.getRecipeList()
+ .containsInput(aStack);
}
}
}
@@ -1124,12 +1142,22 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
&& !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) {
new WorldSpawnedEventBuilder.ParticleEventBuilder().setMotion(0.0D, 0.0D, 0.0D)
- .setIdentifier(ParticleFX.SMOKE)
- .setPosition(
- aBaseMetaTileEntity.getXCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F,
- aBaseMetaTileEntity.getYCoord() + 0.9F + XSTR_INSTANCE.nextFloat() * 0.2F,
- aBaseMetaTileEntity.getZCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F)
- .setWorld(aBaseMetaTileEntity.getWorld()).run();
+ .setIdentifier(ParticleFX.SMOKE)
+ .setPosition(
+ aBaseMetaTileEntity.getXCoord()
+ + 0.8F
+ - XSTR_INSTANCE.nextFloat()
+ * 0.6F,
+ aBaseMetaTileEntity.getYCoord()
+ + 0.9F
+ + XSTR_INSTANCE.nextFloat()
+ * 0.2F,
+ aBaseMetaTileEntity.getZCoord()
+ + 0.8F
+ - XSTR_INSTANCE.nextFloat()
+ * 0.6F)
+ .setWorld(aBaseMetaTileEntity.getWorld())
+ .run();
}
break;
default:
@@ -1192,8 +1220,11 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
}
ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()).setMotion(mX, 0, mZ)
- .setPosition(x, y, z).setWorld(getBaseMetaTileEntity().getWorld());
- particleEventBuilder.setIdentifier(ParticleFX.LAVA).run();
+ .setPosition(x, y, z)
+ .setWorld(
+ getBaseMetaTileEntity().getWorld());
+ particleEventBuilder.setIdentifier(ParticleFX.LAVA)
+ .run();
}
}
break;
@@ -1253,8 +1284,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
@Override
protected ProgressBar createProgressBar(UITexture texture, int imageSize, ProgressBar.Direction direction,
Pos2d pos, Size size) {
- return super.createProgressBar(texture, imageSize, direction, pos, size)
- .setTexture(progressBarTexture.get(), mRecipes.getProgressBarImageSize());
+ return super.createProgressBar(texture, imageSize, direction, pos, size).setTexture(
+ progressBarTexture.get(),
+ mRecipes.getProgressBarImageSize());
}
public enum X {
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java
index 1286c84c9b..193d654af6 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java
@@ -208,8 +208,11 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
}
if (doesFillContainers()) {
- ItemStack tOutput = GT_Utility
- .fillFluidContainer(getDrainableStack(), mInventory[getInputSlot()], false, true);
+ ItemStack tOutput = GT_Utility.fillFluidContainer(
+ getDrainableStack(),
+ mInventory[getInputSlot()],
+ false,
+ true);
if (tOutput != null && aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tOutput, 1)) {
FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true);
aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
@@ -227,8 +230,10 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
if (ItemList.Display_Fluid.isStackEqual(mInventory[getStackDisplaySlot()], true, true))
mInventory[getStackDisplaySlot()] = null;
} else {
- mInventory[getStackDisplaySlot()] = GT_Utility
- .getFluidDisplayStack(getDisplayedFluid(), true, !displaysStackSize());
+ mInventory[getStackDisplaySlot()] = GT_Utility.getFluidDisplayStack(
+ getDisplayedFluid(),
+ true,
+ !displaysStackSize());
}
}
}
@@ -245,13 +250,14 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
@Override
public int fill(FluidStack aFluid, boolean doFill) {
- if (aFluid == null || aFluid.getFluid().getID() <= 0
- || aFluid.amount <= 0
- || !canTankBeFilled()
- || !isFluidInputAllowed(aFluid))
+ if (aFluid == null || aFluid.getFluid()
+ .getID()
+ <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid))
return 0;
- if (getFillableStack() == null || getFillableStack().getFluid().getID() <= 0) {
+ if (getFillableStack() == null || getFillableStack().getFluid()
+ .getID()
+ <= 0) {
if (aFluid.amount <= getCapacity()) {
if (doFill) {
setFillableStack(aFluid.copy());
@@ -337,34 +343,56 @@ public abstract class GT_MetaTileEntity_BasicTank extends GT_MetaTileEntity_Tier
@Override
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
builder.widget(
- new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(7, 16).setSize(71, 45))
- .widget(new DrawableWidget().setDrawable(GT_UITextures.PICTURE_GAUGE).setPos(79, 34).setSize(18, 18))
- .widget(
- new SlotWidget(inventoryHandler, getInputSlot())
- .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN)
- .setPos(79, 16))
- .widget(
- new SlotWidget(inventoryHandler, getOutputSlot())
- .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT)
- .setPos(79, 52))
- .widget(createDrainableFluidSlot().setBackground(GT_UITextures.TRANSPARENT).setPos(58, 41))
- .widget(new TextWidget("Liquid Amount").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 20)).widget(
- TextWidget
- .dynamicString(() -> GT_Utility.parseNumberToString(mFluid != null ? mFluid.amount : 0))
- .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 30));
+ new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK)
+ .setPos(7, 16)
+ .setSize(71, 45))
+ .widget(
+ new DrawableWidget().setDrawable(GT_UITextures.PICTURE_GAUGE)
+ .setPos(79, 34)
+ .setSize(18, 18))
+ .widget(
+ new SlotWidget(inventoryHandler, getInputSlot())
+ .setBackground(
+ getGUITextureSet().getItemSlot(),
+ GT_UITextures.OVERLAY_SLOT_IN)
+ .setPos(79, 16))
+ .widget(
+ new SlotWidget(inventoryHandler, getOutputSlot())
+ .setBackground(
+ getGUITextureSet().getItemSlot(),
+ GT_UITextures.OVERLAY_SLOT_OUT)
+ .setPos(79, 52))
+ .widget(
+ createDrainableFluidSlot().setBackground(GT_UITextures.TRANSPARENT)
+ .setPos(58, 41))
+ .widget(
+ new TextWidget("Liquid Amount").setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setPos(10, 20))
+ .widget(
+ TextWidget.dynamicString(
+ () -> GT_Utility.parseNumberToString(mFluid != null ? mFluid.amount : 0))
+ .setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setPos(10, 30));
}
protected FluidDisplaySlotWidget createDrainableFluidSlot() {
- return new FluidDisplaySlotWidget(inventoryHandler, getStackDisplaySlot())
- .setFluidAccessConstructor(() -> constructFluidAccess(false)).setIHasFluidDisplay(this)
- .setCanDrain(true).setCanFill(!isDrainableStackSeparate())
- .setActionRealClick(FluidDisplaySlotWidget.Action.TRANSFER).setBeforeRealClick((clickData, widget) -> {
- if (NetworkUtils.isClient()) {
- // propagate display item content to actual fluid stored in this tank
- setDrainableStack(GT_Utility.getFluidFromDisplayStack(widget.getMcSlot().getStack()));
- }
- return true;
- });
+ return new FluidDisplaySlotWidget(
+ inventoryHandler,
+ getStackDisplaySlot()).setFluidAccessConstructor(() -> constructFluidAccess(false))
+ .setIHasFluidDisplay(this)
+ .setCanDrain(true)
+ .setCanFill(!isDrainableStackSeparate())
+ .setActionRealClick(FluidDisplaySlotWidget.Action.TRANSFER)
+ .setBeforeRealClick((clickData, widget) -> {
+ if (NetworkUtils.isClient()) {
+ // propagate display item content to actual fluid stored in this tank
+ setDrainableStack(
+ GT_Utility.getFluidFromDisplayStack(
+ widget.getMcSlot()
+ .getStack()));
+ }
+ return true;
+ });
}
protected IFluidAccess constructFluidAccess(boolean aIsFillableStack) {
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java
index 827f2b2ec9..1138b0a51d 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java
@@ -61,14 +61,30 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
ITexture[][][] rTextures = new ITexture[ForgeDirection.VALID_DIRECTIONS.length][17][];
ITexture tIcon = getOverlayIcon();
ITexture tOut = TextureFactory.of(OVERLAY_PIPE_OUT);
- ITexture tUp = TextureFactory
- .of(TextureFactory.of(ARROW_UP), TextureFactory.builder().addIcon(ARROW_UP_GLOW).glow().build());
- ITexture tDown = TextureFactory
- .of(TextureFactory.of(ARROW_DOWN), TextureFactory.builder().addIcon(ARROW_DOWN_GLOW).glow().build());
- ITexture tLeft = TextureFactory
- .of(TextureFactory.of(ARROW_LEFT), TextureFactory.builder().addIcon(ARROW_LEFT_GLOW).glow().build());
- ITexture tRight = TextureFactory
- .of(TextureFactory.of(ARROW_RIGHT), TextureFactory.builder().addIcon(ARROW_RIGHT_GLOW).glow().build());
+ ITexture tUp = TextureFactory.of(
+ TextureFactory.of(ARROW_UP),
+ TextureFactory.builder()
+ .addIcon(ARROW_UP_GLOW)
+ .glow()
+ .build());
+ ITexture tDown = TextureFactory.of(
+ TextureFactory.of(ARROW_DOWN),
+ TextureFactory.builder()
+ .addIcon(ARROW_DOWN_GLOW)
+ .glow()
+ .build());
+ ITexture tLeft = TextureFactory.of(
+ TextureFactory.of(ARROW_LEFT),
+ TextureFactory.builder()
+ .addIcon(ARROW_LEFT_GLOW)
+ .glow()
+ .build());
+ ITexture tRight = TextureFactory.of(
+ TextureFactory.of(ARROW_RIGHT),
+ TextureFactory.builder()
+ .addIcon(ARROW_RIGHT_GLOW)
+ .glow()
+ .build());
for (int i = 0; i < rTextures[0].length; i++) {
rTextures[OUTPUT_INDEX][i] = new ITexture[] { MACHINE_CASINGS[mTier][i], tOut };
rTextures[ARROW_RIGHT_INDEX][i] = new ITexture[] { MACHINE_CASINGS[mTier][i], tRight, tIcon };
@@ -401,7 +417,8 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
if (toSet == 0) continue;
int slot = validSlots.get(slotindex);
slotindex++;
- mInventory[slot] = stacks.get(sID).copy();
+ mInventory[slot] = stacks.get(sID)
+ .copy();
toSet = Math.min(toSet, mInventory[slot].getMaxStackSize());
mInventory[slot].stackSize = toSet;
slots.merge(sID, toSet, (a, b) -> a - b);
@@ -433,15 +450,21 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
bOutput = !bOutput;
if (bOutput) {
GT_Utility.sendChatToPlayer(
- widget.getContext().getPlayer(),
+ widget.getContext()
+ .getPlayer(),
GT_Utility.trans("116", "Emit Energy to Outputside"));
} else {
GT_Utility.sendChatToPlayer(
- widget.getContext().getPlayer(),
+ widget.getContext()
+ .getPlayer(),
GT_Utility.trans("117", "Don't emit Energy"));
}
- }).setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_EMIT_ENERGY).setPos(7, 62)
- .setSize(18, 18));
+ })
+ .setBackground(
+ GT_UITextures.BUTTON_STANDARD,
+ GT_UITextures.OVERLAY_BUTTON_EMIT_ENERGY)
+ .setPos(7, 62)
+ .setSize(18, 18));
}
protected void addEmitRedstoneButton(ModularWindow.Builder builder) {
@@ -449,30 +472,43 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
bRedstoneIfFull = !bRedstoneIfFull;
if (bRedstoneIfFull) {
GT_Utility.sendChatToPlayer(
- widget.getContext().getPlayer(),
+ widget.getContext()
+ .getPlayer(),
GT_Utility.trans("118", "Emit Redstone if no Slot is free"));
} else {
GT_Utility.sendChatToPlayer(
- widget.getContext().getPlayer(),
+ widget.getContext()
+ .getPlayer(),
GT_Utility.trans("119", "Don't emit Redstone"));
}
- }).setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_EMIT_REDSTONE).setPos(25, 62)
- .setSize(18, 18));
+ })
+ .setBackground(
+ GT_UITextures.BUTTON_STANDARD,
+ GT_UITextures.OVERLAY_BUTTON_EMIT_REDSTONE)
+ .setPos(25, 62)
+ .setSize(18, 18));
}
protected void addInvertRedstoneButton(ModularWindow.Builder builder) {
builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> {
bInvert = !bInvert;
if (bInvert) {
- GT_Utility
- .sendChatToPlayer(widget.getContext().getPlayer(), GT_Utility.trans("120", "Invert Redstone"));
+ GT_Utility.sendChatToPlayer(
+ widget.getContext()
+ .getPlayer(),
+ GT_Utility.trans("120", "Invert Redstone"));
} else {
GT_Utility.sendChatToPlayer(
- widget.getContext().getPlayer(),
+ widget.getContext()
+ .getPlayer(),
GT_Utility.trans("121", "Don't invert Redstone"));
}
- }).setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_INVERT_REDSTONE).setPos(43, 62)
- .setSize(18, 18));
+ })
+ .setBackground(
+ GT_UITextures.BUTTON_STANDARD,
+ GT_UITextures.OVERLAY_BUTTON_INVERT_REDSTONE)
+ .setPos(43, 62)
+ .setSize(18, 18));
}
protected void addStockingModeButton(ModularWindow.Builder builder) {
@@ -480,22 +516,32 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
bStockingMode = !bStockingMode;
if (bStockingMode) {
GT_Utility.sendChatToPlayer(
- widget.getContext().getPlayer(),
+ widget.getContext()
+ .getPlayer(),
GT_Utility.trans(
"217",
"Stocking mode. Keeps this many items in destination input slots. This mode can be server unfriendly."));
} else {
GT_Utility.sendChatToPlayer(
- widget.getContext().getPlayer(),
+ widget.getContext()
+ .getPlayer(),
GT_Utility.trans(
"218",
"Transfer size mode. Add exactly this many items in destination input slots as long as there is room."));
}
- }).setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_STOCKING_MODE).setPos(61, 62)
- .setSize(18, 18));
+ })
+ .setBackground(
+ GT_UITextures.BUTTON_STANDARD,
+ GT_UITextures.OVERLAY_BUTTON_STOCKING_MODE)
+ .setPos(61, 62)
+ .setSize(18, 18));
}
protected void addInventorySlots(ModularWindow.Builder builder) {
- builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 9).endAtSlot(26).build().setPos(7, 4));
+ builder.widget(
+ SlotGroup.ofItemHandler(inventoryHandler, 9)
+ .endAtSlot(26)
+ .build()
+ .setPos(7, 4));
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java
index 830706f8fe..d9c32911b7 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java
@@ -44,23 +44,27 @@ public abstract class GT_MetaTileEntity_CubicMultiBlockBase<T extends GT_MetaTil
@Override
protected IStructureDefinition<GT_MetaTileEntity_CubicMultiBlockBase<?>> computeValue(Class<?> type) {
return StructureDefinition.<GT_MetaTileEntity_CubicMultiBlockBase<?>>builder()
- .addShape(
- STRUCTURE_PIECE_MAIN,
- transpose(
- new String[][] { { "hhh", "hhh", "hhh" }, { "h~h", "h-h", "hhh" },
- { "hhh", "hhh", "hhh" }, }))
- .addElement(
- 'h',
- ofChain(
- lazy(
- t -> GT_StructureUtility
- .<GT_MetaTileEntity_CubicMultiBlockBase<?>>buildHatchAdder()
- .atLeastList(t.getAllowedHatches())
- .casingIndex(t.getHatchTextureIndex()).dot(1).build()),
- onElementPass(
- GT_MetaTileEntity_CubicMultiBlockBase::onCorrectCasingAdded,
- lazy(GT_MetaTileEntity_CubicMultiBlockBase::getCasingElement))))
- .build();
+ .addShape(
+ STRUCTURE_PIECE_MAIN,
+ transpose(
+ new String[][] { { "hhh", "hhh", "hhh" }, { "h~h", "h-h", "hhh" },
+ { "hhh", "hhh", "hhh" }, }))
+ .addElement(
+ 'h',
+ ofChain(
+ lazy(
+ t -> GT_StructureUtility.<GT_MetaTileEntity_CubicMultiBlockBase<?>>buildHatchAdder()
+ .atLeastList(
+ t.getAllowedHatches())
+ .casingIndex(
+ t.getHatchTextureIndex())
+ .dot(1)
+ .build()),
+ onElementPass(
+ GT_MetaTileEntity_CubicMultiBlockBase::onCorrectCasingAdded,
+ lazy(
+ GT_MetaTileEntity_CubicMultiBlockBase::getCasingElement))))
+ .build();
}
};
private int mCasingAmount = 0;
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java
index e5cf3d5cc4..bd6facceee 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java
@@ -131,8 +131,14 @@ public abstract class GT_MetaTileEntity_EnhancedMultiBlockBase<T extends GT_Meta
@Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
- aNBT.setByte("eRotation", (byte) mExtendedFacing.getRotation().getIndex());
- aNBT.setByte("eFlip", (byte) mExtendedFacing.getFlip().getIndex());
+ aNBT.setByte(
+ "eRotation",
+ (byte) mExtendedFacing.getRotation()
+ .getIndex());
+ aNBT.setByte(
+ "eFlip",
+ (byte) mExtendedFacing.getFlip()
+ .getIndex());
}
@Override
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java
index 9f75c283ec..cfc1ce6558 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ExtendedPowerMultiBlockBase.java
@@ -139,8 +139,10 @@ public abstract class GT_MetaTileEntity_ExtendedPowerMultiBlockBase<T extends GT
long maxEnergy = 0;
for (GT_MetaTileEntity_Hatch tHatch : getExoticAndNormalEnergyHatchList()) {
if (isValidMetaTileEntity(tHatch)) {
- storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU();
- maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity();
+ storedEnergy += tHatch.getBaseMetaTileEntity()
+ .getStoredEU();
+ maxEnergy += tHatch.getBaseMetaTileEntity()
+ .getEUCapacity();
}
}
long voltage = getAverageInputVoltage();
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java
index fc25a15beb..fc6dce9e70 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java
@@ -145,12 +145,16 @@ public class GT_MetaTileEntity_Hatch_DataAccess extends GT_MetaTileEntity_Hatch
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
switch (mTier) {
case 4:
- getBaseMetaTileEntity()
- .add2by2Slots(builder, getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CIRCUIT);
+ getBaseMetaTileEntity().add2by2Slots(
+ builder,
+ getGUITextureSet().getItemSlot(),
+ GT_UITextures.OVERLAY_SLOT_CIRCUIT);
break;
default:
- getBaseMetaTileEntity()
- .add4by4Slots(builder, getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CIRCUIT);
+ getBaseMetaTileEntity().add4by4Slots(
+ builder,
+ getGUITextureSet().getItemSlot(),
+ GT_UITextures.OVERLAY_SLOT_CIRCUIT);
break;
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java
index 959bcda530..42abf4839b 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java
@@ -132,8 +132,8 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch
@Override
public void initDefaultModes(NBTTagCompound aNBT) {
if (!getBaseMetaTileEntity().getWorld().isRemote) {
- GT_ClientPreference tPreference = GT_Mod.gregtechproxy
- .getClientPreference(getBaseMetaTileEntity().getOwnerUuid());
+ GT_ClientPreference tPreference = GT_Mod.gregtechproxy.getClientPreference(
+ getBaseMetaTileEntity().getOwnerUuid());
if (tPreference != null) disableFilter = !tPreference.isInputBusInitialFilterEnabled();
}
}
@@ -174,7 +174,8 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch
if (toSet == 0) continue;
int slot = validSlots.get(slotindex);
slotindex++;
- mInventory[slot] = stacks.get(sID).copy();
+ mInventory[slot] = stacks.get(sID)
+ .copy();
toSet = Math.min(toSet, mInventory[slot].getMaxStackSize());
mInventory[slot].stackSize = toSet;
slots.merge(sID, toSet, (a, b) -> a - b);
@@ -201,7 +202,9 @@ public class GT_MetaTileEntity_Hatch_InputBus extends GT_MetaTileEntity_Hatch
@Override
public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide).isGUIClickable()) return;
+ if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide)
+ .isGUIClickable())
+ return;
if (aPlayer.isSneaking()) {
if (disableSort) {
disableSort = false;
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java
index bcc260fd2e..d380baf8ed 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java
@@ -96,14 +96,20 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
if (mAuto) return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_AUTOMAINTENANCE_IDLE),
- TextureFactory.builder().addIcon(OVERLAY_AUTOMAINTENANCE_IDLE_GLOW).glow().build() };
+ TextureFactory.builder()
+ .addIcon(OVERLAY_AUTOMAINTENANCE_IDLE_GLOW)
+ .glow()
+ .build() };
return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_MAINTENANCE) };
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
if (mAuto) return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_AUTOMAINTENANCE),
- TextureFactory.builder().addIcon(OVERLAY_AUTOMAINTENANCE_GLOW).glow().build() };
+ TextureFactory.builder()
+ .addIcon(OVERLAY_AUTOMAINTENANCE_GLOW)
+ .glow()
+ .build() };
return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_MAINTENANCE),
TextureFactory.of(OVERLAY_DUCTTAPE) };
}
@@ -146,7 +152,10 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
if (aBaseMetaTileEntity.isClientSide()) return true;
if (aSide == aBaseMetaTileEntity.getFrontFacing()) {
// only allow OC robot fake player
- if (aPlayer instanceof FakePlayer && !aPlayer.getGameProfile().getName().endsWith(".robot")) return false;
+ if (aPlayer instanceof FakePlayer && !aPlayer.getGameProfile()
+ .getName()
+ .endsWith(".robot"))
+ return false;
ItemStack tStack = aPlayer.getCurrentEquippedItem();
if (tStack != null) {
if (tStack.getItem() instanceof ItemToolbox) {
@@ -193,8 +202,10 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
amt = tStack.stackSize;
boolean temp = true;
for (ItemStack aStack : mInventory) {
- if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility
- .areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true))) {
+ if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(
+ GT_OreDictUnificator.get(false, aStack),
+ tStack,
+ true))) {
amt -= aStack.stackSize;
if (amt < 1) {
temp = false;
@@ -211,8 +222,10 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
if (tStack != null) {
amt = tStack.stackSize;
for (ItemStack aStack : mInventory) {
- if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility
- .areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true))) {
+ if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(
+ GT_OreDictUnificator.get(false, aStack),
+ tStack,
+ true))) {
if (aStack.stackSize < amt) {
amt -= aStack.stackSize;
aStack.stackSize = 0;
@@ -322,28 +335,33 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch
getBaseMetaTileEntity().add2by2Slots(builder);
} else {
builder.widget(
- new DrawableWidget().setDrawable(GT_UITextures.SLOT_MAINTENANCE).setPos(78, 33).setSize(20, 20))
- .widget(new SlotWidget(BaseSlot.empty()) {
-
- @Override
- public boolean handleDragAndDrop(ItemStack draggedStack, int button) {
- return false;
- }
-
- @Override
- protected void phantomClick(ClickData clickData, ItemStack cursorStack) {
- if (cursorStack == null) return;
- onToolClick(cursorStack, getContext().getPlayer());
- if (cursorStack.stackSize < 1) {
- getContext().getPlayer().inventory.setItemStack(null);
- }
- if (getContext().getPlayer() instanceof EntityPlayerMP) {
- ((EntityPlayerMP) getContext().getPlayer()).updateHeldItem();
- }
- }
- }.disableShiftInsert().setBackground(GT_UITextures.TRANSPARENT).setPos(79, 34)).widget(
- new TextWidget("Click with Tool to repair.").setDefaultColor(COLOR_TEXT_GRAY.get())
- .setPos(8, 12));
+ new DrawableWidget().setDrawable(GT_UITextures.SLOT_MAINTENANCE)
+ .setPos(78, 33)
+ .setSize(20, 20))
+ .widget(new SlotWidget(BaseSlot.empty()) {
+
+ @Override
+ public boolean handleDragAndDrop(ItemStack draggedStack, int button) {
+ return false;
+ }
+
+ @Override
+ protected void phantomClick(ClickData clickData, ItemStack cursorStack) {
+ if (cursorStack == null) return;
+ onToolClick(cursorStack, getContext().getPlayer());
+ if (cursorStack.stackSize < 1) {
+ getContext().getPlayer().inventory.setItemStack(null);
+ }
+ if (getContext().getPlayer() instanceof EntityPlayerMP) {
+ ((EntityPlayerMP) getContext().getPlayer()).updateHeldItem();
+ }
+ }
+ }.disableShiftInsert()
+ .setBackground(GT_UITextures.TRANSPARENT)
+ .setPos(79, 34))
+ .widget(
+ new TextWidget("Click with Tool to repair.").setDefaultColor(COLOR_TEXT_GRAY.get())
+ .setPos(8, 12));
}
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java
index b41f45e6d2..f0f1705b1f 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java
@@ -34,7 +34,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
private final int pollutionReduction = calculatePollutionReduction(100);
private final int pollutionRecover = 100 - pollutionReduction;
private final String[] description = String.format(localizedDescFormat, pollutionReduction, pollutionRecover)
- .split("\\R");
+ .split("\\R");
private final boolean[] facings = new boolean[ForgeDirection.VALID_DIRECTIONS.length];
public GT_MetaTileEntity_Hatch_Muffler(int aID, String aName, String aNameRegional, int aTier) {
@@ -103,8 +103,12 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
- if (aBaseMetaTileEntity.isClientSide() && this.getBaseMetaTileEntity().isActive()) {
- pollutionParticles(this.getBaseMetaTileEntity().getWorld(), ParticleFX.LARGE_SMOKE.toString());
+ if (aBaseMetaTileEntity.isClientSide() && this.getBaseMetaTileEntity()
+ .isActive()) {
+ pollutionParticles(
+ this.getBaseMetaTileEntity()
+ .getWorld(),
+ ParticleFX.LARGE_SMOKE.toString());
}
}
@@ -159,26 +163,35 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
zSpd = aDir.offsetZ * (0.1F + 0.2F * XSTR_INSTANCE.nextFloat());
}
- WorldSpawnedEventBuilder.ParticleEventBuilder events = new WorldSpawnedEventBuilder.ParticleEventBuilder()
- .setIdentifier(name).setWorld(aWorld).setMotion(xSpd, ySpd, zSpd);
+ WorldSpawnedEventBuilder.ParticleEventBuilder events = new WorldSpawnedEventBuilder.ParticleEventBuilder().setIdentifier(
+ name)
+ .setWorld(
+ aWorld)
+ .setMotion(
+ xSpd,
+ ySpd,
+ zSpd);
if (chk1) {
events.setPosition(
xPos + ran1 * 0.5F,
yPos + XSTR_INSTANCE.nextFloat() * 0.5F,
- zPos + XSTR_INSTANCE.nextFloat() * 0.5F).run();
+ zPos + XSTR_INSTANCE.nextFloat() * 0.5F)
+ .run();
}
if (chk2) {
events.setPosition(
xPos + ran2 * 0.5F,
yPos + XSTR_INSTANCE.nextFloat() * 0.5F,
- zPos + XSTR_INSTANCE.nextFloat() * 0.5F).run();
+ zPos + XSTR_INSTANCE.nextFloat() * 0.5F)
+ .run();
}
if (chk3) {
events.setPosition(
xPos + ran3 * 0.5F,
yPos + XSTR_INSTANCE.nextFloat() * 0.5F,
- zPos + XSTR_INSTANCE.nextFloat() * 0.5F).run();
+ zPos + XSTR_INSTANCE.nextFloat() * 0.5F)
+ .run();
}
}
@@ -217,6 +230,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
*/
public void setInValidFacings(ForgeDirection... aFacings) {
Arrays.fill(facings, true);
- Arrays.stream(aFacings).forEach(face -> facings[face.ordinal()] = false);
+ Arrays.stream(aFacings)
+ .forEach(face -> facings[face.ordinal()] = false);
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java
index 7d95e0b17c..1b7fedce22 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java
@@ -171,10 +171,9 @@ public class GT_MetaTileEntity_Hatch_MultiInput extends GT_MetaTileEntity_Hatch_
@Override
public int fill(FluidStack aFluid, boolean doFill) {
- if (aFluid == null || aFluid.getFluid().getID() <= 0
- || aFluid.amount <= 0
- || !canTankBeFilled()
- || !isFluidInputAllowed(aFluid))
+ if (aFluid == null || aFluid.getFluid()
+ .getID()
+ <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid))
return 0;
if (!hasFluid(aFluid) && getFirstEmptySlot() != -1) {
int tFilled = Math.min(aFluid.amount, mCapacityPer);
@@ -304,21 +303,36 @@ public class GT_MetaTileEntity_Hatch_MultiInput extends GT_MetaTileEntity_Hatch_
final int slotId = i;
builder.widget(
new FluidDisplaySlotWidget(inventoryHandler, slotId)
- .setFluidAccessConstructor(() -> constructFluidAccess(slotId)).setIHasFluidDisplay(this)
- .setCanDrain(true).setCanFill(!isDrainableStackSeparate())
- .setActionRealClick(FluidDisplaySlotWidget.Action.TRANSFER)
- .setBeforeRealClick((clickData, widget) -> {
- if (NetworkUtils.isClient()) {
- // propagate display item content to actual fluid stored in this tank
- setFluid(
- GT_Utility.getFluidFromDisplayStack(widget.getMcSlot().getStack()),
- slotId);
- }
- ItemStack tStackHeld = widget.getContext().getPlayer().inventory.getItemStack();
- FluidStack tFluidHeld = GT_Utility.getFluidForFilledItem(tStackHeld, true);
- return constructFluidAccess(slotId).isMatch(tFluidHeld, slotId);
- }).setUpdateFluidDisplayItem(() -> updateFluidDisplayItem(slotId))
- .setBackground(ModularUITextures.FLUID_SLOT).setPos(positions[slotId]));
+ .setFluidAccessConstructor(
+ () -> constructFluidAccess(slotId))
+ .setIHasFluidDisplay(this)
+ .setCanDrain(true)
+ .setCanFill(!isDrainableStackSeparate())
+ .setActionRealClick(
+ FluidDisplaySlotWidget.Action.TRANSFER)
+ .setBeforeRealClick((clickData, widget) -> {
+ if (NetworkUtils.isClient()) {
+ // propagate display item content to
+ // actual fluid stored in this tank
+ setFluid(
+ GT_Utility.getFluidFromDisplayStack(
+ widget.getMcSlot()
+ .getStack()),
+ slotId);
+ }
+ ItemStack tStackHeld = widget.getContext()
+ .getPlayer().inventory.getItemStack();
+ FluidStack tFluidHeld = GT_Utility.getFluidForFilledItem(
+ tStackHeld,
+ true);
+ return constructFluidAccess(slotId).isMatch(
+ tFluidHeld,
+ slotId);
+ })
+ .setUpdateFluidDisplayItem(
+ () -> updateFluidDisplayItem(slotId))
+ .setBackground(ModularUITextures.FLUID_SLOT)
+ .setPos(positions[slotId]));
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java
index ed29f8fe08..4a8e745a25 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java
@@ -123,16 +123,18 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && mFluid != null) {
- IFluidHandler tTileEntity = aBaseMetaTileEntity
- .getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing());
+ IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(
+ aBaseMetaTileEntity.getFrontFacing());
if (tTileEntity != null) {
FluidStack tDrained = aBaseMetaTileEntity.drain(
ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()),
Math.max(1, mFluid.amount),
false);
if (tDrained != null) {
- int tFilledAmount = tTileEntity
- .fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false);
+ int tFilledAmount = tTileEntity.fill(
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()),
+ tDrained,
+ false);
if (tFilledAmount > 0) {
tTileEntity.fill(
ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()),
@@ -163,7 +165,8 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
lockedFluidName = aNBT.getString("lockedFluidName");
lockedFluidName = lockedFluidName.length() == 0 ? null : lockedFluidName;
if (GT_Utility.getFluidFromUnlocalizedName(lockedFluidName) != null) {
- lockedFluidName = GT_Utility.getFluidFromUnlocalizedName(lockedFluidName).getName();
+ lockedFluidName = GT_Utility.getFluidFromUnlocalizedName(lockedFluidName)
+ .getName();
}
}
@@ -239,7 +242,9 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
@Override
public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide).isGUIClickable()) return;
+ if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide)
+ .isGUIClickable())
+ return;
if (aPlayer.isSneaking()) {
mMode = (byte) ((mMode + 9) % 10);
} else {
@@ -287,8 +292,12 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
"115.3",
"currently none, will be locked to the next that is put in (or use fluid cell to lock)");
} else {
- this.setLockedFluidName(this.getDrainableStack().getFluid().getName());
- inBrackets = this.getDrainableStack().getLocalizedName();
+ this.setLockedFluidName(
+ this.getDrainableStack()
+ .getFluid()
+ .getName());
+ inBrackets = this.getDrainableStack()
+ .getLocalizedName();
}
GT_Utility.sendChatToPlayer(
aPlayer,
@@ -305,8 +314,12 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
"115.3",
"currently none, will be locked to the next that is put in (or use fluid cell to lock)");
} else {
- this.setLockedFluidName(this.getDrainableStack().getFluid().getName());
- inBrackets = this.getDrainableStack().getLocalizedName();
+ this.setLockedFluidName(
+ this.getDrainableStack()
+ .getFluid()
+ .getName());
+ inBrackets = this.getDrainableStack()
+ .getLocalizedName();
}
GT_Utility.sendChatToPlayer(
aPlayer,
@@ -316,7 +329,9 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
}
private boolean tryToLockHatch(EntityPlayer aPlayer, byte aSide) {
- if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide).isGUIClickable()) return false;
+ if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide)
+ .isGUIClickable())
+ return false;
if (!isFluidLocked()) return false;
final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
if (tCurrentItem == null) return false;
@@ -324,7 +339,9 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
if (tFluid == null && tCurrentItem.getItem() instanceof IFluidContainerItem)
tFluid = ((IFluidContainerItem) tCurrentItem.getItem()).getFluid(tCurrentItem);
if (tFluid != null) {
- if (getLockedFluidName() != null && !getLockedFluidName().equals(tFluid.getFluid().getName())) {
+ if (getLockedFluidName() != null && !getLockedFluidName().equals(
+ tFluid.getFluid()
+ .getName())) {
GT_Utility.sendChatToPlayer(
aPlayer,
String.format(
@@ -334,7 +351,9 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
"Hatch is locked to a different fluid. To change the locking, empty it and made it locked to the next fluid with a screwdriver. Currently locked to"),
StatCollector.translateToLocal(getLockedFluidName())));
} else {
- setLockedFluidName(tFluid.getFluid().getName());
+ setLockedFluidName(
+ tFluid.getFluid()
+ .getName());
if (mMode == 8) GT_Utility.sendChatToPlayer(
aPlayer,
String.format(
@@ -427,7 +446,9 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
@Override
protected void onEmptyingContainerWhenEmpty() {
if (this.lockedFluidName == null && this.mFluid != null && isFluidLocked()) {
- this.setLockedFluidName(this.mFluid.getFluid().getName());
+ this.setLockedFluidName(
+ this.mFluid.getFluid()
+ .getName());
final EntityPlayer player;
if (playerThatLockedfluid == null || (player = playerThatLockedfluid.get()) == null) return;
GT_Utility.sendChatToPlayer(
@@ -459,7 +480,8 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
+ EnumChatFormatting.RESET,
(!isFluidLocked() || lockedFluidName == null) ? "Not Locked"
: ("Locked to " + StatCollector.translateToLocal(
- FluidRegistry.getFluidStack(lockedFluidName, 1).getUnlocalizedName())) };
+ FluidRegistry.getFluidStack(lockedFluidName, 1)
+ .getUnlocalizedName())) };
}
@Override
@@ -471,28 +493,51 @@ public class GT_MetaTileEntity_Hatch_Output extends GT_MetaTileEntity_Hatch impl
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
super.addUIWidgets(builder, buildContext);
builder.widget(
- new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(98, 16).setSize(71, 45))
- .widget(
- new FluidDisplaySlotWidget(inventoryHandler, getLockedDisplaySlot()).setIHasFluidDisplay(this)
- .setActionRealClick(FluidDisplaySlotWidget.Action.LOCK)
- .setActionDragAndDrop(FluidDisplaySlotWidget.Action.LOCK)
- .setBeforeClick((clickData, widget) -> {
- if (NetworkUtils.isClient()) {
- // propagate display item content to actual fluid stored in this tank
- setDrainableStack(
- GT_Utility.getFluidFromDisplayStack(mInventory[getStackDisplaySlot()]));
- }
- return true;
- }).setBackground(GT_UITextures.TRANSPARENT).setPos(149, 41))
- .widget(new TextWidget("Locked Fluid").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(101, 20))
- .widget(TextWidget.dynamicString(() -> {
- final ItemStack lockedDisplayStack = mInventory[getLockedDisplaySlot()];
- return lockedDisplayStack == null ? "None" : lockedDisplayStack.getDisplayName();
- }).setSynced(false).setDefaultColor(COLOR_TEXT_WHITE.get()).setTextAlignment(Alignment.CenterLeft)
- .setMaxWidth(65).setPos(101, 30))
- // #updateFluidDisplayItem invalidates locked fluid slot
- // if lockedFluidName == null or mMode is incorrect
- .widget(new FakeSyncWidget.StringSyncer(() -> lockedFluidName, val -> lockedFluidName = val))
- .widget(new FakeSyncWidget.ByteSyncer(() -> mMode, val -> mMode = val));
+ new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK)
+ .setPos(98, 16)
+ .setSize(71, 45))
+ .widget(
+ new FluidDisplaySlotWidget(inventoryHandler, getLockedDisplaySlot()).setIHasFluidDisplay(this)
+ .setActionRealClick(
+ FluidDisplaySlotWidget.Action.LOCK)
+ .setActionDragAndDrop(
+ FluidDisplaySlotWidget.Action.LOCK)
+ .setBeforeClick(
+ (clickData,
+ widget) -> {
+ if (NetworkUtils.isClient()) {
+ // propagate
+ // display
+ // item
+ // content to
+ // actual
+ // fluid
+ // stored in
+ // this tank
+ setDrainableStack(
+ GT_Utility.getFluidFromDisplayStack(
+ mInventory[getStackDisplaySlot()]));
+ }
+ return true;
+ })
+ .setBackground(
+ GT_UITextures.TRANSPARENT)
+ .setPos(149, 41))
+ .widget(
+ new TextWidget("Locked Fluid").setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setPos(101, 20))
+ .widget(TextWidget.dynamicString(() -> {
+ final ItemStack lockedDisplayStack = mInventory[getLockedDisplaySlot()];
+ return lockedDisplayStack == null ? "None" : lockedDisplayStack.getDisplayName();
+ })
+ .setSynced(false)
+ .setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setTextAlignment(Alignment.CenterLeft)
+ .setMaxWidth(65)
+ .setPos(101, 30))
+ // #updateFluidDisplayItem invalidates locked fluid slot
+ // if lockedFluidName == null or mMode is incorrect
+ .widget(new FakeSyncWidget.StringSyncer(() -> lockedFluidName, val -> lockedFluidName = val))
+ .widget(new FakeSyncWidget.ByteSyncer(() -> mMode, val -> mMode = val));
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java
index 094ad29471..c970b64cb9 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java
@@ -160,8 +160,8 @@ public class GT_MetaTileEntity_Hatch_OutputBus extends GT_MetaTileEntity_Hatch i
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && (aTick & 0x7) == 0) {
- final IInventory tTileEntity = aBaseMetaTileEntity
- .getIInventoryAtSide(aBaseMetaTileEntity.getFrontFacing());
+ final IInventory tTileEntity = aBaseMetaTileEntity.getIInventoryAtSide(
+ aBaseMetaTileEntity.getFrontFacing());
if (tTileEntity != null) {
moveMultipleItemStacks(
aBaseMetaTileEntity,
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java
index 51086d806b..d2083fc87c 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java
@@ -104,29 +104,43 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
public GT_MetaTileEntity_MultiBlockBase(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, 2);
- GT_MetaTileEntity_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile
- .get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false);
- this.damageFactorLow = GregTech_API.sMachineFile
- .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorLow", 5);
- this.damageFactorHigh = (float) GregTech_API.sMachineFile
- .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorHigh", 0.6f);
+ GT_MetaTileEntity_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile.get(
+ ConfigCategories.machineconfig,
+ "MultiBlockMachines.disableMaintenance",
+ false);
+ this.damageFactorLow = GregTech_API.sMachineFile.get(
+ ConfigCategories.machineconfig,
+ "MultiBlockMachines.damageFactorLow",
+ 5);
+ this.damageFactorHigh = (float) GregTech_API.sMachineFile.get(
+ ConfigCategories.machineconfig,
+ "MultiBlockMachines.damageFactorHigh",
+ 0.6f);
this.mNEI = "";
}
public GT_MetaTileEntity_MultiBlockBase(String aName) {
super(aName, 2);
- GT_MetaTileEntity_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile
- .get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false);
- this.damageFactorLow = GregTech_API.sMachineFile
- .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorLow", 5);
- this.damageFactorHigh = (float) GregTech_API.sMachineFile
- .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorHigh", 0.6f);
+ GT_MetaTileEntity_MultiBlockBase.disableMaintenance = GregTech_API.sMachineFile.get(
+ ConfigCategories.machineconfig,
+ "MultiBlockMachines.disableMaintenance",
+ false);
+ this.damageFactorLow = GregTech_API.sMachineFile.get(
+ ConfigCategories.machineconfig,
+ "MultiBlockMachines.damageFactorLow",
+ 5);
+ this.damageFactorHigh = (float) GregTech_API.sMachineFile.get(
+ ConfigCategories.machineconfig,
+ "MultiBlockMachines.damageFactorHigh",
+ 0.6f);
}
public static boolean isValidMetaTileEntity(MetaTileEntity aMetaTileEntity) {
- return aMetaTileEntity.getBaseMetaTileEntity() != null
- && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileEntity() == aMetaTileEntity
- && !aMetaTileEntity.getBaseMetaTileEntity().isDead();
+ return aMetaTileEntity.getBaseMetaTileEntity() != null && aMetaTileEntity.getBaseMetaTileEntity()
+ .getMetaTileEntity()
+ == aMetaTileEntity
+ && !aMetaTileEntity.getBaseMetaTileEntity()
+ .isDead();
}
@Override
@@ -433,7 +447,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
try {
GT_Mod.achievements.issueAchivementHatch(
aBaseMetaTileEntity.getWorld()
- .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
+ .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
tStack);
} catch (Exception ignored) {}
addOutput(tStack);
@@ -458,7 +472,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
try {
GT_Mod.achievements.issueAchievement(
aBaseMetaTileEntity.getWorld()
- .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
+ .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
"oilplant");
} catch (Exception ignored) {}
}
@@ -523,7 +537,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
if (getBaseMetaTileEntity().isActive() && activitySound != null) {
if (activitySoundLoop == null) {
activitySoundLoop = new GT_SoundLoop(activitySound, getBaseMetaTileEntity(), false, true);
- Minecraft.getMinecraft().getSoundHandler().playSound(activitySoundLoop);
+ Minecraft.getMinecraft()
+ .getSoundHandler()
+ .playSound(activitySoundLoop);
}
} else {
if (activitySoundLoop != null) {
@@ -683,13 +699,15 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
}
}
if (mInventory[1] != null && getBaseMetaTileEntity().getRandomNumber(2) == 0
- && !mInventory[1].getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.")) {
+ && !mInventory[1].getUnlocalizedName()
+ .startsWith("gt.blockmachines.basicmachine.")) {
if (mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) {
NBTTagCompound tNBT = mInventory[1].getTagCompound();
((GT_MetaGenerated_Tool) mInventory[1].getItem()).doDamage(
mInventory[1],
- (long) getDamageToComponent(mInventory[1]) * (long) Math
- .min(mEUt / this.damageFactorLow, Math.pow(mEUt, this.damageFactorHigh)));
+ (long) getDamageToComponent(mInventory[1]) * (long) Math.min(
+ mEUt / this.damageFactorLow,
+ Math.pow(mEUt, this.damageFactorHigh)));
if (mInventory[1].stackSize == 0) mInventory[1] = null;
}
}
@@ -700,13 +718,17 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
public void explodeMultiblock() {
GT_Log.exp.println(
- "MultiBlockExplosion at: " + this.getBaseMetaTileEntity().getXCoord()
+ "MultiBlockExplosion at: " + this.getBaseMetaTileEntity()
+ .getXCoord()
+ " | "
- + this.getBaseMetaTileEntity().getYCoord()
+ + this.getBaseMetaTileEntity()
+ .getYCoord()
+ " | "
- + this.getBaseMetaTileEntity().getZCoord()
+ + this.getBaseMetaTileEntity()
+ .getZCoord()
+ " DIMID: "
- + this.getBaseMetaTileEntity().getWorld().provider.dimensionId
+ + this.getBaseMetaTileEntity()
+ .getWorld().provider.dimensionId
+ ".");
GT_Pollution.addPollution(getBaseMetaTileEntity(), GT_Mod.gregtechproxy.mPollutionOnExplosion);
@@ -722,7 +744,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
mMaintenanceHatches);
for (MetaTileEntity tTileEntity : allHatches) {
if (tTileEntity != null && tTileEntity.getBaseMetaTileEntity() != null) {
- tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ tTileEntity.getBaseMetaTileEntity()
+ .doExplosion(V[8]);
}
}
getBaseMetaTileEntity().doExplosion(V[8]);
@@ -780,11 +803,13 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
aRemainder = (int) (leftToInject - (aAmpsToInject * aVoltage));
ampsOnCurrentHatch = (int) Math.min(aDynamo.maxAmperesOut(), aAmpsToInject);
for (int i = 0; i < ampsOnCurrentHatch; i++) {
- aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage, false);
+ aDynamo.getBaseMetaTileEntity()
+ .increaseStoredEnergyUnits(aVoltage, false);
}
injected += aVoltage * ampsOnCurrentHatch;
if (aRemainder > 0 && ampsOnCurrentHatch < aDynamo.maxAmperesOut()) {
- aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aRemainder, false);
+ aDynamo.getBaseMetaTileEntity()
+ .increaseStoredEnergyUnits(aRemainder, false);
injected += aRemainder;
}
}
@@ -795,7 +820,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
public long getMaxInputVoltage() {
long rVoltage = 0;
for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
- if (isValidMetaTileEntity(tHatch)) rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage();
+ if (isValidMetaTileEntity(tHatch)) rVoltage += tHatch.getBaseMetaTileEntity()
+ .getInputVoltage();
return rVoltage;
}
@@ -877,7 +903,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
public boolean drainEnergyInput(long aEU) {
if (aEU <= 0) return true;
for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) if (isValidMetaTileEntity(tHatch)) {
- if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)) return true;
+ if (tHatch.getBaseMetaTileEntity()
+ .decreaseStoredEnergyUnits(aEU, false))
+ return true;
}
return false;
}
@@ -946,7 +974,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
ItemStack single = aStack.splitStack(1);
for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
if (!outputSuccess && isValidMetaTileEntity(tHatch) && tHatch.outputsItems()) {
- if (tHatch.getBaseMetaTileEntity().addStackToSlot(1, single)) outputSuccess = true;
+ if (tHatch.getBaseMetaTileEntity()
+ .addStackToSlot(1, single))
+ outputSuccess = true;
}
}
}
@@ -960,9 +990,15 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
tHatch.mRecipeMap = getRecipeMap();
if (isValidMetaTileEntity(tHatch)) {
- if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(0))) {
- if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) {
- tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize);
+ if (GT_Utility.areStacksEqual(
+ aStack,
+ tHatch.getBaseMetaTileEntity()
+ .getStackInSlot(0))) {
+ if (tHatch.getBaseMetaTileEntity()
+ .getStackInSlot(0).stackSize
+ >= aStack.stackSize) {
+ tHatch.getBaseMetaTileEntity()
+ .decrStackSize(0, aStack.stackSize);
return true;
}
}
@@ -971,10 +1007,18 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) {
tHatch.mRecipeMap = getRecipeMap();
if (isValidMetaTileEntity(tHatch)) {
- for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(i))) {
- if (tHatch.getBaseMetaTileEntity().getStackInSlot(i).stackSize >= aStack.stackSize) {
- tHatch.getBaseMetaTileEntity().decrStackSize(i, aStack.stackSize);
+ for (int i = tHatch.getBaseMetaTileEntity()
+ .getSizeInventory()
+ - 1; i >= 0; i--) {
+ if (GT_Utility.areStacksEqual(
+ aStack,
+ tHatch.getBaseMetaTileEntity()
+ .getStackInSlot(i))) {
+ if (tHatch.getBaseMetaTileEntity()
+ .getStackInSlot(i).stackSize
+ >= aStack.stackSize) {
+ tHatch.getBaseMetaTileEntity()
+ .decrStackSize(i, aStack.stackSize);
return true;
}
}
@@ -993,8 +1037,12 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
// }
for (GT_MetaTileEntity_Hatch_OutputBus tHatch : mOutputBusses) {
if (isValidMetaTileEntity(tHatch)) {
- for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
+ for (int i = tHatch.getBaseMetaTileEntity()
+ .getSizeInventory()
+ - 1; i >= 0; i--) {
+ rList.add(
+ tHatch.getBaseMetaTileEntity()
+ .getStackInSlot(i));
}
}
}
@@ -1029,13 +1077,20 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) {
tHatch.mRecipeMap = getRecipeMap();
if (isValidMetaTileEntity(tHatch)) {
- for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
- if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null)
- rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
+ for (int i = tHatch.getBaseMetaTileEntity()
+ .getSizeInventory()
+ - 1; i >= 0; i--) {
+ if (tHatch.getBaseMetaTileEntity()
+ .getStackInSlot(i)
+ != null)
+ rList.add(
+ tHatch.getBaseMetaTileEntity()
+ .getStackInSlot(i));
}
}
}
- if (getStackInSlot(1) != null && getStackInSlot(1).getUnlocalizedName().startsWith("gt.integrated_circuit"))
+ if (getStackInSlot(1) != null && getStackInSlot(1).getUnlocalizedName()
+ .startsWith("gt.integrated_circuit"))
rList.add(getStackInSlot(1));
return rList;
}
@@ -1229,8 +1284,10 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
long maxEnergy = 0;
for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) {
if (isValidMetaTileEntity(tHatch)) {
- storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU();
- maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity();
+ storedEnergy += tHatch.getBaseMetaTileEntity()
+ .getStoredEU();
+ maxEnergy += tHatch.getBaseMetaTileEntity()
+ .getEUCapacity();
}
}
@@ -1519,134 +1576,158 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
@Override
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
builder.widget(
- new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(4, 4).setSize(190, 85));
+ new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK)
+ .setPos(4, 4)
+ .setSize(190, 85));
final SlotWidget inventorySlot = new SlotWidget(inventoryHandler, 1);
- builder.widget(inventorySlot.setPos(173, 167).setBackground(GT_UITextures.SLOT_DARK_GRAY));
+ builder.widget(
+ inventorySlot.setPos(173, 167)
+ .setBackground(GT_UITextures.SLOT_DARK_GRAY));
final DynamicPositionedColumn screenElements = new DynamicPositionedColumn();
drawTexts(screenElements, inventorySlot);
builder.widget(screenElements);
builder.widget(createPowerSwitchButton())
- .widget(new FakeSyncWidget.BooleanSyncer(() -> getBaseMetaTileEntity().isAllowedToWork(), val -> {
- if (val) getBaseMetaTileEntity().enableWorking();
- else getBaseMetaTileEntity().disableWorking();
- }));
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> getBaseMetaTileEntity().isAllowedToWork(), val -> {
+ if (val) getBaseMetaTileEntity().enableWorking();
+ else getBaseMetaTileEntity().disableWorking();
+ }));
builder.widget(createVoidExcessButton())
- .widget(new FakeSyncWidget.BooleanSyncer(() -> voidExcess, val -> voidExcess = val));
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> voidExcess, val -> voidExcess = val));
builder.widget(createInputSeparationButton())
- .widget(new FakeSyncWidget.BooleanSyncer(() -> inputSeparation, val -> inputSeparation = val));
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> inputSeparation, val -> inputSeparation = val));
builder.widget(createBatchModeButton())
- .widget(new FakeSyncWidget.BooleanSyncer(() -> batchMode, val -> batchMode = val));
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> batchMode, val -> batchMode = val));
- builder.widget(createLockToSingleRecipeButton()).widget(
- new FakeSyncWidget.BooleanSyncer(() -> mLockedToSingleRecipe, val -> mLockedToSingleRecipe = val));
+ builder.widget(createLockToSingleRecipeButton())
+ .widget(
+ new FakeSyncWidget.BooleanSyncer(
+ () -> mLockedToSingleRecipe,
+ val -> mLockedToSingleRecipe = val));
}
@Override
public void addGregTechLogo(ModularWindow.Builder builder) {}
protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inventorySlot) {
- screenElements.setSynced(false).setSpace(0).setPos(10, 7);
-
- screenElements
- .widget(
- new TextWidget(GT_Utility.trans("132", "Pipe is loose."))
- .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mWrench))
- .widget(new FakeSyncWidget.BooleanSyncer(() -> mWrench, val -> mWrench = val));
- screenElements
- .widget(
- new TextWidget(GT_Utility.trans("133", "Screws are loose."))
- .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mScrewdriver))
- .widget(new FakeSyncWidget.BooleanSyncer(() -> mScrewdriver, val -> mScrewdriver = val));
- screenElements
- .widget(
- new TextWidget(GT_Utility.trans("134", "Something is stuck."))
- .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mSoftHammer))
- .widget(new FakeSyncWidget.BooleanSyncer(() -> mSoftHammer, val -> mSoftHammer = val));
- screenElements
- .widget(
- new TextWidget(GT_Utility.trans("135", "Platings are dented."))
- .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mHardHammer))
- .widget(new FakeSyncWidget.BooleanSyncer(() -> mHardHammer, val -> mHardHammer = val));
- screenElements
- .widget(
- new TextWidget(GT_Utility.trans("136", "Circuitry burned out."))
- .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mSolderingTool))
- .widget(new FakeSyncWidget.BooleanSyncer(() -> mSolderingTool, val -> mSolderingTool = val));
- screenElements
- .widget(
- new TextWidget(GT_Utility.trans("137", "That doesn't belong there."))
- .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mCrowbar))
- .widget(new FakeSyncWidget.BooleanSyncer(() -> mCrowbar, val -> mCrowbar = val));
- screenElements
- .widget(
- new TextWidget(GT_Utility.trans("138", "Incomplete Structure."))
- .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mMachine))
- .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val));
+ screenElements.setSynced(false)
+ .setSpace(0)
+ .setPos(10, 7);
+
+ screenElements.widget(
+ new TextWidget(GT_Utility.trans("132", "Pipe is loose.")).setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(widget -> !mWrench))
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> mWrench, val -> mWrench = val));
+ screenElements.widget(
+ new TextWidget(GT_Utility.trans("133", "Screws are loose.")).setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(widget -> !mScrewdriver))
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> mScrewdriver, val -> mScrewdriver = val));
+ screenElements.widget(
+ new TextWidget(GT_Utility.trans("134", "Something is stuck.")).setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(widget -> !mSoftHammer))
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> mSoftHammer, val -> mSoftHammer = val));
+ screenElements.widget(
+ new TextWidget(GT_Utility.trans("135", "Platings are dented.")).setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(widget -> !mHardHammer))
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> mHardHammer, val -> mHardHammer = val));
+ screenElements.widget(
+ new TextWidget(GT_Utility.trans("136", "Circuitry burned out.")).setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(widget -> !mSolderingTool))
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> mSolderingTool, val -> mSolderingTool = val));
+ screenElements.widget(
+ new TextWidget(GT_Utility.trans("137", "That doesn't belong there."))
+ .setDefaultColor(
+ COLOR_TEXT_WHITE.get())
+ .setEnabled(widget -> !mCrowbar))
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> mCrowbar, val -> mCrowbar = val));
+ screenElements.widget(
+ new TextWidget(GT_Utility.trans("138", "Incomplete Structure.")).setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(widget -> !mMachine))
+ .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val));
screenElements.widget(
new TextWidget("Too Uncertain.").setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> (getBaseMetaTileEntity().getErrorDisplayID() & 128) != 0));
+ .setEnabled(
+ widget -> (getBaseMetaTileEntity().getErrorDisplayID() & 128)
+ != 0));
screenElements.widget(
new TextWidget("Invalid Parameters.").setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> (getBaseMetaTileEntity().getErrorDisplayID() & 256) != 0));
-
- screenElements
- .widget(
- new TextWidget(GT_Utility.trans("139", "Hit with Soft Mallet"))
- .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(
- widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0
- && !getBaseMetaTileEntity().isActive()))
- .widget(
- new FakeSyncWidget.IntegerSyncer(
- () -> getBaseMetaTileEntity().getErrorDisplayID(),
- val -> getBaseMetaTileEntity().setErrorDisplayID(val)))
- .widget(
- new FakeSyncWidget.BooleanSyncer(
- () -> getBaseMetaTileEntity().isActive(),
- val -> getBaseMetaTileEntity().setActive(val)));
+ .setEnabled(
+ widget -> (getBaseMetaTileEntity().getErrorDisplayID()
+ & 256) != 0));
+
screenElements.widget(
- new TextWidget(GT_Utility.trans("140", "to (re-)start the Machine"))
- .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(
- widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0
- && !getBaseMetaTileEntity().isActive()));
+ new TextWidget(GT_Utility.trans("139", "Hit with Soft Mallet")).setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(
+ widget -> getBaseMetaTileEntity().getErrorDisplayID()
+ == 0
+ && !getBaseMetaTileEntity().isActive()))
+ .widget(
+ new FakeSyncWidget.IntegerSyncer(
+ () -> getBaseMetaTileEntity().getErrorDisplayID(),
+ val -> getBaseMetaTileEntity().setErrorDisplayID(val)))
+ .widget(
+ new FakeSyncWidget.BooleanSyncer(
+ () -> getBaseMetaTileEntity().isActive(),
+ val -> getBaseMetaTileEntity().setActive(val)));
+ screenElements.widget(
+ new TextWidget(
+ GT_Utility.trans("140", "to (re-)start the Machine")).setDefaultColor(COLOR_TEXT_WHITE.get())
+ .setEnabled(
+ widget -> getBaseMetaTileEntity().getErrorDisplayID()
+ == 0
+ && !getBaseMetaTileEntity().isActive()));
screenElements.widget(
new TextWidget(GT_Utility.trans("141", "if it doesn't start.")).setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(
- widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0
- && !getBaseMetaTileEntity().isActive()));
+ .setEnabled(
+ widget -> getBaseMetaTileEntity().getErrorDisplayID()
+ == 0
+ && !getBaseMetaTileEntity().isActive()));
screenElements.widget(
new TextWidget(GT_Utility.trans("142", "Running perfectly.")).setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(
- widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0
- && getBaseMetaTileEntity().isActive()));
+ .setEnabled(
+ widget -> getBaseMetaTileEntity().getErrorDisplayID()
+ == 0
+ && getBaseMetaTileEntity().isActive()));
screenElements.widget(
new TextWidget(GT_Utility.trans("143", "Missing Mining Pipe")).setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> {
- if (getBaseMetaTileEntity().getErrorDisplayID() == 0
- && this instanceof GT_MetaTileEntity_DrillerBase) {
- final ItemStack tItem = inventorySlot.getMcSlot().getStack();
- return tItem == null || !GT_Utility
- .areStacksEqual(tItem, GT_ModHandler.getIC2Item("miningPipe", 1L));
- }
- return false;
- }));
+ .setEnabled(widget -> {
+ if (getBaseMetaTileEntity().getErrorDisplayID()
+ == 0
+ && this instanceof GT_MetaTileEntity_DrillerBase) {
+ final ItemStack tItem = inventorySlot.getMcSlot()
+ .getStack();
+ return tItem == null
+ || !GT_Utility.areStacksEqual(
+ tItem,
+ GT_ModHandler.getIC2Item(
+ "miningPipe",
+ 1L));
+ }
+ return false;
+ }));
screenElements.widget(
new TextWidget(GT_Utility.trans("144", "Missing Turbine Rotor")).setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> {
- if (getBaseMetaTileEntity().getErrorDisplayID() == 0
- && this instanceof GT_MetaTileEntity_LargeTurbine) {
- final ItemStack tItem = inventorySlot.getMcSlot().getStack();
- return tItem == null || !(tItem.getItem() == GT_MetaGenerated_Tool_01.INSTANCE
- && tItem.getItemDamage() >= 170
- && tItem.getItemDamage() <= 177);
- }
- return false;
- }));
+ .setEnabled(widget -> {
+ if (getBaseMetaTileEntity().getErrorDisplayID()
+ == 0
+ && this instanceof GT_MetaTileEntity_LargeTurbine) {
+ final ItemStack tItem = inventorySlot.getMcSlot()
+ .getStack();
+ return tItem == null || !(tItem
+ .getItem()
+ == GT_MetaGenerated_Tool_01.INSTANCE
+ && tItem.getItemDamage()
+ >= 170
+ && tItem.getItemDamage()
+ <= 177);
+ }
+ return false;
+ }));
}
protected ButtonWidget createPowerSwitchButton() {
@@ -1656,21 +1737,25 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
} else {
getBaseMetaTileEntity().enableWorking();
}
- }).setPlayClickSoundResource(
- () -> getBaseMetaTileEntity().isAllowedToWork() ? SoundResource.GUI_BUTTON_UP.resourceLocation
- : SoundResource.GUI_BUTTON_DOWN.resourceLocation)
- .setBackground(() -> {
- List<UITexture> ret = new ArrayList<>();
- ret.add(GT_UITextures.BUTTON_STANDARD);
- if (getBaseMetaTileEntity().isAllowedToWork()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_ON);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF);
- }
- return ret.toArray(new IDrawable[0]);
- }).setPos(174, 148).setSize(16, 16);
+ })
+ .setPlayClickSoundResource(
+ () -> getBaseMetaTileEntity().isAllowedToWork()
+ ? SoundResource.GUI_BUTTON_UP.resourceLocation
+ : SoundResource.GUI_BUTTON_DOWN.resourceLocation)
+ .setBackground(() -> {
+ List<UITexture> ret = new ArrayList<>();
+ ret.add(GT_UITextures.BUTTON_STANDARD);
+ if (getBaseMetaTileEntity().isAllowedToWork()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_ON);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF);
+ }
+ return ret.toArray(new IDrawable[0]);
+ })
+ .setPos(174, 148)
+ .setSize(16, 16);
button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.power_switch"))
- .setTooltipShowUpDelay(TOOLTIP_DELAY);
+ .setTooltipShowUpDelay(TOOLTIP_DELAY);
return (ButtonWidget) button;
}
@@ -1679,26 +1764,30 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
if (isVoidExcessButtonEnabled()) {
voidExcess = !voidExcess;
}
- }).setPlayClickSound(true).setBackground(() -> {
- List<UITexture> ret = new ArrayList<>();
- ret.add(GT_UITextures.BUTTON_STANDARD);
- if (isVoidExcessButtonEnabled()) {
- if (isVoidExcessEnabled()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_ON);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_OFF);
- }
- } else {
- if (isVoidExcessEnabled()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_ON_DISABLED);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_OFF_DISABLED);
- }
- }
- return ret.toArray(new IDrawable[0]);
- }).setPos(8, 91).setSize(16, 16);
+ })
+ .setPlayClickSound(true)
+ .setBackground(() -> {
+ List<UITexture> ret = new ArrayList<>();
+ ret.add(GT_UITextures.BUTTON_STANDARD);
+ if (isVoidExcessButtonEnabled()) {
+ if (isVoidExcessEnabled()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_ON);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_OFF);
+ }
+ } else {
+ if (isVoidExcessEnabled()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_ON_DISABLED);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS_OFF_DISABLED);
+ }
+ }
+ return ret.toArray(new IDrawable[0]);
+ })
+ .setPos(8, 91)
+ .setSize(16, 16);
button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.void_excess"))
- .setTooltipShowUpDelay(TOOLTIP_DELAY);
+ .setTooltipShowUpDelay(TOOLTIP_DELAY);
return (ButtonWidget) button;
}
@@ -1707,26 +1796,32 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
if (isInputSeparationButtonEnabled()) {
inputSeparation = !inputSeparation;
}
- }).setPlayClickSound(true).setBackground(() -> {
- List<UITexture> ret = new ArrayList<>();
- ret.add(GT_UITextures.BUTTON_STANDARD);
- if (isInputSeparationButtonEnabled()) {
- if (isInputSeparationEnabled()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF);
- }
- } else {
- if (isInputSeparationEnabled()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON_DISABLED);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF_DISABLED);
- }
- }
- return ret.toArray(new IDrawable[0]);
- }).setPos(26, 91).setSize(16, 16);
+ })
+ .setPlayClickSound(true)
+ .setBackground(() -> {
+ List<UITexture> ret = new ArrayList<>();
+ ret.add(GT_UITextures.BUTTON_STANDARD);
+ if (isInputSeparationButtonEnabled()) {
+ if (isInputSeparationEnabled()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF);
+ }
+ } else {
+ if (isInputSeparationEnabled()) {
+ ret.add(
+ GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_ON_DISABLED);
+ } else {
+ ret.add(
+ GT_UITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF_DISABLED);
+ }
+ }
+ return ret.toArray(new IDrawable[0]);
+ })
+ .setPos(26, 91)
+ .setSize(16, 16);
button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.input_separation"))
- .setTooltipShowUpDelay(TOOLTIP_DELAY);
+ .setTooltipShowUpDelay(TOOLTIP_DELAY);
return (ButtonWidget) button;
}
@@ -1735,26 +1830,30 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
if (isBatchModeButtonEnabled()) {
batchMode = !batchMode;
}
- }).setPlayClickSound(true).setBackground(() -> {
- List<UITexture> ret = new ArrayList<>();
- ret.add(GT_UITextures.BUTTON_STANDARD);
- if (isBatchModeButtonEnabled()) {
- if (isBatchModeEnabled()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF);
- }
- } else {
- if (isBatchModeEnabled()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON_DISABLED);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF_DISABLED);
- }
- }
- return ret.toArray(new IDrawable[0]);
- }).setPos(44, 91).setSize(16, 16);
+ })
+ .setPlayClickSound(true)
+ .setBackground(() -> {
+ List<UITexture> ret = new ArrayList<>();
+ ret.add(GT_UITextures.BUTTON_STANDARD);
+ if (isBatchModeButtonEnabled()) {
+ if (isBatchModeEnabled()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF);
+ }
+ } else {
+ if (isBatchModeEnabled()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_ON_DISABLED);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_BATCH_MODE_OFF_DISABLED);
+ }
+ }
+ return ret.toArray(new IDrawable[0]);
+ })
+ .setPos(44, 91)
+ .setSize(16, 16);
button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.batch_mode"))
- .setTooltipShowUpDelay(TOOLTIP_DELAY);
+ .setTooltipShowUpDelay(TOOLTIP_DELAY);
return (ButtonWidget) button;
}
@@ -1763,26 +1862,30 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
if (supportsSingleRecipeLocking()) {
mLockedToSingleRecipe = !mLockedToSingleRecipe;
}
- }).setPlayClickSound(true).setBackground(() -> {
- List<UITexture> ret = new ArrayList<>();
- ret.add(GT_UITextures.BUTTON_STANDARD);
- if (supportsSingleRecipeLocking()) {
- if (isRecipeLockingEnabled()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED);
- }
- } else {
- if (isRecipeLockingEnabled()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED_DISABLED);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED_DISABLED);
- }
- }
- return ret.toArray(new IDrawable[0]);
- }).setPos(62, 91).setSize(16, 16);
+ })
+ .setPlayClickSound(true)
+ .setBackground(() -> {
+ List<UITexture> ret = new ArrayList<>();
+ ret.add(GT_UITextures.BUTTON_STANDARD);
+ if (supportsSingleRecipeLocking()) {
+ if (isRecipeLockingEnabled()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED);
+ }
+ } else {
+ if (isRecipeLockingEnabled()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_LOCKED_DISABLED);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED_DISABLED);
+ }
+ }
+ return ret.toArray(new IDrawable[0]);
+ })
+ .setPos(62, 91)
+ .setSize(16, 16);
button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.lock_recipe"))
- .setTooltipShowUpDelay(TOOLTIP_DELAY);
+ .setTooltipShowUpDelay(TOOLTIP_DELAY);
return (ButtonWidget) button;
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SpecialFilter.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SpecialFilter.java
index 6becb5e806..890733e363 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SpecialFilter.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SpecialFilter.java
@@ -90,58 +90,80 @@ public abstract class GT_MetaTileEntity_SpecialFilter extends GT_MetaTileEntity_
builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> {
bInvertFilter = !bInvertFilter;
if (bInvertFilter) {
- GT_Utility.sendChatToPlayer(widget.getContext().getPlayer(), GT_Utility.trans("124", "Invert Filter"));
+ GT_Utility.sendChatToPlayer(
+ widget.getContext()
+ .getPlayer(),
+ GT_Utility.trans("124", "Invert Filter"));
} else {
GT_Utility.sendChatToPlayer(
- widget.getContext().getPlayer(),
+ widget.getContext()
+ .getPlayer(),
GT_Utility.trans("125", "Don't invert Filter"));
}
- }).setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_INVERT_FILTER).setPos(61, 62)
- .setSize(18, 18)).widget(new ButtonWidget().setOnClick((clickData, widget) -> {
- bNBTAllowed = !bNBTAllowed;
- if (bNBTAllowed) {
- GT_Utility.sendChatToPlayer(
- widget.getContext().getPlayer(),
- GT_Utility.trans("126", "Ignore NBT"));
- } else {
- GT_Utility.sendChatToPlayer(
- widget.getContext().getPlayer(),
- GT_Utility.trans("127", "NBT has to match"));
- }
- }).setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_NBT).setPos(79, 62)
- .setSize(18, 18))
- .widget(
- new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_WHITE.apply(27, false))
- .setPos(6, 19).setSize(27, 24))
- .widget(
- new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_BLUE.apply(42, true))
- .setPos(53, 19).setSize(42, 24))
- .widget(
- new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_RED.apply(19, true))
- .setPos(152, 19).setSize(19, 24))
- .widget(new SlotWidget(BaseSlot.phantom(inventoryHandler, 9)) {
-
- @Override
- protected void phantomClick(ClickData clickData, ItemStack cursorStack) {
- clickTypeIcon(clickData.mouseButton != 0, cursorStack);
- }
-
- @Override
- public void buildTooltip(List<Text> tooltip) {
- if (getEmptySlotTooltip() != null) {
- tooltip.addAll(getEmptySlotTooltip());
- }
- super.buildTooltip(tooltip);
- }
-
- @Override
- public List<String> getExtraTooltip() {
- if (getItemExtraTooltip() != null) {
- return getItemExtraTooltip();
- }
- return Collections.emptyList();
- }
- }.disableShiftInsert().setPos(34, 22).setBackground(GT_UITextures.BUTTON_STANDARD))
- .widget(SlotGroup.ofItemHandler(inventoryHandler, 3).endAtSlot(8).build().setPos(97, 4));
+ })
+ .setBackground(
+ GT_UITextures.BUTTON_STANDARD,
+ GT_UITextures.OVERLAY_BUTTON_INVERT_FILTER)
+ .setPos(61, 62)
+ .setSize(18, 18))
+ .widget(new ButtonWidget().setOnClick((clickData, widget) -> {
+ bNBTAllowed = !bNBTAllowed;
+ if (bNBTAllowed) {
+ GT_Utility.sendChatToPlayer(
+ widget.getContext()
+ .getPlayer(),
+ GT_Utility.trans("126", "Ignore NBT"));
+ } else {
+ GT_Utility.sendChatToPlayer(
+ widget.getContext()
+ .getPlayer(),
+ GT_Utility.trans("127", "NBT has to match"));
+ }
+ })
+ .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_NBT)
+ .setPos(79, 62)
+ .setSize(18, 18))
+ .widget(
+ new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_WHITE.apply(27, false))
+ .setPos(6, 19)
+ .setSize(27, 24))
+ .widget(
+ new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_BLUE.apply(42, true))
+ .setPos(53, 19)
+ .setSize(42, 24))
+ .widget(
+ new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_RED.apply(19, true))
+ .setPos(152, 19)
+ .setSize(19, 24))
+ .widget(new SlotWidget(BaseSlot.phantom(inventoryHandler, 9)) {
+
+ @Override
+ protected void phantomClick(ClickData clickData, ItemStack cursorStack) {
+ clickTypeIcon(clickData.mouseButton != 0, cursorStack);
+ }
+
+ @Override
+ public void buildTooltip(List<Text> tooltip) {
+ if (getEmptySlotTooltip() != null) {
+ tooltip.addAll(getEmptySlotTooltip());
+ }
+ super.buildTooltip(tooltip);
+ }
+
+ @Override
+ public List<String> getExtraTooltip() {
+ if (getItemExtraTooltip() != null) {
+ return getItemExtraTooltip();
+ }
+ return Collections.emptyList();
+ }
+ }.disableShiftInsert()
+ .setPos(34, 22)
+ .setBackground(GT_UITextures.BUTTON_STANDARD))
+ .widget(
+ SlotGroup.ofItemHandler(inventoryHandler, 3)
+ .endAtSlot(8)
+ .build()
+ .setPos(97, 4));
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java
index 9c069bbd5f..3424baca8b 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java
@@ -124,7 +124,15 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit
protected SlotWidget createChargerSlot(int x, int y, String tooltipKey, Object[] tooltipArgs) {
return (SlotWidget) new SlotWidget(inventoryHandler, rechargerSlotStartIndex()).disableShiftInsert()
- .setGTTooltip(() -> mTooltipCache.getData(tooltipKey, tooltipArgs)).setTooltipShowUpDelay(TOOLTIP_DELAY)
- .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CHARGER).setPos(x, y);
+ .setGTTooltip(
+ () -> mTooltipCache.getData(
+ tooltipKey,
+ tooltipArgs))
+ .setTooltipShowUpDelay(
+ TOOLTIP_DELAY)
+ .setBackground(
+ getGUITextureSet().getItemSlot(),
+ GT_UITextures.OVERLAY_SLOT_CHARGER)
+ .setPos(x, y);
}
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java
index a70ee0d5e7..cb98e202ad 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java
@@ -175,9 +175,10 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
for (byte i = 0; i < 6 && aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity(); i++)
if (aBaseMetaTileEntity.inputEnergyFrom(i)) {
TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
- if (tTileEntity instanceof IEnergyProvider && ((IEnergyProvider) tTileEntity)
- .extractEnergy(ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)), 1, true)
- == 1) {
+ if (tTileEntity instanceof IEnergyProvider && ((IEnergyProvider) tTileEntity).extractEnergy(
+ ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)),
+ 1,
+ true) == 1) {
long tEU = (long) ((IEnergyProvider) tTileEntity).extractEnergy(
ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)),
GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU),
@@ -271,7 +272,8 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
IWailaConfigHandler config) {
final int facing = getBaseMetaTileEntity().getFrontFacing();
final NBTTagCompound tag = accessor.getNBTData();
- final int side = (byte) accessor.getSide().ordinal();
+ final int side = (byte) accessor.getSide()
+ .ordinal();
final boolean allowedToWork = tag.getBoolean("isAllowedToWork");
final byte inputTier = GT_Utility.getTier(tag.getLong("maxEUInput"));
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java
index 997898a34e..1c61f9ffa7 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Dynamo.java
@@ -125,7 +125,8 @@ public class GT_MetaTileEntity_Wireless_Dynamo extends GT_MetaTileEntity_Hatch_D
if (aTick == 1) {
// UUID and username of the owner.
- owner_uuid = aBaseMetaTileEntity.getOwnerUuid().toString();
+ owner_uuid = aBaseMetaTileEntity.getOwnerUuid()
+ .toString();
owner_name = aBaseMetaTileEntity.getOwnerName();
strongCheckOrAddUser(owner_uuid, owner_name);
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java
index 756a1b138a..e17cc6fbfb 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Wireless_Hatch.java
@@ -18,8 +18,8 @@ import gregtech.api.metatileentity.MetaTileEntity;
public class GT_MetaTileEntity_Wireless_Hatch extends GT_MetaTileEntity_Hatch_Energy
implements IGlobalWirelessEnergy, IWirelessEnergyHatchInformation {
- private final BigInteger eu_transferred_per_operation = BigInteger
- .valueOf(2 * V[mTier] * ticks_between_energy_addition);
+ private final BigInteger eu_transferred_per_operation = BigInteger.valueOf(
+ 2 * V[mTier] * ticks_between_energy_addition);
private final long eu_transferred_per_operation_long = eu_transferred_per_operation.longValue();
private String owner_uuid;
@@ -131,7 +131,8 @@ public class GT_MetaTileEntity_Wireless_Hatch extends GT_MetaTileEntity_Hatch_En
if (aTick == 1) {
// UUID and username of the owner.
- owner_uuid = aBaseMetaTileEntity.getOwnerUuid().toString();
+ owner_uuid = aBaseMetaTileEntity.getOwnerUuid()
+ .toString();
owner_name = aBaseMetaTileEntity.getOwnerName();
strongCheckOrAddUser(owner_uuid, owner_name);