@author Gregorius Techneticies
| 59 | * @author Gregorius Techneticies |
| 60 | */ |
| 61 | public class ItemFluidDisplay extends Item implements IFluidContainerItem, IItemUpdatable, IItemGT { |
| 62 | protected IIcon mIcon; |
| 63 | private final String mName; |
| 64 | |
| 65 | public ItemFluidDisplay() { |
| 66 | super(); |
| 67 | mName = "gt.display.fluid"; |
| 68 | LH.add(mName, "Fluid Display"); |
| 69 | GameRegistry.registerItem(this, mName, MD.GAPI.mID); |
| 70 | if (ConfigsGT.CLIENT.get(ConfigCategories.visibility, "HiddenGTFluidDisplay", F)) ST.hide(this); |
| 71 | ItemsGT.DEBUG_ITEMS.add(this); |
| 72 | ItemsGT.ILLEGAL_DROPS.add(this); |
| 73 | GarbageGT.BLACKLIST.add(this); |
| 74 | } |
| 75 | |
| 76 | @Override |
| 77 | public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { |
| 78 | if (!aWorld.isRemote && UT.Entities.hasInfiniteItems(aPlayer)) for (byte tSide : ALL_SIDES_VALID) if (FL.fill(WD.te(aWorld, aX, aY, aZ, tSide, T), FL.make(FL.fluid(ST.meta_(aStack)), Integer.MAX_VALUE), T) > 0) return T; |
| 79 | return !aWorld.isRemote; |
| 80 | } |
| 81 | |
| 82 | @Override |
| 83 | @SuppressWarnings("unchecked") |
| 84 | public void addInformation(ItemStack aStack, EntityPlayer aPlayer, @SuppressWarnings("rawtypes") List aList, boolean aF3_H) { |
| 85 | NBTTagCompound aNBT = aStack.getTagCompound(); |
| 86 | Fluid aFluid = FL.fluid(ST.meta_(aStack)); |
| 87 | if (aFluid == null) { |
| 88 | aList.add(LH.Chat.BLINKING_RED + "CLIENTSIDE FLUID IS NULL!!!"); |
| 89 | } else if (FL.Error.is(aFluid)) { |
| 90 | aList.add(LH.Chat.BLINKING_RED + "THIS IS AN ERROR AND SHOULD NEVER BE OBTAINABLE!!!"); |
| 91 | } else { |
| 92 | String aName = aFluid.getName(); |
| 93 | |
| 94 | if (SHOW_INTERNAL_NAMES || aF3_H) aList.add("Registry: " + aName); |
| 95 | if (FL.exists(FluidsGT.FLUID_RENAMINGS.get(aName)) || FluidsGT.NONSTANDARD.contains(aName)) aList.add(LH.Chat.BLINKING_RED + "NON-STANDARD FLUID!"); |
| 96 | |
| 97 | long tAmount = 0, tTemperature = DEF_ENV_TEMP; |
| 98 | FluidStack tFluid = NF; |
| 99 | boolean tGas = F; |
| 100 | |
| 101 | if (aNBT == null) { |
| 102 | tAmount = 0; |
| 103 | tFluid = FL.make(aFluid, (int)tAmount); |
| 104 | tGas = FL.gas(tFluid); |
| 105 | tTemperature = FL.temperature(tFluid); |
| 106 | } else { |
| 107 | tAmount = aNBT.getLong("a"); |
| 108 | tFluid = FL.make(aFluid, (int)tAmount); |
| 109 | tGas = aNBT.getBoolean("s"); |
| 110 | tTemperature = aNBT.getLong("h"); |
| 111 | } |
| 112 | |
| 113 | if (tAmount > 0) { |
| 114 | aList.add(LH.Chat.BLUE + "Amount: " + UT.Code.makeString(tAmount) + " L"); |
| 115 | } |
| 116 | OreDictMaterialStack tMaterial = OreDictMaterial.FLUID_MAP.get(aName); |
| 117 | if (tMaterial != null) { |
| 118 | if (tMaterial.mAmount > 0 && tAmount > 0) { |
nothing calls this directly
no outgoing calls
no test coverage detected