(ArrayList<String> aList, EntityPlayer aPlayer, World aWorld, int aScanLevel, int aX, int aY, int aZ, byte aSide, float aClickX, float aClickY, float aClickZ)
| 909 | } |
| 910 | |
| 911 | public static long scan(ArrayList<String> aList, EntityPlayer aPlayer, World aWorld, int aScanLevel, int aX, int aY, int aZ, byte aSide, float aClickX, float aClickY, float aClickZ) { |
| 912 | if (aList == null) return 0; |
| 913 | |
| 914 | ArrayList<String> rList = new ArrayListNoNulls<>(); |
| 915 | long rEUAmount = 0; |
| 916 | |
| 917 | Block aBlock = aWorld.getBlock(aX, aY, aZ); |
| 918 | byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ); |
| 919 | TileEntity aTileEntity = te(aWorld, aX, aY, aZ, T); |
| 920 | |
| 921 | rList.add("--- X: " + aX + " Y: " + aY + " Z: " + aZ + " ---"); |
| 922 | try { |
| 923 | rList.add("Name: " + (aTileEntity instanceof IInventory && Code.stringValid(((IInventory)aTileEntity).getInventoryName()) ? ((IInventory)aTileEntity).getInventoryName() : aBlock.getUnlocalizedName()) + " MetaData: " + aMeta); |
| 924 | rList.add("Registry: " + ST.regName(aBlock)); |
| 925 | if (aScanLevel >= 10) { |
| 926 | rList.add("Block Class: " + aBlock.getClass()); |
| 927 | if (aTileEntity != null) rList.add("TileEntity Class: " + aTileEntity.getClass()); |
| 928 | } |
| 929 | float tResistance = aBlock.getExplosionResistance(aPlayer, aWorld, aX, aY, aZ, aPlayer.posX, aPlayer.posY, aPlayer.posZ); |
| 930 | rList.add("Hardness: " + aBlock.getBlockHardness(aWorld, aX, aY, aZ) + " - " + LH.getToolTipBlastResistance(aBlock, tResistance)); |
| 931 | int tHarvestLevel = aBlock.getHarvestLevel(aMeta); |
| 932 | String tHarvestTool = aBlock.getHarvestTool(aMeta); |
| 933 | rList.add(tHarvestLevel == 0 && aBlock.getMaterial().isAdventureModeExempt() ? "Hand-Harvestable, but " + (Code.stringValid(tHarvestTool)?Code.capitalise(tHarvestTool):"None") + " is faster" : "Tool to Harvest: " + (Code.stringValid(tHarvestTool)?Code.capitalise(tHarvestTool):"None") + " (" + tHarvestLevel + ")"); |
| 934 | if (aBlock.isBeaconBase(aWorld, aX, aY, aZ, aX, aY+1, aZ)) rList.add("Is usable for Beacon Pyramids"); |
| 935 | if (MD.GC.mLoaded && aBlock instanceof IPartialSealableBlock) rList.add(((IPartialSealableBlock)aBlock).isSealed(aWorld, aX, aY, aZ, FORGE_DIR[aSide ^ 1]) ? "Is Sealable on this Side" : "Is not Sealable on this Side"); |
| 936 | } catch(Throwable e) {e.printStackTrace(ERR);} |
| 937 | if (aTileEntity != null) { |
| 938 | try {if (aTileEntity instanceof ITileEntityWeight && ((ITileEntityWeight)aTileEntity).getWeightValue(aSide) > 0) { |
| 939 | rEUAmount+=V[3]; |
| 940 | rList.add("Weight: " + ((ITileEntityWeight)aTileEntity).getWeightValue(aSide) + " kg"); |
| 941 | }} catch(Throwable e) {e.printStackTrace(ERR);} |
| 942 | try {if (aTileEntity instanceof ITileEntityTemperature && ((ITileEntityTemperature)aTileEntity).getTemperatureMax(aSide) > 0) { |
| 943 | rEUAmount+=V[3]; |
| 944 | rList.add("Temperature: " + ((ITileEntityTemperature)aTileEntity).getTemperatureValue(aSide) + " / " + ((ITileEntityTemperature)aTileEntity).getTemperatureMax(aSide) + " K"); |
| 945 | }} catch(Throwable e) {e.printStackTrace(ERR);} |
| 946 | try {if (aTileEntity instanceof ITileEntityGibbl && ((ITileEntityGibbl)aTileEntity).getGibblMax(aSide) > 0) { |
| 947 | rEUAmount+=V[3]; |
| 948 | rList.add("Pressure: " + ((ITileEntityGibbl)aTileEntity).getGibblValue(aSide) + " / " + ((ITileEntityGibbl)aTileEntity).getGibblMax(aSide) + " Gibbl"); |
| 949 | }} catch(Throwable e) {e.printStackTrace(ERR);} |
| 950 | try {if (aTileEntity instanceof ITileEntityProgress && ((ITileEntityProgress)aTileEntity).getProgressMax(aSide) > 0) { |
| 951 | rEUAmount+=V[3]; |
| 952 | rList.add("Progress: " + ((ITileEntityProgress)aTileEntity).getProgressValue(aSide) + " / " + ((ITileEntityProgress)aTileEntity).getProgressMax(aSide)); |
| 953 | }} catch(Throwable e) {e.printStackTrace(ERR);} |
| 954 | |
| 955 | |
| 956 | String rState = ""; |
| 957 | try {if (aTileEntity instanceof ITileEntitySwitchableOnOff) { |
| 958 | if (Code.stringValid(rState)) rState += " --- "; |
| 959 | rEUAmount+=V[3]; |
| 960 | rState += ("State: " + (((ITileEntitySwitchableOnOff)aTileEntity).getStateOnOff()?"ON":"OFF")); |
| 961 | }} catch(Throwable e) {e.printStackTrace(ERR);} |
| 962 | try {if (aTileEntity instanceof ITileEntitySwitchableMode) { |
| 963 | if (Code.stringValid(rState)) rState += " --- "; |
| 964 | rEUAmount+=V[3]; |
| 965 | rState += ("Mode: " + (((ITileEntitySwitchableMode)aTileEntity).getStateMode())); |
| 966 | }} catch(Throwable e) {e.printStackTrace(ERR);} |
| 967 | try {if (aTileEntity instanceof ITileEntityRunningSuccessfully) { |
| 968 | if (Code.stringValid(rState)) rState += " --- "; |
no test coverage detected