Fixed pumpjack animation, retrofitted gas flare, added oil can textures

This commit is contained in:
HbmMods 2017-08-27 17:14:37 +02:00
parent ae19f9fbcc
commit 9c90d4fc61
21 changed files with 231 additions and 156 deletions

View File

@ -233,16 +233,30 @@ v -0.750000 0.343750 -1.843750
v -0.750000 0.656250 -1.843750
v -0.750000 0.343750 -2.156250
v -0.750000 0.656250 -2.156250
vn 0.000000 1.000000 0.000000
v -0.375000 -0.000000 0.375000
v -0.375000 0.050000 0.375000
v -0.375000 -0.000000 -0.375000
v -0.375000 0.050000 -0.375000
v 0.375000 -0.000000 0.375000
v 0.375000 0.050000 0.375000
v 0.375000 -0.000000 -0.375000
v 0.375000 0.050000 -0.375000
v 1.500000 1.500000 0.500000
v 1.500000 1.500000 -6.500000
v -1.500000 1.500000 0.500000
v -1.500000 1.500000 -6.500000
v 1.500000 0.150000 -6.500000
v -1.500000 0.150000 -6.500000
vn 0.000000 -1.000000 0.000000
vn 0.382700 0.000000 -0.923900
vn 0.923900 0.000000 -0.382700
vn 0.923900 0.000000 0.382700
vn 0.382700 0.000000 0.923900
vn -0.382700 0.000000 0.923900
vn -0.923900 0.000000 0.382700
vn 0.000000 1.000000 -0.000000
vn -0.382700 0.000000 -0.923900
vn -0.923900 0.000000 -0.382700
vn 0.000000 -1.000000 0.000000
vn -1.000000 0.000000 0.000000
vn 1.000000 0.000000 0.000000
vn 0.000000 0.000000 1.000000
@ -303,37 +317,37 @@ vn 0.000000 -0.382700 -0.923900
vn 0.000000 0.923900 -0.382700
vn -0.000000 0.923900 0.382700
s off
f 2//1 4//1 3//1
f 239//1 237//1 233//1
f 6//2 8//2 7//2
f 8//3 10//3 9//3
f 10//4 12//4 11//4
f 12//5 14//5 13//5
f 14//6 16//6 15//6
f 16//7 18//7 17//7
f 18//1 14//1 6//1
f 20//8 6//8 5//8
f 18//9 20//9 19//9
f 11//10 15//10 19//10
f 18//8 14//8 6//8
f 20//9 6//9 5//9
f 18//10 20//10 19//10
f 11//1 15//1 19//1
f 24//11 23//11 21//11
f 26//12 25//12 27//12
f 22//13 21//13 25//13
f 33//12 35//12 48//12
f 36//14 35//14 31//14
f 30//13 29//13 33//13
f 60//10 51//10 49//10
f 50//10 44//10 43//10
f 58//10 56//10 55//10
f 56//10 43//10 41//10
f 46//1 48//1 47//1
f 40//1 38//1 37//1
f 49//10 43//10 56//10
f 60//1 51//1 49//1
f 50//1 44//1 43//1
f 58//1 56//1 55//1
f 56//1 43//1 41//1
f 46//8 48//8 47//8
f 40//8 38//8 37//8
f 49//1 43//1 56//1
f 50//12 39//12 44//12
f 60//14 38//14 51//14
f 57//11 55//11 38//11
f 41//13 39//13 54//13
f 62//1 64//1 63//1
f 66//1 68//1 67//1
f 70//1 72//1 71//1
f 62//8 64//8 63//8
f 66//8 68//8 67//8
f 70//8 72//8 71//8
f 89//15 46//15 48//15
f 89//16 91//16 45//16
f 94//15 93//15 62//15
@ -350,12 +364,12 @@ f 119//22 66//22 68//22
f 101//17 103//17 72//17
f 102//20 69//20 70//20
f 103//22 104//22 70//22
f 68//1 66//1 45//1
f 72//1 70//1 61//1
f 68//8 66//8 45//8
f 72//8 70//8 61//8
f 31//11 29//11 69//11
f 72//1 63//1 36//1
f 45//1 66//1 30//1
f 47//1 48//1 61//1
f 72//8 63//8 36//8
f 45//8 66//8 30//8
f 47//8 48//8 61//8
f 87//19 75//19 76//19
f 85//20 88//20 76//20
f 86//17 74//17 75//17
@ -407,10 +421,10 @@ f 110//21 109//21 117//21
f 61//23 62//23 90//23
f 92//24 90//24 73//24
f 82//25 73//25 76//25
f 84//1 82//1 85//1
f 108//1 106//1 113//1
f 88//1 87//1 107//1
f 116//1 115//1 83//1
f 84//8 82//8 85//8
f 108//8 106//8 113//8
f 88//8 87//8 107//8
f 116//8 115//8 83//8
f 85//26 78//26 80//26
f 96//27 93//27 78//27
f 93//28 48//28 47//28
@ -472,12 +486,12 @@ f 154//12 152//12 164//12
f 164//12 152//12 162//12
f 162//12 152//12 160//12
f 150//12 160//12 152//12
f 33//1 29//1 22//1
f 26//1 28//1 35//1
f 22//1 29//1 31//1
f 152//1 151//1 31//1
f 24//1 31//1 151//1
f 152//1 35//1 28//1
f 33//8 29//8 22//8
f 26//8 28//8 35//8
f 22//8 29//8 31//8
f 152//8 151//8 31//8
f 24//8 31//8 151//8
f 152//8 35//8 28//8
f 166//54 168//54 167//54
f 168//55 170//55 169//55
f 170//56 172//56 171//56
@ -501,45 +515,66 @@ f 204//11 203//11 201//11
f 208//14 207//14 203//14
f 206//12 205//12 207//12
f 202//13 201//13 205//13
f 203//10 207//10 205//10
f 208//1 204//1 202//1
f 203//1 207//1 205//1
f 208//8 204//8 202//8
f 212//11 211//11 209//11
f 216//14 215//14 211//14
f 214//12 213//12 215//12
f 210//13 209//13 213//13
f 211//10 215//10 213//10
f 216//1 212//1 210//1
f 211//1 215//1 213//1
f 216//8 212//8 210//8
f 220//11 219//11 217//11
f 224//14 223//14 219//14
f 222//12 221//12 223//12
f 218//13 217//13 221//13
f 219//10 223//10 221//10
f 224//1 220//1 218//1
f 219//1 223//1 221//1
f 224//8 220//8 218//8
f 228//11 227//11 225//11
f 232//14 231//14 227//14
f 230//12 229//12 231//12
f 226//13 225//13 229//13
f 227//10 231//10 229//10
f 232//1 228//1 226//1
f 1//1 2//1 3//1
f 227//1 231//1 229//1
f 232//8 228//8 226//8
f 236//11 235//11 233//11
f 240//14 239//14 235//14
f 238//12 237//12 239//12
f 234//13 233//13 237//13
f 28//14 150//14 122//14
f 240//8 236//8 234//8
f 28//14 245//14 4//14
f 2//13 241//13 243//13
f 23//14 3//14 246//14
f 149//14 24//14 121//14
f 208//12 207//12 213//12
f 206//12 241//12 2//12
f 215//12 4//12 245//12
f 4//12 213//12 2//12
f 216//12 241//12 214//12
f 217//11 227//11 228//11
f 1//11 243//11 226//11
f 246//11 219//11 220//11
f 243//11 244//11 218//11
f 1//11 217//11 219//11
f 27//1 25//1 21//1
f 235//1 239//1 233//1
f 5//2 6//2 7//2
f 7//3 8//3 9//3
f 9//4 10//4 11//4
f 11//5 12//5 13//5
f 13//6 14//6 15//6
f 15//7 16//7 17//7
f 10//1 8//1 6//1
f 6//1 20//1 18//1
f 18//1 16//1 14//1
f 14//1 12//1 10//1
f 10//1 6//1 14//1
f 19//8 20//8 5//8
f 17//9 18//9 19//9
f 19//10 5//10 11//10
f 7//10 9//10 11//10
f 11//10 13//10 15//10
f 15//10 17//10 19//10
f 5//10 7//10 11//10
f 10//8 8//8 6//8
f 6//8 20//8 18//8
f 18//8 16//8 14//8
f 14//8 12//8 10//8
f 10//8 6//8 14//8
f 19//9 20//9 5//9
f 17//10 18//10 19//10
f 19//1 5//1 11//1
f 7//1 9//1 11//1
f 11//1 13//1 15//1
f 15//1 17//1 19//1
f 5//1 7//1 11//1
f 22//11 24//11 21//11
f 28//12 26//12 27//12
f 26//13 22//13 25//13
@ -550,13 +585,13 @@ f 35//12 36//12 64//12
f 62//12 48//12 35//12
f 32//14 36//14 31//14
f 34//13 30//13 33//13
f 58//10 60//10 49//10
f 49//10 50//10 43//10
f 57//10 58//10 55//10
f 54//10 56//10 41//10
f 45//1 46//1 47//1
f 39//1 40//1 37//1
f 58//10 49//10 56//10
f 58//1 60//1 49//1
f 49//1 50//1 43//1
f 57//1 58//1 55//1
f 54//1 56//1 41//1
f 45//8 46//8 47//8
f 39//8 40//8 37//8
f 58//1 49//1 56//1
f 42//12 44//12 39//12
f 50//12 52//12 40//12
f 40//12 39//12 50//12
@ -569,9 +604,9 @@ f 55//11 53//11 37//11
f 53//13 54//13 37//13
f 41//13 42//13 39//13
f 39//13 37//13 54//13
f 61//1 62//1 63//1
f 65//1 66//1 67//1
f 69//1 70//1 71//1
f 61//8 62//8 63//8
f 65//8 66//8 67//8
f 69//8 70//8 71//8
f 90//15 89//15 48//15
f 46//16 89//16 45//16
f 64//15 94//15 62//15
@ -588,24 +623,24 @@ f 120//22 119//22 68//22
f 71//17 101//17 72//17
f 104//20 102//20 70//20
f 72//22 103//22 70//22
f 47//1 68//1 45//1
f 63//1 72//1 61//1
f 47//8 68//8 45//8
f 63//8 72//8 61//8
f 65//11 67//11 29//11
f 69//11 71//11 31//11
f 32//11 31//11 71//11
f 29//11 30//11 65//11
f 67//11 69//11 29//11
f 36//1 32//1 72//1
f 71//1 72//1 32//1
f 63//1 64//1 36//1
f 30//1 34//1 45//1
f 46//1 45//1 34//1
f 66//1 65//1 30//1
f 61//1 70//1 68//1
f 69//1 67//1 68//1
f 68//1 47//1 61//1
f 48//1 62//1 61//1
f 70//1 69//1 68//1
f 36//8 32//8 72//8
f 71//8 72//8 32//8
f 63//8 64//8 36//8
f 30//8 34//8 45//8
f 46//8 45//8 34//8
f 66//8 65//8 30//8
f 61//8 70//8 68//8
f 69//8 67//8 68//8
f 68//8 47//8 61//8
f 48//8 62//8 61//8
f 70//8 69//8 68//8
f 88//19 87//19 76//19
f 73//20 85//20 76//20
f 87//17 86//17 75//17
@ -657,10 +692,10 @@ f 118//21 110//21 117//21
f 92//23 61//23 90//23
f 76//24 92//24 73//24
f 84//25 82//25 76//25
f 88//1 84//1 85//1
f 116//1 108//1 113//1
f 108//1 88//1 107//1
f 84//1 116//1 83//1
f 88//8 84//8 85//8
f 116//8 108//8 113//8
f 108//8 88//8 107//8
f 84//8 116//8 83//8
f 88//26 85//26 80//26
f 80//27 96//27 78//27
f 96//28 93//28 47//28
@ -728,12 +763,12 @@ f 127//49 125//49 159//49
f 129//50 127//50 161//50
f 131//51 129//51 163//51
f 133//52 131//52 147//52
f 26//1 33//1 22//1
f 33//1 26//1 35//1
f 24//1 22//1 31//1
f 35//1 152//1 31//1
f 149//1 24//1 151//1
f 150//1 152//1 28//1
f 26//8 33//8 22//8
f 33//8 26//8 35//8
f 24//8 22//8 31//8
f 35//8 152//8 31//8
f 149//8 24//8 151//8
f 150//8 152//8 28//8
f 165//54 166//54 167//54
f 167//55 168//55 169//55
f 169//56 170//56 171//56
@ -765,23 +800,58 @@ f 202//11 204//11 201//11
f 204//14 208//14 203//14
f 208//12 206//12 207//12
f 206//13 202//13 205//13
f 201//10 203//10 205//10
f 206//1 208//1 202//1
f 201//1 203//1 205//1
f 206//8 208//8 202//8
f 210//11 212//11 209//11
f 212//14 216//14 211//14
f 216//12 214//12 215//12
f 214//13 210//13 213//13
f 209//10 211//10 213//10
f 214//1 216//1 210//1
f 209//1 211//1 213//1
f 214//8 216//8 210//8
f 218//11 220//11 217//11
f 220//14 224//14 219//14
f 224//12 222//12 223//12
f 222//13 218//13 221//13
f 217//10 219//10 221//10
f 222//1 224//1 218//1
f 217//1 219//1 221//1
f 222//8 224//8 218//8
f 226//11 228//11 225//11
f 228//14 232//14 227//14
f 232//12 230//12 231//12
f 230//13 226//13 229//13
f 225//10 227//10 229//10
f 230//1 232//1 226//1
f 225//1 227//1 229//1
f 230//8 232//8 226//8
f 234//11 236//11 233//11
f 236//14 240//14 235//14
f 240//12 238//12 239//12
f 238//13 234//13 237//13
f 122//14 242//14 28//14
f 245//14 28//14 242//14
f 150//14 146//14 122//14
f 238//8 240//8 234//8
f 27//14 28//14 4//14
f 1//13 2//13 243//13
f 24//14 23//14 246//14
f 244//14 121//14 24//14
f 145//14 149//14 121//14
f 24//14 246//14 244//14
f 214//12 208//12 213//12
f 205//12 206//12 2//12
f 245//12 242//12 216//12
f 216//12 215//12 245//12
f 205//12 2//12 207//12
f 4//12 215//12 213//12
f 213//12 207//12 2//12
f 208//12 214//12 241//12
f 216//12 242//12 241//12
f 241//12 206//12 208//12
f 218//11 217//11 228//11
f 225//11 1//11 226//11
f 220//11 244//11 246//11
f 246//11 3//11 219//11
f 218//11 228//11 243//11
f 226//11 243//11 228//11
f 244//11 220//11 218//11
f 219//11 3//11 1//11
f 1//11 225//11 227//11
f 227//11 217//11 1//11
f 23//1 27//1 21//1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

