Fix bug > Oil Teleportation to GC Planets #837
This commit is contained in:
parent
2c82f057aa
commit
811644f90a
3 changed files with 14 additions and 5 deletions
|
@ -1524,6 +1524,10 @@ public class GT_Utility {
|
||||||
|
|
||||||
public static FluidStack getUndergroundOil(World aWorld, int aX, int aZ, boolean needConsumeOil) {
|
public static FluidStack getUndergroundOil(World aWorld, int aX, int aZ, boolean needConsumeOil) {
|
||||||
|
|
||||||
|
if (aWorld.provider.dimensionId!=0)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
Random tRandom = new Random((aWorld.getSeed() + (aX / 96) + (7 * (aZ / 96))));
|
Random tRandom = new Random((aWorld.getSeed() + (aX / 96) + (7 * (aZ / 96))));
|
||||||
int oil = tRandom.nextInt(3);
|
int oil = tRandom.nextInt(3);
|
||||||
|
@ -1756,6 +1760,7 @@ public class GT_Utility {
|
||||||
}
|
}
|
||||||
if (aPlayer.capabilities.isCreativeMode&>_Values.D1) {
|
if (aPlayer.capabilities.isCreativeMode&>_Values.D1) {
|
||||||
FluidStack tFluid = getUndergroundOil(aWorld, aX, aZ);
|
FluidStack tFluid = getUndergroundOil(aWorld, aX, aZ);
|
||||||
|
if (tFluid!=null)
|
||||||
tList.add("Oil in Chunk: " + tFluid.amount + " " + tFluid.getLocalizedName());
|
tList.add("Oil in Chunk: " + tFluid.amount + " " + tFluid.getLocalizedName());
|
||||||
}
|
}
|
||||||
// if(aPlayer.capabilities.isCreativeMode){
|
// if(aPlayer.capabilities.isCreativeMode){
|
||||||
|
@ -2003,7 +2008,9 @@ public class GT_Utility {
|
||||||
|
|
||||||
public static void setProspectionData(ItemStack aStack, int aX, int aY, int aZ, int aDim, FluidStack aFluid, String[] aOres) {
|
public static void setProspectionData(ItemStack aStack, int aX, int aY, int aZ, int aDim, FluidStack aFluid, String[] aOres) {
|
||||||
NBTTagCompound tNBT = getNBT(aStack);
|
NBTTagCompound tNBT = getNBT(aStack);
|
||||||
String tData = aX + "," + aY + "," + aZ + "," + aDim + "," + (aFluid.amount / 5000) + "," + aFluid.getLocalizedName() + ",";
|
String tData = aX + "," + aY + "," + aZ + "," + aDim + ",";
|
||||||
|
if (aFluid!=null)
|
||||||
|
tData += (aFluid.amount / 5000) + "," + aFluid.getLocalizedName() + ",";
|
||||||
for (String tString : aOres) {
|
for (String tString : aOres) {
|
||||||
tData += tString + ",";
|
tData += tString + ",";
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,6 +149,7 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba
|
||||||
|
|
||||||
private void putOil(int x, int z, HashMap<String, Integer> aOils) {
|
private void putOil(int x, int z, HashMap<String, Integer> aOils) {
|
||||||
FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), x, z);
|
FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), x, z);
|
||||||
|
if (tFluid != null)
|
||||||
if (tFluid.amount / 5000 > 0)
|
if (tFluid.amount / 5000 > 0)
|
||||||
aOils.put(x + "," + z + "," + (tFluid.amount / 5000) + "," + tFluid.getLocalizedName(), tFluid.amount / 5000);
|
aOils.put(x + "," + z + "," + (tFluid.amount / 5000) + "," + tFluid.getLocalizedName(), tFluid.amount / 5000);
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,7 @@ public class GT_MetaTileEntity_OilDrill extends GT_MetaTileEntity_MultiBlockBase
|
||||||
}
|
}
|
||||||
FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord(), true);
|
FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord(), true);
|
||||||
if (tFluid == null) {
|
if (tFluid == null) {
|
||||||
|
stopMachine();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (getYOfPumpHead() > 0 && getBaseMetaTileEntity().getBlockOffset(ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX, getYOfPumpHead() - 1 - getBaseMetaTileEntity().getYCoord(), ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ) != Blocks.bedrock) {
|
if (getYOfPumpHead() > 0 && getBaseMetaTileEntity().getBlockOffset(ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX, getYOfPumpHead() - 1 - getBaseMetaTileEntity().getYCoord(), ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ) != Blocks.bedrock) {
|
||||||
|
|
Loading…
Reference in a new issue