diff options
| author | Techlone <techlone.mc@gmail.com> | 2017-06-01 20:59:40 +0500 |
|---|---|---|
| committer | Techlone <techlone.mc@gmail.com> | 2017-06-01 20:59:40 +0500 |
| commit | 067f4491a812497f6bd013690cf9d8b13f8fc4b3 (patch) | |
| tree | 2d2fb412e2f503b9ba5fafa073e0afec6580c464 /src/main/java/gregtech/common/tileentities/machines/basic | |
| parent | 7c48590a49242bb26eddafa26d2cd7b4ce3546d8 (diff) | |
| parent | f2f74c09f931b5e6647037b40d56672d3b605cb2 (diff) | |
| download | GT5-Unofficial-067f4491a812497f6bd013690cf9d8b13f8fc4b3.tar.gz GT5-Unofficial-067f4491a812497f6bd013690cf9d8b13f8fc4b3.tar.bz2 GT5-Unofficial-067f4491a812497f6bd013690cf9d8b13f8fc4b3.zip | |
Merge branch 'unstable' into advminer2_improvements
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines/basic')
2 files changed, 13 insertions, 11 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java index 270fef65e3..24eaf87292 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java @@ -22,6 +22,7 @@ import gregtech.api.objects.ItemData; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_UndergroundOil; import gregtech.common.blocks.GT_Block_Ores_Abstract; import gregtech.common.blocks.GT_TileEntity_Ores; import ic2.core.Ic2Items; @@ -31,6 +32,7 @@ import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.ChunkPosition; import net.minecraftforge.fluids.FluidStack; @@ -141,25 +143,24 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba int tLeftZBound = GT_Utility.getScaleCoordinates(this.getBaseMetaTileEntity().getZCoord() - radius, 16); int tRightZBound = GT_Utility.getScaleCoordinates(this.getBaseMetaTileEntity().getZCoord() + radius, 16); - HashMap<ChunkPosition, FluidStack> tFluids = new HashMap<ChunkPosition, FluidStack>(); + HashMap<ChunkCoordIntPair, FluidStack> tFluids = new HashMap<>(); try { for (int x = tLeftXBound; x <= tRightXBound; ++x) for (int z = tLeftZBound; z <= tRightZBound; ++z) { ChunkPosition tPos = new ChunkPosition(GT_Utility.getScaleCoordinates(x*16,96), 0, GT_Utility.getScaleCoordinates(z*16,96)); - FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), x*16, z*16); + ChunkCoordIntPair cInts = getBaseMetaTileEntity().getWorld().getChunkFromChunkCoords(tPos.chunkPosX,tPos.chunkPosZ).getChunkCoordIntPair(); + FluidStack tFluid = GT_UndergroundOil.undergroundOil(getBaseMetaTileEntity().getWorld().getChunkFromChunkCoords(tPos.chunkPosX,tPos.chunkPosZ),-1); if (tFluid != null) - if (tFluids.containsKey(tPos)) - { - if (tFluids.get(tPos).amount<tFluid.amount) - tFluids.get(tPos).amount = tFluid.amount; - } else if (tFluid.amount / 5000 > 0) - tFluids.put(tPos, tFluid); + if (tFluids.containsKey(cInts)) { + if (tFluids.get(cInts).amount<tFluid.amount) + tFluids.get(cInts).amount = tFluid.amount; + } else tFluids.put(cInts, tFluid); } - for (HashMap.Entry<ChunkPosition, FluidStack> fl : tFluids.entrySet()) { - aOils.put(fl.getKey().chunkPosX + "," + fl.getKey().chunkPosZ + "," + (fl.getValue().amount / 5000) + "," + fl.getValue().getLocalizedName(), fl.getValue().amount / 5000); + for (Map.Entry<ChunkCoordIntPair, FluidStack> fl : tFluids.entrySet()) { + aOils.put(fl.getKey().chunkXPos + "," + fl.getKey().chunkZPos + "," + fl.getValue().amount + "," + fl.getValue().getLocalizedName(), fl.getValue().amount); } } catch (Exception e) { // TODO: handle exception diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java index b088e10d69..85defad0cb 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java @@ -12,6 +12,7 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.ItemData; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_UndergroundOil; import gregtech.common.blocks.GT_Block_Ores_Abstract; import gregtech.common.blocks.GT_TileEntity_Ores; import ic2.core.Ic2Items; @@ -102,7 +103,7 @@ public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_Basic } } if(tStringList.size()<1){tStringList.add("No Ores found.");} - FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord()); + FluidStack tFluid = GT_UndergroundOil.undergroundOil(getBaseMetaTileEntity(),-1); String[] tStringArray = new String[tStringList.size()]; { for (int i = 0; i < tStringArray.length; i++) { |