View File

@ -15,7 +15,7 @@ public class FluidTypeHandler {
TRITIUM (0x000099, 153, 5, 1, "hbmfluid.tritium"),
OIL (0x020202, 131586, 6, 1, "hbmfluid.oil"),
HOTOIL (0x020202, 131586, 8, 1, "hbmfluid.hotoil"),
HOTOIL (0x300900, 3148032, 8, 1, "hbmfluid.hotoil"),
HEAVYOIL (0x141312, 1315602, 2, 2, "hbmfluid.heavyoil"),
BITUMEN (0x1f2426, 2040870, 3, 2, "hbmfluid.bitumen"),
@ -42,8 +42,8 @@ public class FluidTypeHandler {
AMAT (0x010101, 65793, 0, 2, "hbmfluid.amat"),
ASCHRAB (0xb50000, 11862016, 1, 2, "hbmfluid.aschrab"),
ACID (0x020202, 11862016, 10, 2, "hbmfluid.acid"),
WATZ (0x020202, 11862016, 11, 2, "hbmfluid.watz");
ACID (0xfff7aa, 16775082, 10, 2, "hbmfluid.acid"),
WATZ (0x86653E, 8807742, 11, 2, "hbmfluid.watz");
private int color;

View File

@ -12,11 +12,9 @@ import net.minecraft.item.ItemStack;
public class ContainerMachineGasFlare extends Container {
private TileEntityMachineGasFlare testNuke;
private int gas;
private int power;
public ContainerMachineGasFlare(InventoryPlayer invPlayer, TileEntityMachineGasFlare tedf) {
gas = 0;
power = 0;
testNuke = tedf;
@ -42,8 +40,7 @@ public class ContainerMachineGasFlare extends Container {
@Override
public void addCraftingToCrafters(ICrafting crafting) {
super.addCraftingToCrafters(crafting);
crafting.sendProgressBarUpdate(this, 0, this.testNuke.gas);
crafting.sendProgressBarUpdate(this, 1, this.testNuke.power);
crafting.sendProgressBarUpdate(this, 0, this.testNuke.power);
}
@Override
@ -94,27 +91,18 @@ public class ContainerMachineGasFlare extends Container {
{
ICrafting par1 = (ICrafting)this.crafters.get(i);
if(this.gas != this.testNuke.gas)
{
par1.sendProgressBarUpdate(this, 0, this.testNuke.gas);
}
if(this.power != this.testNuke.power)
{
par1.sendProgressBarUpdate(this, 1, this.testNuke.power);
par1.sendProgressBarUpdate(this, 0, this.testNuke.power);
}
}
this.gas = this.testNuke.gas;
this.power = this.testNuke.power;
}
@Override
public void updateProgressBar(int i, int j) {
if(i == 0)
{
testNuke.gas = j;
}
if(i == 1)
{
testNuke.power = j;
}

View File

@ -2,6 +2,7 @@ package com.hbm.inventory.gui;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.container.ContainerMachineGasFlare;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.TileEntityMachineGasFlare;
@ -11,7 +12,7 @@ import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GUIMachineGasFlare extends GuiContainer {
public class GUIMachineGasFlare extends GuiFluidContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_gasFlare.png");
private TileEntityMachineGasFlare flare;
@ -23,6 +24,13 @@ public class GUIMachineGasFlare extends GuiContainer {
this.xSize = 176;
this.ySize = 166;
}
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
flare.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 69 - 52, 34, 52);
}
@Override
protected void drawGuiContainerForegroundLayer( int i, int j) {
@ -38,9 +46,13 @@ public class GUIMachineGasFlare extends GuiContainer {
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
int i = flare.getGasScaled(52);
drawTexturedModalRect(guiLeft + 80, guiTop + 69 - i, 192, 52 - i, 34, i);
int j = flare.getPowerScaled(52);
drawTexturedModalRect(guiLeft + 8, guiTop + 69 - j, 176, 52 - j, 16, j);
Minecraft.getMinecraft().getTextureManager().bindTexture(FluidTank.fluidTextures);
flare.tank.renderTank(this, guiLeft + 80, guiTop + 69, flare.tank.getTankType().textureX() * FluidTank.x, flare.tank.getTankType().textureY() * FluidTank.y, 16, 52);
flare.tank.renderTank(this, guiLeft + 80 + 16, guiTop + 69, flare.tank.getTankType().textureX() * FluidTank.x, flare.tank.getTankType().textureY() * FluidTank.y, 16, 52);
flare.tank.renderTank(this, guiLeft + 80 + 32, guiTop + 69, flare.tank.getTankType().textureX() * FluidTank.x, flare.tank.getTankType().textureY() * FluidTank.y, 2, 52);
}
}

View File

@ -360,7 +360,6 @@ public class ModItems {
public static Item inf_antimatter;
public static Item inf_antischrabidium;
public static Item oil_canola;
public static Item canister_empty;
public static Item canister_smear;
public static Item canister_canola;
@ -1320,7 +1319,6 @@ public class ModItems {
thermo_element = new Item().setUnlocalizedName("thermo_element").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":thermo_element");
limiter = new Item().setUnlocalizedName("limiter").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":limiter");
oil_canola = new Item().setUnlocalizedName("oil_canola").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":oil_canola");
canister_empty = new ItemCustomLore().setUnlocalizedName("canister_empty").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":canister_empty");
canister_smear = new ItemCustomLore().setUnlocalizedName("canister_smear").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_smear");
canister_canola = new ItemCustomLore().setUnlocalizedName("canister_canola").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_canola");
@ -2308,9 +2306,6 @@ public class ModItems {
//Large Tanks
GameRegistry.registerItem(tank_waste, tank_waste.getUnlocalizedName());
//Oils
GameRegistry.registerItem(oil_canola, oil_canola.getUnlocalizedName());
//Canisters
GameRegistry.registerItem(canister_empty, canister_empty.getUnlocalizedName());

View File

@ -1191,6 +1191,11 @@ public class Library {
{
tileentity = worldObj.getTileEntity(((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetX, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetY, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetZ);
}
//Gas Flare
if(block == ModBlocks.dummy_port_flare)
{
tileentity = worldObj.getTileEntity(((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetX, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetY, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetZ);
}
if(tileentity == that)
tileentity = null;

View File

@ -68,7 +68,7 @@ public class RenderPumpjack extends TileEntitySpecialRenderer {
GL11.glRotatef(180, 0F, 1F, 0F);
this.bindTexture(gadgetTexture);
float t = (float) Math.sin((i / (180 / Math.PI)))/2 * 25;
float t = (float) Math.sin((i / (180 / Math.PI))) * 15;
GL11.glRotatef(t, 1F, 0F, 0F);
ResourceManager.pumpjack_head.renderAll();
@ -85,10 +85,13 @@ public class RenderPumpjack extends TileEntitySpecialRenderer {
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
float j = (float) Math.sin((i / (180 / Math.PI))) * 15;
float t = (float) Math.sin((i / (180 / Math.PI)));
float u = (float) Math.sin(((i + 90) / (180 / Math.PI)));
drawConnection(0.55, 0.5 + t, -5.5 - u, 0.55, 2.5, -6);
drawConnection(-0.55, 0.5 + t, -5.5 - u, -0.55, 2.5, -6);
float v = (float) Math.sin((j / (180 / Math.PI))) * 3;
float w = (float) Math.sin(((j + 90) / (180 / Math.PI))) * 3;
drawConnection(0.55, 0.5 + t, -5.5 - u, 0.55, 2.5 + v, -2.5 - w);
drawConnection(-0.55, 0.5 + t, -5.5 - u, -0.55, 2.5 + v, -2.5 - w);
GL11.glPopMatrix();
}
@ -99,14 +102,14 @@ public class RenderPumpjack extends TileEntitySpecialRenderer {
GL11.glDisable(GL11.GL_CULL_FACE);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawing(5);
tessellator.setColorRGBA_F(0.683F, 0.089F, 0.0F, 1.0F);
tessellator.setColorRGBA_F(0.6F, 0.6F, 0.6F, 1.0F);
tessellator.addVertex(x + 0.05F, y, z);
tessellator.addVertex(x - 0.05F, y, z);
tessellator.addVertex(a + 0.05F, b, c);
tessellator.addVertex(a - 0.05F, b, c);
tessellator.draw();
tessellator.startDrawing(5);
tessellator.setColorRGBA_F(0.683F, 0.089F, 0.0F, 1.0F);
tessellator.setColorRGBA_F(0.6F, 0.6F, 0.6F, 1.0F);
tessellator.addVertex(x, y, z + 0.05F);
tessellator.addVertex(x, y, z - 0.05F);
tessellator.addVertex(a, b, c + 0.05F);

View File

@ -6,9 +6,13 @@ import java.util.Random;
import com.hbm.entity.particle.EntityGasFlameFX;
import com.hbm.explosion.ExplosionThermo;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.interfaces.IConsumer;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidContainer;
import com.hbm.interfaces.IGasAcceptor;
import com.hbm.interfaces.ISource;
import com.hbm.inventory.FluidTank;
import com.hbm.items.ModItems;
import com.hbm.items.special.ItemBattery;
import com.hbm.lib.Library;
@ -23,16 +27,16 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
public class TileEntityMachineGasFlare extends TileEntity implements ISidedInventory, ISource, IGasAcceptor {
public class TileEntityMachineGasFlare extends TileEntity implements ISidedInventory, ISource, IFluidContainer, IFluidAcceptor {
private ItemStack slots[];
public int gas;
public int power;
public static final int maxPower = 100000;
public static final int maxGas = 64 * 50;
public int age = 0;
public List<IConsumer> list = new ArrayList();
public FluidTank tank;
private static final int[] slots_top = new int[] {1};
private static final int[] slots_bottom = new int[] {2, 0};
@ -43,6 +47,7 @@ public class TileEntityMachineGasFlare extends TileEntity implements ISidedInven
public TileEntityMachineGasFlare() {
slots = new ItemStack[3];
tank = new FluidTank(FluidType.GAS, 64000, 0);
}
@Override
@ -151,7 +156,7 @@ public class TileEntityMachineGasFlare extends TileEntity implements ISidedInven
NBTTagList list = nbt.getTagList("items", 10);
this.power = nbt.getInteger("powerTime");
this.gas = nbt.getInteger("gas");
tank.readFromNBT(nbt, "gas");
slots = new ItemStack[getSizeInventory()];
for(int i = 0; i < list.tagCount(); i++)
@ -169,7 +174,7 @@ public class TileEntityMachineGasFlare extends TileEntity implements ISidedInven
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setInteger("powerTime", power);
nbt.setInteger("gas", gas);
tank.writeToNBT(nbt, "gas");
NBTTagList list = new NBTTagList();
for(int i = 0; i < slots.length; i++)
@ -201,10 +206,6 @@ public class TileEntityMachineGasFlare extends TileEntity implements ISidedInven
return false;
}
public int getGasScaled(int i) {
return (gas * i) / maxGas;
}
public int getPowerScaled(int i) {
return (power * i) / maxPower;
}
@ -220,25 +221,15 @@ public class TileEntityMachineGasFlare extends TileEntity implements ISidedInven
if(!worldObj.isRemote) {
if(slots[1] != null && slots[1].getItem() == ModItems.gas_full && gas + 50 <= maxGas) {
if(slots[2] == null) {
gas += 50;
slots[1].stackSize--;
if(slots[1].stackSize <= 0)
slots[1] = null;
slots[2] = new ItemStack(ModItems.gas_empty);
}else if(slots[2] != null && slots[2].getItem() == ModItems.gas_empty && slots[2].stackSize < slots[2].getMaxStackSize()) {
gas += 50;
slots[1].stackSize--;
if(slots[1].stackSize <= 0)
slots[1] = null;
slots[2].stackSize++;
}
}
tank.loadTank(1, 2, slots);
tank.updateTank(xCoord, yCoord, zCoord);
if(gas >= 0) {
gas--;
power += 5;
if(tank.getFill() >= 10) {
tank.setFill(tank.getFill() - 10);
power += 50;
if(power > maxPower)
power = maxPower;
worldObj.spawnEntityInWorld(new EntityGasFlameFX(worldObj, this.xCoord + 0.5F, this.yCoord + 11F, this.zCoord + 0.5F, 0.0, 0.0, 0.0));
ExplosionThermo.setEntitiesOnFire(worldObj, this.xCoord, this.yCoord + 11, zCoord, 5);
@ -308,17 +299,28 @@ public class TileEntityMachineGasFlare extends TileEntity implements ISidedInven
}
@Override
public void setGasFill(int i) {
this.gas = i;
public void setFillstate(int fill, int index) {
tank.setFill(fill);
}
@Override
public int getGasFill() {
return this.gas;
public void setType(FluidType type, int index) {
tank.setTankType(type);
}
@Override
public int getMaxGasFill() {
return TileEntityMachineGasFlare.maxGas;
public int getMaxAFluidFill(FluidType type) {
return type.name().equals(this.tank.getTankType().name()) ? tank.getMaxFill() : 0;
}
@Override
public int getAFluidFill(FluidType type) {
return type.name().equals(this.tank.getTankType().name()) ? tank.getFill() : 0;
}
@Override
public void setAFluidFill(int i, FluidType type) {
if(type.name().equals(tank.getTankType().name()))
tank.setFill(i);
}
}