diff options
| author | Jason Mitchell <mitchej@gmail.com> | 2023-01-28 19:32:44 -0800 |
|---|---|---|
| committer | Jason Mitchell <mitchej@gmail.com> | 2023-01-28 19:32:44 -0800 |
| commit | 55f64675b42ac8d3c557cc850f78664bee006f6f (patch) | |
| tree | 2afd26dd3d5e6f763119bc192b57c66a1a075922 /src/main/java/gtPlusPlus/xmod/gregtech/common/covers | |
| parent | 0f5dfd01b877b6a1019e0671b88d07974aae68c0 (diff) | |
| download | GT5-Unofficial-55f64675b42ac8d3c557cc850f78664bee006f6f.tar.gz GT5-Unofficial-55f64675b42ac8d3c557cc850f78664bee006f6f.tar.bz2 GT5-Unofficial-55f64675b42ac8d3c557cc850f78664bee006f6f.zip | |
[ci skip] spotlessApply with the new settings
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common/covers')
4 files changed, 150 insertions, 224 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java index 9e507048ed..9a5cf5f64c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java @@ -34,113 +34,69 @@ public class CoverManager { Cover_Gt_Machine_Casing = new MetaItemCoverCasings(); if (Loader.isModLoaded("Ztones")) { - String[] aZtoneCoverTextureNames = new String[] {"agon", "iszm", "korp", "jelt", "bitt"}; - MetaCustomCoverItem[] aZtoneCoverItems = - new MetaCustomCoverItem[] {Cover_Agon, Cover_Iszm, Cover_Korp, Cover_Jelt, Cover_Bitt}; - CustomIcon[][] aArrays = new CustomIcon[][] { - TEXTURE_ZTONES_AGON, TEXTURE_ZTONES_ISZM, TEXTURE_ZTONES_KORP, TEXTURE_ZTONES_JELT, TEXTURE_ZTONES_BITT - }; - short[][][] aRGB = - new short[][][] {ZTONES.RGB_AGON, ZTONES.RGB_ISZM, ZTONES.RGB_KORP, ZTONES.RGB_JELT, ZTONES.RGB_BITT - }; + String[] aZtoneCoverTextureNames = new String[] { "agon", "iszm", "korp", "jelt", "bitt" }; + MetaCustomCoverItem[] aZtoneCoverItems = new MetaCustomCoverItem[] { Cover_Agon, Cover_Iszm, Cover_Korp, + Cover_Jelt, Cover_Bitt }; + CustomIcon[][] aArrays = new CustomIcon[][] { TEXTURE_ZTONES_AGON, TEXTURE_ZTONES_ISZM, TEXTURE_ZTONES_KORP, + TEXTURE_ZTONES_JELT, TEXTURE_ZTONES_BITT }; + short[][][] aRGB = new short[][][] { ZTONES.RGB_AGON, ZTONES.RGB_ISZM, ZTONES.RGB_KORP, ZTONES.RGB_JELT, + ZTONES.RGB_BITT }; for (int y = 0; y < aZtoneCoverTextureNames.length; y++) { - aZtoneCoverItems[y] = - new MetaCustomCoverItem("Ztones", 16, aZtoneCoverTextureNames[y], aArrays[y], aRGB[y]); + aZtoneCoverItems[y] = new MetaCustomCoverItem( + "Ztones", + 16, + aZtoneCoverTextureNames[y], + aArrays[y], + aRGB[y]); } } } static final class ZTONES { - private static final short[][] RGB_AGON = new short[][] { - VanillaColours.DYE_WHITE.getAsShort(), - VanillaColours.DYE_YELLOW.getAsShort(), - VanillaColours.DYE_LIME.getAsShort(), - VanillaColours.DYE_GREEN.getAsShort(), - VanillaColours.DYE_CYAN.getAsShort(), - VanillaColours.DYE_LIGHT_BLUE.getAsShort(), - VanillaColours.DYE_DARK_BLUE.getAsShort(), - VanillaColours.DYE_DARK_PURPLE.getAsShort(), - VanillaColours.DYE_LIGHT_PURPLE.getAsShort(), - VanillaColours.DYE_PINK.getAsShort(), - VanillaColours.DYE_RED.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_BROWN.getAsShort(), - VanillaColours.DYE_BLACK.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_LIGHT_GRAY.getAsShort(), - }; - private static final short[][] RGB_ISZM = new short[][] { - VanillaColours.DYE_LIGHT_GRAY.getAsShort(), - VanillaColours.DYE_WHITE.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_BLUE.getAsShort(), - VanillaColours.DYE_YELLOW.getAsShort(), - VanillaColours.DYE_DARK_BLUE.getAsShort(), - VanillaColours.DYE_RED.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_CYAN.getAsShort(), - VanillaColours.DYE_YELLOW.getAsShort(), - VanillaColours.DYE_RED.getAsShort(), - VanillaColours.DYE_CYAN.getAsShort(), - VanillaColours.DYE_GREEN.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_LIGHT_BLUE.getAsShort(), - VanillaColours.DYE_DARK_PURPLE.getAsShort(), - }; - private static final short[][] RGB_KORP = new short[][] { - new short[] {125, 125, 125}, - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - new short[] {22, 156, 156}, - new short[] {22, 156, 156}, - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - }; - private static final short[][] RGB_JELT = new short[][] { - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - }; - private static final short[][] RGB_BITT = new short[][] { - VanillaColours.DYE_BLACK.getAsShort(), - VanillaColours.DYE_WHITE.getAsShort(), - VanillaColours.DYE_YELLOW.getAsShort(), - VanillaColours.DYE_LIME.getAsShort(), - VanillaColours.DYE_GREEN.getAsShort(), - VanillaColours.DYE_CYAN.getAsShort(), - VanillaColours.DYE_LIGHT_BLUE.getAsShort(), - VanillaColours.DYE_LIGHT_BLUE.getAsShort(), - VanillaColours.DYE_DARK_BLUE.getAsShort(), - VanillaColours.DYE_DARK_PURPLE.getAsShort(), - VanillaColours.DYE_LIGHT_PURPLE.getAsShort(), - VanillaColours.DYE_PINK.getAsShort(), - VanillaColours.DYE_RED.getAsShort(), - VanillaColours.DYE_RED.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_BROWN.getAsShort(), - }; + private static final short[][] RGB_AGON = new short[][] { VanillaColours.DYE_WHITE.getAsShort(), + VanillaColours.DYE_YELLOW.getAsShort(), VanillaColours.DYE_LIME.getAsShort(), + VanillaColours.DYE_GREEN.getAsShort(), VanillaColours.DYE_CYAN.getAsShort(), + VanillaColours.DYE_LIGHT_BLUE.getAsShort(), VanillaColours.DYE_DARK_BLUE.getAsShort(), + VanillaColours.DYE_DARK_PURPLE.getAsShort(), VanillaColours.DYE_LIGHT_PURPLE.getAsShort(), + VanillaColours.DYE_PINK.getAsShort(), VanillaColours.DYE_RED.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_BROWN.getAsShort(), + VanillaColours.DYE_BLACK.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), + VanillaColours.DYE_LIGHT_GRAY.getAsShort(), }; + private static final short[][] RGB_ISZM = new short[][] { VanillaColours.DYE_LIGHT_GRAY.getAsShort(), + VanillaColours.DYE_WHITE.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), + VanillaColours.DYE_DARK_BLUE.getAsShort(), VanillaColours.DYE_YELLOW.getAsShort(), + VanillaColours.DYE_DARK_BLUE.getAsShort(), VanillaColours.DYE_RED.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_CYAN.getAsShort(), + VanillaColours.DYE_YELLOW.getAsShort(), VanillaColours.DYE_RED.getAsShort(), + VanillaColours.DYE_CYAN.getAsShort(), VanillaColours.DYE_GREEN.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_LIGHT_BLUE.getAsShort(), + VanillaColours.DYE_DARK_PURPLE.getAsShort(), }; + private static final short[][] RGB_KORP = new short[][] { new short[] { 125, 125, 125 }, + VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), + VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), + VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), + VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), + VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), + VanillaColours.DYE_DARK_GRAY.getAsShort(), new short[] { 22, 156, 156 }, new short[] { 22, 156, 156 }, + VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), }; + private static final short[][] RGB_JELT = new short[][] { VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), }; + private static final short[][] RGB_BITT = new short[][] { VanillaColours.DYE_BLACK.getAsShort(), + VanillaColours.DYE_WHITE.getAsShort(), VanillaColours.DYE_YELLOW.getAsShort(), + VanillaColours.DYE_LIME.getAsShort(), VanillaColours.DYE_GREEN.getAsShort(), + VanillaColours.DYE_CYAN.getAsShort(), VanillaColours.DYE_LIGHT_BLUE.getAsShort(), + VanillaColours.DYE_LIGHT_BLUE.getAsShort(), VanillaColours.DYE_DARK_BLUE.getAsShort(), + VanillaColours.DYE_DARK_PURPLE.getAsShort(), VanillaColours.DYE_LIGHT_PURPLE.getAsShort(), + VanillaColours.DYE_PINK.getAsShort(), VanillaColours.DYE_RED.getAsShort(), + VanillaColours.DYE_RED.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_BROWN.getAsShort(), }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java index 4e2f758d61..fc7c2e83d8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java @@ -1,10 +1,19 @@ package gtPlusPlus.xmod.gregtech.common.covers; +import java.util.concurrent.atomic.AtomicBoolean; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; + import com.gtnewhorizons.modularui.api.drawable.Text; import com.gtnewhorizons.modularui.api.math.MathExpression; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.common.widget.TextWidget; import com.gtnewhorizons.modularui.common.widget.textfield.BaseTextFieldWidget; + import gregtech.api.gui.modularui.GT_CoverUIBuildContext; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.util.GT_CoverBehavior; @@ -13,12 +22,6 @@ import gregtech.api.util.ISerializableObject; import gregtech.common.gui.modularui.widget.CoverDataControllerWidget; import gregtech.common.gui.modularui.widget.CoverDataFollower_TextFieldWidget; import gtPlusPlus.core.util.minecraft.LangUtils; -import java.util.concurrent.atomic.AtomicBoolean; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; public class GTPP_Cover_Overflow extends GT_CoverBehavior { @@ -32,8 +35,8 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { this.mMaxTransferRate = aTransferRate * 1000; } - public int doCoverThings( - byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + long aTimer) { if (aCoverVariable == 0) { return aCoverVariable; } @@ -68,15 +71,8 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { return aCoverVariable; } - public int onCoverScrewdriverclick( - byte aSide, - int aCoverID, - int aCoverVariable, - ICoverable aTileEntity, - EntityPlayer aPlayer, - float aX, - float aY, - float aZ) { + public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + EntityPlayer aPlayer, float aX, float aY, float aZ) { if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { aCoverVariable += (mMaxTransferRate * (aPlayer.isSneaking() ? 0.1f : 0.01f)); } else { @@ -89,19 +85,13 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { aCoverVariable = mMaxTransferRate; } GT_Utility.sendChatToPlayer( - aPlayer, LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); + aPlayer, + LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); return aCoverVariable; } - public boolean onCoverRightclick( - byte aSide, - int aCoverID, - int aCoverVariable, - ICoverable aTileEntity, - EntityPlayer aPlayer, - float aX, - float aY, - float aZ) { + public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + EntityPlayer aPlayer, float aX, float aY, float aZ) { boolean aShift = aPlayer.isSneaking(); int aAmount = aShift ? 128 : 8; if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { @@ -116,7 +106,8 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { aCoverVariable = mMaxTransferRate; } GT_Utility.sendChatToPlayer( - aPlayer, LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); + aPlayer, + LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); return true; } @@ -194,40 +185,42 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { protected void addUIWidgets(ModularWindow.Builder builder) { AtomicBoolean warn = new AtomicBoolean(false); - builder.widget(new CoverDataControllerWidget<>( - this::getCoverData, this::setCoverData, GTPP_Cover_Overflow.this) + builder.widget( + new CoverDataControllerWidget<>(this::getCoverData, this::setCoverData, GTPP_Cover_Overflow.this) .addFollower( new CoverDataFollower_TextFieldWidget<>(), coverData -> String.valueOf(convert(coverData)), (coverData, state) -> new ISerializableObject.LegacyCoverData( (int) MathExpression.parseMathExpression(state)), - widget -> widget.setOnScrollNumbersLong(1, 5, 50) - .setNumbersLong(val -> { - warn.set(false); - if (val > mMaxTransferRate) { - val = (long) mMaxTransferRate; - warn.set(true); - } else if (val < 0) { - val = 0L; - } - return val; - }) - .setPattern(BaseTextFieldWidget.NATURAL_NUMS) - .setFocusOnGuiOpen(true) + widget -> widget.setOnScrollNumbersLong(1, 5, 50).setNumbersLong(val -> { + warn.set(false); + if (val > mMaxTransferRate) { + val = (long) mMaxTransferRate; + warn.set(true); + } else if (val < 0) { + val = 0L; + } + return val; + }).setPattern(BaseTextFieldWidget.NATURAL_NUMS).setFocusOnGuiOpen(true) .setPos(startX + spaceX * 0, startY + spaceY * 0 + 8) .setSize(spaceX * 4 - 3, 12))) - .widget(new TextWidget(GT_Utility.trans("323", "L")) - .setDefaultColor(COLOR_TEXT_GRAY.get()) - .setPos(startX + spaceX * 4, 4 + startY + spaceY * 0 + 8)) - .widget(TextWidget.dynamicText(() -> new Text((warn.get() - ? GT_Utility.trans("325", "Max") - : GT_Utility.trans("324", "Now")) - + ": " + convert(getCoverData()) - + "/" + mMaxTransferRate + " " - + GT_Utility.trans("323", "L")) - .color(warn.get() ? COLOR_TEXT_WARN.get() : COLOR_TEXT_GRAY.get())) - .setSynced(false) - .setPos(startX + spaceX * 0, 4 + startY + spaceY * 1 + 6)); + .widget( + new TextWidget(GT_Utility.trans("323", "L")).setDefaultColor(COLOR_TEXT_GRAY.get()) + .setPos(startX + spaceX * 4, 4 + startY + spaceY * 0 + 8)) + .widget( + TextWidget + .dynamicText( + () -> new Text( + (warn.get() ? GT_Utility.trans("325", "Max") + : GT_Utility.trans("324", "Now")) + ": " + + convert(getCoverData()) + + "/" + + mMaxTransferRate + + " " + + GT_Utility.trans("323", "L")).color( + warn.get() ? COLOR_TEXT_WARN.get() + : COLOR_TEXT_GRAY.get())) + .setSynced(false).setPos(startX + spaceX * 0, 4 + startY + spaceY * 1 + 6)); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java index 46a6e9d600..27cd5be67e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java @@ -1,5 +1,12 @@ package gtPlusPlus.xmod.gregtech.common.covers; +import java.lang.reflect.Field; +import java.util.HashMap; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; + import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -8,11 +15,6 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.LangUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import java.lang.reflect.Field; -import java.util.HashMap; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; public class GTPP_Cover_Overflow_Item extends GT_CoverBehavior { @@ -27,11 +29,11 @@ public class GTPP_Cover_Overflow_Item extends GT_CoverBehavior { static { sQuantumChest = ReflectionUtils.getClass("gregtech.common.tileentities.storage.GT_MetaTileEntity_QuantumChest"); - sSuperChestGTPP = ReflectionUtils.getClass( - "gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest"); + sSuperChestGTPP = ReflectionUtils + .getClass("gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest"); if (CORE.GTNH) { - sSuperChestGTNH = - ReflectionUtils.getClass("gregtech.common.tileentities.storage.GT_MetaTileEntity_SuperChest"); + sSuperChestGTNH = ReflectionUtils + .getClass("gregtech.common.tileentities.storage.GT_MetaTileEntity_SuperChest"); } else { sSuperChestGTNH = null; } @@ -54,15 +56,15 @@ public class GTPP_Cover_Overflow_Item extends GT_CoverBehavior { this.mMaxItemCapacity = aCapacity * 1000; } - public int doCoverThings( - byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + long aTimer) { if (aCoverVariable == 0) { return aCoverVariable; } // Get the IGTTile - IGregTechTileEntity aGtTileEntity = aTileEntity.getIGregTechTileEntity( - aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord()); + IGregTechTileEntity aGtTileEntity = aTileEntity + .getIGregTechTileEntity(aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord()); if (aGtTileEntity == null) { return aCoverVariable; } @@ -101,15 +103,8 @@ public class GTPP_Cover_Overflow_Item extends GT_CoverBehavior { return true; } - public int onCoverScrewdriverclick( - byte aSide, - int aCoverID, - int aCoverVariable, - ICoverable aTileEntity, - EntityPlayer aPlayer, - float aX, - float aY, - float aZ) { + public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + EntityPlayer aPlayer, float aX, float aY, float aZ) { if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { aCoverVariable += (mMaxItemCapacity * (aPlayer.isSneaking() ? 0.1f : 0.01f)); } else { @@ -122,19 +117,13 @@ public class GTPP_Cover_Overflow_Item extends GT_CoverBehavior { aCoverVariable = mMaxItemCapacity; } GT_Utility.sendChatToPlayer( - aPlayer, LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); + aPlayer, + LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); return aCoverVariable; } - public boolean onCoverRightclick( - byte aSide, - int aCoverID, - int aCoverVariable, - ICoverable aTileEntity, - EntityPlayer aPlayer, - float aX, - float aY, - float aZ) { + public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + EntityPlayer aPlayer, float aX, float aY, float aZ) { boolean aShift = aPlayer.isSneaking(); int aAmount = aShift ? 128 : 8; if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { @@ -149,7 +138,8 @@ public class GTPP_Cover_Overflow_Item extends GT_CoverBehavior { aCoverVariable = mMaxItemCapacity; } GT_Utility.sendChatToPlayer( - aPlayer, LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); + aPlayer, + LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); return true; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java index b8b130e987..eccbf78c8a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java @@ -1,5 +1,14 @@ package gtPlusPlus.xmod.gregtech.common.covers; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; + import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_CoverBehavior; @@ -8,13 +17,6 @@ import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.api.objects.random.XSTR; import gtPlusPlus.core.util.minecraft.LangUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { @@ -30,35 +32,20 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { ForgeDirection aDir = ForgeDirection.getOrientation(aSide); String s = aEntity.getInventoryName() + "." + aPos.getUniqueIdentifier() + aDir.name(); return s; - } catch (Throwable t) { - } + } catch (Throwable t) {} XSTR x = new XSTR(); return "ERROR." + x.getSeed() + x.hashCode() + x.nextDouble() + ".ID"; } - public boolean onCoverRightclick( - byte aSide, - int aCoverID, - int aCoverVariable, - ICoverable aTileEntity, - EntityPlayer aPlayer, - float aX, - float aY, - float aZ) { - PlayerUtils.messagePlayer( - aPlayer, LangUtils.trans("756", "Connectable: ") + getConnectionState(aCoverVariable)); + public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + EntityPlayer aPlayer, float aX, float aY, float aZ) { + PlayerUtils + .messagePlayer(aPlayer, LangUtils.trans("756", "Connectable: ") + getConnectionState(aCoverVariable)); return super.onCoverRightclick(aSide, aCoverID, aCoverVariable, aTileEntity, aPlayer, aX, aY, aZ); } - public int onCoverScrewdriverclick( - byte aSide, - int aCoverID, - int aCoverVariable, - ICoverable aTileEntity, - EntityPlayer aPlayer, - float aX, - float aY, - float aZ) { + public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + EntityPlayer aPlayer, float aX, float aY, float aZ) { return super.onCoverScrewdriverclick(aSide, aCoverID, aCoverVariable, aTileEntity, aPlayer, aX, aY, aZ); } @@ -95,8 +82,8 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { } @Override - public int doCoverThings( - byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + long aTimer) { try { String aKey = generateUniqueKey(aSide, aTileEntity); Integer b = sConnectionStateForEntityMap.get(aKey); @@ -131,8 +118,8 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { } @Override - public byte getRedstoneInput( - byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + public byte getRedstoneInput(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, + ICoverable aTileEntity) { if (!getConnectionState(aCoverVariable)) { return 0; } @@ -153,8 +140,8 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { } @Override - public boolean onCoverRemoval( - byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { + public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + boolean aForced) { String aKey = generateUniqueKey(aSide, aTileEntity); sConnectionStateForEntityMap.remove(aKey); // Logger.INFO("Unmapping key "+aKey+"."); |
