|
7 | 7 | import gregtech.api.objects.ItemData; |
8 | 8 | import gregtech.api.util.GT_LanguageManager; |
9 | 9 | import gregtech.api.util.GT_OreDictUnificator; |
| 10 | +import gregtech.api.util.GT_Utility; |
10 | 11 | import gregtech.common.GT_Proxy; |
11 | 12 | import gregtech.common.blocks.GT_Block_Ores_Abstract; |
12 | 13 | import gregtech.common.blocks.GT_TileEntity_Ores; |
@@ -52,7 +53,7 @@ public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer |
52 | 53 | if(aWorld.getBlock(aX,aY,aZ) == Blocks.bedrock) |
53 | 54 | { |
54 | 55 | if (!aWorld.isRemote) { |
55 | | - FluidStack fStack = getUndergroundOil(aWorld,aX,aZ); |
| 56 | + FluidStack fStack = GT_Utility.getUndergroundOil(aWorld,aX,aZ); |
56 | 57 | addChatMassageByValue(aPlayer,fStack.amount/5000,fStack.getLocalizedName()); |
57 | 58 | if (!aPlayer.capabilities.isCreativeMode) |
58 | 59 | ((DetravMetaGeneratedTool01)aItem).doDamage(aStack, this.mCosts); |
@@ -203,44 +204,6 @@ else if (value < 100) |
203 | 204 | aPlayer.addChatMessage(new ChatComponentText(foundTexts[5] + name)); |
204 | 205 | } |
205 | 206 |
|
206 | | - public static FluidStack getUndergroundOil(World aWorld, int aX, int aZ) { |
207 | | - Random tRandom = new Random((aWorld.getSeed() + (aX / 96) + (7 * (aZ / 96)))); |
208 | | - int oil = tRandom.nextInt(3); |
209 | | - double amount = tRandom.nextInt(50) + tRandom.nextDouble(); |
210 | | - oil = tRandom.nextInt(4); |
211 | | -// System.out.println("Oil: "+(aX/96)+" "+(aZ/96)+" "+oil+" "+amount); |
212 | | -// amount = 40; |
213 | | - Fluid tFluid = null; |
214 | | - switch(oil) { |
215 | | - case 0: |
216 | | - tFluid = Materials.NatruralGas.mGas; |
217 | | - break; |
218 | | - case 1: |
219 | | - tFluid = Materials.OilLight.mFluid; |
220 | | - break; |
221 | | - case 2: |
222 | | - tFluid = Materials.OilMedium.mFluid; |
223 | | - break; |
224 | | - case 3: |
225 | | - tFluid = Materials.OilHeavy.mFluid; |
226 | | - break; |
227 | | - default: |
228 | | - tFluid = Materials.Oil.mFluid; |
229 | | - } |
230 | | - |
231 | | - int tAmount = (int)(Math.pow(amount, 5.0D) / 100.0D); |
232 | | - ChunkPosition tPos = new ChunkPosition(aX / 16, 1, aZ / 16); |
233 | | - if(GT_Proxy.chunkData.containsKey(tPos)) { |
234 | | - int[] tInts = (int[])GT_Proxy.chunkData.get(tPos); |
235 | | - if(tInts.length > 0 && tInts[0] > 0) { |
236 | | - tAmount = tInts[0]; |
237 | | - } |
238 | | - } |
239 | | - tAmount -= 5; |
240 | | - |
241 | | - return new FluidStack(tFluid, tAmount); |
242 | | - } |
243 | | - |
244 | 207 | public static int getPolution(World aWorld, int aX, int aZ) |
245 | 208 | { |
246 | 209 | ChunkPosition tPos = new ChunkPosition(aX / 16, 1, aZ / 16); |
|
0 commit comments