diff options
| author | Léa Gris <lea.gris@noiraude.net> | 2022-07-23 13:21:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-23 13:21:54 +0200 |
| commit | 74464417fd78c389b9d84173a7f9aeb4443ae0b6 (patch) | |
| tree | 84170a821c75e6198801438e7d5da71df48b2beb /src/main/java/gregtech/common/tileentities/machines | |
| parent | 4f4a5e495e5a71467fb22ae5694f508193bc5f13 (diff) | |
| download | GT5-Unofficial-74464417fd78c389b9d84173a7f9aeb4443ae0b6.tar.gz GT5-Unofficial-74464417fd78c389b9d84173a7f9aeb4443ae0b6.tar.bz2 GT5-Unofficial-74464417fd78c389b9d84173a7f9aeb4443ae0b6.zip | |
add(api/enums): particle and sound effect enumerations (#1154)
* add(api/enums): particle and sound effect enumerations
- Adds new GregTech API enumerations:
- `ParticleFX`: Enumerates known EntityFX particles.
- `SoundResource`: Enumerates known sounds with, id and ResourceLocation.
- Refactors code to use the new enumerations instead of string literals.
- Uses `ParticleFX` and `onRandomDisplayTick` to improve or implement
new particle effects for these machines:
- BBF: Adds random flames in front of the firebox.
- Steam machines: Changes pressure-exhaust particles to white vapour,
rather than dark smoke.
- Magic Energy Absorber: Adds random effect, of absorbed magical purple
particles, by the EnderDragon Egg siphon.
- Forge Hammer: Adds sparse random sparks, ejected from the main face.
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines')
18 files changed, 671 insertions, 461 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java index 1573c951eb..4bc9a56e2f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java @@ -1,14 +1,12 @@ package gregtech.common.tileentities.machines.basic; -import cpw.mods.fml.common.FMLCommonHandler; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IIndividual; import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SoundResource; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -16,7 +14,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin import gregtech.api.objects.ItemData; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_AssemblyLineUtils; -import gregtech.api.util.GT_Assemblyline_Server; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -24,11 +21,13 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; import net.minecraft.init.Items; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagString; +import java.util.Objects; + +import static gregtech.api.enums.GT_Values.*; import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes; @@ -36,30 +35,30 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_Scanner(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 1, "Scans Crops and other things.", 1, 1, "Scanner.png", "", - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_SCANNER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_SIDE_SCANNER_ACTIVE_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_SCANNER), - TextureFactory.builder().addIcon(OVERLAY_SIDE_SCANNER_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_SCANNER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_FRONT_SCANNER_ACTIVE_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_SCANNER), - TextureFactory.builder().addIcon(OVERLAY_FRONT_SCANNER_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_SCANNER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_TOP_SCANNER_ACTIVE_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_SCANNER), - TextureFactory.builder().addIcon(OVERLAY_TOP_SCANNER_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_SCANNER_ACTIVE), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_SCANNER_ACTIVE_GLOW).glow().build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_SCANNER), - TextureFactory.builder().addIcon(OVERLAY_BOTTOM_SCANNER_GLOW).glow().build())); + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_SCANNER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_SCANNER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_SCANNER), + TextureFactory.builder().addIcon(OVERLAY_SIDE_SCANNER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_SCANNER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_SCANNER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_SCANNER), + TextureFactory.builder().addIcon(OVERLAY_FRONT_SCANNER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_SCANNER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_SCANNER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_SCANNER), + TextureFactory.builder().addIcon(OVERLAY_TOP_SCANNER_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_SCANNER_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_SCANNER_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_SCANNER), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_SCANNER_GLOW).glow().build())); } public GT_MetaTileEntity_Scanner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { @@ -105,7 +104,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { return 2; } } catch (Throwable e) { - if (GT_Values.D1) { + if (D1) { e.printStackTrace(GT_Log.err); } } @@ -127,6 +126,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { } aStack.stackSize -= 1; this.mOutputItems[0] = GT_Utility.copyAmount(1L, aStack); + assert this.mOutputItems[0] != null; this.mOutputItems[0].setTagCompound(tNBT); return 2; } @@ -170,6 +170,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { aStack.stackSize -= 1; this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); + assert this.mOutputItems[0] != null; this.mOutputItems[0].setTagCompound(aStack.getTagCompound()); calculateOverclockedNess(30, 128); //In case recipe is too OP for that machine @@ -182,6 +183,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { aStack.stackSize -= 1; this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); + assert this.mOutputItems[0] != null; this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "map_id", (short) aStack.getItemDamage())); calculateOverclockedNess(30, 128); //In case recipe is too OP for that machine @@ -195,27 +197,32 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; String sTier = ""; - if (aStack.getItem().getIdFromItem(aStack.getItem()) == GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 0).getItem().getIdFromItem(GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 0).getItem())) { - if (aStack.getItemDamage() == 0 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 0).copy().toString())) + int stackItemID = Item.getIdFromItem(aStack.getItem()); + int stackItemDamage = aStack.getItemDamage(); + if (stackItemID == Item.getIdFromItem(Objects.requireNonNull(GT_ModHandler.getModItem(MOD_ID_GC_CORE, "item.schematic", 1L, 0)).getItem())) { + if (stackItemDamage == 0 && aStack.toString().equals(Objects.requireNonNull(GT_ModHandler.getModItem(MOD_ID_GC_CORE, "item.schematic", 1L, 0)).copy().toString())) sTier = "100"; - else if (aStack.getItemDamage() == 1 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 1).copy().toString())) + else if (stackItemDamage == 1 && aStack.toString().equals(Objects.requireNonNull(GT_ModHandler.getModItem(MOD_ID_GC_CORE, "item.schematic", 1L, 1)).copy().toString())) sTier = "2"; - } else if (aStack.getItem().getIdFromItem(aStack.getItem()) == GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 0).getItem().getIdFromItem(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 0).getItem())) { - if (aStack.getItemDamage() == 0 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 0).copy().toString())) - sTier = "3"; - else if (aStack.getItemDamage() == 1 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 1).copy().toString())) - sTier = "101"; - else if (aStack.getItemDamage() == 2 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 2).copy().toString())) - sTier = "102"; - } else if (aStack.getUnlocalizedName().matches(".*\\d+.*")) - sTier = aStack.getUnlocalizedName().split("(?<=\\D)(?=\\d)")[1].substring(0, 1); - else - sTier = "1"; + } else { + if (stackItemID == Item.getIdFromItem(Objects.requireNonNull(GT_ModHandler.getModItem(MOD_ID_GC_MARS, "item.schematic", 1L, 0)).getItem())) { + if (stackItemDamage == 0 && aStack.toString().equals(Objects.requireNonNull(GT_ModHandler.getModItem(MOD_ID_GC_MARS, "item.schematic", 1L, 0)).copy().toString())) + sTier = "3"; + else if (stackItemDamage == 1 && aStack.toString().equals(Objects.requireNonNull(GT_ModHandler.getModItem(MOD_ID_GC_MARS, "item.schematic", 1L, 1)).copy().toString())) + sTier = "101"; + else if (stackItemDamage == 2 && aStack.toString().equals(Objects.requireNonNull(GT_ModHandler.getModItem(MOD_ID_GC_MARS, "item.schematic", 1L, 2)).copy().toString())) + sTier = "102"; + } else if (aStack.getUnlocalizedName().matches(".*\\d+.*")) + sTier = aStack.getUnlocalizedName().split("(?<=\\D)(?=\\d)")[1].substring(0, 1); + else + sTier = "1"; + } getSpecialSlot().stackSize -= 1; aStack.stackSize -= 1; this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); + assert this.mOutputItems[0] != null; this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "rocket_tier", Short.parseShort(sTier))); calculateOverclockedNess(480, 36000); @@ -241,7 +248,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { } } - if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true) && aStack != null) { + if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true)) { for (GT_Recipe.GT_Recipe_AssemblyLine tRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) { if (GT_Utility.areStacksEqual(tRecipe.mResearchItem, aStack, true)) { boolean failScanner = true; @@ -254,20 +261,12 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { if (failScanner) { return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; } - - String s = tRecipe.mOutput.getDisplayName(); - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { - s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mOutput.getDisplayName()); - if (s == null) - s = tRecipe.mOutput.getDisplayName(); - } this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); - // Use Assline Utils if (GT_AssemblyLineUtils.setAssemblyLineRecipeOnDataStick(this.mOutputItems[0], tRecipe)) { - aStack.stackSize -= 1; + aStack.stackSize -= 1; calculateOverclockedNess(30, tRecipe.mResearchTime); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) @@ -275,7 +274,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { getSpecialSlot().stackSize -= 1; return 2; } - + } } } @@ -314,7 +313,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(212), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(SoundResource.IC2_MACHINES_MAGNETIZER_LOOP, 10, 1.0F, aX, aY, aZ); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java index c349ace362..a74f8123ec 100644 --- a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java @@ -1,7 +1,7 @@ /** - * + * * Inspired/ported from GregTech 6 under the LGPL license - * + * * Copyright (c) 2020 GregTech-6 Team * * This file is part of GregTech. @@ -66,7 +66,7 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta public GT_MetaTileEntity_LongDistancePipelineBase(int aID, String aName, String aNameRegional, int aTier, String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } - + public GT_MetaTileEntity_LongDistancePipelineBase(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -99,7 +99,7 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta public boolean isSameClass(GT_MetaTileEntity_LongDistancePipelineBase other) { return false; } - + @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) return true; @@ -112,7 +112,7 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta } return false; } - + public boolean isDead() { return getBaseMetaTileEntity() == null || getBaseMetaTileEntity().isDead(); } @@ -122,7 +122,7 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta if (gt_tile == null || !gt_tile.isAllowedToWork() || gt_tile.isClientSide()) return false; World world = gt_tile.getWorld(); if (world == null) return false; - + if (mTargetPos == null) { // We don't have a target position, scan the pipes scanPipes(); @@ -133,9 +133,9 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta // Only check if the target position is loaded TileEntity te = world.getTileEntity(mTargetPos.posX, mTargetPos.posY, mTargetPos.posZ); final IMetaTileEntity tMeta; - if (te instanceof BaseMetaTileEntity && + if (te instanceof BaseMetaTileEntity && ((tMeta = ((BaseMetaTileEntity)te).getMetaTileEntity()) instanceof GT_MetaTileEntity_LongDistancePipelineBase) && - isSameClass((GT_MetaTileEntity_LongDistancePipelineBase)tMeta)) + isSameClass((GT_MetaTileEntity_LongDistancePipelineBase)tMeta)) { // It's the right type! mTarget = (GT_MetaTileEntity_LongDistancePipelineBase)tMeta; @@ -164,54 +164,54 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta aList.addAll(Arrays.asList("Is the Target", "Sender is at: X: " + coords.posX + " Y: " + coords.posY + " Z: " + coords.posZ)); } else { aList.addAll( - Arrays.asList(checkTarget() ? "Has Target" : "Has no loaded Target", + Arrays.asList(checkTarget() ? "Has Target" : "Has no loaded Target", "Target should be around: X: " + mTargetPos.posX + " Y: " + mTargetPos.posY + " Z: " + mTargetPos.posZ )); - } + } return aList; } - + // What meta should the pipes for this pipeline have public abstract int getPipeMeta(); - + protected void scanPipes() { if (mSender != null && !mSender.isDead() && mSender.mTarget == this) return; - + // Check if we need to scan anything final IGregTechTileEntity gtTile = getBaseMetaTileEntity(); if (gtTile == null) return; - + final World world = gtTile.getWorld(); if (world == null) return; - + mTargetPos = getCoords(); mTarget = this; mSender = null; - + // Start scanning from the output side Block aBlock = gtTile.getBlockAtSide(gtTile.getBackFacing()); - + if(aBlock instanceof GT_Block_LongDistancePipe) { byte aMetaData = gtTile.getMetaIDAtSide(gtTile.getBackFacing()); if (aMetaData != getPipeMeta()) return; - + HashSet<ChunkCoordinates> tVisited = new HashSet<>(Collections.singletonList(getCoords())), tWires = new HashSet<>(); - Queue<ChunkCoordinates> + Queue<ChunkCoordinates> tQueue = new LinkedList<>(Collections.singletonList(getFacingOffset(gtTile, gtTile.getBackFacing()))); while (!tQueue.isEmpty()) { final ChunkCoordinates aCoords = tQueue.poll(); - + if(world.getBlock(aCoords.posX, aCoords.posY, aCoords.posZ) == aBlock && world.getBlockMetadata(aCoords.posX, aCoords.posY, aCoords.posZ) == aMetaData) { // We've got another pipe/wire block - // TODO: Make sure it's the right type of pipe/wire via meta + // TODO: Make sure it's the right type of pipe/wire via meta ChunkCoordinates tCoords; tWires.add(aCoords); - + // For each direction, if we haven't already visisted that coordinate, add it to the end of the queue if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX + 1, aCoords.posY, aCoords.posZ))) tQueue.add(tCoords); if (tVisited.add(tCoords = new ChunkCoordinates(aCoords.posX - 1, aCoords.posY, aCoords.posZ))) tQueue.add(tCoords); @@ -223,12 +223,12 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta // It's not a block - let's see if it's a tile entity TileEntity tTileEntity = world.getTileEntity(aCoords.posX, aCoords.posY, aCoords.posZ); if ( - tTileEntity != gtTile && tTileEntity instanceof BaseMetaTileEntity && - ((BaseMetaTileEntity)tTileEntity).getMetaTileEntity() instanceof GT_MetaTileEntity_LongDistancePipelineBase) + tTileEntity != gtTile && tTileEntity instanceof BaseMetaTileEntity && + ((BaseMetaTileEntity)tTileEntity).getMetaTileEntity() instanceof GT_MetaTileEntity_LongDistancePipelineBase) { final GT_MetaTileEntity_LongDistancePipelineBase tGtTile = (GT_MetaTileEntity_LongDistancePipelineBase)((BaseMetaTileEntity) tTileEntity).getMetaTileEntity(); if (isSameClass(tGtTile) && tWires.contains( - tGtTile.getFacingOffset((BaseMetaTileEntity)tTileEntity, ((BaseMetaTileEntity) tTileEntity).getFrontFacing()) + tGtTile.getFacingOffset((BaseMetaTileEntity)tTileEntity, ((BaseMetaTileEntity) tTileEntity).getFrontFacing()) )) { // If it's the same class, and we've scanned a wire in front of it (the input side), we've found our target // still need to check if it's distant enough @@ -244,7 +244,7 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta } } } - + // Remove this block from the visited because we might end up back here from another wire that IS connected to the // input side tVisited.remove(aCoords); @@ -252,7 +252,7 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta } } } - + } protected int getDistanceToSelf(ChunkCoordinates aCoords) { @@ -265,15 +265,15 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta return new ChunkCoordinates( gt_tile.getOffsetX(aSide, 1), gt_tile.getOffsetY(aSide, 1), gt_tile.getOffsetZ(aSide, 1) ); - + } - + public ChunkCoordinates getCoords() { final IGregTechTileEntity gt_tile = getBaseMetaTileEntity(); return new ChunkCoordinates(gt_tile.getXCoord(), gt_tile.getYCoord(), gt_tile.getZCoord()); } - @Override + @Override public void onMachineBlockUpdate() { //GT_Mod.GT_FML_LOGGER.info("You're dead to me"); mTargetPos = null; mSender = null; @@ -288,33 +288,33 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta public boolean shouldTriggerBlockUpdate() { return true; } @Override - public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { + public void getWailaBody(ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { final NBTTagCompound tag = accessor.getNBTData(); final int facing = getBaseMetaTileEntity().getFrontFacing(); final int side = (byte) accessor.getSide().ordinal(); if (side == facing) - currenttip.add(GOLD + "Pipeline Input" + RESET); + currentTip.add(GOLD + "Pipeline Input" + RESET); else if (side == ForgeDirection.OPPOSITES[facing]) - currenttip.add(BLUE + "Pipeline Output" + RESET); + currentTip.add(BLUE + "Pipeline Output" + RESET); else - currenttip.add("Pipeline Side"); + currentTip.add("Pipeline Side"); if (tag.getBoolean("hasSender")) - currenttip.add("Other End of Input: " + GREEN + "distance" + RESET); + currentTip.add("Other End of Input: " + GREEN + "distance" + RESET); else if (tag.getBoolean("hasTooCloseSender")) - currenttip.add("Other End of Input: " + RED + "too close" + RESET); + currentTip.add("Other End of Input: " + RED + "too close" + RESET); else - currenttip.add("Other End of Input: " + YELLOW + "cannot found(may need to update other end)" + RESET); + currentTip.add("Other End of Input: " + YELLOW + "cannot found(may need to update other end)" + RESET); if (tag.getBoolean("hasTarget")) - currenttip.add("Other End of Output: " + GREEN + "distance" + RESET); + currentTip.add("Other End of Output: " + GREEN + "distance" + RESET); else if (tag.getBoolean("hasTooCloseTarget")) - currenttip.add("Other End of Output: " + RED + "too close" + RESET); + currentTip.add("Other End of Output: " + RED + "too close" + RESET); else - currenttip.add("Other End of Output: " + YELLOW + "cannot found" + RESET); + currentTip.add("Other End of Output: " + YELLOW + "cannot found" + RESET); - super.getWailaBody(itemStack, currenttip, accessor, config); + super.getWailaBody(itemStack, currentTip, accessor, config); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java index fae9ff3fec..674b674b1c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java @@ -6,13 +6,19 @@ import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; +import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.*; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_DataAccess; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_MultiInput; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_AssemblyLineUtils; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; @@ -24,7 +30,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; -import java.util.Arrays; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlockAnyMeta; @@ -329,7 +334,7 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 20) { - GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(212), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(SoundResource.IC2_MACHINES_MAGNETIZER_LOOP, 10, 1.0F, aX, aY, aZ); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java index b6c9b230a1..5f6a34832e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java @@ -2,6 +2,7 @@ package gregtech.common.tileentities.machines.multi; import gregtech.GT_Mod; import gregtech.api.GregTech_API; +import gregtech.api.enums.ParticleFX; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ISecondaryDescribable; import gregtech.api.interfaces.ITexture; @@ -282,7 +283,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul new WorldSpawnedEventBuilder.ParticleEventBuilder() .setMotion(0D,0.3D,0D) - .setIdentifier("largesmoke") + .setIdentifier(ParticleFX.LARGE_SMOKE) .setPosition( aBaseMetaTileEntity.getOffsetX((byte) 1, 1) + XSTR_INSTANCE.nextFloat(), aBaseMetaTileEntity.getOffsetY((byte) 1, 1), diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java index b6ee628f2e..e0e3124d4c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java @@ -3,6 +3,7 @@ package gregtech.common.tileentities.machines.multi; import com.gtnewhorizon.structurelib.structure.IStructureElement; import gregtech.GT_Mod; import gregtech.api.GregTech_API; +import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.gui.GT_GUIContainer_MultiMachine; @@ -21,10 +22,7 @@ import java.util.ArrayList; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW; -import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW; +import static gregtech.api.enums.Textures.BlockIcons.*; public class GT_MetaTileEntity_ImplosionCompressor extends GT_MetaTileEntity_CubicMultiBlockBase<GT_MetaTileEntity_ImplosionCompressor> { public GT_MetaTileEntity_ImplosionCompressor(int aID, String aName, String aNameRegional) { @@ -44,20 +42,20 @@ public class GT_MetaTileEntity_ImplosionCompressor extends GT_MetaTileEntity_Cub protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Implosion Compressor") - .addInfo("Explosions are fun") - .addInfo("Controller block for the Implosion Compressor") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) |
