From f5c8d4309a86ac5eb8adc231c60883e0f4ca18da Mon Sep 17 00:00:00 2001 From: HbmMods Date: Mon, 28 Aug 2017 22:42:56 +0200 Subject: [PATCH] More work on pumpjack --- assets/hbm/models/pumpjack_base.obj | 1122 +++++++++-------- com/hbm/blocks/ModBlocks.java | 6 + .../blocks/machine/DummyBlockPumpjack.java | 107 ++ com/hbm/blocks/machine/MachinePumpjack.java | 200 ++- com/hbm/handler/GUIHandler.java | 161 +-- com/hbm/handler/MultiblockHandler.java | 4 + .../container/ContainerMachinePumpjack.java | 146 +++ com/hbm/inventory/gui/GUIMachinePumpjack.java | 77 ++ com/hbm/packet/PacketDispatcher.java | 2 + com/hbm/packet/TEPumpjackPacket.java | 68 + com/hbm/render/tileentity/RenderPumpjack.java | 43 +- .../tileentity/TileEntityMachinePumpjack.java | 519 +++++++- 12 files changed, 1748 insertions(+), 707 deletions(-) create mode 100644 com/hbm/blocks/machine/DummyBlockPumpjack.java create mode 100644 com/hbm/inventory/container/ContainerMachinePumpjack.java create mode 100644 com/hbm/inventory/gui/GUIMachinePumpjack.java create mode 100644 com/hbm/packet/TEPumpjackPacket.java diff --git a/assets/hbm/models/pumpjack_base.obj b/assets/hbm/models/pumpjack_base.obj index 2cb7c4a75..25338e562 100644 --- a/assets/hbm/models/pumpjack_base.obj +++ b/assets/hbm/models/pumpjack_base.obj @@ -1,10 +1,9 @@ # Blender v2.76 (sub 0) OBJ File: 'pumpjack_base.blend' # www.blender.org o Plane -v -1.500000 0.000000 0.500000 -v 1.500000 0.000000 0.500000 -v -1.500000 0.000000 -6.500000 -v 1.500000 0.000000 -6.500000 +v -1.250000 0.000000 0.400000 +v 1.250000 0.000000 0.400000 +v -1.250000 0.343750 -3.156250 v 0.000000 0.000000 -0.100000 v 0.000000 0.500000 -0.100000 v 0.070711 0.000000 -0.070711 @@ -241,12 +240,39 @@ 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 +v 1.250000 1.500000 0.400000 +v -1.250000 1.500000 0.400000 +v -1.250000 0.656250 -2.843750 +v -1.250000 0.343750 -2.843750 +v 1.250000 0.000000 -6.400000 +v 1.000000 0.000000 -6.400000 +v 1.000000 0.150000 -6.400000 +v 0.500000 1.500000 -6.400000 +v 0.375000 1.500000 -6.400000 +v 0.375000 0.150000 -6.400000 +v 1.250000 1.500000 -6.400000 +v 1.250000 0.150000 -6.400000 +v -1.250000 0.000000 -6.400000 +v -1.000000 0.000000 -6.400000 +v -1.000000 0.150000 -6.400000 +v -0.500000 1.500000 -6.400000 +v -0.375000 1.500000 -6.400000 +v -0.375000 0.150000 -6.400000 +v -1.250000 1.500000 -6.400000 +v -1.250000 0.150000 -6.400000 +v -1.250000 0.656250 -3.156250 +v -1.250000 0.343750 -1.843750 +v -1.250000 0.656250 -1.843750 +v -1.250000 0.343750 -2.156250 +v -1.250000 0.656250 -2.156250 +v 1.250000 0.343750 -1.843750 +v 1.250000 0.656250 -1.843750 +v 1.250000 0.343750 -2.156250 +v 1.250000 0.656250 -2.156250 +v 1.250000 0.343750 -2.843750 +v 1.250000 0.656250 -2.843750 +v 1.250000 0.343750 -3.156250 +v 1.250000 0.656250 -3.156250 vn 0.000000 -1.000000 0.000000 vn 0.382700 0.000000 -0.923900 vn 0.923900 0.000000 -0.382700 @@ -317,541 +343,541 @@ vn 0.000000 -0.382700 -0.923900 vn 0.000000 0.923900 -0.382700 vn -0.000000 0.923900 0.382700 s off -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//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//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//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 -f 94//17 64//17 63//17 -f 90//18 48//18 47//18 -f 91//19 92//19 47//19 -f 93//20 96//20 61//20 -f 95//19 63//19 61//19 -f 101//21 71//21 69//21 -f 118//21 117//21 67//21 -f 118//16 65//16 66//16 -f 117//18 120//18 68//18 -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//8 66//8 45//8 -f 72//8 70//8 61//8 -f 31//11 29//11 69//11 -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 -f 86//15 85//15 73//15 -f 83//19 84//19 80//19 -f 82//18 78//18 80//18 -f 81//16 83//16 79//16 -f 81//15 77//15 78//15 -f 42//15 81//15 82//15 -f 42//16 41//16 83//16 -f 44//18 82//18 84//18 -f 41//19 43//19 84//19 -f 52//15 50//15 85//15 -f 52//17 86//17 87//17 -f 50//20 49//20 88//20 -f 51//19 87//19 88//19 -f 79//19 80//19 92//19 -f 78//18 90//18 92//18 -f 77//16 79//16 91//16 -f 77//15 89//15 90//15 -f 75//19 95//19 96//19 -f 73//20 76//20 96//20 -f 74//17 94//17 95//17 -f 74//15 73//15 93//15 -f 107//22 108//22 100//22 -f 106//20 98//20 100//20 -f 105//17 107//17 99//17 -f 105//21 97//21 98//21 -f 99//22 100//22 104//22 -f 98//20 102//20 104//20 -f 97//17 99//17 103//17 -f 97//21 101//21 102//21 -f 59//21 105//21 106//21 -f 59//17 60//17 107//17 -f 57//20 106//20 108//20 -f 60//22 58//22 108//22 -f 115//22 111//22 112//22 -f 113//18 116//18 112//18 -f 114//16 110//16 111//16 -f 114//21 113//21 109//21 -f 53//21 55//21 113//21 -f 53//16 114//16 115//16 -f 55//18 56//18 116//18 -f 54//22 115//22 116//22 -f 111//22 119//22 120//22 -f 109//18 112//18 120//18 -f 110//16 118//16 119//16 -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//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 -f 87//29 88//29 100//29 -f 96//30 95//30 99//30 -f 95//31 96//31 70//31 -f 103//32 63//32 61//32 -f 75//33 76//33 104//33 -f 76//34 75//34 107//34 -f 100//25 98//25 113//25 -f 120//35 117//35 98//35 -f 117//23 69//23 70//23 -f 68//28 67//28 102//28 -f 109//36 112//36 104//36 -f 106//26 108//26 112//26 -f 119//32 120//32 47//32 -f 79//37 80//37 120//37 -f 80//38 79//38 115//38 -f 83//39 84//39 112//39 -f 92//40 91//40 111//40 -f 91//31 66//31 68//31 -f 145//41 143//41 146//41 -f 136//42 138//42 137//42 -f 138//43 140//43 139//43 -f 140//44 142//44 141//44 -f 148//45 136//45 135//45 -f 142//46 144//46 143//46 -f 127//11 135//11 143//11 -f 142//12 134//12 122//12 -f 156//47 146//47 122//47 -f 124//48 126//48 158//48 -f 160//49 158//49 126//49 -f 162//50 160//50 128//50 -f 164//51 162//51 130//51 -f 134//52 148//52 164//52 -f 154//53 148//53 147//53 -f 154//13 153//13 151//13 -f 150//14 149//14 145//14 -f 149//14 27//14 23//14 -f 121//47 145//47 155//47 -f 123//48 155//48 157//48 -f 125//49 157//49 159//49 -f 127//50 159//50 161//50 -f 129//51 161//51 163//51 -f 131//52 163//52 147//52 -f 155//11 145//11 149//11 -f 157//11 155//11 149//11 -f 159//11 157//11 149//11 -f 153//11 147//11 163//11 -f 153//11 163//11 151//11 -f 163//11 161//11 151//11 -f 161//11 159//11 151//11 -f 149//11 151//11 159//11 -f 150//12 146//12 156//12 -f 156//12 158//12 150//12 -f 160//12 150//12 158//12 -f 154//12 164//12 148//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//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 -f 172//57 174//57 173//57 -f 174//58 176//58 175//58 -f 176//59 178//59 177//59 -f 176//13 174//13 170//13 -f 180//60 166//60 165//60 -f 178//61 180//61 179//61 -f 186//12 185//12 183//12 -f 198//13 200//13 199//13 -f 187//62 195//62 194//62 -f 184//63 185//63 193//63 -f 183//64 191//64 189//64 -f 188//65 196//65 195//65 -f 185//66 186//66 194//66 -f 183//67 184//67 192//67 -f 182//68 189//68 190//68 -f 181//69 190//69 196//69 -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//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//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//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//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//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 -f 64//12 62//12 35//12 -f 48//12 46//12 33//12 -f 34//12 33//12 46//12 -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//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 -f 52//14 51//14 40//14 -f 60//14 59//14 38//14 -f 38//14 40//14 51//14 -f 37//11 38//11 55//11 -f 59//11 57//11 38//11 -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//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 -f 95//17 94//17 63//17 -f 92//18 90//18 47//18 -f 45//19 91//19 47//19 -f 62//20 93//20 61//20 -f 96//19 95//19 61//19 -f 102//21 101//21 69//21 -f 65//21 118//21 67//21 -f 119//16 118//16 66//16 -f 67//18 117//18 68//18 -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//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//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 -f 74//15 86//15 73//15 -f 79//19 83//19 80//19 -f 84//18 82//18 80//18 -f 77//16 81//16 79//16 -f 82//15 81//15 78//15 -f 44//15 42//15 82//15 -f 81//16 42//16 83//16 -f 43//18 44//18 84//18 -f 83//19 41//19 84//19 -f 86//15 52//15 85//15 -f 51//17 52//17 87//17 -f 85//20 50//20 88//20 -f 49//19 51//19 88//19 -f 91//19 79//19 92//19 -f 80//18 78//18 92//18 -f 89//16 77//16 91//16 -f 78//15 77//15 90//15 -f 76//19 75//19 96//19 -f 93//20 73//20 96//20 -f 75//17 74//17 95//17 -f 94//15 74//15 93//15 -f 99//22 107//22 100//22 -f 108//20 106//20 100//20 -f 97//17 105//17 99//17 -f 106//21 105//21 98//21 -f 103//22 99//22 104//22 -f 100//20 98//20 104//20 -f 101//17 97//17 103//17 -f 98//21 97//21 102//21 -f 57//21 59//21 106//21 -f 105//17 59//17 107//17 -f 58//20 57//20 108//20 -f 107//22 60//22 108//22 -f 116//22 115//22 112//22 -f 109//18 113//18 112//18 -f 115//16 114//16 111//16 -f 110//21 114//21 109//21 -f 114//21 53//21 113//21 -f 54//16 53//16 115//16 -f 113//18 55//18 116//18 -f 56//22 54//22 116//22 -f 112//22 111//22 120//22 -f 117//18 109//18 120//18 -f 111//16 110//16 119//16 -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//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 -f 99//29 87//29 100//29 -f 100//30 96//30 99//30 -f 72//31 95//31 70//31 -f 104//32 103//32 61//32 -f 103//33 75//33 104//33 -f 108//34 76//34 107//34 -f 116//25 100//25 113//25 -f 100//35 120//35 98//35 -f 120//23 117//23 70//23 -f 104//28 68//28 102//28 -f 102//36 109//36 104//36 -f 109//26 106//26 112//26 -f 45//32 119//32 47//32 -f 119//37 79//37 120//37 -f 116//38 80//38 115//38 -f 111//39 83//39 112//39 -f 112//40 92//40 111//40 -f 92//31 91//31 68//31 -f 122//41 146//41 144//41 -f 145//41 121//41 143//41 -f 143//41 144//41 146//41 -f 135//42 136//42 137//42 -f 137//43 138//43 139//43 -f 139//44 140//44 141//44 -f 135//45 133//45 147//45 -f 148//45 134//45 136//45 -f 135//45 147//45 148//45 -f 141//46 142//46 143//46 -f 143//11 121//11 127//11 -f 123//11 125//11 127//11 -f 127//11 129//11 131//11 -f 131//11 133//11 127//11 -f 135//11 137//11 139//11 -f 139//11 141//11 143//11 -f 121//11 123//11 127//11 -f 127//11 133//11 135//11 -f 135//11 139//11 143//11 -f 126//12 124//12 122//12 -f 122//12 144//12 142//12 -f 142//12 140//12 134//12 -f 138//12 136//12 134//12 -f 134//12 132//12 130//12 -f 130//12 128//12 126//12 -f 126//12 122//12 134//12 -f 140//12 138//12 134//12 -f 134//12 130//12 126//12 -f 124//47 156//47 122//47 -f 156//48 124//48 158//48 -f 128//49 160//49 126//49 -f 130//50 162//50 128//50 -f 132//51 164//51 130//51 -f 132//52 134//52 164//52 -f 153//53 154//53 147//53 -f 152//13 154//13 151//13 -f 146//14 150//14 145//14 -f 23//14 24//14 149//14 -f 149//14 150//14 27//14 -f 28//14 27//14 150//14 -f 123//47 121//47 155//47 -f 125//48 123//48 157//48 -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//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 -f 171//57 172//57 173//57 -f 173//58 174//58 175//58 -f 175//59 176//59 177//59 -f 170//13 168//13 166//13 -f 166//13 180//13 170//13 -f 178//13 176//13 170//13 -f 174//13 172//13 170//13 -f 170//13 180//13 178//13 -f 179//60 180//60 165//60 -f 177//61 178//61 179//61 -f 183//12 182//12 181//12 -f 181//12 188//12 183//12 -f 187//12 186//12 183//12 -f 185//12 184//12 183//12 -f 183//12 188//12 187//12 -f 197//13 198//13 199//13 -f 186//62 187//62 194//62 -f 192//63 184//63 193//63 -f 182//64 183//64 189//64 -f 187//65 188//65 195//65 -f 193//66 185//66 194//66 -f 191//67 183//67 192//67 -f 181//68 182//68 190//68 -f 188//69 181//69 196//69 -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//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//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//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//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 +f 238//1 236//1 232//1 +f 5//2 7//2 6//2 +f 7//3 9//3 8//3 +f 9//4 11//4 10//4 +f 11//5 13//5 12//5 +f 13//6 15//6 14//6 +f 15//7 17//7 16//7 +f 17//8 13//8 5//8 +f 19//9 5//9 4//9 +f 17//10 19//10 18//10 +f 10//1 14//1 18//1 +f 23//11 22//11 20//11 +f 25//12 24//12 26//12 +f 21//13 20//13 24//13 +f 32//12 34//12 47//12 +f 35//14 34//14 30//14 +f 29//13 28//13 32//13 +f 59//1 50//1 48//1 +f 49//1 43//1 42//1 +f 57//1 55//1 54//1 +f 55//1 42//1 40//1 +f 45//8 47//8 46//8 +f 39//8 37//8 36//8 +f 48//1 42//1 55//1 +f 49//12 38//12 43//12 +f 59//14 37//14 50//14 +f 56//11 54//11 37//11 +f 40//13 38//13 53//13 +f 61//8 63//8 62//8 +f 65//8 67//8 66//8 +f 69//8 71//8 70//8 +f 88//15 45//15 47//15 +f 88//16 90//16 44//16 +f 93//15 92//15 61//15 +f 93//17 63//17 62//17 +f 89//18 47//18 46//18 +f 90//19 91//19 46//19 +f 92//20 95//20 60//20 +f 94//19 62//19 60//19 +f 100//21 70//21 68//21 +f 117//21 116//21 66//21 +f 117//16 64//16 65//16 +f 116//18 119//18 67//18 +f 118//22 65//22 67//22 +f 100//17 102//17 71//17 +f 101//20 68//20 69//20 +f 102//22 103//22 69//22 +f 67//8 65//8 44//8 +f 71//8 69//8 60//8 +f 30//11 28//11 68//11 +f 71//8 62//8 35//8 +f 44//8 65//8 29//8 +f 46//8 47//8 60//8 +f 86//19 74//19 75//19 +f 84//20 87//20 75//20 +f 85//17 73//17 74//17 +f 85//15 84//15 72//15 +f 82//19 83//19 79//19 +f 81//18 77//18 79//18 +f 80//16 82//16 78//16 +f 80//15 76//15 77//15 +f 41//15 80//15 81//15 +f 41//16 40//16 82//16 +f 43//18 81//18 83//18 +f 40//19 42//19 83//19 +f 51//15 49//15 84//15 +f 51//17 85//17 86//17 +f 49//20 48//20 87//20 +f 50//19 86//19 87//19 +f 78//19 79//19 91//19 +f 77//18 89//18 91//18 +f 76//16 78//16 90//16 +f 76//15 88//15 89//15 +f 74//19 94//19 95//19 +f 72//20 75//20 95//20 +f 73//17 93//17 94//17 +f 73//15 72//15 92//15 +f 106//22 107//22 99//22 +f 105//20 97//20 99//20 +f 104//17 106//17 98//17 +f 104//21 96//21 97//21 +f 98//22 99//22 103//22 +f 97//20 101//20 103//20 +f 96//17 98//17 102//17 +f 96//21 100//21 101//21 +f 58//21 104//21 105//21 +f 58//17 59//17 106//17 +f 56//20 105//20 107//20 +f 59//22 57//22 107//22 +f 114//22 110//22 111//22 +f 112//18 115//18 111//18 +f 113//16 109//16 110//16 +f 113//21 112//21 108//21 +f 52//21 54//21 112//21 +f 52//16 113//16 114//16 +f 54//18 55//18 115//18 +f 53//22 114//22 115//22 +f 110//22 118//22 119//22 +f 108//18 111//18 119//18 +f 109//16 117//16 118//16 +f 109//21 108//21 116//21 +f 60//23 61//23 89//23 +f 91//24 89//24 72//24 +f 81//25 72//25 75//25 +f 83//8 81//8 84//8 +f 107//8 105//8 112//8 +f 87//8 86//8 106//8 +f 115//8 114//8 82//8 +f 84//26 77//26 79//26 +f 95//27 92//27 77//27 +f 92//28 47//28 46//28 +f 86//29 87//29 99//29 +f 95//30 94//30 98//30 +f 94//31 95//31 69//31 +f 102//32 62//32 60//32 +f 74//33 75//33 103//33 +f 75//34 74//34 106//34 +f 99//25 97//25 112//25 +f 119//35 116//35 97//35 +f 116//23 68//23 69//23 +f 67//28 66//28 101//28 +f 108//36 111//36 103//36 +f 105//26 107//26 111//26 +f 118//32 119//32 46//32 +f 78//37 79//37 119//37 +f 79//38 78//38 114//38 +f 82//39 83//39 111//39 +f 91//40 90//40 110//40 +f 90//31 65//31 67//31 +f 144//41 142//41 145//41 +f 135//42 137//42 136//42 +f 137//43 139//43 138//43 +f 139//44 141//44 140//44 +f 147//45 135//45 134//45 +f 141//46 143//46 142//46 +f 126//11 134//11 142//11 +f 141//12 133//12 121//12 +f 155//47 145//47 121//47 +f 123//48 125//48 157//48 +f 159//49 157//49 125//49 +f 161//50 159//50 127//50 +f 163//51 161//51 129//51 +f 133//52 147//52 163//52 +f 153//53 147//53 146//53 +f 153//13 152//13 150//13 +f 149//14 148//14 144//14 +f 148//14 26//14 22//14 +f 120//47 144//47 154//47 +f 122//48 154//48 156//48 +f 124//49 156//49 158//49 +f 126//50 158//50 160//50 +f 128//51 160//51 162//51 +f 130//52 162//52 146//52 +f 154//11 144//11 148//11 +f 156//11 154//11 148//11 +f 158//11 156//11 148//11 +f 152//11 146//11 162//11 +f 152//11 162//11 150//11 +f 162//11 160//11 150//11 +f 160//11 158//11 150//11 +f 148//11 150//11 158//11 +f 149//12 145//12 155//12 +f 155//12 157//12 149//12 +f 159//12 149//12 157//12 +f 153//12 163//12 147//12 +f 153//12 151//12 163//12 +f 163//12 151//12 161//12 +f 161//12 151//12 159//12 +f 149//12 159//12 151//12 +f 32//8 28//8 21//8 +f 25//8 27//8 34//8 +f 21//8 28//8 30//8 +f 151//8 150//8 30//8 +f 23//8 30//8 150//8 +f 151//8 34//8 27//8 +f 165//54 167//54 166//54 +f 167//55 169//55 168//55 +f 169//56 171//56 170//56 +f 171//57 173//57 172//57 +f 173//58 175//58 174//58 +f 175//59 177//59 176//59 +f 175//13 173//13 169//13 +f 179//60 165//60 164//60 +f 177//61 179//61 178//61 +f 185//12 184//12 182//12 +f 197//13 199//13 198//13 +f 186//62 194//62 193//62 +f 183//63 184//63 192//63 +f 182//64 190//64 188//64 +f 187//65 195//65 194//65 +f 184//66 185//66 193//66 +f 182//67 183//67 191//67 +f 181//68 188//68 189//68 +f 180//69 189//69 195//69 +f 203//11 202//11 200//11 +f 207//14 206//14 202//14 +f 205//12 204//12 206//12 +f 201//13 200//13 204//13 +f 202//1 206//1 204//1 +f 207//8 203//8 201//8 +f 211//11 210//11 208//11 +f 215//14 214//14 210//14 +f 213//12 212//12 214//12 +f 209//13 208//13 212//13 +f 210//1 214//1 212//1 +f 215//8 211//8 209//8 +f 219//11 218//11 216//11 +f 223//14 222//14 218//14 +f 221//12 220//12 222//12 +f 217//13 216//13 220//13 +f 218//1 222//1 220//1 +f 223//8 219//8 217//8 +f 227//11 226//11 224//11 +f 231//14 230//14 226//14 +f 229//12 228//12 230//12 +f 225//13 224//13 228//13 +f 226//1 230//1 228//1 +f 231//8 227//8 225//8 +f 235//11 234//11 232//11 +f 239//14 238//14 234//14 +f 237//12 236//12 238//12 +f 233//13 232//13 236//13 +f 239//8 235//8 233//8 +f 2//13 240//13 241//13 +f 269//12 270//12 268//12 +f 2//12 265//12 266//12 +f 26//1 24//1 20//1 +f 246//14 249//14 247//14 +f 246//14 251//14 244//14 +f 253//14 252//14 259//14 +f 257//14 254//14 255//14 +f 259//11 252//11 3//11 +f 263//11 264//11 242//11 +f 262//11 261//11 1//11 +f 3//11 1//11 243//11 +f 264//11 241//11 242//11 +f 251//12 272//12 271//12 +f 270//12 240//12 268//12 +f 2//12 244//12 269//12 +f 234//1 238//1 232//1 +f 4//2 5//2 6//2 +f 6//3 7//3 8//3 +f 8//4 9//4 10//4 +f 10//5 11//5 12//5 +f 12//6 13//6 14//6 +f 14//7 15//7 16//7 +f 9//8 7//8 5//8 +f 5//8 19//8 17//8 +f 17//8 15//8 13//8 +f 13//8 11//8 9//8 +f 9//8 5//8 13//8 +f 18//9 19//9 4//9 +f 16//10 17//10 18//10 +f 18//1 4//1 10//1 +f 6//1 8//1 10//1 +f 10//1 12//1 14//1 +f 14//1 16//1 18//1 +f 4//1 6//1 10//1 +f 21//11 23//11 20//11 +f 27//12 25//12 26//12 +f 25//13 21//13 24//13 +f 63//12 61//12 34//12 +f 47//12 45//12 32//12 +f 33//12 32//12 45//12 +f 34//12 35//12 63//12 +f 61//12 47//12 34//12 +f 31//14 35//14 30//14 +f 33//13 29//13 32//13 +f 57//1 59//1 48//1 +f 48//1 49//1 42//1 +f 56//1 57//1 54//1 +f 53//1 55//1 40//1 +f 44//8 45//8 46//8 +f 38//8 39//8 36//8 +f 57//1 48//1 55//1 +f 41//12 43//12 38//12 +f 49//12 51//12 39//12 +f 39//12 38//12 49//12 +f 51//14 50//14 39//14 +f 59//14 58//14 37//14 +f 37//14 39//14 50//14 +f 36//11 37//11 54//11 +f 58//11 56//11 37//11 +f 54//11 52//11 36//11 +f 52//13 53//13 36//13 +f 40//13 41//13 38//13 +f 38//13 36//13 53//13 +f 60//8 61//8 62//8 +f 64//8 65//8 66//8 +f 68//8 69//8 70//8 +f 89//15 88//15 47//15 +f 45//16 88//16 44//16 +f 63//15 93//15 61//15 +f 94//17 93//17 62//17 +f 91//18 89//18 46//18 +f 44//19 90//19 46//19 +f 61//20 92//20 60//20 +f 95//19 94//19 60//19 +f 101//21 100//21 68//21 +f 64//21 117//21 66//21 +f 118//16 117//16 65//16 +f 66//18 116//18 67//18 +f 119//22 118//22 67//22 +f 70//17 100//17 71//17 +f 103//20 101//20 69//20 +f 71//22 102//22 69//22 +f 46//8 67//8 44//8 +f 62//8 71//8 60//8 +f 64//11 66//11 28//11 +f 68//11 70//11 30//11 +f 31//11 30//11 70//11 +f 28//11 29//11 64//11 +f 66//11 68//11 28//11 +f 35//8 31//8 71//8 +f 70//8 71//8 31//8 +f 62//8 63//8 35//8 +f 29//8 33//8 44//8 +f 45//8 44//8 33//8 +f 65//8 64//8 29//8 +f 60//8 69//8 67//8 +f 68//8 66//8 67//8 +f 67//8 46//8 60//8 +f 47//8 61//8 60//8 +f 69//8 68//8 67//8 +f 87//19 86//19 75//19 +f 72//20 84//20 75//20 +f 86//17 85//17 74//17 +f 73//15 85//15 72//15 +f 78//19 82//19 79//19 +f 83//18 81//18 79//18 +f 76//16 80//16 78//16 +f 81//15 80//15 77//15 +f 43//15 41//15 81//15 +f 80//16 41//16 82//16 +f 42//18 43//18 83//18 +f 82//19 40//19 83//19 +f 85//15 51//15 84//15 +f 50//17 51//17 86//17 +f 84//20 49//20 87//20 +f 48//19 50//19 87//19 +f 90//19 78//19 91//19 +f 79//18 77//18 91//18 +f 88//16 76//16 90//16 +f 77//15 76//15 89//15 +f 75//19 74//19 95//19 +f 92//20 72//20 95//20 +f 74//17 73//17 94//17 +f 93//15 73//15 92//15 +f 98//22 106//22 99//22 +f 107//20 105//20 99//20 +f 96//17 104//17 98//17 +f 105//21 104//21 97//21 +f 102//22 98//22 103//22 +f 99//20 97//20 103//20 +f 100//17 96//17 102//17 +f 97//21 96//21 101//21 +f 56//21 58//21 105//21 +f 104//17 58//17 106//17 +f 57//20 56//20 107//20 +f 106//22 59//22 107//22 +f 115//22 114//22 111//22 +f 108//18 112//18 111//18 +f 114//16 113//16 110//16 +f 109//21 113//21 108//21 +f 113//21 52//21 112//21 +f 53//16 52//16 114//16 +f 112//18 54//18 115//18 +f 55//22 53//22 115//22 +f 111//22 110//22 119//22 +f 116//18 108//18 119//18 +f 110//16 109//16 118//16 +f 117//21 109//21 116//21 +f 91//23 60//23 89//23 +f 75//24 91//24 72//24 +f 83//25 81//25 75//25 +f 87//8 83//8 84//8 +f 115//8 107//8 112//8 +f 107//8 87//8 106//8 +f 83//8 115//8 82//8 +f 87//26 84//26 79//26 +f 79//27 95//27 77//27 +f 95//28 92//28 46//28 +f 98//29 86//29 99//29 +f 99//30 95//30 98//30 +f 71//31 94//31 69//31 +f 103//32 102//32 60//32 +f 102//33 74//33 103//33 +f 107//34 75//34 106//34 +f 115//25 99//25 112//25 +f 99//35 119//35 97//35 +f 119//23 116//23 69//23 +f 103//28 67//28 101//28 +f 101//36 108//36 103//36 +f 108//26 105//26 111//26 +f 44//32 118//32 46//32 +f 118//37 78//37 119//37 +f 115//38 79//38 114//38 +f 110//39 82//39 111//39 +f 111//40 91//40 110//40 +f 91//31 90//31 67//31 +f 121//41 145//41 143//41 +f 144//41 120//41 142//41 +f 142//41 143//41 145//41 +f 134//42 135//42 136//42 +f 136//43 137//43 138//43 +f 138//44 139//44 140//44 +f 134//45 132//45 146//45 +f 147//45 133//45 135//45 +f 134//45 146//45 147//45 +f 140//46 141//46 142//46 +f 142//11 120//11 126//11 +f 122//11 124//11 126//11 +f 126//11 128//11 130//11 +f 130//11 132//11 126//11 +f 134//11 136//11 138//11 +f 138//11 140//11 142//11 +f 120//11 122//11 126//11 +f 126//11 132//11 134//11 +f 134//11 138//11 142//11 +f 125//12 123//12 121//12 +f 121//12 143//12 141//12 +f 141//12 139//12 133//12 +f 137//12 135//12 133//12 +f 133//12 131//12 129//12 +f 129//12 127//12 125//12 +f 125//12 121//12 133//12 +f 139//12 137//12 133//12 +f 133//12 129//12 125//12 +f 123//47 155//47 121//47 +f 155//48 123//48 157//48 +f 127//49 159//49 125//49 +f 129//50 161//50 127//50 +f 131//51 163//51 129//51 +f 131//52 133//52 163//52 +f 152//53 153//53 146//53 +f 151//13 153//13 150//13 +f 145//14 149//14 144//14 +f 22//14 23//14 148//14 +f 148//14 149//14 26//14 +f 27//14 26//14 149//14 +f 122//47 120//47 154//47 +f 124//48 122//48 156//48 +f 126//49 124//49 158//49 +f 128//50 126//50 160//50 +f 130//51 128//51 162//51 +f 132//52 130//52 146//52 +f 25//8 32//8 21//8 +f 32//8 25//8 34//8 +f 23//8 21//8 30//8 +f 34//8 151//8 30//8 +f 148//8 23//8 150//8 +f 149//8 151//8 27//8 +f 164//54 165//54 166//54 +f 166//55 167//55 168//55 +f 168//56 169//56 170//56 +f 170//57 171//57 172//57 +f 172//58 173//58 174//58 +f 174//59 175//59 176//59 +f 169//13 167//13 165//13 +f 165//13 179//13 169//13 +f 177//13 175//13 169//13 +f 173//13 171//13 169//13 +f 169//13 179//13 177//13 +f 178//60 179//60 164//60 +f 176//61 177//61 178//61 +f 182//12 181//12 180//12 +f 180//12 187//12 182//12 +f 186//12 185//12 182//12 +f 184//12 183//12 182//12 +f 182//12 187//12 186//12 +f 196//13 197//13 198//13 +f 185//62 186//62 193//62 +f 191//63 183//63 192//63 +f 181//64 182//64 188//64 +f 186//65 187//65 194//65 +f 192//66 184//66 193//66 +f 190//67 182//67 191//67 +f 180//68 181//68 189//68 +f 187//69 180//69 195//69 +f 201//11 203//11 200//11 +f 203//14 207//14 202//14 +f 207//12 205//12 206//12 +f 205//13 201//13 204//13 +f 200//1 202//1 204//1 +f 205//8 207//8 201//8 +f 209//11 211//11 208//11 +f 211//14 215//14 210//14 +f 215//12 213//12 214//12 +f 213//13 209//13 212//13 +f 208//1 210//1 212//1 +f 213//8 215//8 209//8 +f 217//11 219//11 216//11 +f 219//14 223//14 218//14 +f 223//12 221//12 222//12 +f 221//13 217//13 220//13 +f 216//1 218//1 220//1 +f 221//8 223//8 217//8 +f 225//11 227//11 224//11 +f 227//14 231//14 226//14 +f 231//12 229//12 230//12 +f 229//13 225//13 228//13 +f 224//1 226//1 228//1 +f 229//8 231//8 225//8 +f 233//11 235//11 232//11 +f 235//14 239//14 234//14 +f 239//12 237//12 238//12 +f 237//13 233//13 236//13 +f 237//8 239//8 233//8 +f 1//13 2//13 241//13 +f 267//12 269//12 268//12 +f 240//12 2//12 266//12 +f 22//1 26//1 20//1 +f 247//14 250//14 246//14 +f 251//14 246//14 250//14 +f 249//14 248//14 247//14 +f 245//14 246//14 244//14 +f 254//14 253//14 259//14 +f 258//14 255//14 254//14 +f 256//14 257//14 255//14 +f 254//14 259//14 258//14 +f 3//11 260//11 259//11 +f 258//11 259//11 260//11 +f 243//11 263//11 242//11 +f 241//11 262//11 1//11 +f 263//11 243//11 1//11 +f 3//11 252//11 1//11 +f 1//11 261//11 263//11 +f 260//11 242//11 241//11 +f 264//11 262//11 241//11 +f 241//11 258//11 260//11 +f 271//12 244//12 251//12 +f 251//12 250//12 272//12 +f 266//12 268//12 240//12 +f 270//12 272//12 250//12 +f 250//12 240//12 270//12 +f 269//12 267//12 2//12 +f 265//12 2//12 267//12 +f 244//12 271//12 269//12 diff --git a/com/hbm/blocks/ModBlocks.java b/com/hbm/blocks/ModBlocks.java index e8d330500..b89c744ce 100644 --- a/com/hbm/blocks/ModBlocks.java +++ b/com/hbm/blocks/ModBlocks.java @@ -422,6 +422,8 @@ public class ModBlocks { public static Block dummy_port_fluidtank; public static Block dummy_block_refinery; public static Block dummy_port_refinery; + public static Block dummy_block_pumpjack; + public static Block dummy_port_pumpjack; private static void initializeBlock() { @@ -746,6 +748,8 @@ public class ModBlocks { dummy_port_fluidtank = new DummyBlockFluidTank(Material.iron).setBlockName("dummy_port_fluidtank").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel"); dummy_block_refinery = new DummyBlockRefinery(Material.iron).setBlockName("dummy_block_refinery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium"); dummy_port_refinery = new DummyBlockRefinery(Material.iron).setBlockName("dummy_port_refinery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium"); + dummy_block_pumpjack = new DummyBlockPumpjack(Material.iron).setBlockName("dummy_block_pumpjack").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium"); + dummy_port_pumpjack = new DummyBlockPumpjack(Material.iron).setBlockName("dummy_port_pumpjack").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium"); } private static void registerBlock() { @@ -1056,6 +1060,8 @@ public class ModBlocks { GameRegistry.registerBlock(dummy_port_fluidtank, dummy_port_fluidtank.getUnlocalizedName()); GameRegistry.registerBlock(dummy_block_refinery, dummy_block_refinery.getUnlocalizedName()); GameRegistry.registerBlock(dummy_port_refinery, dummy_port_refinery.getUnlocalizedName()); + GameRegistry.registerBlock(dummy_block_pumpjack, dummy_block_pumpjack.getUnlocalizedName()); + GameRegistry.registerBlock(dummy_port_pumpjack, dummy_port_pumpjack.getUnlocalizedName()); //Other Technical Blocks GameRegistry.registerBlock(oil_pipe, oil_pipe.getUnlocalizedName()); diff --git a/com/hbm/blocks/machine/DummyBlockPumpjack.java b/com/hbm/blocks/machine/DummyBlockPumpjack.java new file mode 100644 index 000000000..bd9ccbe9d --- /dev/null +++ b/com/hbm/blocks/machine/DummyBlockPumpjack.java @@ -0,0 +1,107 @@ +package com.hbm.blocks.machine; + +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.interfaces.IDummy; +import com.hbm.main.MainRegistry; +import com.hbm.tileentity.TileEntityDummy; +import com.hbm.tileentity.TileEntityMachineChemplant; +import com.hbm.tileentity.TileEntityMachinePumpjack; + +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class DummyBlockPumpjack extends BlockContainer implements IDummy { + + public static boolean safeBreak = false; + + public DummyBlockPumpjack(Material p_i45386_1_) { + super(p_i45386_1_); + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityDummy(); + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block block, int i) + { + if(!safeBreak) { + TileEntity te = world.getTileEntity(x, y, z); + if(te != null && te instanceof TileEntityDummy) { + int a = ((TileEntityDummy)te).targetX; + int b = ((TileEntityDummy)te).targetY; + int c = ((TileEntityDummy)te).targetZ; + + //world.getBlock(a, b, c).breakBlock(world, a, b, c, block, i); + if(!world.isRemote) + world.func_147480_a(a, b, c, true); + } + } + world.removeTileEntity(x, y, z); + } + + @Override + public int getRenderType() { + return -1; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + { + return null; + } + + @Override + @SideOnly(Side.CLIENT) + public Item getItem(World world, int x, int y, int z) + { + return Item.getItemFromBlock(ModBlocks.machine_pumpjack); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { + if(world.isRemote) + { + return true; + } else if(!player.isSneaking()) + { + TileEntity te = world.getTileEntity(x, y, z); + if(te != null && te instanceof TileEntityDummy) { + int a = ((TileEntityDummy)te).targetX; + int b = ((TileEntityDummy)te).targetY; + int c = ((TileEntityDummy)te).targetZ; + + TileEntityMachinePumpjack entity = (TileEntityMachinePumpjack) world.getTileEntity(a, b, c); + if(entity != null) + { + FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_pumpjack, world, a, b, c); + } + } + return true; + } else { + return false; + } + } + +} diff --git a/com/hbm/blocks/machine/MachinePumpjack.java b/com/hbm/blocks/machine/MachinePumpjack.java index d898ed509..962b46e36 100644 --- a/com/hbm/blocks/machine/MachinePumpjack.java +++ b/com/hbm/blocks/machine/MachinePumpjack.java @@ -1,17 +1,41 @@ package com.hbm.blocks.machine; +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.handler.MultiblockHandler; +import com.hbm.interfaces.IMultiblock; +import com.hbm.tileentity.TileEntityDummy; +import com.hbm.tileentity.TileEntityMachineOilWell; import com.hbm.tileentity.TileEntityMachinePumpjack; +import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; import net.minecraft.world.World; -public class MachinePumpjack extends BlockContainer { +public class MachinePumpjack extends BlockContainer implements IMultiblock { + + private final Random field_149933_a = new Random(); + private Random rand; + private static boolean keepInventory; public MachinePumpjack(Material p_i45386_1_) { super(p_i45386_1_); } + + @Override + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + { + return Item.getItemFromBlock(ModBlocks.machine_pumpjack); + } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { @@ -32,5 +56,179 @@ public class MachinePumpjack extends BlockContainer { public boolean renderAsNormalBlock() { return false; } + + @Override + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) + { + if (!keepInventory) + { + TileEntityMachinePumpjack tileentityfurnace = (TileEntityMachinePumpjack)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + + if (tileentityfurnace != null) + { + for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1) + { + ItemStack itemstack = tileentityfurnace.getStackInSlot(i1); + + if (itemstack != null) + { + float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + + while (itemstack.stackSize > 0) + { + int j1 = this.field_149933_a.nextInt(21) + 10; + + if (j1 > itemstack.stackSize) + { + j1 = itemstack.stackSize; + } + + itemstack.stackSize -= j1; + EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); + + if (itemstack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3; + entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F; + entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3; + p_149749_1_.spawnEntityInWorld(entityitem); + } + } + } + + p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_); + } + } + + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { + int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + + if (i == 0) { + world.setBlockMetadataWithNotify(x, y, z, 5, 2); + if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.pumpjackDimensionEast)) { + MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.pumpjackDimensionEast, ModBlocks.dummy_block_pumpjack); + + // + DummyBlockPumpjack.safeBreak = true; + world.setBlock(x + 2, y, z, ModBlocks.dummy_port_pumpjack); + TileEntity te = world.getTileEntity(x + 2, y, z); + if(te instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } + world.setBlock(x - 3, y, z, ModBlocks.dummy_port_pumpjack); + TileEntity te2 = world.getTileEntity(x - 3, y, z); + if(te instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te2; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } + DummyBlockPumpjack.safeBreak = false; + // + + } else + world.func_147480_a(x, y, z, true); + } + if (i == 1) { + world.setBlockMetadataWithNotify(x, y, z, 3, 2); + if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.pumpjackDimensionSouth)) { + MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.pumpjackDimensionSouth, ModBlocks.dummy_block_pumpjack); + + // + DummyBlockPumpjack.safeBreak = true; + world.setBlock(x, y, z + 2, ModBlocks.dummy_port_pumpjack); + TileEntity te = world.getTileEntity(x, y, z + 2); + if(te instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } + world.setBlock(x, y, z - 3, ModBlocks.dummy_port_pumpjack); + TileEntity te2 = world.getTileEntity(x, y, z - 3); + if(te instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te2; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } + DummyBlockPumpjack.safeBreak = false; + // + + } else + world.func_147480_a(x, y, z, true); + } + if (i == 2) { + world.setBlockMetadataWithNotify(x, y, z, 4, 2); + if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.pumpjackDimensionWest)) { + MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.pumpjackDimensionWest, ModBlocks.dummy_block_pumpjack); + + // + DummyBlockPumpjack.safeBreak = true; + world.setBlock(x + 3, y, z, ModBlocks.dummy_port_pumpjack); + TileEntity te = world.getTileEntity(x + 3, y, z); + if(te instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } + world.setBlock(x - 2, y, z, ModBlocks.dummy_port_pumpjack); + TileEntity te2 = world.getTileEntity(x - 2, y, z); + if(te instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te2; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } + DummyBlockPumpjack.safeBreak = false; + // + + } else + world.func_147480_a(x, y, z, true); + } + if (i == 3) { + world.setBlockMetadataWithNotify(x, y, z, 2, 2); + if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.pumpjackDimensionNorth)) { + MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.pumpjackDimensionNorth, ModBlocks.dummy_block_pumpjack); + + // + DummyBlockPumpjack.safeBreak = true; + world.setBlock(x, y, z + 3, ModBlocks.dummy_port_pumpjack); + TileEntity te = world.getTileEntity(x, y, z + 3); + if(te instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } + world.setBlock(x, y, z - 2, ModBlocks.dummy_port_pumpjack); + TileEntity te2 = world.getTileEntity(x, y, z - 2); + if(te instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te2; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } + DummyBlockPumpjack.safeBreak = false; + // + + } else + world.func_147480_a(x, y, z, true); + } + } } diff --git a/com/hbm/handler/GUIHandler.java b/com/hbm/handler/GUIHandler.java index 5425ff8c3..11979e901 100644 --- a/com/hbm/handler/GUIHandler.java +++ b/com/hbm/handler/GUIHandler.java @@ -1,149 +1,10 @@ package com.hbm.handler; import com.hbm.blocks.ModBlocks; -import com.hbm.inventory.container.ContainerBombMulti; -import com.hbm.inventory.container.ContainerCentrifuge; -import com.hbm.inventory.container.ContainerConverterHeRf; -import com.hbm.inventory.container.ContainerConverterRfHe; -import com.hbm.inventory.container.ContainerCoreAdvanced; -import com.hbm.inventory.container.ContainerCoreTitanium; -import com.hbm.inventory.container.ContainerDiFurnace; -import com.hbm.inventory.container.ContainerElectricFurnace; -import com.hbm.inventory.container.ContainerFWatzCore; -import com.hbm.inventory.container.ContainerFusionMultiblock; -import com.hbm.inventory.container.ContainerGenerator; -import com.hbm.inventory.container.ContainerIGenerator; -import com.hbm.inventory.container.ContainerLaunchPadTier1; -import com.hbm.inventory.container.ContainerMachineAssembler; -import com.hbm.inventory.container.ContainerMachineBattery; -import com.hbm.inventory.container.ContainerMachineCMBFactory; -import com.hbm.inventory.container.ContainerMachineChemplant; -import com.hbm.inventory.container.ContainerMachineCoal; -import com.hbm.inventory.container.ContainerMachineCyclotron; -import com.hbm.inventory.container.ContainerMachineDeuterium; -import com.hbm.inventory.container.ContainerMachineDiesel; -import com.hbm.inventory.container.ContainerMachineFluidTank; -import com.hbm.inventory.container.ContainerMachineGasFlare; -import com.hbm.inventory.container.ContainerMachineMiningDrill; -import com.hbm.inventory.container.ContainerMachineOilWell; -import com.hbm.inventory.container.ContainerMachineRTG; -import com.hbm.inventory.container.ContainerMachineRefinery; -import com.hbm.inventory.container.ContainerMachineSchrabidiumTransmutator; -import com.hbm.inventory.container.ContainerMachineShredder; -import com.hbm.inventory.container.ContainerMachineTeleporter; -import com.hbm.inventory.container.ContainerNukeBoy; -import com.hbm.inventory.container.ContainerNukeCustom; -import com.hbm.inventory.container.ContainerNukeFleija; -import com.hbm.inventory.container.ContainerNukeFurnace; -import com.hbm.inventory.container.ContainerNukeGadget; -import com.hbm.inventory.container.ContainerNukeMan; -import com.hbm.inventory.container.ContainerNukeMike; -import com.hbm.inventory.container.ContainerNukePrototype; -import com.hbm.inventory.container.ContainerNukeTsar; -import com.hbm.inventory.container.ContainerPuF6Tank; -import com.hbm.inventory.container.ContainerReactor; -import com.hbm.inventory.container.ContainerReactorMultiblock; -import com.hbm.inventory.container.ContainerReiXMainframe; -import com.hbm.inventory.container.ContainerRtgFurnace; -import com.hbm.inventory.container.ContainerTestNuke; -import com.hbm.inventory.container.ContainerUF6Tank; -import com.hbm.inventory.container.ContainerWatzCore; -import com.hbm.inventory.gui.GUIBombMulti; -import com.hbm.inventory.gui.GUIConverterHeRf; -import com.hbm.inventory.gui.GUIConverterRfHe; -import com.hbm.inventory.gui.GUICoreAdvanced; -import com.hbm.inventory.gui.GUICoreTitanium; -import com.hbm.inventory.gui.GUIFWatzCore; -import com.hbm.inventory.gui.GUIFusionMultiblock; -import com.hbm.inventory.gui.GUIIGenerator; -import com.hbm.inventory.gui.GUILaunchPadTier1; -import com.hbm.inventory.gui.GUIMachineAssembler; -import com.hbm.inventory.gui.GUIMachineBattery; -import com.hbm.inventory.gui.GUIMachineCMBFactory; -import com.hbm.inventory.gui.GUIMachineCentrifuge; -import com.hbm.inventory.gui.GUIMachineChemplant; -import com.hbm.inventory.gui.GUIMachineCoal; -import com.hbm.inventory.gui.GUIMachineCyclotron; -import com.hbm.inventory.gui.GUIMachineDeuterium; -import com.hbm.inventory.gui.GUIMachineDiesel; -import com.hbm.inventory.gui.GUIMachineElectricFurnace; -import com.hbm.inventory.gui.GUIMachineFluidTank; -import com.hbm.inventory.gui.GUIMachineGasFlare; -import com.hbm.inventory.gui.GUIMachineGenerator; -import com.hbm.inventory.gui.GUIMachineMiningDrill; -import com.hbm.inventory.gui.GUIMachineOilWell; -import com.hbm.inventory.gui.GUIMachinePuF6Tank; -import com.hbm.inventory.gui.GUIMachineRTG; -import com.hbm.inventory.gui.GUIMachineReactor; -import com.hbm.inventory.gui.GUIMachineRefinery; -import com.hbm.inventory.gui.GUIMachineSchrabidiumTransmutator; -import com.hbm.inventory.gui.GUIMachineShredder; -import com.hbm.inventory.gui.GUIMachineTeleporter; -import com.hbm.inventory.gui.GUIMachineUF6Tank; -import com.hbm.inventory.gui.GUINukeBoy; -import com.hbm.inventory.gui.GUINukeCustom; -import com.hbm.inventory.gui.GUINukeFleija; -import com.hbm.inventory.gui.GUINukeFurnace; -import com.hbm.inventory.gui.GUINukeGadget; -import com.hbm.inventory.gui.GUINukeMan; -import com.hbm.inventory.gui.GUINukeMike; -import com.hbm.inventory.gui.GUINukePrototype; -import com.hbm.inventory.gui.GUINukeTsar; -import com.hbm.inventory.gui.GUIReactorMultiblock; -import com.hbm.inventory.gui.GUIReiXMainframe; -import com.hbm.inventory.gui.GUIRtgFurnace; -import com.hbm.inventory.gui.GUIScreenTemplateFolder; -import com.hbm.inventory.gui.GUITestDiFurnace; -import com.hbm.inventory.gui.GUITestNuke; -import com.hbm.inventory.gui.GUIWatzCore; +import com.hbm.inventory.container.*; +import com.hbm.inventory.gui.*; import com.hbm.items.ModItems; -import com.hbm.tileentity.TileEntityBombMulti; -import com.hbm.tileentity.TileEntityConverterHeRf; -import com.hbm.tileentity.TileEntityConverterRfHe; -import com.hbm.tileentity.TileEntityCoreAdvanced; -import com.hbm.tileentity.TileEntityCoreTitanium; -import com.hbm.tileentity.TileEntityDiFurnace; -import com.hbm.tileentity.TileEntityFWatzCore; -import com.hbm.tileentity.TileEntityFusionMultiblock; -import com.hbm.tileentity.TileEntityMachineIGenerator; -import com.hbm.tileentity.TileEntityMachineMiningDrill; -import com.hbm.tileentity.TileEntityMachineOilWell; -import com.hbm.tileentity.TileEntityLaunchPad; -import com.hbm.tileentity.TileEntityMachineAssembler; -import com.hbm.tileentity.TileEntityMachineBattery; -import com.hbm.tileentity.TileEntityMachineCMBFactory; -import com.hbm.tileentity.TileEntityMachineCentrifuge; -import com.hbm.tileentity.TileEntityMachineChemplant; -import com.hbm.tileentity.TileEntityMachineCoal; -import com.hbm.tileentity.TileEntityMachineCyclotron; -import com.hbm.tileentity.TileEntityMachineDeuterium; -import com.hbm.tileentity.TileEntityMachineDiesel; -import com.hbm.tileentity.TileEntityMachineElectricFurnace; -import com.hbm.tileentity.TileEntityMachineFluidTank; -import com.hbm.tileentity.TileEntityMachineGasFlare; -import com.hbm.tileentity.TileEntityMachineGenerator; -import com.hbm.tileentity.TileEntityMachinePuF6Tank; -import com.hbm.tileentity.TileEntityMachineRTG; -import com.hbm.tileentity.TileEntityMachineReactor; -import com.hbm.tileentity.TileEntityMachineRefinery; -import com.hbm.tileentity.TileEntityMachineSchrabidiumTransmutator; -import com.hbm.tileentity.TileEntityMachineShredder; -import com.hbm.tileentity.TileEntityMachineTeleporter; -import com.hbm.tileentity.TileEntityMachineUF6Tank; -import com.hbm.tileentity.TileEntityNukeBoy; -import com.hbm.tileentity.TileEntityNukeCustom; -import com.hbm.tileentity.TileEntityNukeFleija; -import com.hbm.tileentity.TileEntityNukeFurnace; -import com.hbm.tileentity.TileEntityNukeGadget; -import com.hbm.tileentity.TileEntityNukeMan; -import com.hbm.tileentity.TileEntityNukeMike; -import com.hbm.tileentity.TileEntityNukePrototype; -import com.hbm.tileentity.TileEntityNukeTsar; -import com.hbm.tileentity.TileEntityReactorMultiblock; -import com.hbm.tileentity.TileEntityReiXMainframe; -import com.hbm.tileentity.TileEntityRtgFurnace; -import com.hbm.tileentity.TileEntityTestNuke; -import com.hbm.tileentity.TileEntityWatzCore; +import com.hbm.tileentity.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; @@ -534,6 +395,14 @@ public class GUIHandler implements IGuiHandler { return new ContainerMachineFluidTank(player.inventory, (TileEntityMachineFluidTank) entity); } } + + case ModBlocks.guiID_machine_pumpjack: + { + if(entity instanceof TileEntityMachinePumpjack) + { + return new ContainerMachinePumpjack(player.inventory, (TileEntityMachinePumpjack) entity); + } + } } return null; } @@ -922,6 +791,14 @@ public class GUIHandler implements IGuiHandler { return new GUIMachineFluidTank(player.inventory, (TileEntityMachineFluidTank) entity); } } + + case ModBlocks.guiID_machine_pumpjack: + { + if(entity instanceof TileEntityMachinePumpjack) + { + return new GUIMachinePumpjack(player.inventory, (TileEntityMachinePumpjack) entity); + } + } } } else { //CLIENTONLY GUIS diff --git a/com/hbm/handler/MultiblockHandler.java b/com/hbm/handler/MultiblockHandler.java index 8d5d73d85..d97e392dc 100644 --- a/com/hbm/handler/MultiblockHandler.java +++ b/com/hbm/handler/MultiblockHandler.java @@ -59,6 +59,10 @@ public class MultiblockHandler { public static final int[] fluidTankDimensionNS = new int[] { 1, 1, 2, 0, 2, 2 }; public static final int[] fluidTankDimensionEW = new int[] { 2, 2, 2, 0, 1, 1 }; public static final int[] refineryDimensions = new int[] { 1, 1, 9, 0, 1, 1 }; + public static final int[] pumpjackDimensionNorth = new int[] { 1, 1, 4, 0, 5, 0 }; + public static final int[] pumpjackDimensionEast = new int[] { 0, 5, 4, 0, 1, 1 }; + public static final int[] pumpjackDimensionSouth = new int[] { 1, 1, 4, 0, 0, 5 }; + public static final int[] pumpjackDimensionWest = new int[] { 5, 0, 4, 0, 1, 1 }; //Approved! public static boolean checkSpace(World world, int x, int y, int z, int[] i) { diff --git a/com/hbm/inventory/container/ContainerMachinePumpjack.java b/com/hbm/inventory/container/ContainerMachinePumpjack.java new file mode 100644 index 000000000..818cbdc3a --- /dev/null +++ b/com/hbm/inventory/container/ContainerMachinePumpjack.java @@ -0,0 +1,146 @@ +package com.hbm.inventory.container; + +import com.hbm.inventory.SlotMachineOutput; +import com.hbm.tileentity.TileEntityMachineOilWell; +import com.hbm.tileentity.TileEntityMachinePumpjack; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ContainerMachinePumpjack extends Container { + + private TileEntityMachinePumpjack testNuke; + private int power; + private int warning; + private int warning2; + + public ContainerMachinePumpjack(InventoryPlayer invPlayer, TileEntityMachinePumpjack tedf) { + power = 0; + warning = 0; + warning2 = 0; + + testNuke = tedf; + + //Battery + this.addSlotToContainer(new Slot(tedf, 0, 44, 54)); + //Canister Input + this.addSlotToContainer(new Slot(tedf, 1, 134, 18)); + //Canister Output + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 2, 134, 54)); + //Gas Input + this.addSlotToContainer(new Slot(tedf, 3, 134, 72)); + //Gas Output + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 4, 134, 108)); + //Chip + this.addSlotToContainer(new Slot(tedf, 5, 8, 90)); + + for(int i = 0; i < 3; i++) + { + for(int j = 0; j < 9; j++) + { + this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18 + 56)); + } + } + + for(int i = 0; i < 9; i++) + { + this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 56)); + } + } + + @Override + public void addCraftingToCrafters(ICrafting crafting) { + super.addCraftingToCrafters(crafting); + crafting.sendProgressBarUpdate(this, 0, this.testNuke.power); + crafting.sendProgressBarUpdate(this, 1, this.testNuke.warning); + crafting.sendProgressBarUpdate(this, 2, this.testNuke.warning2); + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot) this.inventorySlots.get(par2); + + if (var4 != null && var4.getHasStack()) + { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if (par2 <= 5) { + if (!this.mergeItemStack(var5, 6, this.inventorySlots.size(), true)) + { + return null; + } + } + else if (!this.mergeItemStack(var5, 0, 2, false)) + { + if (!this.mergeItemStack(var5, 3, 4, false)) + if (!this.mergeItemStack(var5, 5, 6, false)) + return null; + } + + if (var5.stackSize == 0) + { + var4.putStack((ItemStack) null); + } + else + { + var4.onSlotChanged(); + } + } + + return var3; + } + + @Override + public boolean canInteractWith(EntityPlayer player) { + return testNuke.isUseableByPlayer(player); + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + + for(int i = 0; i < this.crafters.size(); i++) + { + ICrafting par1 = (ICrafting)this.crafters.get(i); + if(this.power != this.testNuke.power) + { + par1.sendProgressBarUpdate(this, 0, this.testNuke.power); + } + if(this.warning != this.testNuke.warning) + { + par1.sendProgressBarUpdate(this, 1, this.testNuke.warning); + } + if(this.warning2 != this.testNuke.warning2) + { + par1.sendProgressBarUpdate(this, 2, this.testNuke.warning2); + } + } + + this.power = this.testNuke.power; + this.warning = this.testNuke.warning; + this.warning2 = this.testNuke.warning2; + } + + @Override + public void updateProgressBar(int i, int j) { + if(i == 0) + { + testNuke.power = j; + } + if(i == 1) + { + testNuke.warning = j; + } + if(i == 2) + { + testNuke.warning2 = j; + } + } +} diff --git a/com/hbm/inventory/gui/GUIMachinePumpjack.java b/com/hbm/inventory/gui/GUIMachinePumpjack.java new file mode 100644 index 000000000..d77335a7d --- /dev/null +++ b/com/hbm/inventory/gui/GUIMachinePumpjack.java @@ -0,0 +1,77 @@ +package com.hbm.inventory.gui; + +import org.lwjgl.opengl.GL11; + +import com.hbm.inventory.FluidTank; +import com.hbm.inventory.container.ContainerMachineOilWell; +import com.hbm.inventory.container.ContainerMachinePumpjack; +import com.hbm.lib.RefStrings; +import com.hbm.tileentity.TileEntityMachineOilWell; +import com.hbm.tileentity.TileEntityMachinePumpjack; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; + +public class GUIMachinePumpjack extends GuiFluidContainer { + + private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_well_large.png"); + private TileEntityMachinePumpjack derrick; + + public GUIMachinePumpjack(InventoryPlayer invPlayer, TileEntityMachinePumpjack tedf) { + super(new ContainerMachinePumpjack(invPlayer, tedf)); + derrick = tedf; + + this.xSize = 176; + this.ySize = 222; + } + + @Override + public void drawScreen(int mouseX, int mouseY, float f) { + super.drawScreen(mouseX, mouseY, f); + + derrick.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 70 - 52, 34, 52); + derrick.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 124 - 52, 34, 52); + } + + @Override + protected void drawGuiContainerForegroundLayer( int i, int j) { + String name = this.derrick.hasCustomInventoryName() ? this.derrick.getInventoryName() : I18n.format(this.derrick.getInventoryName()); + + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + + int i = derrick.getPowerScaled(52); + drawTexturedModalRect(guiLeft + 8, guiTop + 70 - i, 176, 52 - i, 16, i); + + int k = derrick.warning; + if(k == 2) + drawTexturedModalRect(guiLeft + 44, guiTop + 18, 176, 52, 16, 16); + if(k == 1) + drawTexturedModalRect(guiLeft + 44, guiTop + 18, 192, 52, 16, 16); + + int l = derrick.warning2; + if(l == 1) + drawTexturedModalRect(guiLeft + 44, guiTop + 90, 208, 52, 16, 16); + if(l == 2) + drawTexturedModalRect(guiLeft + 44, guiTop + 90, 224, 52, 16, 16); + + Minecraft.getMinecraft().getTextureManager().bindTexture(FluidTank.fluidTextures); + + derrick.tanks[0].renderTank(this, guiLeft + 80, guiTop + 70, derrick.tanks[0].getTankType().textureX() * FluidTank.x, derrick.tanks[0].getTankType().textureY() * FluidTank.y, 16, 52); + derrick.tanks[0].renderTank(this, guiLeft + 96, guiTop + 70, derrick.tanks[0].getTankType().textureX() * FluidTank.x, derrick.tanks[0].getTankType().textureY() * FluidTank.y, 16, 52); + derrick.tanks[0].renderTank(this, guiLeft + 112, guiTop + 70, derrick.tanks[0].getTankType().textureX() * FluidTank.x, derrick.tanks[0].getTankType().textureY() * FluidTank.y, 2, 52); + derrick.tanks[1].renderTank(this, guiLeft + 80, guiTop + 124, derrick.tanks[1].getTankType().textureX() * FluidTank.x, derrick.tanks[1].getTankType().textureY() * FluidTank.y, 16, 52); + derrick.tanks[1].renderTank(this, guiLeft + 96, guiTop + 124, derrick.tanks[1].getTankType().textureX() * FluidTank.x, derrick.tanks[1].getTankType().textureY() * FluidTank.y, 16, 52); + derrick.tanks[1].renderTank(this, guiLeft + 112, guiTop + 124, derrick.tanks[1].getTankType().textureX() * FluidTank.x, derrick.tanks[1].getTankType().textureY() * FluidTank.y, 2, 52); + } +} diff --git a/com/hbm/packet/PacketDispatcher.java b/com/hbm/packet/PacketDispatcher.java index a118911b3..6bc403262 100644 --- a/com/hbm/packet/PacketDispatcher.java +++ b/com/hbm/packet/PacketDispatcher.java @@ -43,6 +43,8 @@ public class PacketDispatcher { wrapper.registerMessage(TETurretPacket.Handler.class, TETurretPacket.class, i++, Side.CLIENT); //Signals server to consume items and create template wrapper.registerMessage(ItemFolderPacket.Handler.class, ItemFolderPacket.class, i++, Side.SERVER); + //Pumpjack rotation for animation rendering + wrapper.registerMessage(TEPumpjackPacket.Handler.class, TEPumpjackPacket.class, i++, Side.CLIENT); } } diff --git a/com/hbm/packet/TEPumpjackPacket.java b/com/hbm/packet/TEPumpjackPacket.java new file mode 100644 index 000000000..782a0df4e --- /dev/null +++ b/com/hbm/packet/TEPumpjackPacket.java @@ -0,0 +1,68 @@ +package com.hbm.packet; + +import com.hbm.tileentity.TileEntityMachineAssembler; +import com.hbm.tileentity.TileEntityMachinePumpjack; + +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import io.netty.buffer.ByteBuf; +import net.minecraft.client.Minecraft; +import net.minecraft.tileentity.TileEntity; + +public class TEPumpjackPacket implements IMessage { + + int x; + int y; + int z; + int spin; + boolean progress; + + public TEPumpjackPacket() + { + + } + + public TEPumpjackPacket(int x, int y, int z, int spin, boolean bool) + { + this.x = x; + this.y = y; + this.z = z; + this.spin = spin; + this.progress = bool; + } + + @Override + public void fromBytes(ByteBuf buf) { + x = buf.readInt(); + y = buf.readInt(); + z = buf.readInt(); + spin = buf.readInt(); + progress = buf.readBoolean(); + } + + @Override + public void toBytes(ByteBuf buf) { + buf.writeInt(x); + buf.writeInt(y); + buf.writeInt(z); + buf.writeInt(spin); + buf.writeBoolean(progress); + } + + public static class Handler implements IMessageHandler { + + @Override + public IMessage onMessage(TEPumpjackPacket m, MessageContext ctx) { + TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z); + + if (te != null && te instanceof TileEntityMachinePumpjack) { + + TileEntityMachinePumpjack gen = (TileEntityMachinePumpjack) te; + gen.rotation = m.spin; + gen.isProgressing = m.progress; + } + return null; + } + } +} diff --git a/com/hbm/render/tileentity/RenderPumpjack.java b/com/hbm/render/tileentity/RenderPumpjack.java index b04871fe5..36c0c482f 100644 --- a/com/hbm/render/tileentity/RenderPumpjack.java +++ b/com/hbm/render/tileentity/RenderPumpjack.java @@ -4,6 +4,7 @@ import org.lwjgl.opengl.GL11; import com.hbm.lib.RefStrings; import com.hbm.main.ResourceManager; +import com.hbm.tileentity.TileEntityMachinePumpjack; import com.hbm.tileentity.TileEntityTurretBase; import net.minecraft.client.renderer.Tessellator; @@ -17,17 +18,28 @@ public class RenderPumpjack extends TileEntitySpecialRenderer { private ResourceLocation gadgetTexture = new ResourceLocation(RefStrings.MODID, "textures/models/TheGadget3_.png"); - int i = 0; + int i; @Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) { - i += 2; - if(i >= 360) - i-= 360; - GL11.glPushMatrix(); - GL11.glTranslated(x + 0.5D, y, z + 0.5D); + GL11.glTranslated(x + 0.5, y, z + 0.5); + switch(tileEntity.getBlockMetadata()) + { + case 2: + GL11.glRotatef(0, 0F, 1F, 0F); break; + case 4: + GL11.glRotatef(90, 0F, 1F, 0F); break; + case 3: + GL11.glRotatef(180, 0F, 1F, 0F); break; + case 5: + GL11.glRotatef(270, 0F, 1F, 0F); break; + } + + if(tileEntity instanceof TileEntityMachinePumpjack) + i= ((TileEntityMachinePumpjack)tileEntity).rotation; + GL11.glPushMatrix(); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glRotatef(180, 0F, 1F, 0F); @@ -37,13 +49,12 @@ public class RenderPumpjack extends TileEntitySpecialRenderer { GL11.glPopMatrix(); - renderTileEntityAt2(tileEntity, x, y, z, f); + renderTileEntityAt2(); } - public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f) + public void renderTileEntityAt2() { GL11.glPushMatrix(); - GL11.glTranslated(x + 0.5D, y, z + 0.5D); GL11.glTranslated(0, 1.5, 5.5); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE); @@ -51,17 +62,18 @@ public class RenderPumpjack extends TileEntitySpecialRenderer { this.bindTexture(gadgetTexture); GL11.glRotated(i - 90, 1F, 0F, 0F); + ResourceManager.pumpjack_rotor.renderAll(); GL11.glPopMatrix(); - renderTileEntityAt3(tileEntity, x, y, z, f); + renderTileEntityAt3(); } - public void renderTileEntityAt3(TileEntity tileEntity, double x, double y, double z, float f) + public void renderTileEntityAt3() { GL11.glPushMatrix(); - GL11.glTranslated(x + 0.5D, y + 1, z + 0.5D); + GL11.glTranslated(0, 1, 0); GL11.glTranslated(0, 2.5, 2.5); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE); @@ -74,13 +86,13 @@ public class RenderPumpjack extends TileEntitySpecialRenderer { GL11.glPopMatrix(); - renderTileEntityAt4(tileEntity, x, y, z, f); + renderTileEntityAt4(); } - public void renderTileEntityAt4(TileEntity tileEntity, double x, double y, double z, float f) + public void renderTileEntityAt4() { GL11.glPushMatrix(); - GL11.glTranslated(x + 0.5D, y + 1, z + 0.5D); + GL11.glTranslated(0, 1, 0); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glRotatef(180, 0F, 1F, 0F); @@ -94,6 +106,7 @@ public class RenderPumpjack extends TileEntitySpecialRenderer { drawConnection(-0.55, 0.5 + t, -5.5 - u, -0.55, 2.5 + v, -2.5 - w); GL11.glPopMatrix(); + GL11.glPopMatrix(); } public void drawConnection(double x, double y, double z, double a, double b, double c) { diff --git a/com/hbm/tileentity/TileEntityMachinePumpjack.java b/com/hbm/tileentity/TileEntityMachinePumpjack.java index d453b5a15..d0f75d39e 100644 --- a/com/hbm/tileentity/TileEntityMachinePumpjack.java +++ b/com/hbm/tileentity/TileEntityMachinePumpjack.java @@ -1,7 +1,524 @@ package com.hbm.tileentity; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.entity.particle.EntityGasFX; +import com.hbm.explosion.ExplosionLarge; +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.IFluidSource; +import com.hbm.inventory.FluidTank; +import com.hbm.items.ModItems; +import com.hbm.items.special.ItemBattery; +import com.hbm.lib.Library; +import com.hbm.packet.PacketDispatcher; +import com.hbm.packet.TEAssemblerPacket; +import com.hbm.packet.TEPumpjackPacket; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraftforge.oredict.OreDictionary; -public class TileEntityMachinePumpjack extends TileEntity { +public class TileEntityMachinePumpjack extends TileEntity implements ISidedInventory, IConsumer, IFluidContainer, IFluidSource { + private ItemStack slots[]; + + public int power; + public int warning; + public int warning2; + public static final int maxPower = 100000; + public int age = 0; + public int age2 = 0; + public List list1 = new ArrayList(); + public List list2 = new ArrayList(); + public FluidTank[] tanks; + public boolean isProgressing; + public int rotation; + + private static final int[] slots_top = new int[] {1}; + private static final int[] slots_bottom = new int[] {2, 0}; + private static final int[] slots_side = new int[] {0}; + Random rand = new Random(); + + private String customName; + + public TileEntityMachinePumpjack() { + slots = new ItemStack[6]; + tanks = new FluidTank[2]; + tanks[0] = new FluidTank(FluidType.OIL, 128000, 0); + tanks[1] = new FluidTank(FluidType.GAS, 128000, 1); + } + + @Override + public int getSizeInventory() { + return slots.length; + } + + @Override + public ItemStack getStackInSlot(int i) { + return slots[i]; + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) { + if(slots[i] != null) + { + ItemStack itemStack = slots[i]; + slots[i] = null; + return itemStack; + } else { + return null; + } + } + + @Override + public void setInventorySlotContents(int i, ItemStack itemStack) { + slots[i] = itemStack; + if(itemStack != null && itemStack.stackSize > getInventoryStackLimit()) + { + itemStack.stackSize = getInventoryStackLimit(); + } + } + + @Override + public String getInventoryName() { + return this.hasCustomInventoryName() ? this.customName : "container.oilWell"; + } + + @Override + public boolean hasCustomInventoryName() { + return this.customName != null && this.customName.length() > 0; + } + + public void setCustomName(String name) { + this.customName = name; + } + + @Override + public int getInventoryStackLimit() { + return 64; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer player) { + if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) + { + return false; + }else{ + return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=128; + } + } + + //You scrubs aren't needed for anything (right now) + @Override + public void openInventory() {} + @Override + public void closeInventory() {} + + @Override + public boolean isItemValidForSlot(int i, ItemStack itemStack) { + if(i == 0) + if(itemStack.getItem() instanceof ItemBattery) + return true; + + if(i == 1) + return true; + + return false; + } + + @Override + public ItemStack decrStackSize(int i, int j) { + if(slots[i] != null) + { + if(slots[i].stackSize <= j) + { + ItemStack itemStack = slots[i]; + slots[i] = null; + return itemStack; + } + ItemStack itemStack1 = slots[i].splitStack(j); + if (slots[i].stackSize == 0) + { + slots[i] = null; + } + + return itemStack1; + } else { + return null; + } + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + NBTTagList list = nbt.getTagList("items", 10); + + this.power = nbt.getInteger("powerTime"); + this.age = nbt.getInteger("age"); + + this.tanks[0].readFromNBT(nbt, "oil"); + this.tanks[1].readFromNBT(nbt, "gas"); + + slots = new ItemStack[getSizeInventory()]; + + for(int i = 0; i < list.tagCount(); i++) + { + NBTTagCompound nbt1 = list.getCompoundTagAt(i); + byte b0 = nbt1.getByte("slot"); + if(b0 >= 0 && b0 < slots.length) + { + slots[b0] = ItemStack.loadItemStackFromNBT(nbt1); + } + } + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + nbt.setInteger("powerTime", power); + nbt.setInteger("age", age); + + this.tanks[0].writeToNBT(nbt, "oil"); + this.tanks[1].writeToNBT(nbt, "gas"); + + NBTTagList list = new NBTTagList(); + + for(int i = 0; i < slots.length; i++) + { + if(slots[i] != null) + { + NBTTagCompound nbt1 = new NBTTagCompound(); + nbt1.setByte("slot", (byte)i); + slots[i].writeToNBT(nbt1); + list.appendTag(nbt1); + } + } + nbt.setTag("items", list); + } + + @Override + public int[] getAccessibleSlotsFromSide(int p_94128_1_) + { + return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side); + } + + @Override + public boolean canInsertItem(int i, ItemStack itemStack, int j) { + return this.isItemValidForSlot(i, itemStack); + } + + @Override + public boolean canExtractItem(int i, ItemStack itemStack, int j) { + return false; + } + + public int getPowerScaled(int i) { + return (power * i) / maxPower; + } + + @Override + public void updateEntity() { + + int timer = 20; + + age++; + age2++; + if(age >= timer) + age -= timer; + if(age2 >= 20) + age2 -= 20; + if(age2 == 9 || age2 == 19) { + fillFluidInit(tanks[0].getTankType()); + fillFluidInit(tanks[1].getTankType()); + } + + if(!worldObj.isRemote) { + this.tanks[0].unloadTank(1, 2, slots); + this.tanks[1].unloadTank(3, 4, slots); + + for(int i = 0; i < 2; i++) { + tanks[i].updateTank(xCoord, yCoord, zCoord); + } + + power = Library.chargeTEFromItems(slots, 0, power, maxPower); + + if(power >= 200) { + + //operation start + + if(age == timer - 1) { + warning = 0; + + //warning 0, green: derrick is operational + //warning 1, red: derrick is full, has no power or the drill is jammed + //warning 2, yellow: drill has reached max depth + + for(int i = this.yCoord - 1; i > this.yCoord - 1 - 100; i--) { + + if(i <= 5) { + //Code 2: The drilling ended + warning = 2; + break; + } + + Block b = worldObj.getBlock(this.xCoord, i, this.zCoord); + if(b == ModBlocks.oil_pipe) + continue; + + if(b == Blocks.air || b == Blocks.grass || b == Blocks.dirt || + b == Blocks.stone || b == Blocks.sand || b == Blocks.sandstone || + b == Blocks.clay || b == Blocks.hardened_clay || b == Blocks.stained_hardened_clay || + b == Blocks.gravel || isOre(b, worldObj.getBlockMetadata(xCoord, i, zCoord)) || + b.isReplaceable(worldObj, xCoord, i, zCoord)) { + worldObj.setBlock(xCoord, i, zCoord, ModBlocks.oil_pipe); + + //Code 2: The drilling ended + if(i == this.yCoord - 100) + warning = 2; + break; + + } else if((b == ModBlocks.ore_oil || b == ModBlocks.ore_oil_empty) && this.tanks[0].getFill() < this.tanks[0].getMaxFill() && this.tanks[1].getFill() < this.tanks[1].getMaxFill()) { + if(succ(this.xCoord, i, this.zCoord)) { + + this.tanks[0].setFill(this.tanks[0].getFill() + 650); + if(this.tanks[0].getFill() > this.tanks[0].getMaxFill()) + this.tanks[0].setFill(tanks[0].getMaxFill()); + + + this.tanks[1].setFill(this.tanks[1].getFill() + (100 + rand.nextInt(301))); + if(this.tanks[1].getFill() > this.tanks[1].getMaxFill()) + this.tanks[1].setFill(tanks[1].getMaxFill()); + + break; + } else { + worldObj.setBlock(xCoord, i, zCoord, ModBlocks.oil_pipe); + break; + } + + } else { + //Code 1: Drill jammed + warning = 1; + break; + } + } + } + + //operation end + + power -= 200; + } else { + warning = 1; + } + + warning2 = 0; + if(tanks[1].getFill() > 0) { + if(slots[5] != null && (slots[5].getItem() == ModItems.fuse || slots[5].getItem() == ModItems.screwdriver)) { + warning2 = 2; + tanks[1].setFill(tanks[1].getFill() - 50); + if(tanks[1].getFill() <= 0) + tanks[1].setFill(0); + worldObj.spawnEntityInWorld(new EntityGasFX(worldObj, this.xCoord + 0.5F, this.yCoord + 0.5F, this.zCoord + 0.5F, 0.0, 0.0, 0.0)); + } else { + warning2 = 1; + } + } + + isProgressing = warning == 0; + rotation += (warning == 0 ? 5 : 0); + rotation = rotation % 360; + + PacketDispatcher.wrapper.sendToAll(new TEPumpjackPacket(xCoord, yCoord, zCoord, rotation, isProgressing)); + } + + } + + public boolean isOre(Block b, int meta) { + + int[] ids = OreDictionary.getOreIDs(new ItemStack(b, 1, meta)); + + for(int i = 0; i < ids.length; i++) { + + String s = OreDictionary.getOreName(ids[i]); + + if(s.length() > 3 && s.substring(0, 3).equals("ore")) + return true; + } + + return false; + } + + public boolean succ(int x, int y, int z) { + + list.clear(); + + succ1(x, y, z); + succ2(x, y, z); + + if(!list.isEmpty()) { + + int i = rand.nextInt(list.size()); + int a = list.get(i)[0]; + int b = list.get(i)[1]; + int c = list.get(i)[2]; + + if(worldObj.getBlock(a, b, c) == ModBlocks.ore_oil) { + + worldObj.setBlock(a, b, c, ModBlocks.ore_oil_empty); + return true; + } + } + + return false; + } + + public void succInit1(int x, int y, int z) { + succ1(x + 1, y, z); + succ1(x - 1, y, z); + succ1(x, y + 1, z); + succ1(x, y - 1, z); + succ1(x, y, z + 1); + succ1(x, y, z - 1); + } + + public void succInit2(int x, int y, int z) { + succ2(x + 1, y, z); + succ2(x - 1, y, z); + succ2(x, y + 1, z); + succ2(x, y - 1, z); + succ2(x, y, z + 1); + succ2(x, y, z - 1); + } + + List list = new ArrayList(); + + public void succ1(int x, int y, int z) { + if(worldObj.getBlock(x, y, z) == ModBlocks.ore_oil_empty && + worldObj.getBlockMetadata(x, y, z) == 0) { + worldObj.setBlockMetadataWithNotify(x, y, z, 1, 2); + succInit1(x, y, z); + } + } + + public void succ2(int x, int y, int z) { + if(worldObj.getBlock(x, y, z) == ModBlocks.ore_oil_empty && + worldObj.getBlockMetadata(x, y, z) == 1) { + worldObj.setBlockMetadataWithNotify(x, y, z, 0, 2); + succInit2(x, y, z); + } else if(worldObj.getBlock(x, y, z) == ModBlocks.ore_oil) { + list.add(new int[] { x, y, z }); + } + } + + @Override + public void setPower(int i) { + power = i; + + } + + @Override + public int getPower() { + return power; + + } + + @Override + public int getMaxPower() { + return maxPower; + } + + @Override + public AxisAlignedBB getRenderBoundingBox() { + return TileEntity.INFINITE_EXTENT_AABB; + } + + @Override + @SideOnly(Side.CLIENT) + public double getMaxRenderDistanceSquared() + { + return 65536.0D; + } + + @Override + public boolean getTact() { + if (age2 >= 0 && age2 < 10) { + return true; + } + + return false; + } + + @Override + public void fillFluidInit(FluidType type) { + fillFluid(this.xCoord - 2, this.yCoord, this.zCoord, getTact(), type); + fillFluid(this.xCoord + 2, this.yCoord, this.zCoord, getTact(), type); + fillFluid(this.xCoord, this.yCoord, this.zCoord - 2, getTact(), type); + fillFluid(this.xCoord, this.yCoord, this.zCoord + 2, getTact(), type); + } + + @Override + public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) { + Library.transmitFluid(x, y, z, newTact, this, worldObj, type); + } + + @Override + public int getSFluidFill(FluidType type) { + if(type.name().equals(tanks[0].getTankType().name())) + return tanks[0].getFill(); + else if(type.name().equals(tanks[1].getTankType().name())) + return tanks[1].getFill(); + + return 0; + } + + @Override + public void setSFluidFill(int i, FluidType type) { + if(type.name().equals(tanks[0].getTankType().name())) + tanks[0].setFill(i); + else if(type.name().equals(tanks[1].getTankType().name())) + tanks[1].setFill(i); + } + + @Override + public List getFluidList(FluidType type) { + if(type.name().equals(tanks[0].getTankType().name())) + return this.list1; + if(type.name().equals(tanks[1].getTankType().name())) + return this.list2; + return new ArrayList(); + } + + @Override + public void clearFluidList(FluidType type) { + if(type.name().equals(tanks[0].getTankType().name())) + list1.clear(); + if(type.name().equals(tanks[1].getTankType().name())) + list2.clear(); + } + + @Override + public void setFillstate(int fill, int index) { + if(index < 2 && tanks[index] != null) + tanks[index].setFill(fill); + } + + @Override + public void setType(FluidType type, int index) { + if(index < 2 && tanks[index] != null) + tanks[index].setTankType(type); + } }