diff --git a/.classpath b/.classpath
index 37cb1f94..9d71da7e 100644
--- a/.classpath
+++ b/.classpath
@@ -2,6 +2,6 @@
-
+
diff --git a/build.xml b/build.xml
index b42fe22e..4059787c 100644
--- a/build.xml
+++ b/build.xml
@@ -17,13 +17,14 @@
-
-
-
+
+
+
+
@@ -44,7 +45,7 @@
-
+
@@ -57,6 +58,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -87,11 +103,7 @@
-
-
-
-
-
+
@@ -100,6 +112,12 @@
+
+
+
+
+
+
diff --git a/buildcraft_resources/build.number b/buildcraft_resources/build.number
index 395124d9..72d52022 100644
--- a/buildcraft_resources/build.number
+++ b/buildcraft_resources/build.number
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
-#Sat Jan 26 10:14:15 CET 2013
-build.number=16
+#Fri Feb 22 17:54:19 CET 2013
+build.number=19
diff --git a/buildcraft_resources/build.xml b/buildcraft_resources/build.xml
index 8661bebd..65fad00c 100644
--- a/buildcraft_resources/build.xml
+++ b/buildcraft_resources/build.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/buildcraft_resources/changelog/3.4.3 b/buildcraft_resources/changelog/3.4.3
new file mode 100644
index 00000000..d538ef9f
--- /dev/null
+++ b/buildcraft_resources/changelog/3.4.3
@@ -0,0 +1,13 @@
+
+# 3.4.3
+
+- Added: Glass facades. (Krapht)
+- Changed: Autoarchic gates now always pulse at a single, fast rate. (cpw)
+- Bugfix: Vines now marked as soft blocks. (CovertJaguar)
+- Bugfix: Prevented crash if world gen is disabled. (CovertJaguar)
+- Bugfix: Fixed NPE when liquid in tank has ceased to exist. (Krapht)
+- Bugfix: Fixed /buildcraft not working in SSP. (viper283)
+- Bugfix: Fixed tank filling. (CovertJaguar)
+- Bugfix: Pipe items now registered with FML. (CovertJaguar)
+- Bugfix: Version check now threaded. (Pahimar)
+- Localization: Several updates to locations. (Contributors)
\ No newline at end of file
diff --git a/buildcraft_resources/changelog/3.4.4 b/buildcraft_resources/changelog/3.4.4
new file mode 100644
index 00000000..ced0a87b
--- /dev/null
+++ b/buildcraft_resources/changelog/3.4.4
@@ -0,0 +1,6 @@
+# 3.4.4
+
+- Changed: Improved pipe interaction, pipe selection. Gate GUI will only open if the actual gate has been clicked. (Player)
+- Bugfix: Fixed pipes not respecting an inventory's maximum stack limit. (powercrystals)
+- Bugfix: Fixed a possible endless look when interacting with inventories. (immibis)
+- Bugfix: Fixed possible crash with other mods interacting with the advanced assembly table. (Player)
\ No newline at end of file
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/advworkbenchtable_bottom.png b/buildcraft_resources/mods/buildcraft/textures/blocks/advworkbenchtable_bottom.png
new file mode 100644
index 00000000..4722beb1
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/advworkbenchtable_bottom.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/advworkbenchtable_side.png b/buildcraft_resources/mods/buildcraft/textures/blocks/advworkbenchtable_side.png
new file mode 100644
index 00000000..90920c11
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/advworkbenchtable_side.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/advworkbenchtable_top.png b/buildcraft_resources/mods/buildcraft/textures/blocks/advworkbenchtable_top.png
new file mode 100644
index 00000000..c26cd27e
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/advworkbenchtable_top.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/architect_front.png b/buildcraft_resources/mods/buildcraft/textures/blocks/architect_front.png
new file mode 100644
index 00000000..1b38b276
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/architect_front.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/architect_sides.png b/buildcraft_resources/mods/buildcraft/textures/blocks/architect_sides.png
new file mode 100644
index 00000000..3c1284d2
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/architect_sides.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/architect_top.png b/buildcraft_resources/mods/buildcraft/textures/blocks/architect_top.png
new file mode 100644
index 00000000..4a8eb3d7
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/architect_top.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/architect_top_neg.png b/buildcraft_resources/mods/buildcraft/textures/blocks/architect_top_neg.png
new file mode 100644
index 00000000..eb0d4f7b
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/architect_top_neg.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/architect_top_pos.png b/buildcraft_resources/mods/buildcraft/textures/blocks/architect_top_pos.png
new file mode 100644
index 00000000..8a55e3ab
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/architect_top_pos.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/assemblytable_bottom.png b/buildcraft_resources/mods/buildcraft/textures/blocks/assemblytable_bottom.png
new file mode 100644
index 00000000..4722beb1
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/assemblytable_bottom.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/assemblytable_side.png b/buildcraft_resources/mods/buildcraft/textures/blocks/assemblytable_side.png
new file mode 100644
index 00000000..24f9473c
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/assemblytable_side.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/assemblytable_top.png b/buildcraft_resources/mods/buildcraft/textures/blocks/assemblytable_top.png
new file mode 100644
index 00000000..843cef29
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/assemblytable_top.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/autoWorkbench_side.png b/buildcraft_resources/mods/buildcraft/textures/blocks/autoWorkbench_side.png
new file mode 100644
index 00000000..2b1b4dca
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/autoWorkbench_side.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/autoWorkbench_top.png b/buildcraft_resources/mods/buildcraft/textures/blocks/autoWorkbench_top.png
new file mode 100644
index 00000000..a174d496
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/autoWorkbench_top.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/blockBlueLaser.png b/buildcraft_resources/mods/buildcraft/textures/blocks/blockBlueLaser.png
new file mode 100644
index 00000000..e048b52d
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/blockBlueLaser.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/blockDrillHeadTexture.png b/buildcraft_resources/mods/buildcraft/textures/blocks/blockDrillHeadTexture.png
new file mode 100644
index 00000000..e424b817
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/blockDrillHeadTexture.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/blockDrillTexture.png b/buildcraft_resources/mods/buildcraft/textures/blocks/blockDrillTexture.png
new file mode 100644
index 00000000..f867a585
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/blockDrillTexture.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/blockFillerSides.png b/buildcraft_resources/mods/buildcraft/textures/blocks/blockFillerSides.png
new file mode 100644
index 00000000..a870fa6f
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/blockFillerSides.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/blockFillerTopOff.png b/buildcraft_resources/mods/buildcraft/textures/blocks/blockFillerTopOff.png
new file mode 100644
index 00000000..e9edaf8b
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/blockFillerTopOff.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/blockFillerTopOn.png b/buildcraft_resources/mods/buildcraft/textures/blocks/blockFillerTopOn.png
new file mode 100644
index 00000000..d3d78898
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/blockFillerTopOn.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/blockFrame.png b/buildcraft_resources/mods/buildcraft/textures/blocks/blockFrame.png
new file mode 100644
index 00000000..ca76680b
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/blockFrame.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/blockMarker.png b/buildcraft_resources/mods/buildcraft/textures/blocks/blockMarker.png
new file mode 100644
index 00000000..b1f37399
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/blockMarker.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/blockPathMarker.png b/buildcraft_resources/mods/buildcraft/textures/blocks/blockPathMarker.png
new file mode 100644
index 00000000..65d97186
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/blockPathMarker.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/blockPathMarkerActive.png b/buildcraft_resources/mods/buildcraft/textures/blocks/blockPathMarkerActive.png
new file mode 100644
index 00000000..2f5e8cbb
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/blockPathMarkerActive.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/blockPlainPipe.png b/buildcraft_resources/mods/buildcraft/textures/blocks/blockPlainPipe.png
new file mode 100644
index 00000000..05940b37
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/blockPlainPipe.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/blockRedLaser.png b/buildcraft_resources/mods/buildcraft/textures/blocks/blockRedLaser.png
new file mode 100644
index 00000000..98da7c67
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/blockRedLaser.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/blockStripesLaser.png b/buildcraft_resources/mods/buildcraft/textures/blocks/blockStripesLaser.png
new file mode 100644
index 00000000..7c4ca50f
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/blockStripesLaser.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/blockTransparentLaser.png b/buildcraft_resources/mods/buildcraft/textures/blocks/blockTransparentLaser.png
new file mode 100644
index 00000000..3840bdcb
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/blockTransparentLaser.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_12_13.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_12_13.png
new file mode 100644
index 00000000..2fe0cec3
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_12_13.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_12_14.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_12_14.png
new file mode 100644
index 00000000..0e3f7355
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_12_14.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_12_15.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_12_15.png
new file mode 100644
index 00000000..a5bce439
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_12_15.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_13_14.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_13_14.png
new file mode 100644
index 00000000..a6099c28
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_13_14.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_13_15.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_13_15.png
new file mode 100644
index 00000000..3ebb9035
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_13_15.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_0.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_0.png
new file mode 100644
index 00000000..c09260fc
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_0.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_1.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_1.png
new file mode 100644
index 00000000..daddc6cd
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_1.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_2.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_2.png
new file mode 100644
index 00000000..3b4dfd95
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_2.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_3.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_3.png
new file mode 100644
index 00000000..a42b1453
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_3.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_4.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_4.png
new file mode 100644
index 00000000..db398e83
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_4.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_5.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_5.png
new file mode 100644
index 00000000..cf1dbf95
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_5.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_6.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_6.png
new file mode 100644
index 00000000..c9f31a5f
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_6.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_7.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_7.png
new file mode 100644
index 00000000..1702bfc8
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_7.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_8.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_8.png
new file mode 100644
index 00000000..38cf1b32
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_8.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_9.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_9.png
new file mode 100644
index 00000000..b560449d
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_15_9.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_1_4.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_1_4.png
new file mode 100644
index 00000000..ee8479a0
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_1_4.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_0.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_0.png
new file mode 100644
index 00000000..ce20976c
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_0.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_1.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_1.png
new file mode 100644
index 00000000..a3abf5ae
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_1.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_10.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_10.png
new file mode 100644
index 00000000..3d0f32c1
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_10.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_11.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_11.png
new file mode 100644
index 00000000..e15be761
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_11.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_12.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_12.png
new file mode 100644
index 00000000..bb9c6801
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_12.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_13.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_13.png
new file mode 100644
index 00000000..2cdf33f1
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_13.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_14.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_14.png
new file mode 100644
index 00000000..f667bc59
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_14.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_15.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_15.png
new file mode 100644
index 00000000..aab04d09
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_15.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_2.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_2.png
new file mode 100644
index 00000000..22db373e
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_2.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_3.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_3.png
new file mode 100644
index 00000000..750b5193
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_3.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_4.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_4.png
new file mode 100644
index 00000000..56beb2d6
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_4.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_5.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_5.png
new file mode 100644
index 00000000..5079c423
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_5.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_6.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_6.png
new file mode 100644
index 00000000..2fd0f78c
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_6.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_7.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_7.png
new file mode 100644
index 00000000..96e8542e
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_7.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_8.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_8.png
new file mode 100644
index 00000000..78d46bc4
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_8.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_9.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_9.png
new file mode 100644
index 00000000..416b2075
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_5_9.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_11.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_11.png
new file mode 100644
index 00000000..4716720c
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_11.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_12.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_12.png
new file mode 100644
index 00000000..19877359
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_12.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_15.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_15.png
new file mode 100644
index 00000000..22eaf31e
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_15.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_5.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_5.png
new file mode 100644
index 00000000..40e8a3c2
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_5.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_7.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_7.png
new file mode 100644
index 00000000..4674a691
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_7.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_9.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_9.png
new file mode 100644
index 00000000..20f4ce68
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_7_9.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_8_0.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_8_0.png
new file mode 100644
index 00000000..a811102f
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_8_0.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_8_1.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_8_1.png
new file mode 100644
index 00000000..4d529437
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_8_1.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_8_2.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_8_2.png
new file mode 100644
index 00000000..93e420da
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_8_2.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/block_8_3.png b/buildcraft_resources/mods/buildcraft/textures/blocks/block_8_3.png
new file mode 100644
index 00000000..668986ac
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/block_8_3.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/builder_front.png b/buildcraft_resources/mods/buildcraft/textures/blocks/builder_front.png
new file mode 100644
index 00000000..aa7c1c2a
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/builder_front.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/builder_side.png b/buildcraft_resources/mods/buildcraft/textures/blocks/builder_side.png
new file mode 100644
index 00000000..0b061d1f
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/builder_side.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/builder_top.png b/buildcraft_resources/mods/buildcraft/textures/blocks/builder_top.png
new file mode 100644
index 00000000..223bdee5
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/builder_top.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/clear.png b/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/clear.png
new file mode 100644
index 00000000..69296678
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/clear.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/fillAll.png b/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/fillAll.png
new file mode 100644
index 00000000..128fb518
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/fillAll.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/flatten.png b/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/flatten.png
new file mode 100644
index 00000000..2a020f98
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/flatten.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/pyramid.png b/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/pyramid.png
new file mode 100644
index 00000000..82a969aa
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/pyramid.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/stairs.png b/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/stairs.png
new file mode 100644
index 00000000..7df07d48
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/stairs.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/walls.png b/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/walls.png
new file mode 100644
index 00000000..5856e02f
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/fillerPatterns/walls.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_dark.png
new file mode 100644
index 00000000..4cdf4339
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_diamond_and_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_diamond_and_dark.png
new file mode 100644
index 00000000..8b44f3a8
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_diamond_and_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_diamond_and_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_diamond_and_lit.png
new file mode 100644
index 00000000..abc89033
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_diamond_and_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_diamond_or_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_diamond_or_dark.png
new file mode 100644
index 00000000..fc44df71
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_diamond_or_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_diamond_or_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_diamond_or_lit.png
new file mode 100644
index 00000000..b789a8ae
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_diamond_or_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_gold_and_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_gold_and_dark.png
new file mode 100644
index 00000000..c9bcdf3c
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_gold_and_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_gold_and_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_gold_and_lit.png
new file mode 100644
index 00000000..5a210398
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_gold_and_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_gold_or_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_gold_or_dark.png
new file mode 100644
index 00000000..a65b1d35
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_gold_or_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_gold_or_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_gold_or_lit.png
new file mode 100644
index 00000000..16935efb
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_gold_or_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_iron_and_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_iron_and_dark.png
new file mode 100644
index 00000000..98226ce7
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_iron_and_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_iron_and_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_iron_and_lit.png
new file mode 100644
index 00000000..dbef7d12
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_iron_and_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_iron_or_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_iron_or_dark.png
new file mode 100644
index 00000000..3ea10f60
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_iron_or_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_iron_or_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_iron_or_lit.png
new file mode 100644
index 00000000..452a33f4
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_iron_or_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_lit.png
new file mode 100644
index 00000000..0e752172
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_autarchic_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_dark.png
new file mode 100644
index 00000000..e3d1ae00
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_diamond_and_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_diamond_and_dark.png
new file mode 100644
index 00000000..78e412aa
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_diamond_and_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_diamond_and_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_diamond_and_lit.png
new file mode 100644
index 00000000..c3b5ef0a
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_diamond_and_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_diamond_or_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_diamond_or_dark.png
new file mode 100644
index 00000000..e0781853
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_diamond_or_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_diamond_or_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_diamond_or_lit.png
new file mode 100644
index 00000000..d04b1f52
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_diamond_or_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_gold_and_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_gold_and_dark.png
new file mode 100644
index 00000000..e5116bc9
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_gold_and_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_gold_and_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_gold_and_lit.png
new file mode 100644
index 00000000..9cdef37f
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_gold_and_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_gold_or_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_gold_or_dark.png
new file mode 100644
index 00000000..8a3b6fcb
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_gold_or_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_gold_or_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_gold_or_lit.png
new file mode 100644
index 00000000..408096a0
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_gold_or_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_iron_and_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_iron_and_dark.png
new file mode 100644
index 00000000..4d671e50
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_iron_and_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_iron_and_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_iron_and_lit.png
new file mode 100644
index 00000000..93530814
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_iron_and_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_iron_or_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_iron_or_dark.png
new file mode 100644
index 00000000..13d1b3e6
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_iron_or_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_iron_or_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_iron_or_lit.png
new file mode 100644
index 00000000..df3e7e97
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_iron_or_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/gate_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_lit.png
new file mode 100644
index 00000000..4d3b59c0
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/gate_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/laser_bottom.png b/buildcraft_resources/mods/buildcraft/textures/blocks/laser_bottom.png
new file mode 100644
index 00000000..4722beb1
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/laser_bottom.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/laser_side.png b/buildcraft_resources/mods/buildcraft/textures/blocks/laser_side.png
new file mode 100644
index 00000000..6c48787e
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/laser_side.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/laser_top.png b/buildcraft_resources/mods/buildcraft/textures/blocks/laser_top.png
new file mode 100644
index 00000000..a5d1ee0b
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/laser_top.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/library_side.png b/buildcraft_resources/mods/buildcraft/textures/blocks/library_side.png
new file mode 100644
index 00000000..53a88c75
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/library_side.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/library_topbottom.png b/buildcraft_resources/mods/buildcraft/textures/blocks/library_topbottom.png
new file mode 100644
index 00000000..0b061d1f
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/library_topbottom.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/miningwell_back.png b/buildcraft_resources/mods/buildcraft/textures/blocks/miningwell_back.png
new file mode 100644
index 00000000..37a5c0ee
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/miningwell_back.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/miningwell_front.png b/buildcraft_resources/mods/buildcraft/textures/blocks/miningwell_front.png
new file mode 100644
index 00000000..e81cb643
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/miningwell_front.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/miningwell_side.png b/buildcraft_resources/mods/buildcraft/textures/blocks/miningwell_side.png
new file mode 100644
index 00000000..d2db884a
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/miningwell_side.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/miningwell_top.png b/buildcraft_resources/mods/buildcraft/textures/blocks/miningwell_top.png
new file mode 100644
index 00000000..1df0cf36
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/miningwell_top.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/oil.png b/buildcraft_resources/mods/buildcraft/textures/blocks/oil.png
new file mode 100644
index 00000000..bc09b4f6
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/oil.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/oil.txt b/buildcraft_resources/mods/buildcraft/textures/blocks/oil.txt
new file mode 100644
index 00000000..d8fe765a
--- /dev/null
+++ b/buildcraft_resources/mods/buildcraft/textures/blocks/oil.txt
@@ -0,0 +1,32 @@
+0*2
+1*2
+2*2
+3*2
+4*2
+5*2
+6*2
+7*2
+8*2
+9*2
+10*2
+11*2
+12*2
+13*2
+14*2
+15*2
+16*2
+17*2
+18*2
+19*2
+20*2
+21*2
+22*2
+23*2
+24*2
+25*2
+26*2
+27*2
+28*2
+29*2
+30*2
+31*2
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/oil_flow.png b/buildcraft_resources/mods/buildcraft/textures/blocks/oil_flow.png
new file mode 100644
index 00000000..a5b8c520
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/oil_flow.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/oil_flow.txt b/buildcraft_resources/mods/buildcraft/textures/blocks/oil_flow.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeAllEmerald_solid.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeAllEmerald_solid.png
new file mode 100644
index 00000000..f5c4c694
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeAllEmerald_solid.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeAllIron_solid.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeAllIron_solid.png
new file mode 100644
index 00000000..019e9997
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeAllIron_solid.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeAllWood_solid.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeAllWood_solid.png
new file mode 100644
index 00000000..9af263b3
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeAllWood_solid.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsCobblestone.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsCobblestone.png
new file mode 100644
index 00000000..2333e35f
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsCobblestone.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_center.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_center.png
new file mode 100644
index 00000000..6d9eaf2d
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_center.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_down.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_down.png
new file mode 100644
index 00000000..00895f69
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_down.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_east.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_east.png
new file mode 100644
index 00000000..4215bd4f
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_east.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_north.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_north.png
new file mode 100644
index 00000000..6c2fcadd
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_north.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_south.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_south.png
new file mode 100644
index 00000000..f5438304
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_south.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_up.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_up.png
new file mode 100644
index 00000000..462fb1a5
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_up.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_west.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_west.png
new file mode 100644
index 00000000..22d584ce
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsDiamond_west.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsEmerald_standard.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsEmerald_standard.png
new file mode 100644
index 00000000..6a412f8e
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsEmerald_standard.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsGold.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsGold.png
new file mode 100644
index 00000000..ffd652c7
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsGold.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsIron_standard.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsIron_standard.png
new file mode 100644
index 00000000..455153b6
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsIron_standard.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsObsidian.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsObsidian.png
new file mode 100644
index 00000000..88a9b4e6
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsObsidian.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsSandstone.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsSandstone.png
new file mode 100644
index 00000000..63eaddcc
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsSandstone.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsStone.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsStone.png
new file mode 100644
index 00000000..31d2f4d9
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsStone.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsVoid.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsVoid.png
new file mode 100644
index 00000000..88cd89ab
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsVoid.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsWood_standard.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsWood_standard.png
new file mode 100644
index 00000000..99a6fda6
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeItemsWood_standard.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsCobblestone.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsCobblestone.png
new file mode 100644
index 00000000..0006ce86
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsCobblestone.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsEmerald_standard.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsEmerald_standard.png
new file mode 100644
index 00000000..49fdb49a
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsEmerald_standard.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsGold.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsGold.png
new file mode 100644
index 00000000..ad776e99
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsGold.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsIron_standard.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsIron_standard.png
new file mode 100644
index 00000000..5f1bc4a7
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsIron_standard.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsSandstone.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsSandstone.png
new file mode 100644
index 00000000..788e7fc6
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsSandstone.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsStone.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsStone.png
new file mode 100644
index 00000000..a1391f6a
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsStone.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsVoid.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsVoid.png
new file mode 100644
index 00000000..80dfa00e
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsVoid.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsWood_standard.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsWood_standard.png
new file mode 100644
index 00000000..70564fb2
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeLiquidsWood_standard.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipePowerGold.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipePowerGold.png
new file mode 100644
index 00000000..801a332b
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipePowerGold.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipePowerStone.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipePowerStone.png
new file mode 100644
index 00000000..8d40f447
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipePowerStone.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipePowerWood_standard.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipePowerWood_standard.png
new file mode 100644
index 00000000..83557735
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipePowerWood_standard.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeStripes.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeStripes.png
new file mode 100644
index 00000000..2af4334c
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeStripes.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pipeStructureCobblestone.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeStructureCobblestone.png
new file mode 100644
index 00000000..c6f04a89
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pipeStructureCobblestone.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pump_bottom.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pump_bottom.png
new file mode 100644
index 00000000..c56e943b
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pump_bottom.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pump_side.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pump_side.png
new file mode 100644
index 00000000..2167f78a
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pump_side.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pump_top.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pump_top.png
new file mode 100644
index 00000000..495426b6
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pump_top.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/pump_tube.png b/buildcraft_resources/mods/buildcraft/textures/blocks/pump_tube.png
new file mode 100644
index 00000000..da048389
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/pump_tube.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/quarry_front.png b/buildcraft_resources/mods/buildcraft/textures/blocks/quarry_front.png
new file mode 100644
index 00000000..cbbebb58
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/quarry_front.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/quarry_side.png b/buildcraft_resources/mods/buildcraft/textures/blocks/quarry_side.png
new file mode 100644
index 00000000..7fdee108
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/quarry_side.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/quarry_top.png b/buildcraft_resources/mods/buildcraft/textures/blocks/quarry_top.png
new file mode 100644
index 00000000..6cc0346c
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/quarry_top.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/tank_bottom_side.png b/buildcraft_resources/mods/buildcraft/textures/blocks/tank_bottom_side.png
new file mode 100644
index 00000000..07cea95a
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/tank_bottom_side.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/tank_stacked_side.png b/buildcraft_resources/mods/buildcraft/textures/blocks/tank_stacked_side.png
new file mode 100644
index 00000000..9393f2c2
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/tank_stacked_side.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/tank_top.png b/buildcraft_resources/mods/buildcraft/textures/blocks/tank_top.png
new file mode 100644
index 00000000..6cf5925a
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/tank_top.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/texture_blue_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_blue_dark.png
new file mode 100644
index 00000000..c3b97fe0
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_blue_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/texture_blue_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_blue_lit.png
new file mode 100644
index 00000000..5a898458
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_blue_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/texture_cyan.png b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_cyan.png
new file mode 100644
index 00000000..10f20c12
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_cyan.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/texture_green_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_green_dark.png
new file mode 100644
index 00000000..666b0cc9
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_green_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/texture_green_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_green_lit.png
new file mode 100644
index 00000000..a9ba3b94
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_green_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/texture_red_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_red_dark.png
new file mode 100644
index 00000000..d005abf6
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_red_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/texture_red_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_red_lit.png
new file mode 100644
index 00000000..247b67ff
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_red_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/texture_yellow_dark.png b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_yellow_dark.png
new file mode 100644
index 00000000..48a98f40
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_yellow_dark.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/blocks/texture_yellow_lit.png b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_yellow_lit.png
new file mode 100644
index 00000000..7e1814f3
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/blocks/texture_yellow_lit.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate.png b/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate.png
new file mode 100644
index 00000000..386551a7
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_diamond_and.png b/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_diamond_and.png
new file mode 100644
index 00000000..66b4c149
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_diamond_and.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_diamond_or.png b/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_diamond_or.png
new file mode 100644
index 00000000..35fbe2f3
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_diamond_or.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_gold_and.png b/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_gold_and.png
new file mode 100644
index 00000000..e1fdf8e3
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_gold_and.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_gold_or.png b/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_gold_or.png
new file mode 100644
index 00000000..5cf69082
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_gold_or.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_iron_and.png b/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_iron_and.png
new file mode 100644
index 00000000..43a87079
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_iron_and.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_iron_or.png b/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_iron_or.png
new file mode 100644
index 00000000..217eddb7
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/autarchic_gate_iron_or.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/block_0_0.png b/buildcraft_resources/mods/buildcraft/textures/items/block_0_0.png
new file mode 100644
index 00000000..69a55126
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/block_0_0.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/bluePipeWire.png b/buildcraft_resources/mods/buildcraft/textures/items/bluePipeWire.png
new file mode 100644
index 00000000..9e0d0845
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/bluePipeWire.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/blueprint_clean.png b/buildcraft_resources/mods/buildcraft/textures/items/blueprint_clean.png
new file mode 100644
index 00000000..9a0c7157
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/blueprint_clean.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/blueprint_used.png b/buildcraft_resources/mods/buildcraft/textures/items/blueprint_used.png
new file mode 100644
index 00000000..049ca7fc
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/blueprint_used.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/bucketFuel.png b/buildcraft_resources/mods/buildcraft/textures/items/bucketFuel.png
new file mode 100644
index 00000000..2edaa96f
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/bucketFuel.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/diamondGearItem.png b/buildcraft_resources/mods/buildcraft/textures/items/diamondGearItem.png
new file mode 100644
index 00000000..7d1dcbd8
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/diamondGearItem.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/fuel.png b/buildcraft_resources/mods/buildcraft/textures/items/fuel.png
new file mode 100644
index 00000000..3a170b37
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/fuel.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/fuel.txt b/buildcraft_resources/mods/buildcraft/textures/items/fuel.txt
new file mode 100644
index 00000000..d8fe765a
--- /dev/null
+++ b/buildcraft_resources/mods/buildcraft/textures/items/fuel.txt
@@ -0,0 +1,32 @@
+0*2
+1*2
+2*2
+3*2
+4*2
+5*2
+6*2
+7*2
+8*2
+9*2
+10*2
+11*2
+12*2
+13*2
+14*2
+15*2
+16*2
+17*2
+18*2
+19*2
+20*2
+21*2
+22*2
+23*2
+24*2
+25*2
+26*2
+27*2
+28*2
+29*2
+30*2
+31*2
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/gate.png b/buildcraft_resources/mods/buildcraft/textures/items/gate.png
new file mode 100644
index 00000000..74a27932
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/gate.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/gate_diamond_and.png b/buildcraft_resources/mods/buildcraft/textures/items/gate_diamond_and.png
new file mode 100644
index 00000000..06ce1cb6
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/gate_diamond_and.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/gate_diamond_or.png b/buildcraft_resources/mods/buildcraft/textures/items/gate_diamond_or.png
new file mode 100644
index 00000000..f1dfdd59
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/gate_diamond_or.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/gate_gold_and.png b/buildcraft_resources/mods/buildcraft/textures/items/gate_gold_and.png
new file mode 100644
index 00000000..201df0f4
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/gate_gold_and.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/gate_gold_or.png b/buildcraft_resources/mods/buildcraft/textures/items/gate_gold_or.png
new file mode 100644
index 00000000..a6b97659
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/gate_gold_or.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/gate_iron_and.png b/buildcraft_resources/mods/buildcraft/textures/items/gate_iron_and.png
new file mode 100644
index 00000000..55dc6b44
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/gate_iron_and.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/gate_iron_or.png b/buildcraft_resources/mods/buildcraft/textures/items/gate_iron_or.png
new file mode 100644
index 00000000..51601dc7
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/gate_iron_or.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/goldGearItem.png b/buildcraft_resources/mods/buildcraft/textures/items/goldGearItem.png
new file mode 100644
index 00000000..c06dc477
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/goldGearItem.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/greenPipeWire.png b/buildcraft_resources/mods/buildcraft/textures/items/greenPipeWire.png
new file mode 100644
index 00000000..c154708a
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/greenPipeWire.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/icons/energy.png b/buildcraft_resources/mods/buildcraft/textures/items/icons/energy.png
new file mode 100644
index 00000000..808090e5
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/icons/energy.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/icons/guiicons_0_1.png b/buildcraft_resources/mods/buildcraft/textures/items/icons/guiicons_0_1.png
new file mode 100644
index 00000000..ffa02e5e
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/icons/guiicons_0_1.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/icons/guiicons_0_2.png b/buildcraft_resources/mods/buildcraft/textures/items/icons/guiicons_0_2.png
new file mode 100644
index 00000000..d9616214
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/icons/guiicons_0_2.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/icons/guiicons_0_3.png b/buildcraft_resources/mods/buildcraft/textures/items/icons/guiicons_0_3.png
new file mode 100644
index 00000000..6803aec8
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/icons/guiicons_0_3.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/icons/guiicons_0_4.png b/buildcraft_resources/mods/buildcraft/textures/items/icons/guiicons_0_4.png
new file mode 100644
index 00000000..6d4a18b9
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/icons/guiicons_0_4.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/ironGearItem.png b/buildcraft_resources/mods/buildcraft/textures/items/ironGearItem.png
new file mode 100644
index 00000000..2429dbde
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/ironGearItem.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/oil_bucket.png b/buildcraft_resources/mods/buildcraft/textures/items/oil_bucket.png
new file mode 100644
index 00000000..97378976
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/oil_bucket.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/pipeWaterproof.png b/buildcraft_resources/mods/buildcraft/textures/items/pipeWaterproof.png
new file mode 100644
index 00000000..43ae39a6
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/pipeWaterproof.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/redPipeWire.png b/buildcraft_resources/mods/buildcraft/textures/items/redPipeWire.png
new file mode 100644
index 00000000..efef1d90
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/redPipeWire.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/redstone_diamond_chipset.png b/buildcraft_resources/mods/buildcraft/textures/items/redstone_diamond_chipset.png
new file mode 100644
index 00000000..1b85b70e
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/redstone_diamond_chipset.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/redstone_gold_chipset.png b/buildcraft_resources/mods/buildcraft/textures/items/redstone_gold_chipset.png
new file mode 100644
index 00000000..92490c48
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/redstone_gold_chipset.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/redstone_iron_chipset.png b/buildcraft_resources/mods/buildcraft/textures/items/redstone_iron_chipset.png
new file mode 100644
index 00000000..a8f31b54
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/redstone_iron_chipset.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/redstone_pulsating_chipset.png b/buildcraft_resources/mods/buildcraft/textures/items/redstone_pulsating_chipset.png
new file mode 100644
index 00000000..fe903b7c
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/redstone_pulsating_chipset.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/redstone_red_chipset.png b/buildcraft_resources/mods/buildcraft/textures/items/redstone_red_chipset.png
new file mode 100644
index 00000000..4a47b828
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/redstone_red_chipset.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/stoneGearItem.png b/buildcraft_resources/mods/buildcraft/textures/items/stoneGearItem.png
new file mode 100644
index 00000000..4454fbec
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/stoneGearItem.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/template_clean.png b/buildcraft_resources/mods/buildcraft/textures/items/template_clean.png
new file mode 100644
index 00000000..5aad5650
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/template_clean.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/template_used.png b/buildcraft_resources/mods/buildcraft/textures/items/template_used.png
new file mode 100644
index 00000000..9320aa9e
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/template_used.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/action_machinecontrol_loop.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/action_machinecontrol_loop.png
new file mode 100644
index 00000000..728760bb
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/action_machinecontrol_loop.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/action_machinecontrol_off.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/action_machinecontrol_off.png
new file mode 100644
index 00000000..3ee463b9
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/action_machinecontrol_off.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/action_machinecontrol_on.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/action_machinecontrol_on.png
new file mode 100644
index 00000000..a76ff88b
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/action_machinecontrol_on.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_3_4.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_3_4.png
new file mode 100644
index 00000000..55f45e0e
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_3_4.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_0.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_0.png
new file mode 100644
index 00000000..551b96db
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_0.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_1.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_1.png
new file mode 100644
index 00000000..49f9ebb4
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_1.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_2.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_2.png
new file mode 100644
index 00000000..b593fd93
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_2.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_3.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_3.png
new file mode 100644
index 00000000..d3cac204
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_3.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_4.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_4.png
new file mode 100644
index 00000000..9cf99cc4
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_4.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_5.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_5.png
new file mode 100644
index 00000000..5faea954
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_5_5.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_blue.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_blue.png
new file mode 100644
index 00000000..97fdff70
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_blue.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_green.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_green.png
new file mode 100644
index 00000000..b9ffd8cf
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_green.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_red.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_red.png
new file mode 100644
index 00000000..bc887162
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_red.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_yellow.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_yellow.png
new file mode 100644
index 00000000..be5701de
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_yellow.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_contains.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_contains.png
new file mode 100644
index 00000000..d76d5097
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_contains.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_empty.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_empty.png
new file mode 100644
index 00000000..ebcc50eb
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_empty.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_full.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_full.png
new file mode 100644
index 00000000..8ff3210c
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_full.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_space.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_space.png
new file mode 100644
index 00000000..09e774a7
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_space.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_contains.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_contains.png
new file mode 100644
index 00000000..c5c32c18
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_contains.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_empty.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_empty.png
new file mode 100644
index 00000000..d72090b6
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_empty.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_full.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_full.png
new file mode 100644
index 00000000..91fa97ce
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_full.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_space.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_space.png
new file mode 100644
index 00000000..0dbf4961
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_space.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_machine_active.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_machine_active.png
new file mode 100644
index 00000000..cb105774
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_machine_active.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_machine_inactive.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_machine_inactive.png
new file mode 100644
index 00000000..8ad47918
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_machine_inactive.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_containsenergy.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_containsenergy.png
new file mode 100644
index 00000000..99758ff3
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_containsenergy.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_containsitems.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_containsitems.png
new file mode 100644
index 00000000..696b3db8
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_containsitems.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_containsliquid.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_containsliquid.png
new file mode 100644
index 00000000..1fb023b8
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_containsliquid.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_empty.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_empty.png
new file mode 100644
index 00000000..91d03ca2
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_empty.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_blue_active.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_blue_active.png
new file mode 100644
index 00000000..af19b19d
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_blue_active.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_blue_inactive.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_blue_inactive.png
new file mode 100644
index 00000000..c526130a
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_blue_inactive.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_green_active.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_green_active.png
new file mode 100644
index 00000000..770fca6c
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_green_active.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_green_inactive.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_green_inactive.png
new file mode 100644
index 00000000..aa1a6bae
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_green_inactive.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_red_active.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_red_active.png
new file mode 100644
index 00000000..d8282638
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_red_active.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_red_inactive.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_red_inactive.png
new file mode 100644
index 00000000..a22e8383
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_red_inactive.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_yellow_active.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_yellow_active.png
new file mode 100644
index 00000000..c17e566c
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_yellow_active.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_yellow_inactive.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_yellow_inactive.png
new file mode 100644
index 00000000..ea4d30f0
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_yellow_inactive.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_redstoneinput_active.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_redstoneinput_active.png
new file mode 100644
index 00000000..3e45ecb4
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_redstoneinput_active.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_redstoneinput_inactive.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_redstoneinput_inactive.png
new file mode 100644
index 00000000..0cfff2da
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_redstoneinput_inactive.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/woodenGearItem.png b/buildcraft_resources/mods/buildcraft/textures/items/woodenGearItem.png
new file mode 100644
index 00000000..133351ce
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/woodenGearItem.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/wrenchItem.png b/buildcraft_resources/mods/buildcraft/textures/items/wrenchItem.png
new file mode 100644
index 00000000..edfd003e
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/wrenchItem.png differ
diff --git a/buildcraft_resources/mods/buildcraft/textures/items/yellowPipeWire.png b/buildcraft_resources/mods/buildcraft/textures/items/yellowPipeWire.png
new file mode 100644
index 00000000..af865730
Binary files /dev/null and b/buildcraft_resources/mods/buildcraft/textures/items/yellowPipeWire.png differ
diff --git a/common/buildcraft/BuildCraftBuilders.java b/common/buildcraft/BuildCraftBuilders.java
index 9d78d3d7..40582769 100644
--- a/common/buildcraft/BuildCraftBuilders.java
+++ b/common/buildcraft/BuildCraftBuilders.java
@@ -14,12 +14,16 @@ import java.util.LinkedList;
import java.util.TreeMap;
import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.Property;
+import net.minecraftforge.event.ForgeSubscribe;
import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.bptblocks.BptBlockBed;
import buildcraft.api.bptblocks.BptBlockCustomStack;
@@ -47,6 +51,7 @@ import buildcraft.builders.BlockFiller;
import buildcraft.builders.BlockMarker;
import buildcraft.builders.BlockPathMarker;
import buildcraft.builders.BptBlockFiller;
+import buildcraft.builders.BuilderProxyClient;
import buildcraft.builders.EventHandlerBuilders;
import buildcraft.builders.FillerFillAll;
import buildcraft.builders.FillerFillPyramid;
@@ -82,6 +87,8 @@ import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
@Mod(name = "BuildCraft Builders", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Builders", dependencies = DefaultProps.DEPENDENCY_CORE)
@NetworkMod(channels = { DefaultProps.NET_CHANNEL_NAME }, packetHandler = PacketHandlerBuilders.class, clientSideRequired = true, serverSideRequired = true)
@@ -133,7 +140,7 @@ public class BuildCraftBuilders {
new BptBlockDirt(Block.tilledField.blockID);
new BptBlockDelegate(Block.torchRedstoneIdle.blockID, Block.torchRedstoneActive.blockID);
- new BptBlockDelegate(Block.stoneOvenActive.blockID, Block.stoneOvenIdle.blockID);
+ new BptBlockDelegate(Block.furnaceBurning.blockID, Block.furnaceIdle.blockID);
new BptBlockDelegate(Block.pistonMoving.blockID, Block.pistonBase.blockID);
new BptBlockWallSide(Block.torchWood.blockID);
@@ -142,7 +149,7 @@ public class BuildCraftBuilders {
new BptBlockRotateMeta(Block.ladder.blockID, new int[] { 2, 5, 3, 4 }, true);
new BptBlockRotateMeta(Block.fenceGate.blockID, new int[] { 0, 1, 2, 3 }, true);
- new BptBlockRotateInventory(Block.stoneOvenIdle.blockID, new int[] { 2, 5, 3, 4 }, true);
+ new BptBlockRotateInventory(Block.furnaceIdle.blockID, new int[] { 2, 5, 3, 4 }, true);
new BptBlockRotateInventory(Block.chest.blockID, new int[] { 2, 5, 3, 4 }, true);
new BptBlockRotateInventory(Block.lockedChest.blockID, new int[] { 2, 5, 3, 4 }, true);
new BptBlockRotateInventory(Block.dispenser.blockID, new int[] { 2, 5, 3, 4 }, true);
@@ -184,11 +191,11 @@ public class BuildCraftBuilders {
new BptBlockPumpkin(Block.pumpkinLantern.blockID);
- new BptBlockStairs(Block.stairCompactCobblestone.blockID);
- new BptBlockStairs(Block.stairCompactPlanks.blockID);
+ new BptBlockStairs(Block.stairsCobblestone.blockID);
+ new BptBlockStairs(Block.stairsWoodOak.blockID);
new BptBlockStairs(Block.stairsNetherBrick.blockID);
new BptBlockStairs(Block.stairsBrick.blockID);
- new BptBlockStairs(Block.stairsStoneBrickSmooth.blockID);
+ new BptBlockStairs(Block.stairsStoneBrick.blockID);
new BptBlockDoor(Block.doorWood.blockID, new ItemStack(Item.doorWood));
new BptBlockDoor(Block.doorSteel.blockID, new ItemStack(Item.doorSteel));
@@ -230,36 +237,36 @@ public class BuildCraftBuilders {
fillerDestroyProp.comment = "If true, Filler will destroy blocks instead of breaking them.";
fillerDestroy = fillerDestroyProp.getBoolean(DefaultProps.FILLER_DESTROY);
- templateItem = new ItemBptTemplate(Integer.parseInt(templateItemId.value));
- templateItem.setItemName("templateItem");
+ templateItem = new ItemBptTemplate(templateItemId.getInt());
+ templateItem.setUnlocalizedName("templateItem");
LanguageRegistry.addName(templateItem, "Template");
- blueprintItem = new ItemBptBluePrint(Integer.parseInt(blueprintItemId.value));
- blueprintItem.setItemName("blueprintItem");
+ blueprintItem = new ItemBptBluePrint(blueprintItemId.getInt());
+ blueprintItem.setUnlocalizedName("blueprintItem");
LanguageRegistry.addName(blueprintItem, "Blueprint");
- markerBlock = new BlockMarker(Integer.parseInt(markerId.value));
- CoreProxy.proxy.registerBlock(markerBlock.setBlockName("markerBlock"));
+ markerBlock = new BlockMarker(markerId.getInt());
+ CoreProxy.proxy.registerBlock(markerBlock.setUnlocalizedName("markerBlock"));
CoreProxy.proxy.addName(markerBlock, "Land Mark");
- pathMarkerBlock = new BlockPathMarker(Integer.parseInt(pathMarkerId.value));
- CoreProxy.proxy.registerBlock(pathMarkerBlock.setBlockName("pathMarkerBlock"));
+ pathMarkerBlock = new BlockPathMarker(pathMarkerId.getInt());
+ CoreProxy.proxy.registerBlock(pathMarkerBlock.setUnlocalizedName("pathMarkerBlock"));
CoreProxy.proxy.addName(pathMarkerBlock, "Path Mark");
- fillerBlock = new BlockFiller(Integer.parseInt(fillerId.value));
- CoreProxy.proxy.registerBlock(fillerBlock.setBlockName("fillerBlock"));
+ fillerBlock = new BlockFiller(fillerId.getInt());
+ CoreProxy.proxy.registerBlock(fillerBlock.setUnlocalizedName("fillerBlock"));
CoreProxy.proxy.addName(fillerBlock, "Filler");
- builderBlock = new BlockBuilder(Integer.parseInt(builderId.value));
- CoreProxy.proxy.registerBlock(builderBlock.setBlockName("builderBlock"));
+ builderBlock = new BlockBuilder(builderId.getInt());
+ CoreProxy.proxy.registerBlock(builderBlock.setUnlocalizedName("builderBlock"));
CoreProxy.proxy.addName(builderBlock, "Builder");
- architectBlock = new BlockArchitect(Integer.parseInt(architectId.value));
- CoreProxy.proxy.registerBlock(architectBlock.setBlockName("architectBlock"));
+ architectBlock = new BlockArchitect(architectId.getInt());
+ CoreProxy.proxy.registerBlock(architectBlock.setUnlocalizedName("architectBlock"));
CoreProxy.proxy.addName(architectBlock, "Architect Table");
- libraryBlock = new BlockBlueprintLibrary(Integer.parseInt(libraryId.value));
- CoreProxy.proxy.registerBlock(libraryBlock.setBlockName("libraryBlock"));
+ libraryBlock = new BlockBlueprintLibrary(libraryId.getInt());
+ CoreProxy.proxy.registerBlock(libraryBlock.setUnlocalizedName("libraryBlock"));
CoreProxy.proxy.addName(libraryBlock, "Blueprint Library");
GameRegistry.registerTileEntity(TileMarker.class, "Marker");
@@ -269,7 +276,12 @@ public class BuildCraftBuilders {
GameRegistry.registerTileEntity(TilePathMarker.class, "net.minecraft.src.builders.TilePathMarker");
GameRegistry.registerTileEntity(TileBlueprintLibrary.class, "net.minecraft.src.builders.TileBlueprintLibrary");
- BuildCraftCore.mainConfiguration.save();
+ if (BuildCraftCore.mainConfiguration.hasChanged())
+ {
+ BuildCraftCore.mainConfiguration.save();
+ }
+
+ MinecraftForge.EVENT_BUS.register(this);
// public static final Block music;
// public static final Block cloth;
@@ -379,4 +391,20 @@ public class BuildCraftBuilders {
TilePathMarker.clearAvailableMarkersList();
}
+
+ @ForgeSubscribe
+ @SideOnly(Side.CLIENT)
+ public void loadTextures(TextureStitchEvent.Pre evt) {
+ if (evt.map == Minecraft.getMinecraft().renderEngine.textureMapBlocks) {
+ TextureMap terrainMap = evt.map;
+ BuilderProxyClient.fillerFillAllTexture = terrainMap.registerIcon("buildcraft:fillerPatterns/fillAll");
+ BuilderProxyClient.fillerClearTexture = terrainMap.registerIcon("buildcraft:fillerPatterns/clear");
+ BuilderProxyClient.fillerWallsTexture = terrainMap.registerIcon("buildcraft:fillerPatterns/walls");
+ BuilderProxyClient.fillerStairsTexture = terrainMap.registerIcon("buildcraft:fillerPatterns/stairs");
+ BuilderProxyClient.fillerFlattenTexture = terrainMap.registerIcon("buildcraft:fillerPatterns/flatten");
+ BuilderProxyClient.fillerPyramidTexture = terrainMap.registerIcon("buildcraft:fillerPatterns/pyramid");
+ }
+ }
+
+
}
diff --git a/common/buildcraft/BuildCraftCore.java b/common/buildcraft/BuildCraftCore.java
index c353c985..f5756270 100644
--- a/common/buildcraft/BuildCraftCore.java
+++ b/common/buildcraft/BuildCraftCore.java
@@ -14,22 +14,26 @@ import java.util.logging.Logger;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFluid;
-import net.minecraft.command.CommandHandler;
+import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityList;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
+import net.minecraft.util.Icon;
+import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.IPlantable;
+import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.Property;
+import net.minecraftforge.event.ForgeSubscribe;
import buildcraft.api.core.BuildCraftAPI;
-import buildcraft.api.gates.Action;
+import buildcraft.api.core.IIconProvider;
import buildcraft.api.gates.ActionManager;
-import buildcraft.api.gates.Trigger;
import buildcraft.api.power.PowerFramework;
import buildcraft.core.BlockIndex;
import buildcraft.core.BlockSpring;
import buildcraft.core.BuildCraftConfiguration;
import buildcraft.core.CommandBuildCraft;
+import buildcraft.core.CoreIconProvider;
import buildcraft.core.DefaultProps;
import buildcraft.core.EntityEnergyLaser;
import buildcraft.core.EntityPowerLaser;
@@ -48,6 +52,9 @@ import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.triggers.ActionMachineControl;
import buildcraft.core.triggers.ActionMachineControl.Mode;
import buildcraft.core.triggers.ActionRedstoneOutput;
+import buildcraft.core.triggers.ActionTriggerIconProvider;
+import buildcraft.core.triggers.BCAction;
+import buildcraft.core.triggers.BCTrigger;
import buildcraft.core.triggers.DefaultActionProvider;
import buildcraft.core.triggers.DefaultTriggerProvider;
import buildcraft.core.triggers.TriggerInventory;
@@ -72,7 +79,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
-import net.minecraftforge.common.MinecraftForge;
+import cpw.mods.fml.relauncher.SideOnly;
@Mod(name = "BuildCraft", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Core", dependencies = "required-after:Forge@[6.5.0.0,)")
@NetworkMod(channels = { DefaultProps.NET_CHANNEL_NAME }, packetHandler = PacketHandler.class, clientSideRequired = true, serverSideRequired = true)
@@ -104,7 +111,7 @@ public class BuildCraftCore {
public static boolean continuousCurrentModel;
public static Block springBlock;
-
+
public static Item woodenGearItem;
public static Item stoneGearItem;
public static Item ironGearItem;
@@ -112,33 +119,40 @@ public class BuildCraftCore {
public static Item diamondGearItem;
public static Item wrenchItem;
- public static int redLaserTexture;
- public static int blueLaserTexture;
- public static int stripesLaserTexture;
- public static int transparentTexture;
+ @SideOnly(Side.CLIENT)
+ public static Icon redLaserTexture;
+ @SideOnly(Side.CLIENT)
+ public static Icon blueLaserTexture;
+ @SideOnly(Side.CLIENT)
+ public static Icon stripesLaserTexture;
+ @SideOnly(Side.CLIENT)
+ public static Icon transparentTexture;
+
+ @SideOnly(Side.CLIENT)
+ public static IIconProvider iconProvider;
public static int blockByEntityModel;
public static int legacyPipeModel;
public static int markerModel;
public static int oilModel;
- public static Trigger triggerMachineActive = new TriggerMachine(DefaultProps.TRIGGER_MACHINE_ACTIVE, true);
- public static Trigger triggerMachineInactive = new TriggerMachine(DefaultProps.TRIGGER_MACHINE_INACTIVE, false);
- public static Trigger triggerEmptyInventory = new TriggerInventory(DefaultProps.TRIGGER_EMPTY_INVENTORY, TriggerInventory.State.Empty);
- public static Trigger triggerContainsInventory = new TriggerInventory(DefaultProps.TRIGGER_CONTAINS_INVENTORY, TriggerInventory.State.Contains);
- public static Trigger triggerSpaceInventory = new TriggerInventory(DefaultProps.TRIGGER_SPACE_INVENTORY, TriggerInventory.State.Space);
- public static Trigger triggerFullInventory = new TriggerInventory(DefaultProps.TRIGGER_FULL_INVENTORY, TriggerInventory.State.Full);
- public static Trigger triggerEmptyLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_EMPTY_LIQUID, TriggerLiquidContainer.State.Empty);
- public static Trigger triggerContainsLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_CONTAINS_LIQUID, TriggerLiquidContainer.State.Contains);
- public static Trigger triggerSpaceLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_SPACE_LIQUID, TriggerLiquidContainer.State.Space);
- public static Trigger triggerFullLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_FULL_LIQUID, TriggerLiquidContainer.State.Full);
- public static Trigger triggerRedstoneActive = new TriggerRedstoneInput(DefaultProps.TRIGGER_REDSTONE_ACTIVE, true);
- public static Trigger triggerRedstoneInactive = new TriggerRedstoneInput(DefaultProps.TRIGGER_REDSTONE_INACTIVE, false);
+ public static BCTrigger triggerMachineActive = new TriggerMachine(DefaultProps.TRIGGER_MACHINE_ACTIVE, true);
+ public static BCTrigger triggerMachineInactive = new TriggerMachine(DefaultProps.TRIGGER_MACHINE_INACTIVE, false);
+ public static BCTrigger triggerEmptyInventory = new TriggerInventory(DefaultProps.TRIGGER_EMPTY_INVENTORY, TriggerInventory.State.Empty);
+ public static BCTrigger triggerContainsInventory = new TriggerInventory(DefaultProps.TRIGGER_CONTAINS_INVENTORY, TriggerInventory.State.Contains);
+ public static BCTrigger triggerSpaceInventory = new TriggerInventory(DefaultProps.TRIGGER_SPACE_INVENTORY, TriggerInventory.State.Space);
+ public static BCTrigger triggerFullInventory = new TriggerInventory(DefaultProps.TRIGGER_FULL_INVENTORY, TriggerInventory.State.Full);
+ public static BCTrigger triggerEmptyLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_EMPTY_LIQUID, TriggerLiquidContainer.State.Empty);
+ public static BCTrigger triggerContainsLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_CONTAINS_LIQUID, TriggerLiquidContainer.State.Contains);
+ public static BCTrigger triggerSpaceLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_SPACE_LIQUID, TriggerLiquidContainer.State.Space);
+ public static BCTrigger triggerFullLiquid = new TriggerLiquidContainer(DefaultProps.TRIGGER_FULL_LIQUID, TriggerLiquidContainer.State.Full);
+ public static BCTrigger triggerRedstoneActive = new TriggerRedstoneInput(DefaultProps.TRIGGER_REDSTONE_ACTIVE, true);
+ public static BCTrigger triggerRedstoneInactive = new TriggerRedstoneInput(DefaultProps.TRIGGER_REDSTONE_INACTIVE, false);
- public static Action actionRedstone = new ActionRedstoneOutput(DefaultProps.ACTION_REDSTONE);
- public static Action actionOn = new ActionMachineControl(DefaultProps.ACTION_ON, Mode.On);
- public static Action actionOff = new ActionMachineControl(DefaultProps.ACTION_OFF, Mode.Off);
- public static Action actionLoop = new ActionMachineControl(DefaultProps.ACTION_LOOP, Mode.Loop);
+ public static BCAction actionRedstone = new ActionRedstoneOutput(DefaultProps.ACTION_REDSTONE);
+ public static BCAction actionOn = new ActionMachineControl(DefaultProps.ACTION_ON, Mode.On);
+ public static BCAction actionOff = new ActionMachineControl(DefaultProps.ACTION_OFF, Mode.Off);
+ public static BCAction actionLoop = new ActionMachineControl(DefaultProps.ACTION_LOOP, Mode.Loop);
public static boolean loadDefaultRecipes = true;
public static boolean forcePneumaticPower = true;
@@ -148,6 +162,8 @@ public class BuildCraftCore {
public static Logger bcLog = Logger.getLogger("Buildcraft");
+ public IIconProvider actionTriggerIconProvider = new ActionTriggerIconProvider();
+
@Instance("BuildCraft|Core")
public static BuildCraftCore instance;
@@ -165,11 +181,6 @@ public class BuildCraftCore {
try {
mainConfiguration.load();
- redLaserTexture = 0 * 16 + 2;
- blueLaserTexture = 0 * 16 + 1;
- stripesLaserTexture = 0 * 16 + 3;
- transparentTexture = 0 * 16 + 0;
-
Property continuousCurrent = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "current.continuous",
DefaultProps.CURRENT_CONTINUOUS);
continuousCurrent.comment = "set to true for allowing machines to be driven by continuous current";
@@ -202,7 +213,7 @@ public class BuildCraftCore {
String powerFrameworkClassName = "buildcraft.energy.PneumaticPowerFramework";
if (!forcePneumaticPower) {
- powerFrameworkClassName = powerFrameworkClass.value;
+ powerFrameworkClassName = powerFrameworkClass.getString();
}
try {
PowerFramework.currentFramework = (PowerFramework) Class.forName(powerFrameworkClassName).getConstructor().newInstance();
@@ -213,11 +224,11 @@ public class BuildCraftCore {
Property wrenchId = BuildCraftCore.mainConfiguration.getItem("wrench.id", DefaultProps.WRENCH_ID);
- wrenchItem = (new ItemWrench(wrenchId.getInt(DefaultProps.WRENCH_ID))).setIconIndex(0 * 16 + 2).setItemName("wrenchItem");
+ wrenchItem = (new ItemWrench(wrenchId.getInt(DefaultProps.WRENCH_ID))).setUnlocalizedName("wrenchItem");
LanguageRegistry.addName(wrenchItem, "Wrench");
Property springId = BuildCraftCore.mainConfiguration.getBlock("springBlock.id", DefaultProps.SPRING_ID);
-
+
Property woodenGearId = BuildCraftCore.mainConfiguration.getItem("woodenGearItem.id", DefaultProps.WOODEN_GEAR_ID);
Property stoneGearId = BuildCraftCore.mainConfiguration.getItem("stoneGearItem.id", DefaultProps.STONE_GEAR_ID);
Property ironGearId = BuildCraftCore.mainConfiguration.getItem("ironGearItem.id", DefaultProps.IRON_GEAR_ID);
@@ -229,26 +240,31 @@ public class BuildCraftCore {
BuildCraftCore.modifyWorld = modifyWorld.getBoolean(true);
if(BuildCraftCore.modifyWorld) {
- springBlock = new BlockSpring(Integer.parseInt(springId.value)).setBlockName("eternalSpring");
+ springBlock = new BlockSpring(springId.getInt()).setUnlocalizedName("eternalSpring");
GameRegistry.registerBlock(springBlock, "eternalSpring");
}
-
- woodenGearItem = (new ItemBuildCraft(Integer.parseInt(woodenGearId.value))).setIconIndex(1 * 16 + 0).setItemName("woodenGearItem");
+
+ woodenGearItem = (new ItemBuildCraft(woodenGearId.getInt())).setUnlocalizedName("woodenGearItem");
LanguageRegistry.addName(woodenGearItem, "Wooden Gear");
- stoneGearItem = (new ItemBuildCraft(Integer.parseInt(stoneGearId.value))).setIconIndex(1 * 16 + 1).setItemName("stoneGearItem");
+ stoneGearItem = (new ItemBuildCraft(stoneGearId.getInt())).setUnlocalizedName("stoneGearItem");
LanguageRegistry.addName(stoneGearItem, "Stone Gear");
- ironGearItem = (new ItemBuildCraft(Integer.parseInt(ironGearId.value))).setIconIndex(1 * 16 + 2).setItemName("ironGearItem");
+ ironGearItem = (new ItemBuildCraft(ironGearId.getInt())).setUnlocalizedName("ironGearItem");
LanguageRegistry.addName(ironGearItem, "Iron Gear");
- goldGearItem = (new ItemBuildCraft(Integer.parseInt(goldenGearId.value))).setIconIndex(1 * 16 + 3).setItemName("goldGearItem");
+ goldGearItem = (new ItemBuildCraft(goldenGearId.getInt())).setUnlocalizedName("goldGearItem");
LanguageRegistry.addName(goldGearItem, "Gold Gear");
- diamondGearItem = (new ItemBuildCraft(Integer.parseInt(diamondGearId.value))).setIconIndex(1 * 16 + 4).setItemName("diamondGearItem");
+ diamondGearItem = (new ItemBuildCraft(diamondGearId.getInt())).setUnlocalizedName("diamondGearItem");
LanguageRegistry.addName(diamondGearItem, "Diamond Gear");
+
+ MinecraftForge.EVENT_BUS.register(this);
+
} finally {
- mainConfiguration.save();
+ if (mainConfiguration.hasChanged()) {
+ mainConfiguration.save();
+ }
}
}
@@ -301,6 +317,22 @@ public class BuildCraftCore {
event.registerServerCommand(new CommandBuildCraft());
}
+ @ForgeSubscribe
+ @SideOnly(Side.CLIENT)
+ public void textureHook(TextureStitchEvent.Pre event){
+ if (event.map == Minecraft.getMinecraft().renderEngine.textureMapItems) {
+ iconProvider = new CoreIconProvider();
+ iconProvider.registerIcons(event.map);
+ actionTriggerIconProvider.registerIcons(event.map);
+ } else if (event.map == Minecraft.getMinecraft().renderEngine.textureMapBlocks) {
+ BuildCraftCore.redLaserTexture = event.map.registerIcon("buildcraft:blockRedLaser");
+ BuildCraftCore.blueLaserTexture = event.map.registerIcon("buildcraft:blockBlueLaser");
+ BuildCraftCore.stripesLaserTexture = event.map.registerIcon("buildcraft:blockStripesLaser");
+ BuildCraftCore.transparentTexture = event.map.registerIcon("buildcraft:blockTransparentLaser");
+ }
+
+ }
+
public void loadRecipes() {
GameRegistry.addRecipe(new ItemStack(wrenchItem), "I I", " G ", " I ", Character.valueOf('I'), Item.ingotIron, Character.valueOf('G'), stoneGearItem);
GameRegistry.addRecipe(new ItemStack(woodenGearItem), " S ", "S S", " S ", Character.valueOf('S'), Item.stick);
diff --git a/common/buildcraft/BuildCraftEnergy.java b/common/buildcraft/BuildCraftEnergy.java
index 3e318a14..559a55be 100644
--- a/common/buildcraft/BuildCraftEnergy.java
+++ b/common/buildcraft/BuildCraftEnergy.java
@@ -12,19 +12,20 @@ import java.util.TreeMap;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
-import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.client.Minecraft;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
+import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.Property;
+import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.liquids.LiquidContainerData;
import net.minecraftforge.liquids.LiquidContainerRegistry;
import net.minecraftforge.liquids.LiquidDictionary;
import net.minecraftforge.liquids.LiquidStack;
import buildcraft.api.fuels.IronEngineCoolant;
import buildcraft.api.fuels.IronEngineFuel;
-import buildcraft.api.gates.Trigger;
import buildcraft.api.recipes.RefineryRecipe;
import buildcraft.core.BlockIndex;
import buildcraft.core.DefaultProps;
@@ -32,6 +33,7 @@ import buildcraft.core.ItemBuildCraft;
import buildcraft.core.Version;
import buildcraft.core.network.PacketHandler;
import buildcraft.core.proxy.CoreProxy;
+import buildcraft.core.triggers.BCTrigger;
import buildcraft.energy.BlockEngine;
import buildcraft.energy.BlockOilFlowing;
import buildcraft.energy.BlockOilStill;
@@ -54,6 +56,8 @@ import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
@Mod(name = "BuildCraft Energy", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Energy", dependencies = DefaultProps.DEPENDENCY_CORE)
@NetworkMod(channels = { DefaultProps.NET_CHANNEL_NAME }, packetHandler = PacketHandler.class, clientSideRequired = true, serverSideRequired = true)
@@ -76,10 +80,10 @@ public class BuildCraftEnergy {
public static TreeMap saturationStored = new TreeMap();
- public static Trigger triggerBlueEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_BLUE_ENGINE_HEAT, EnergyStage.Blue);
- public static Trigger triggerGreenEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_GREEN_ENGINE_HEAT, EnergyStage.Green);
- public static Trigger triggerYellowEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_YELLOW_ENGINE_HEAT, EnergyStage.Yellow);
- public static Trigger triggerRedEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_RED_ENGINE_HEAT, EnergyStage.Red);
+ public static BCTrigger triggerBlueEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_BLUE_ENGINE_HEAT, EnergyStage.Blue);
+ public static BCTrigger triggerGreenEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_GREEN_ENGINE_HEAT, EnergyStage.Green);
+ public static BCTrigger triggerYellowEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_YELLOW_ENGINE_HEAT, EnergyStage.Yellow);
+ public static BCTrigger triggerRedEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_RED_ENGINE_HEAT, EnergyStage.Red);
@Instance("BuildCraft|Energy")
public static BuildCraftEnergy instance;
@@ -99,7 +103,6 @@ public class BuildCraftEnergy {
}
EnergyProxy.proxy.registerBlockRenderers();
EnergyProxy.proxy.registerTileEntities();
- EnergyProxy.proxy.registerTextureFX();
}
@PreInit
@@ -120,28 +123,28 @@ public class BuildCraftEnergy {
LanguageRegistry.addName(new ItemStack(engineBlock, 1, 1), "Steam Engine");
LanguageRegistry.addName(new ItemStack(engineBlock, 1, 2), "Combustion Engine");
- oilStill = (new BlockOilStill(oilStillId.getInt(DefaultProps.OIL_STILL_ID), Material.water)).setBlockName("oil");
- CoreProxy.proxy.addName(oilStill.setBlockName("oilStill"), "Oil");
+ oilStill = (new BlockOilStill(oilStillId.getInt(DefaultProps.OIL_STILL_ID), Material.water)).setUnlocalizedName("oil");
+ CoreProxy.proxy.addName(oilStill.setUnlocalizedName("oilStill"), "Oil");
CoreProxy.proxy.registerBlock(oilStill);
- oilMoving = (new BlockOilFlowing(oilMovingId.getInt(DefaultProps.OIL_MOVING_ID), Material.water)).setBlockName("oil");
- CoreProxy.proxy.addName(oilMoving.setBlockName("oilMoving"), "Oil");
+ oilMoving = (new BlockOilFlowing(oilMovingId.getInt(DefaultProps.OIL_MOVING_ID), Material.water)).setUnlocalizedName("oil");
+ CoreProxy.proxy.addName(oilMoving.setUnlocalizedName("oilMoving"), "Oil");
CoreProxy.proxy.registerBlock(oilMoving);
// Oil and fuel
if (oilMoving.blockID + 1 != oilStill.blockID)
throw new RuntimeException("Oil Still id must be Oil Moving id + 1");
- fuel = new ItemBuildCraft(itemFuelId.getInt(DefaultProps.FUEL_ID)).setItemName("fuel");
+ fuel = new ItemBuildCraft(itemFuelId.getInt(DefaultProps.FUEL_ID)).setUnlocalizedName("fuel");
LanguageRegistry.addName(fuel, "Fuel");
MinecraftForge.EVENT_BUS.register(new OilBucketHandler());
- bucketOil = (new ItemBucketOil(bucketOilId.getInt(DefaultProps.BUCKET_OIL_ID))).setItemName("bucketOil").setContainerItem(Item.bucketEmpty);
+ bucketOil = (new ItemBucketOil(bucketOilId.getInt(DefaultProps.BUCKET_OIL_ID))).setUnlocalizedName("bucketOil").setContainerItem(Item.bucketEmpty);
LanguageRegistry.addName(bucketOil, "Oil Bucket");
- bucketFuel = new ItemBuildCraft(Integer.parseInt(bucketFuelId.value)).setItemName("bucketFuel").setContainerItem(Item.bucketEmpty);
- bucketFuel.setIconIndex(0 * 16 + 3).setMaxStackSize(1);
+ bucketFuel = new ItemBuildCraft(bucketFuelId.getInt()).setUnlocalizedName("bucketFuel").setContainerItem(Item.bucketEmpty);
+ bucketFuel.setMaxStackSize(1);
LanguageRegistry.addName(bucketFuel, "Fuel Bucket");
oilLiquid = LiquidDictionary.getOrCreateLiquid("Oil", new LiquidStack(oilStill, 1));
@@ -161,6 +164,18 @@ public class BuildCraftEnergy {
bucketOil), new ItemStack(Item.bucketEmpty)));
LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getLiquid("Fuel", LiquidContainerRegistry.BUCKET_VOLUME),
new ItemStack(bucketFuel), new ItemStack(Item.bucketEmpty)));
+
+ MinecraftForge.EVENT_BUS.register(this);
+ }
+
+ @ForgeSubscribe
+ @SideOnly(Side.CLIENT)
+ public void textureHook(TextureStitchEvent.Post event) {
+ if (event.map == Minecraft.getMinecraft().renderEngine.textureMapItems) {
+ LiquidDictionary.getCanonicalLiquid("Fuel").setRenderingIcon(fuel.getIconFromDamage(0)).setTextureSheet("/gui/items.png");
+ } else {
+ LiquidDictionary.getCanonicalLiquid("Oil").setRenderingIcon(oilStill.getBlockTextureFromSide(1)).setTextureSheet("/terrain.png");
+ }
}
public static void loadRecipes() {
@@ -199,7 +214,7 @@ public class BuildCraftEnergy {
// int z = toPollute.k;
//
// if (world.getBlockId(x, y, z) == 0) {
- // world.setBlockAndMetadataWithNotify(x, y, z,
+ // world.setBlock(x, y, z,
// BuildCraftEnergy.pollution.blockID,
// saturation * 16 / 100);
//
@@ -215,7 +230,7 @@ public class BuildCraftEnergy {
// if (remainingSaturation > 0) {
// if (world.getBlockId(i, j + 1, k) == 0) {
// if (j + 1 < 128) {
- // world.setBlockAndMetadataWithNotify(i, j + 1, k,
+ // world.setBlock(i, j + 1, k,
// BuildCraftEnergy.pollution.blockID,
// saturation * 16 / 100);
// saturationStored.put(new BlockIndex(i, j + 1, k),
diff --git a/common/buildcraft/BuildCraftFactory.java b/common/buildcraft/BuildCraftFactory.java
index ad919001..6dff79bf 100644
--- a/common/buildcraft/BuildCraftFactory.java
+++ b/common/buildcraft/BuildCraftFactory.java
@@ -11,13 +11,18 @@ package buildcraft;
import java.util.List;
import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
+import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.ForgeChunkManager;
import net.minecraftforge.common.ForgeChunkManager.Ticket;
+import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.Property;
+import net.minecraftforge.event.ForgeSubscribe;
import buildcraft.core.DefaultProps;
import buildcraft.core.Version;
import buildcraft.core.proxy.CoreProxy;
@@ -35,6 +40,7 @@ import buildcraft.factory.BptBlockFrame;
import buildcraft.factory.BptBlockRefinery;
import buildcraft.factory.BptBlockTank;
import buildcraft.factory.FactoryProxy;
+import buildcraft.factory.FactoryProxyClient;
import buildcraft.factory.GuiHandler;
import buildcraft.factory.TileAutoWorkbench;
import buildcraft.factory.TileHopper;
@@ -57,6 +63,8 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
@Mod(name = "BuildCraft Factory", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Factory", dependencies = DefaultProps.DEPENDENCY_CORE)
@NetworkMod(channels = { DefaultProps.NET_CHANNEL_NAME }, packetHandler = PacketHandlerFactory.class, clientSideRequired = true, serverSideRequired = true)
@@ -73,8 +81,6 @@ public class BuildCraftFactory {
public static BlockHopper hopperBlock;
public static boolean hopperDisabled;
- public static int drillTexture;
-
public static boolean allowMining = true;
@Instance("BuildCraft|Factory")
@@ -135,8 +141,6 @@ public class BuildCraftFactory {
}
FactoryProxy.proxy.initializeTileEntities();
- FactoryProxy.proxy.initializeEntityRenders();
- drillTexture = 2 * 16 + 1;
new BptBlockAutoWorkbench(autoWorkbenchBlock.blockID);
new BptBlockFrame(frameBlock.blockID);
@@ -150,9 +154,9 @@ public class BuildCraftFactory {
@PreInit
public void initialize(FMLPreInitializationEvent evt) {
- allowMining = Boolean.parseBoolean(BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "mining.enabled", true).value);
+ allowMining = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "mining.enabled", true).getBoolean(true);
- Property minigWellId = BuildCraftCore.mainConfiguration.getBlock("miningWell.id", DefaultProps.MINING_WELL_ID);
+ Property miningWellId = BuildCraftCore.mainConfiguration.getBlock("miningWell.id", DefaultProps.MINING_WELL_ID);
Property plainPipeId = BuildCraftCore.mainConfiguration.getBlock("drill.id", DefaultProps.DRILL_ID);
Property autoWorkbenchId = BuildCraftCore.mainConfiguration.getBlock("autoWorkbench.id", DefaultProps.AUTO_WORKBENCH_ID);
Property frameId = BuildCraftCore.mainConfiguration.getBlock("frame.id", DefaultProps.FRAME_ID);
@@ -163,48 +167,57 @@ public class BuildCraftFactory {
Property hopperId = BuildCraftCore.mainConfiguration.getBlock("hopper.id", DefaultProps.HOPPER_ID);
Property hopperDisable = BuildCraftCore.mainConfiguration.get("Block Savers", "hopper.disabled", false);
- BuildCraftCore.mainConfiguration.save();
+ if (BuildCraftCore.mainConfiguration.hasChanged())
+ {
+ BuildCraftCore.mainConfiguration.save();
+ }
- miningWellBlock = new BlockMiningWell(Integer.parseInt(minigWellId.value));
- CoreProxy.proxy.registerBlock(miningWellBlock.setBlockName("miningWellBlock"));
+ miningWellBlock = new BlockMiningWell(miningWellId.getInt());
+ CoreProxy.proxy.registerBlock(miningWellBlock.setUnlocalizedName("miningWellBlock"));
CoreProxy.proxy.addName(miningWellBlock, "Mining Well");
- plainPipeBlock = new BlockPlainPipe(Integer.parseInt(plainPipeId.value));
- CoreProxy.proxy.registerBlock(plainPipeBlock.setBlockName("plainPipeBlock"));
+ plainPipeBlock = new BlockPlainPipe(plainPipeId.getInt());
+ CoreProxy.proxy.registerBlock(plainPipeBlock.setUnlocalizedName("plainPipeBlock"));
CoreProxy.proxy.addName(plainPipeBlock, "Mining Pipe");
- autoWorkbenchBlock = new BlockAutoWorkbench(Integer.parseInt(autoWorkbenchId.value));
- CoreProxy.proxy.registerBlock(autoWorkbenchBlock.setBlockName("autoWorkbenchBlock"));
+ autoWorkbenchBlock = new BlockAutoWorkbench(autoWorkbenchId.getInt());
+ CoreProxy.proxy.registerBlock(autoWorkbenchBlock.setUnlocalizedName("autoWorkbenchBlock"));
CoreProxy.proxy.addName(autoWorkbenchBlock, "Automatic Crafting Table");
- frameBlock = new BlockFrame(Integer.parseInt(frameId.value));
- CoreProxy.proxy.registerBlock(frameBlock.setBlockName("frameBlock"));
+ frameBlock = new BlockFrame(frameId.getInt());
+ CoreProxy.proxy.registerBlock(frameBlock.setUnlocalizedName("frameBlock"));
CoreProxy.proxy.addName(frameBlock, "Frame");
- quarryBlock = new BlockQuarry(Integer.parseInt(quarryId.value));
- CoreProxy.proxy.registerBlock(quarryBlock.setBlockName("machineBlock"));
+ quarryBlock = new BlockQuarry(quarryId.getInt());
+ CoreProxy.proxy.registerBlock(quarryBlock.setUnlocalizedName("machineBlock"));
CoreProxy.proxy.addName(quarryBlock, "Quarry");
- tankBlock = new BlockTank(Integer.parseInt(tankId.value));
- CoreProxy.proxy.registerBlock(tankBlock.setBlockName("tankBlock"));
+ tankBlock = new BlockTank(tankId.getInt());
+ CoreProxy.proxy.registerBlock(tankBlock.setUnlocalizedName("tankBlock"));
CoreProxy.proxy.addName(tankBlock, "Tank");
- pumpBlock = new BlockPump(Integer.parseInt(pumpId.value));
- CoreProxy.proxy.registerBlock(pumpBlock.setBlockName("pumpBlock"));
+ pumpBlock = new BlockPump(pumpId.getInt());
+ CoreProxy.proxy.registerBlock(pumpBlock.setUnlocalizedName("pumpBlock"));
CoreProxy.proxy.addName(pumpBlock, "Pump");
- refineryBlock = new BlockRefinery(Integer.parseInt(refineryId.value));
- CoreProxy.proxy.registerBlock(refineryBlock.setBlockName("refineryBlock"));
+ refineryBlock = new BlockRefinery(refineryId.getInt());
+ CoreProxy.proxy.registerBlock(refineryBlock.setUnlocalizedName("refineryBlock"));
CoreProxy.proxy.addName(refineryBlock, "Refinery");
- hopperDisabled = Boolean.parseBoolean(hopperDisable.value);
+ hopperDisabled = hopperDisable.getBoolean(false);
if (!hopperDisabled) {
- hopperBlock = new BlockHopper(Integer.parseInt(hopperId.value));
- CoreProxy.proxy.registerBlock(hopperBlock.setBlockName("blockHopper"));
+ hopperBlock = new BlockHopper(hopperId.getInt());
+ CoreProxy.proxy.registerBlock(hopperBlock.setUnlocalizedName("blockHopper"));
CoreProxy.proxy.addName(hopperBlock, "Hopper");
}
- BuildCraftCore.mainConfiguration.save();
+ FactoryProxy.proxy.initializeEntityRenders();
+ if (BuildCraftCore.mainConfiguration.hasChanged())
+ {
+ BuildCraftCore.mainConfiguration.save();
+ }
+
+ MinecraftForge.EVENT_BUS.register(this);
}
public static void loadRecipes() {
@@ -218,16 +231,16 @@ public class BuildCraftFactory {
new Object[] { "ipi", "gig", "dDd", Character.valueOf('i'), BuildCraftCore.ironGearItem, Character.valueOf('p'), Item.redstone,
Character.valueOf('g'), BuildCraftCore.goldGearItem, Character.valueOf('d'), BuildCraftCore.diamondGearItem,
Character.valueOf('D'), Item.pickaxeDiamond, });
-
+
CoreProxy.proxy.addCraftingRecipe(new ItemStack(pumpBlock), new Object[] { "T ", "W ", Character.valueOf('T'), tankBlock, Character.valueOf('W'),
- miningWellBlock, });
+ miningWellBlock, });
}
else {
- CoreProxy.proxy.addCraftingRecipe(new ItemStack(pumpBlock), new Object[] { "iri", "iTi", "gpg",
+ CoreProxy.proxy.addCraftingRecipe(new ItemStack(pumpBlock), new Object[] { "iri", "iTi", "gpg",
Character.valueOf('r'), Item.redstone,
- Character.valueOf('i'), Item.ingotIron,
- Character.valueOf('T'), tankBlock,
- Character.valueOf('g'), BuildCraftCore.ironGearItem,
+ Character.valueOf('i'), Item.ingotIron,
+ Character.valueOf('T'), tankBlock,
+ Character.valueOf('g'), BuildCraftCore.ironGearItem,
Character.valueOf('p'), BuildCraftTransport.pipeLiquidsGold });
}
@@ -248,4 +261,16 @@ public class BuildCraftFactory {
}
}
+
+
+ @ForgeSubscribe
+ @SideOnly(Side.CLIENT)
+ public void loadTextures(TextureStitchEvent.Pre evt) {
+ if (evt.map == Minecraft.getMinecraft().renderEngine.textureMapBlocks) {
+ TextureMap terrainTextures = evt.map;
+ FactoryProxyClient.pumpTexture = terrainTextures.registerIcon("buildcraft:pump_tube");
+ FactoryProxyClient.drillTexture = terrainTextures.registerIcon("buildcraft:blockDrillTexture");
+ FactoryProxyClient.drillHeadTexture = terrainTextures.registerIcon("buildcraft:blockDrillHeadTexture");
+ }
+ }
}
diff --git a/common/buildcraft/BuildCraftSilicon.java b/common/buildcraft/BuildCraftSilicon.java
index b2d29fbf..cf90f4b1 100644
--- a/common/buildcraft/BuildCraftSilicon.java
+++ b/common/buildcraft/BuildCraftSilicon.java
@@ -76,18 +76,18 @@ public class BuildCraftSilicon {
BuildCraftCore.mainConfiguration.save();
- laserBlock = new BlockLaser(Integer.parseInt(laserId.value));
- CoreProxy.proxy.addName(laserBlock.setBlockName("laserBlock"), "Laser");
+ laserBlock = new BlockLaser(laserId.getInt());
+ CoreProxy.proxy.addName(laserBlock.setUnlocalizedName("laserBlock"), "Laser");
CoreProxy.proxy.registerBlock(laserBlock);
- assemblyTableBlock = new BlockAssemblyTable(Integer.parseInt(assemblyTableId.value));
+ assemblyTableBlock = new BlockAssemblyTable(assemblyTableId.getInt());
GameRegistry.registerBlock(assemblyTableBlock, ItemAssemblyTable.class);
LanguageRegistry.addName(new ItemStack(assemblyTableBlock, 0, 0), "Assembly Table");
LanguageRegistry.addName(new ItemStack(assemblyTableBlock, 0, 1), "Advanced Crafting Table");
- redstoneChipset = new ItemRedstoneChipset(Integer.parseInt(redstoneChipsetId.value));
- redstoneChipset.setItemName("redstoneChipset");
+ redstoneChipset = new ItemRedstoneChipset(redstoneChipsetId.getInt());
+ redstoneChipset.setUnlocalizedName("redstoneChipset");
}
diff --git a/common/buildcraft/BuildCraftTransport.java b/common/buildcraft/BuildCraftTransport.java
index b70015c0..3849c364 100644
--- a/common/buildcraft/BuildCraftTransport.java
+++ b/common/buildcraft/BuildCraftTransport.java
@@ -13,31 +13,35 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import net.minecraft.block.Block;
-import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.Property;
-import buildcraft.api.gates.Action;
+import buildcraft.api.core.IIconProvider;
import buildcraft.api.gates.ActionManager;
-import buildcraft.api.gates.Trigger;
import buildcraft.api.recipes.AssemblyRecipe;
import buildcraft.api.transport.IExtractionHandler;
import buildcraft.api.transport.IPipe;
import buildcraft.api.transport.PipeManager;
+import buildcraft.core.CreativeTabBuildCraft;
import buildcraft.core.DefaultProps;
import buildcraft.core.ItemBuildCraft;
import buildcraft.core.Version;
import buildcraft.core.proxy.CoreProxy;
+import buildcraft.core.triggers.BCAction;
+import buildcraft.core.triggers.BCTrigger;
import buildcraft.transport.BlockGenericPipe;
+import buildcraft.transport.GateIconProvider;
import buildcraft.transport.GuiHandler;
import buildcraft.transport.ItemFacade;
import buildcraft.transport.ItemGate;
import buildcraft.transport.ItemPipe;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTriggerProvider;
import buildcraft.transport.TransportProxy;
+import buildcraft.transport.WireIconProvider;
import buildcraft.transport.blueprints.BptBlockPipe;
import buildcraft.transport.blueprints.BptItemPipeDiamond;
import buildcraft.transport.blueprints.BptItemPipeEmerald;
@@ -98,8 +102,6 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
public class BuildCraftTransport {
public static BlockGenericPipe genericPipeBlock;
- public static int[] diamondTextures = new int[6];
-
public static boolean alwaysConnectPipes;
public static boolean usePipeLoss;
public static int maxItemsInPipes;
@@ -143,28 +145,32 @@ public class BuildCraftTransport {
public static Item pipeStructureCobblestone;
public static int groupItemsTrigger;
- public static Trigger triggerPipeEmpty = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_EMPTY, Kind.Empty);
- public static Trigger triggerPipeItems = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_ITEMS, Kind.ContainsItems);
- public static Trigger triggerPipeLiquids = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_LIQUIDS, Kind.ContainsLiquids);
- public static Trigger triggerPipeEnergy = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_ENERGY, Kind.ContainsEnergy);
- public static Trigger triggerRedSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_RED_SIGNAL_ACTIVE, true, IPipe.WireColor.Red);
- public static Trigger triggerRedSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_RED_SIGNAL_INACTIVE, false, IPipe.WireColor.Red);
- public static Trigger triggerBlueSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_BLUE_SIGNAL_ACTIVE, true, IPipe.WireColor.Blue);
- public static Trigger triggerBlueSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_BLUE_SIGNAL_INACTIVE, false, IPipe.WireColor.Blue);
- public static Trigger triggerGreenSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_GREEN_SIGNAL_ACTIVE, true, IPipe.WireColor.Green);
- public static Trigger triggerGreenSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_GREEN_SIGNAL_INACTIVE, false, IPipe.WireColor.Green);
- public static Trigger triggerYellowSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_YELLOW_SIGNAL_ACTIVE, true, IPipe.WireColor.Yellow);
- public static Trigger triggerYellowSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_YELLOW_SIGNAL_INACTIVE, false, IPipe.WireColor.Yellow);
+ public static BCTrigger triggerPipeEmpty = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_EMPTY, Kind.Empty);
+ public static BCTrigger triggerPipeItems = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_ITEMS, Kind.ContainsItems);
+ public static BCTrigger triggerPipeLiquids = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_LIQUIDS, Kind.ContainsLiquids);
+ public static BCTrigger triggerPipeEnergy = new TriggerPipeContents(DefaultProps.TRIGGER_PIPE_ENERGY, Kind.ContainsEnergy);
+ public static BCTrigger triggerRedSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_RED_SIGNAL_ACTIVE, true, IPipe.WireColor.Red);
+ public static BCTrigger triggerRedSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_RED_SIGNAL_INACTIVE, false, IPipe.WireColor.Red);
+ public static BCTrigger triggerBlueSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_BLUE_SIGNAL_ACTIVE, true, IPipe.WireColor.Blue);
+ public static BCTrigger triggerBlueSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_BLUE_SIGNAL_INACTIVE, false, IPipe.WireColor.Blue);
+ public static BCTrigger triggerGreenSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_GREEN_SIGNAL_ACTIVE, true, IPipe.WireColor.Green);
+ public static BCTrigger triggerGreenSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_GREEN_SIGNAL_INACTIVE, false, IPipe.WireColor.Green);
+ public static BCTrigger triggerYellowSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_YELLOW_SIGNAL_ACTIVE, true, IPipe.WireColor.Yellow);
+ public static BCTrigger triggerYellowSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_YELLOW_SIGNAL_INACTIVE, false, IPipe.WireColor.Yellow);
- public static Action actionRedSignal = new ActionSignalOutput(DefaultProps.ACTION_RED_SIGNAL, IPipe.WireColor.Red);
- public static Action actionBlueSignal = new ActionSignalOutput(DefaultProps.ACTION_BLUE_SIGNAL, IPipe.WireColor.Blue);
- public static Action actionGreenSignal = new ActionSignalOutput(DefaultProps.ACTION_GREEN_SIGNAL, IPipe.WireColor.Green);
- public static Action actionYellowSignal = new ActionSignalOutput(DefaultProps.ACTION_YELLOW_SIGNAL, IPipe.WireColor.Yellow);
- public static Action actionEnergyPulser = new ActionEnergyPulser(DefaultProps.ACTION_ENERGY_PULSER);
- public static Action actionSingleEnergyPulse = new ActionSingleEnergyPulse(DefaultProps.ACTION_SINGLE_ENERGY_PULSE);
+ public static BCAction actionRedSignal = new ActionSignalOutput(DefaultProps.ACTION_RED_SIGNAL, IPipe.WireColor.Red);
+ public static BCAction actionBlueSignal = new ActionSignalOutput(DefaultProps.ACTION_BLUE_SIGNAL, IPipe.WireColor.Blue);
+ public static BCAction actionGreenSignal = new ActionSignalOutput(DefaultProps.ACTION_GREEN_SIGNAL, IPipe.WireColor.Green);
+ public static BCAction actionYellowSignal = new ActionSignalOutput(DefaultProps.ACTION_YELLOW_SIGNAL, IPipe.WireColor.Yellow);
+ public static BCAction actionEnergyPulser = new ActionEnergyPulser(DefaultProps.ACTION_ENERGY_PULSER);
+ public static BCAction actionSingleEnergyPulse = new ActionSingleEnergyPulse(DefaultProps.ACTION_SINGLE_ENERGY_PULSE);
@Instance("BuildCraft|Transport")
public static BuildCraftTransport instance;
+
+ public IIconProvider pipeIconProvider = new PipeIconProvider();
+ public IIconProvider gateIconProvider = new GateIconProvider();
+ public IIconProvider wireIconProvider = new WireIconProvider();
private static class PipeRecipe {
boolean isShapeless = false; // pipe recipes come shaped and unshaped.
@@ -182,12 +188,12 @@ public class BuildCraftTransport {
}
@Override
- public boolean canExtractItems(IPipe pipe, World world, int i, int j, int k) {
+ public boolean canExtractItems(Object extractor, World world, int i, int j, int k) {
return testStrings(items, world, i, j, k);
}
@Override
- public boolean canExtractLiquids(IPipe pipe, World world, int i, int j, int k) {
+ public boolean canExtractLiquids(Object extractor, World world, int i, int j, int k) {
return testStrings(liquids, world, i, j, k);
}
@@ -200,7 +206,7 @@ public class BuildCraftTransport {
int meta = world.getBlockMetadata(i, j, k);
for (String excluded : excludedBlocks) {
- if (excluded.equals(block.getBlockName()))
+ if (excluded.equals(block.getUnlocalizedName()))
return false;
String[] tokens = excluded.split(":");
@@ -229,18 +235,22 @@ public class BuildCraftTransport {
durability.comment = "How long a pipe will take to break";
pipeDurability = (float) durability.getDouble(DefaultProps.PIPES_DURABILITY);
- Property exclusionItemList = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_BLOCK, "woodenPipe.item.exclusion", "");
+ Property exclusionItemList = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_BLOCK, "woodenPipe.item.exclusion", new String[0]);
- String[] excludedItemBlocks = exclusionItemList.value.split(",");
- for (int j = 0; j < excludedItemBlocks.length; ++j) {
- excludedItemBlocks[j] = excludedItemBlocks[j].trim();
+ String[] excludedItemBlocks = exclusionItemList.getStringList();
+ if(excludedItemBlocks != null) {
+ for (int j = 0; j < excludedItemBlocks.length; ++j) {
+ excludedItemBlocks[j] = excludedItemBlocks[j].trim();
+ }
}
- Property exclusionLiquidList = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_BLOCK, "woodenPipe.liquid.exclusion", "");
+ Property exclusionLiquidList = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_BLOCK, "woodenPipe.liquid.exclusion", new String[0]);
- String[] excludedLiquidBlocks = exclusionLiquidList.value.split(",");
- for (int j = 0; j < excludedLiquidBlocks.length; ++j) {
- excludedLiquidBlocks[j] = excludedLiquidBlocks[j].trim();
+ String[] excludedLiquidBlocks = exclusionLiquidList.getStringList();
+ if(excludedLiquidBlocks != null) {
+ for (int j = 0; j < excludedLiquidBlocks.length; ++j) {
+ excludedLiquidBlocks[j] = excludedLiquidBlocks[j].trim();
+ }
}
PipeManager.registerExtractionHandler(new ExtractionHandler(excludedItemBlocks, excludedLiquidBlocks));
@@ -248,22 +258,23 @@ public class BuildCraftTransport {
Property maxItemInPipesProp = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "pipes.maxItems", 100);
maxItemInPipesProp.comment = "pipes containing more than this amount of items will explode, not dropping any item";
- maxItemsInPipes = Integer.parseInt(maxItemInPipesProp.value);
+ maxItemsInPipes = maxItemInPipesProp.getInt();
Property groupItemsTriggerProp = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "pipes.groupItemsTrigger", 32);
groupItemsTriggerProp.comment = "when reaching this amount of objects in a pipes, items will be automatically grouped";
- groupItemsTrigger = Integer.parseInt(groupItemsTriggerProp.value);
+ groupItemsTrigger = groupItemsTriggerProp.getInt();
+
Property genericPipeId = BuildCraftCore.mainConfiguration.getBlock("pipe.id", DefaultProps.GENERIC_PIPE_ID);
Property pipeWaterproofId = BuildCraftCore.mainConfiguration.getItem("pipeWaterproof.id", DefaultProps.PIPE_WATERPROOF_ID);
- pipeWaterproof = new ItemBuildCraft(Integer.parseInt(pipeWaterproofId.value)).setIconIndex(2 * 16 + 1);
- pipeWaterproof.setItemName("pipeWaterproof");
- pipeWaterproof.setCreativeTab(CreativeTabs.tabMaterials);
+ pipeWaterproof = new ItemBuildCraft(pipeWaterproofId.getInt());
+ pipeWaterproof.setUnlocalizedName("pipeWaterproof");
+ pipeWaterproof.setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
LanguageRegistry.addName(pipeWaterproof, "Pipe Waterproof");
- genericPipeBlock = new BlockGenericPipe(Integer.parseInt(genericPipeId.value));
+ genericPipeBlock = new BlockGenericPipe(genericPipeId.getInt());
GameRegistry.registerBlock(genericPipeBlock);
// Fixing retro-compatiblity
@@ -305,45 +316,45 @@ public class BuildCraftTransport {
pipeItemsSandstone, null);
Property redPipeWireId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "redPipeWire.id", DefaultProps.RED_PIPE_WIRE);
- redPipeWire = new ItemBuildCraft(Integer.parseInt(redPipeWireId.value)).setIconIndex(4 * 16 + 0);
- redPipeWire.setItemName("redPipeWire");
+ redPipeWire = new ItemBuildCraft(redPipeWireId.getInt());
+ redPipeWire.setUnlocalizedName("redPipeWire");
LanguageRegistry.addName(redPipeWire, "Red Pipe Wire");
AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.redstone, 1),
new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(redPipeWire, 8)));
Property bluePipeWireId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "bluePipeWire.id", DefaultProps.BLUE_PIPE_WIRE);
- bluePipeWire = new ItemBuildCraft(Integer.parseInt(bluePipeWireId.value)).setIconIndex(4 * 16 + 1);
- bluePipeWire.setItemName("bluePipeWire");
+ bluePipeWire = new ItemBuildCraft(bluePipeWireId.getInt());
+ bluePipeWire.setUnlocalizedName("bluePipeWire");
LanguageRegistry.addName(bluePipeWire, "Blue Pipe Wire");
AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.redstone, 1),
new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(bluePipeWire, 8)));
Property greenPipeWireId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "greenPipeWire.id", DefaultProps.GREEN_PIPE_WIRE);
- greenPipeWire = new ItemBuildCraft(Integer.parseInt(greenPipeWireId.value)).setIconIndex(4 * 16 + 2);
- greenPipeWire.setItemName("greenPipeWire");
+ greenPipeWire = new ItemBuildCraft(greenPipeWireId.getInt());
+ greenPipeWire.setUnlocalizedName("greenPipeWire");
LanguageRegistry.addName(greenPipeWire, "Green Pipe Wire");
AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 2), new ItemStack(Item.redstone, 1),
new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(greenPipeWire, 8)));
Property yellowPipeWireId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "yellowPipeWire.id", DefaultProps.YELLOW_PIPE_WIRE);
- yellowPipeWire = new ItemBuildCraft(Integer.parseInt(yellowPipeWireId.value)).setIconIndex(4 * 16 + 3);
- yellowPipeWire.setItemName("yellowPipeWire");
+ yellowPipeWire = new ItemBuildCraft(yellowPipeWireId.getInt());
+ yellowPipeWire.setUnlocalizedName("yellowPipeWire");
LanguageRegistry.addName(yellowPipeWire, "Yellow Pipe Wire");
AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 11), new ItemStack(Item.redstone, 1),
new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(yellowPipeWire, 8)));
Property pipeGateId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeGate.id", DefaultProps.GATE_ID);
- pipeGate = new ItemGate(Integer.parseInt(pipeGateId.value), 0).setIconIndex(2 * 16 + 3);
- pipeGate.setItemName("pipeGate");
+ pipeGate = new ItemGate(pipeGateId.getInt(), 0);
+ pipeGate.setUnlocalizedName("pipeGate");
Property pipeGateAutarchicId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeGateAutarchic.id",
DefaultProps.GATE_AUTARCHIC_ID);
- pipeGateAutarchic = new ItemGate(Integer.parseInt(pipeGateAutarchicId.value), 1).setIconIndex(2 * 16 + 3);
- pipeGateAutarchic.setItemName("pipeGateAutarchic");
+ pipeGateAutarchic = new ItemGate(pipeGateAutarchicId.getInt(), 1);
+ pipeGateAutarchic.setUnlocalizedName("pipeGateAutarchic");
Property pipeFacadeId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeFacade.id", DefaultProps.PIPE_FACADE_ID);
- facadeItem = new ItemFacade(Integer.parseInt(pipeFacadeId.value));
- facadeItem.setItemName("pipeFacade");
+ facadeItem = new ItemFacade(pipeFacadeId.getInt());
+ facadeItem.setUnlocalizedName("pipeFacade");
} finally {
BuildCraftCore.mainConfiguration.save();
@@ -369,10 +380,6 @@ public class BuildCraftTransport {
// ModLoader.RegisterTileEntity(TileDockingStation.class,
// "net.minecraft.src.buildcraft.TileDockingStation");
- for (int j = 0; j < 6; ++j) {
- diamondTextures[j] = 1 * 16 + 6 + j;
- }
-
new BptBlockPipe(genericPipeBlock.blockID);
BuildCraftCore.itemBptProps[pipeItemsWood.itemID] = new BptItemPipeWooden();
@@ -442,7 +449,7 @@ public class BuildCraftTransport {
int id = prop.getInt(defaultID);
ItemPipe res = BlockGenericPipe.registerPipe(id, clas);
- res.setItemName(clas.getSimpleName());
+ res.setUnlocalizedName(clas.getSimpleName());
LanguageRegistry.addName(res, descr);
// Add appropriate recipe to temporary list
diff --git a/common/buildcraft/api/blueprints/BlueprintManager.java b/common/buildcraft/api/blueprints/BlueprintManager.java
index 4a528bef..9bab365b 100644
--- a/common/buildcraft/api/blueprints/BlueprintManager.java
+++ b/common/buildcraft/api/blueprints/BlueprintManager.java
@@ -5,6 +5,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import buildcraft.api.core.BuildCraftAPI;
+@Deprecated
public class BlueprintManager {
public static BptBlock[] blockBptProps = new BptBlock[Block.blocksList.length];
@@ -16,7 +17,7 @@ public class BlueprintManager {
sig.itemClassName = item.getClass().getSimpleName();
}
- sig.itemName = item.getItemNameIS(new ItemStack(item));
+ sig.itemName = item.getUnlocalizedName(new ItemStack(item));
return sig;
}
diff --git a/common/buildcraft/api/blueprints/BptBlock.java b/common/buildcraft/api/blueprints/BptBlock.java
index d1785b46..3e281012 100644
--- a/common/buildcraft/api/blueprints/BptBlock.java
+++ b/common/buildcraft/api/blueprints/BptBlock.java
@@ -1,8 +1,8 @@
-/**
+/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
@@ -21,26 +21,28 @@ import buildcraft.api.core.BuildCraftAPI;
/**
* This class allow to specify specific behavior for blocks stored in blueprints:
- *
+ *
* - what items needs to be used to create that block - how the block has to be built on the world - how to rotate the block - what extra data to store / load
* in the blueprint
- *
+ *
* Default implementations of this can be seen in the package buildcraft.api.bptblocks. The class BptBlockUtils provide some additional utilities.
- *
+ *
* Blueprints perform "id translation" in case the block ids between a blueprint and the world installation are different. In order to translate block ids,
* blocks needs to be uniquely identified. By default, this identification is done by:
- *
+ *
* - the block simple class name - the tile simple class name (if any) - the block name
- *
+ *
* In certain circumstances, the above is not enough (e.g. if several blocks share the same class and the same name, with no tile). In this case, additional
* data may be provided by children of this class:
- *
+ *
* - mod name - custom signature
- *
+ *
* At blueprint load time, BuildCraft will check that each block id of the blueprint corresponds to the block id in the installation. If not, it will perform a
* search through the block list, and upon matching signature, it will translate all blocks ids of the blueprint to the installation ones. If no such block id
* is found, BuildCraft will assume that the block is not installed and will not load the blueprint.
*/
+
+@Deprecated
public class BptBlock {
public final int blockId;
@@ -69,11 +71,11 @@ public class BptBlock {
* This is called each time an item matches a reqquirement, that is: (req id == stack id) for damageable items (req id == stack id && req dmg == stack dmg)
* for other items by default, it will increase damage of damageable items by the amount of damage of the requirement, and remove the intended amount of non
* damageable item.
- *
+ *
* Client may override this behavior for default items. Note that this subprogram may be called twice with the same parameters, once with a copy of
* requirements and stack to check if the entire requirements can be fullfilled, and once with the real inventory. Implementer is responsible for updating
* req (with the remaining requirements if any) and stack (after usage)
- *
+ *
* returns: what was used (similer to req, but created from stack, so that any NBT based differences are drawn from the correct source)
*/
public ItemStack useItem(BptSlotInfo slot, IBptContext context, ItemStack req, ItemStack stack) {
@@ -112,7 +114,7 @@ public class BptBlock {
/**
* Return true if the block on the world correspond to the block stored in the blueprint at the location given by the slot. By default, this subprogram is
* permissive and doesn't take into account metadata.
- *
+ *
* Added metadata sensitivity //Krapht
*/
public boolean isValid(BptSlotInfo slot, IBptContext context) {
@@ -131,8 +133,8 @@ public class BptBlock {
*/
public void buildBlock(BptSlotInfo slot, IBptContext context) {
// Meta needs to be specified twice, depending on the block behavior
- context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, slot.meta);
- context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta);
+ context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,3);
+ context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,3);
if (Block.blocksList[slot.blockId] instanceof BlockContainer) {
TileEntity tile = context.world().getBlockTileEntity(slot.x, slot.y, slot.z);
@@ -157,7 +159,7 @@ public class BptBlock {
/**
* Initializes a slot from the blueprint according to an objet placed on {x, y, z} on the world. This typically means adding entries in slot.cpt. Note that
* "id" and "meta" will be set automatically, corresponding to the block id and meta.
- *
+ *
* By default, if the block is a BlockContainer, tile information will be to save / load the block.
*/
public void initializeFromWorld(BptSlotInfo slot, IBptContext context, int x, int y, int z) {
@@ -206,7 +208,7 @@ public class BptBlock {
}
}
- sig.blockName = block.getBlockName();
+ sig.blockName = block.getUnlocalizedName();
sig.replaceNullWithStar();
return sig;
diff --git a/common/buildcraft/api/blueprints/BptBlockUtils.java b/common/buildcraft/api/blueprints/BptBlockUtils.java
index f80df6f9..a2d4ec19 100644
--- a/common/buildcraft/api/blueprints/BptBlockUtils.java
+++ b/common/buildcraft/api/blueprints/BptBlockUtils.java
@@ -16,6 +16,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
+@Deprecated
public class BptBlockUtils {
public static void requestInventoryContents(BptSlotInfo slot, IBptContext context, LinkedList requirements) {
diff --git a/common/buildcraft/api/blueprints/BptSlotInfo.java b/common/buildcraft/api/blueprints/BptSlotInfo.java
index 494498cd..32d5962f 100644
--- a/common/buildcraft/api/blueprints/BptSlotInfo.java
+++ b/common/buildcraft/api/blueprints/BptSlotInfo.java
@@ -17,6 +17,8 @@ import net.minecraft.nbt.NBTTagCompound;
/**
* This class records a slot, either from a blueprint or from a block placed in the world.
*/
+
+@Deprecated
public class BptSlotInfo {
public int blockId = 0;
diff --git a/common/buildcraft/api/blueprints/IBptContext.java b/common/buildcraft/api/blueprints/IBptContext.java
index abe6ffed..4b8c6715 100644
--- a/common/buildcraft/api/blueprints/IBptContext.java
+++ b/common/buildcraft/api/blueprints/IBptContext.java
@@ -17,6 +17,8 @@ import buildcraft.api.core.Position;
/**
* This interface provide contextual information when building or initializing blueprint slots.
*/
+
+@Deprecated
public interface IBptContext {
/**
diff --git a/common/buildcraft/api/blueprints/ItemSignature.java b/common/buildcraft/api/blueprints/ItemSignature.java
index 6ff25b5b..d6bd0310 100644
--- a/common/buildcraft/api/blueprints/ItemSignature.java
+++ b/common/buildcraft/api/blueprints/ItemSignature.java
@@ -9,6 +9,7 @@
package buildcraft.api.blueprints;
+@Deprecated
public class ItemSignature {
public String itemClassName;
diff --git a/common/buildcraft/api/bptblocks/BptBlockBed.java b/common/buildcraft/api/bptblocks/BptBlockBed.java
index 14c1a057..904f1a9f 100644
--- a/common/buildcraft/api/bptblocks/BptBlockBed.java
+++ b/common/buildcraft/api/bptblocks/BptBlockBed.java
@@ -1,8 +1,8 @@
-/**
+/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
@@ -17,6 +17,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockBed extends BptBlock {
public BptBlockBed(int blockId) {
@@ -56,7 +57,7 @@ public class BptBlockBed extends BptBlock {
if ((slot.meta & 8) != 0)
return;
- context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, slot.meta);
+ context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,1);
int x2 = slot.x;
int z2 = slot.z;
@@ -76,7 +77,7 @@ public class BptBlockBed extends BptBlock {
break;
}
- context.world().setBlockAndMetadataWithNotify(x2, slot.y, z2, slot.blockId, slot.meta + 8);
+ context.world().setBlock(x2, slot.y, z2, slot.blockId, slot.meta + 8,1);
}
@Override
diff --git a/common/buildcraft/api/bptblocks/BptBlockCustomStack.java b/common/buildcraft/api/bptblocks/BptBlockCustomStack.java
index 35efa285..959b7eba 100644
--- a/common/buildcraft/api/bptblocks/BptBlockCustomStack.java
+++ b/common/buildcraft/api/bptblocks/BptBlockCustomStack.java
@@ -16,6 +16,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockCustomStack extends BptBlock {
final ItemStack customStack;
diff --git a/common/buildcraft/api/bptblocks/BptBlockDelegate.java b/common/buildcraft/api/bptblocks/BptBlockDelegate.java
index 49f20343..c6b5ad33 100644
--- a/common/buildcraft/api/bptblocks/BptBlockDelegate.java
+++ b/common/buildcraft/api/bptblocks/BptBlockDelegate.java
@@ -17,6 +17,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockDelegate extends BptBlock {
final int delegateTo;
diff --git a/common/buildcraft/api/bptblocks/BptBlockDirt.java b/common/buildcraft/api/bptblocks/BptBlockDirt.java
index dcfd689d..61643d64 100644
--- a/common/buildcraft/api/bptblocks/BptBlockDirt.java
+++ b/common/buildcraft/api/bptblocks/BptBlockDirt.java
@@ -1,8 +1,8 @@
-/**
+/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
@@ -17,6 +17,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockDirt extends BptBlock {
public BptBlockDirt(int blockId) {
@@ -30,7 +31,7 @@ public class BptBlockDirt extends BptBlock {
@Override
public void buildBlock(BptSlotInfo slot, IBptContext context) {
- context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, Block.dirt.blockID, slot.meta);
+ context.world().setBlock(slot.x, slot.y, slot.z, Block.dirt.blockID, slot.meta,1);
}
@Override
diff --git a/common/buildcraft/api/bptblocks/BptBlockDoor.java b/common/buildcraft/api/bptblocks/BptBlockDoor.java
index 77c79279..ffd0bbef 100644
--- a/common/buildcraft/api/bptblocks/BptBlockDoor.java
+++ b/common/buildcraft/api/bptblocks/BptBlockDoor.java
@@ -1,8 +1,8 @@
-/**
+/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
@@ -16,6 +16,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockDoor extends BptBlock {
final ItemStack stack;
@@ -61,11 +62,11 @@ public class BptBlockDoor extends BptBlock {
@Override
public void buildBlock(BptSlotInfo slot, IBptContext context) {
- context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, slot.meta);
- context.world().setBlockAndMetadataWithNotify(slot.x, slot.y + 1, slot.z, slot.blockId, slot.meta + 8);
+ context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,1);
+ context.world().setBlock(slot.x, slot.y + 1, slot.z, slot.blockId, slot.meta + 8,1);
- context.world().setBlockMetadataWithNotify(slot.x, slot.y + 1, slot.z, slot.meta + 8);
- context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta);
+ context.world().setBlockMetadataWithNotify(slot.x, slot.y + 1, slot.z, slot.meta + 8,1);
+ context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,1);
}
}
diff --git a/common/buildcraft/api/bptblocks/BptBlockIgnore.java b/common/buildcraft/api/bptblocks/BptBlockIgnore.java
index e501bfaf..dd58463d 100644
--- a/common/buildcraft/api/bptblocks/BptBlockIgnore.java
+++ b/common/buildcraft/api/bptblocks/BptBlockIgnore.java
@@ -16,6 +16,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockIgnore extends BptBlock {
public BptBlockIgnore(int blockId) {
diff --git a/common/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java b/common/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java
index 8f00fd2f..0e490463 100644
--- a/common/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java
+++ b/common/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java
@@ -16,6 +16,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockIgnoreMeta extends BptBlock {
public BptBlockIgnoreMeta(int blockId) {
diff --git a/common/buildcraft/api/bptblocks/BptBlockInventory.java b/common/buildcraft/api/bptblocks/BptBlockInventory.java
index d2f30014..e4ebf709 100644
--- a/common/buildcraft/api/bptblocks/BptBlockInventory.java
+++ b/common/buildcraft/api/bptblocks/BptBlockInventory.java
@@ -5,6 +5,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockInventory extends BptBlock {
public BptBlockInventory(int blockId) {
diff --git a/common/buildcraft/api/bptblocks/BptBlockLever.java b/common/buildcraft/api/bptblocks/BptBlockLever.java
index c55f1959..0a1eab23 100644
--- a/common/buildcraft/api/bptblocks/BptBlockLever.java
+++ b/common/buildcraft/api/bptblocks/BptBlockLever.java
@@ -15,6 +15,7 @@ import net.minecraft.item.ItemStack;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockLever extends BptBlockWallSide {
public BptBlockLever(int blockId) {
diff --git a/common/buildcraft/api/bptblocks/BptBlockLiquid.java b/common/buildcraft/api/bptblocks/BptBlockLiquid.java
index 3562965e..49172957 100644
--- a/common/buildcraft/api/bptblocks/BptBlockLiquid.java
+++ b/common/buildcraft/api/bptblocks/BptBlockLiquid.java
@@ -1,8 +1,8 @@
-/**
+/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
@@ -16,6 +16,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockLiquid extends BptBlock {
private final ItemStack bucketStack;
@@ -54,7 +55,7 @@ public class BptBlockLiquid extends BptBlock {
@Override
public void buildBlock(BptSlotInfo slot, IBptContext context) {
if (slot.meta == 0) {
- context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, 0);
+ context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, 0,1);
}
}
diff --git a/common/buildcraft/api/bptblocks/BptBlockPiston.java b/common/buildcraft/api/bptblocks/BptBlockPiston.java
index f9021a35..b12693bd 100644
--- a/common/buildcraft/api/bptblocks/BptBlockPiston.java
+++ b/common/buildcraft/api/bptblocks/BptBlockPiston.java
@@ -1,8 +1,8 @@
-/**
+/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
@@ -12,6 +12,7 @@ package buildcraft.api.bptblocks;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockPiston extends BptBlockRotateMeta {
public BptBlockPiston(int blockId) {
@@ -22,7 +23,7 @@ public class BptBlockPiston extends BptBlockRotateMeta {
public void buildBlock(BptSlotInfo slot, IBptContext context) {
int meta = slot.meta & 7;
- context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, meta);
+ context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, meta,1);
}
}
diff --git a/common/buildcraft/api/bptblocks/BptBlockPumpkin.java b/common/buildcraft/api/bptblocks/BptBlockPumpkin.java
index af3a2135..43473f98 100644
--- a/common/buildcraft/api/bptblocks/BptBlockPumpkin.java
+++ b/common/buildcraft/api/bptblocks/BptBlockPumpkin.java
@@ -16,6 +16,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockPumpkin extends BptBlock {
public BptBlockPumpkin(int blockId) {
diff --git a/common/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java b/common/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java
index 84549ba9..67ca97c3 100644
--- a/common/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java
+++ b/common/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java
@@ -17,6 +17,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockRedstoneRepeater extends BptBlock {
public BptBlockRedstoneRepeater(int blockId) {
diff --git a/common/buildcraft/api/bptblocks/BptBlockRotateInventory.java b/common/buildcraft/api/bptblocks/BptBlockRotateInventory.java
index fe830586..319fcf7e 100644
--- a/common/buildcraft/api/bptblocks/BptBlockRotateInventory.java
+++ b/common/buildcraft/api/bptblocks/BptBlockRotateInventory.java
@@ -4,6 +4,7 @@ import net.minecraft.inventory.IInventory;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockRotateInventory extends BptBlockRotateMeta {
public BptBlockRotateInventory(int blockId, int[] rotations, boolean rotateForward) {
diff --git a/common/buildcraft/api/bptblocks/BptBlockRotateMeta.java b/common/buildcraft/api/bptblocks/BptBlockRotateMeta.java
index bf5ffa2b..eb846df5 100644
--- a/common/buildcraft/api/bptblocks/BptBlockRotateMeta.java
+++ b/common/buildcraft/api/bptblocks/BptBlockRotateMeta.java
@@ -16,6 +16,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockRotateMeta extends BptBlock {
int[] rot;
diff --git a/common/buildcraft/api/bptblocks/BptBlockSign.java b/common/buildcraft/api/bptblocks/BptBlockSign.java
index a19fd745..84a3996a 100644
--- a/common/buildcraft/api/bptblocks/BptBlockSign.java
+++ b/common/buildcraft/api/bptblocks/BptBlockSign.java
@@ -19,6 +19,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockSign extends BptBlock {
boolean isWall;
diff --git a/common/buildcraft/api/bptblocks/BptBlockStairs.java b/common/buildcraft/api/bptblocks/BptBlockStairs.java
index 2e4b2b8b..8ade4a4d 100644
--- a/common/buildcraft/api/bptblocks/BptBlockStairs.java
+++ b/common/buildcraft/api/bptblocks/BptBlockStairs.java
@@ -16,6 +16,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockStairs extends BptBlock {
public BptBlockStairs(int blockId) {
diff --git a/common/buildcraft/api/bptblocks/BptBlockWallSide.java b/common/buildcraft/api/bptblocks/BptBlockWallSide.java
index 4bf54818..8178d0f1 100644
--- a/common/buildcraft/api/bptblocks/BptBlockWallSide.java
+++ b/common/buildcraft/api/bptblocks/BptBlockWallSide.java
@@ -16,6 +16,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockWallSide extends BptBlock {
public BptBlockWallSide(int blockId) {
diff --git a/common/buildcraft/api/core/BuildCraftAPI.java b/common/buildcraft/api/core/BuildCraftAPI.java
index d0a3e293..87c45fdf 100644
--- a/common/buildcraft/api/core/BuildCraftAPI.java
+++ b/common/buildcraft/api/core/BuildCraftAPI.java
@@ -10,39 +10,11 @@
package buildcraft.api.core;
import net.minecraft.block.Block;
-import net.minecraft.world.World;
public class BuildCraftAPI {
- @Deprecated
- // To be removed, see LiquidContainerRegistry
- public static final int BUCKET_VOLUME = 1000;
public static final int LAST_ORIGINAL_BLOCK = 122;
public static final int LAST_ORIGINAL_ITEM = 126;
public static final boolean[] softBlocks = new boolean[Block.blocksList.length];
-
- @Deprecated
- // To be removed
- public static boolean softBlock(int blockId) {
- return blockId == 0 || softBlocks[blockId] || Block.blocksList[blockId] == null;
- }
-
- @Deprecated
- // To be removed
- public static boolean unbreakableBlock(int blockId) {
- return blockId == Block.bedrock.blockID || blockId == Block.lavaStill.blockID || blockId == Block.lavaMoving.blockID;
- }
-
- @Deprecated
- // To be removed
- public static void breakBlock(World world, int x, int y, int z) {
- int blockId = world.getBlockId(x, y, z);
-
- if (blockId != 0) {
- Block.blocksList[blockId].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
- }
-
- world.setBlockWithNotify(x, y, z, 0);
- }
}
diff --git a/common/buildcraft/api/core/IIconProvider.java b/common/buildcraft/api/core/IIconProvider.java
new file mode 100644
index 00000000..04833918
--- /dev/null
+++ b/common/buildcraft/api/core/IIconProvider.java
@@ -0,0 +1,24 @@
+package buildcraft.api.core;
+
+import net.minecraft.client.renderer.texture.IconRegister;
+import net.minecraft.util.Icon;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public interface IIconProvider {
+
+ /**
+ * @param iconIndex
+ * @return
+ */
+ @SideOnly(Side.CLIENT)
+ public Icon getIcon(int iconIndex);
+
+ /**
+ * A call for the provider to register its Icons. This may be called multiple times but should only be executed once per provider
+ * @param iconRegister
+ */
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister iconRegister);
+
+}
diff --git a/common/buildcraft/api/filler/IFillerPattern.java b/common/buildcraft/api/filler/IFillerPattern.java
index e39a7ca0..71b1e411 100644
--- a/common/buildcraft/api/filler/IFillerPattern.java
+++ b/common/buildcraft/api/filler/IFillerPattern.java
@@ -2,7 +2,10 @@ package buildcraft.api.filler;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import buildcraft.api.core.IBox;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public interface IFillerPattern {
@@ -12,9 +15,8 @@ public interface IFillerPattern {
public boolean iteratePattern(TileEntity tile, IBox box, ItemStack stackToPlace);
- public String getTextureFile();
-
- public int getTextureIndex();
+ @SideOnly(Side.CLIENT)
+ public Icon getTexture();
public String getName();
diff --git a/common/buildcraft/api/gates/Action.java b/common/buildcraft/api/gates/Action.java
deleted file mode 100644
index d76e315f..00000000
--- a/common/buildcraft/api/gates/Action.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Copyright (c) SpaceToad, 2011
- * http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
- * License 1.0, or MMPL. Please check the contents of the license located in
- * http://www.mod-buildcraft.com/MMPL-1.0.txt
- */
-
-package buildcraft.api.gates;
-
-public abstract class Action implements IAction {
-
- protected int id;
-
- public Action(int id) {
- this.id = id;
- ActionManager.actions[id] = this;
- }
-
- @Override
- public int getId() {
- return this.id;
- }
-
- @Override
- public abstract String getTexture();
-
- @Override
- public int getIndexInTexture() {
- return 0;
- }
-
- @Override
- public boolean hasParameter() {
- return false;
- }
-
- @Override
- public String getDescription() {
- return "";
- }
-}
diff --git a/common/buildcraft/api/gates/ActionManager.java b/common/buildcraft/api/gates/ActionManager.java
index e81bece6..34a558ec 100644
--- a/common/buildcraft/api/gates/ActionManager.java
+++ b/common/buildcraft/api/gates/ActionManager.java
@@ -8,8 +8,8 @@ import buildcraft.api.transport.IPipe;
public class ActionManager {
- public static Trigger[] triggers = new Trigger[1024];
- public static Action[] actions = new Action[1024];
+ public static ITrigger[] triggers = new ITrigger[1024];
+ public static IAction[] actions = new IAction[1024];
private static LinkedList triggerProviders = new LinkedList();
private static LinkedList actionProviders = new LinkedList();
diff --git a/common/buildcraft/api/gates/IAction.java b/common/buildcraft/api/gates/IAction.java
index d9856fdb..80c68657 100644
--- a/common/buildcraft/api/gates/IAction.java
+++ b/common/buildcraft/api/gates/IAction.java
@@ -1,13 +1,20 @@
package buildcraft.api.gates;
+import net.minecraft.util.Icon;
+import buildcraft.api.core.IIconProvider;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
public interface IAction {
int getId();
- String getTexture();
-
- int getIndexInTexture();
-
+ @SideOnly(Side.CLIENT)
+ Icon getTexture();
+
+ @SideOnly(Side.CLIENT)
+ IIconProvider getIconProvider();
+
boolean hasParameter();
String getDescription();
diff --git a/common/buildcraft/api/gates/ITrigger.java b/common/buildcraft/api/gates/ITrigger.java
index 84ff26bf..a8f5f5e8 100644
--- a/common/buildcraft/api/gates/ITrigger.java
+++ b/common/buildcraft/api/gates/ITrigger.java
@@ -1,6 +1,11 @@
package buildcraft.api.gates;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
+import buildcraft.api.core.IIconProvider;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import net.minecraftforge.common.ForgeDirection;
public interface ITrigger {
@@ -9,31 +14,30 @@ public interface ITrigger {
/**
* Return the texture file for this trigger icon
*/
- public abstract String getTextureFile();
-
- /**
- * Return the icon id in the texture file
- */
- public abstract int getIndexInTexture();
+ @SideOnly(Side.CLIENT)
+ public Icon getTextureIcon();
+
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider();
/**
* Return true if this trigger can accept parameters
*/
- public abstract boolean hasParameter();
+ public boolean hasParameter();
/**
* Return the trigger description in the UI
*/
- public abstract String getDescription();
+ public String getDescription();
/**
* Return true if the tile given in parameter activates the trigger, given the parameters.
*/
- public abstract boolean isTriggerActive(TileEntity tile, ITriggerParameter parameter);
+ public abstract boolean isTriggerActive(ForgeDirection side, TileEntity tile, ITriggerParameter parameter);
/**
* Create parameters for the trigger. As for now, there is only one kind of trigger parameter available so this subprogram is final.
*/
- public abstract ITriggerParameter createParameter();
+ public ITriggerParameter createParameter();
}
diff --git a/common/buildcraft/api/gates/ITriggerDirectional.java b/common/buildcraft/api/gates/ITriggerDirectional.java
deleted file mode 100644
index 344e168b..00000000
--- a/common/buildcraft/api/gates/ITriggerDirectional.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package buildcraft.api.gates;
-
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.common.ForgeDirection;
-
-// TODO: Merge with ITrigger
-
-/**
- * This interface was added to expand on the existing Trigger interface without breaking the API. At some point when it is safe to break the API, this function
- * should replace the one in ITrigger.
- */
-public interface ITriggerDirectional extends ITrigger {
-
- /**
- * Return true if the tile given in parameter activates the trigger, given the parameters.
- */
- public abstract boolean isTriggerActive(ForgeDirection side, TileEntity tile, ITriggerParameter parameter);
-}
diff --git a/common/buildcraft/api/gates/Trigger.java b/common/buildcraft/api/gates/Trigger.java
deleted file mode 100644
index aa1fe37d..00000000
--- a/common/buildcraft/api/gates/Trigger.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * Copyright (c) SpaceToad, 2011
- * http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
- * License 1.0, or MMPL. Please check the contents of the license located in
- * http://www.mod-buildcraft.com/MMPL-1.0.txt
- */
-
-package buildcraft.api.gates;
-
-import net.minecraft.tileentity.TileEntity;
-
-/**
- * This class has to be implemented to create new triggers kinds to BuildCraft gates. There is an instance per kind, which will get called wherever the trigger
- * can be active.
- */
-public abstract class Trigger implements ITrigger {
-
- protected int id;
-
- /**
- * Creates a new triggers, and stores it in the trigger list
- */
- public Trigger(int id) {
- this.id = id;
- ActionManager.triggers[id] = this;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see net.minecraft.src.buildcraft.api.gates.ITrigger#getId()
- */
- @Override
- public int getId() {
- return this.id;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see net.minecraft.src.buildcraft.api.gates.ITrigger#getTextureFile()
- */
- @Override
- public abstract String getTextureFile();
-
- /*
- * (non-Javadoc)
- *
- * @see net.minecraft.src.buildcraft.api.gates.ITrigger#getIndexInTexture()
- */
- @Override
- public int getIndexInTexture() {
- return 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see net.minecraft.src.buildcraft.api.gates.ITrigger#hasParameter()
- */
- @Override
- public boolean hasParameter() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see net.minecraft.src.buildcraft.api.gates.ITrigger#getDescription()
- */
- @Override
- public String getDescription() {
- return "";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see net.minecraft.src.buildcraft.api.gates.ITrigger#isTriggerActive(net.minecraft.src.TileEntity,
- * net.minecraft.src.buildcraft.api.gates.TriggerParameter)
- */
- @Override
- public boolean isTriggerActive(TileEntity tile, ITriggerParameter parameter) {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see net.minecraft.src.buildcraft.api.gates.ITrigger#createParameter()
- */
- @Override
- public final ITriggerParameter createParameter() {
- return new TriggerParameter();
- }
-}
diff --git a/common/buildcraft/api/inventory/ISpecialInventory.java b/common/buildcraft/api/inventory/ISpecialInventory.java
index 5b52e360..27b735d4 100644
--- a/common/buildcraft/api/inventory/ISpecialInventory.java
+++ b/common/buildcraft/api/inventory/ISpecialInventory.java
@@ -12,7 +12,7 @@ public interface ISpecialInventory extends IInventory {
* @param stack
* ItemStack offered for addition. Do not manipulate this!
* @param doAdd
- * If false no actual addition should take place.
+ * If false no actual addition should take place. Implementors should simulate.
* @param from
* Orientation the ItemStack is offered from.
* @return Amount of items used from the passed stack.
@@ -23,12 +23,13 @@ public interface ISpecialInventory extends IInventory {
* Requests items to be extracted from the inventory
*
* @param doRemove
- * If false no actual extraction may occur.
+ * If false no actual extraction may occur. Implementors should simulate.
+ * Can be used to "peek" at what the result would be
* @param from
* Orientation the ItemStack is requested from.
* @param maxItemCount
* Maximum amount of items to extract (spread over all returned item stacks)
- * @return Array of item stacks extracted from the inventory
+ * @return Array of item stacks that were/would be extracted from the inventory
*/
ItemStack[] extractItem(boolean doRemove, ForgeDirection from, int maxItemCount);
diff --git a/common/buildcraft/api/power/IPowerReceptor.java b/common/buildcraft/api/power/IPowerReceptor.java
index 8fe6c83b..661145e0 100644
--- a/common/buildcraft/api/power/IPowerReceptor.java
+++ b/common/buildcraft/api/power/IPowerReceptor.java
@@ -9,6 +9,8 @@
package buildcraft.api.power;
+import net.minecraftforge.common.ForgeDirection;
+
public interface IPowerReceptor {
public void setPowerProvider(IPowerProvider provider);
@@ -17,6 +19,6 @@ public interface IPowerReceptor {
public void doWork();
- public int powerRequest();
+ public int powerRequest(ForgeDirection from);
}
diff --git a/common/buildcraft/api/transport/FacadeManager.java b/common/buildcraft/api/transport/FacadeManager.java
index d27574fe..f5333921 100644
--- a/common/buildcraft/api/transport/FacadeManager.java
+++ b/common/buildcraft/api/transport/FacadeManager.java
@@ -4,9 +4,15 @@ import java.lang.reflect.Method;
import net.minecraft.item.ItemStack;
+/**
+ * You can use this if you wish, but FML InterModComms are recommended.
+ *
+ * SYNTAX: add-facade:id@meta
+ */
public class FacadeManager {
private static Method addFacade;
+ @SuppressWarnings({ "unchecked", "rawtypes" })
public static void addFacade(ItemStack is) {
try {
if (addFacade == null) {
diff --git a/common/buildcraft/api/transport/IExtractionHandler.java b/common/buildcraft/api/transport/IExtractionHandler.java
index 7301ec94..863cc312 100644
--- a/common/buildcraft/api/transport/IExtractionHandler.java
+++ b/common/buildcraft/api/transport/IExtractionHandler.java
@@ -9,11 +9,13 @@ public interface IExtractionHandler {
/**
* Can this pipe extract items from the block located at these coordinates?
+ * param extractor can be null
*/
- boolean canExtractItems(IPipe pipe, World world, int i, int j, int k);
+ boolean canExtractItems(Object extractor, World world, int i, int j, int k);
/**
* Can this pipe extract liquids from the block located at these coordinates?
+ * param extractor can be null
*/
- boolean canExtractLiquids(IPipe pipe, World world, int i, int j, int k);
+ boolean canExtractLiquids(Object extractor, World world, int i, int j, int k);
}
diff --git a/common/buildcraft/api/transport/IPipedItem.java b/common/buildcraft/api/transport/IPipedItem.java
index 31df98f1..5dc85792 100644
--- a/common/buildcraft/api/transport/IPipedItem.java
+++ b/common/buildcraft/api/transport/IPipedItem.java
@@ -7,7 +7,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import buildcraft.api.core.Position;
-import buildcraft.api.core.SafeTimeTracker;
public interface IPipedItem {
@@ -53,32 +52,6 @@ public interface IPipedItem {
*/
public abstract void setContainer(TileEntity container);
- /**
- * @return the synchroTracker
- */
- @Deprecated
- public abstract SafeTimeTracker getSynchroTracker();
-
- /**
- * @param synchroTracker
- * the synchroTracker to set
- */
- @Deprecated
- public abstract void setSynchroTracker(SafeTimeTracker synchroTracker);
-
- /**
- * @return the deterministicRandomization
- */
- @Deprecated
- public abstract int getDeterministicRandomization();
-
- /**
- * @param deterministicRandomization
- * the deterministicRandomization to set
- */
- @Deprecated
- public abstract void setDeterministicRandomization(int deterministicRandomization);
-
/**
* @return the entityId
*/
diff --git a/common/buildcraft/api/transport/ISolidSideTile.java b/common/buildcraft/api/transport/ISolidSideTile.java
new file mode 100644
index 00000000..627b0d88
--- /dev/null
+++ b/common/buildcraft/api/transport/ISolidSideTile.java
@@ -0,0 +1,7 @@
+package buildcraft.api.transport;
+
+import net.minecraftforge.common.ForgeDirection;
+
+public interface ISolidSideTile {
+ public boolean isSolidOnSide(ForgeDirection side);
+}
diff --git a/common/buildcraft/api/transport/PipeManager.java b/common/buildcraft/api/transport/PipeManager.java
index 47fc60ec..10736d63 100644
--- a/common/buildcraft/api/transport/PipeManager.java
+++ b/common/buildcraft/api/transport/PipeManager.java
@@ -2,45 +2,36 @@ package buildcraft.api.transport;
import java.util.ArrayList;
import java.util.List;
-import java.util.TreeMap;
import net.minecraft.world.World;
-import cpw.mods.fml.common.FMLCommonHandler;
-import cpw.mods.fml.relauncher.Side;
public abstract class PipeManager {
- @Deprecated
- private static TreeMap allServerEntities = new TreeMap();
- @Deprecated
- private static TreeMap allClientEntities = new TreeMap();
-
public static List extractionHandlers = new ArrayList();
public static void registerExtractionHandler(IExtractionHandler handler) {
extractionHandlers.add(handler);
}
- public static boolean canExtractItems(IPipe pipe, World world, int i, int j, int k) {
+ /**
+ * param extractor can be null
+ */
+ public static boolean canExtractItems(Object extractor, World world, int i, int j, int k) {
for (IExtractionHandler handler : extractionHandlers)
- if (!handler.canExtractItems(pipe, world, i, j, k))
+ if (!handler.canExtractItems(extractor, world, i, j, k))
return false;
return true;
}
-
- public static boolean canExtractLiquids(IPipe pipe, World world, int i, int j, int k) {
+
+ /**
+ * param extractor can be null
+ */
+ public static boolean canExtractLiquids(Object extractor, World world, int i, int j, int k) {
for (IExtractionHandler handler : extractionHandlers)
- if (!handler.canExtractLiquids(pipe, world, i, j, k))
+ if (!handler.canExtractLiquids(extractor, world, i, j, k))
return false;
return true;
}
-
- @Deprecated
- public static TreeMap getAllEntities() {
- if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)
- return allClientEntities;
- return allServerEntities;
- }
}
diff --git a/common/buildcraft/builders/BlockArchitect.java b/common/buildcraft/builders/BlockArchitect.java
index beb57f01..aa176351 100644
--- a/common/buildcraft/builders/BlockArchitect.java
+++ b/common/buildcraft/builders/BlockArchitect.java
@@ -13,11 +13,13 @@ import java.util.ArrayList;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
@@ -25,33 +27,24 @@ import buildcraft.BuildCraftBuilders;
import buildcraft.api.core.Position;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.CreativeTabBuildCraft;
-import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.Utils;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockArchitect extends BlockContainer {
- int blockTextureSides;
- int blockTextureFront;
- int blockTextureTopPos;
- int blockTextureTopNeg;
- int blockTextureTopArchitect;
+ Icon blockTextureSides;
+ Icon blockTextureFront;
+ Icon blockTextureTopPos;
+ Icon blockTextureTopNeg;
+ Icon blockTextureTopArchitect;
public BlockArchitect(int i) {
super(i, Material.iron);
setHardness(0.5F);
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
- blockTextureSides = 3 * 16 + 0;
- blockTextureTopNeg = 3 * 16 + 1;
- blockTextureTopPos = 3 * 16 + 2;
- blockTextureTopArchitect = 3 * 16 + 3;
- blockTextureFront = 3 * 16 + 4;
- }
-
- @Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
}
@Override
@@ -73,17 +66,17 @@ public class BlockArchitect extends BlockContainer {
switch (ForgeDirection.values()[meta]) {
case WEST:
- world.setBlockMetadata(i, j, k, ForgeDirection.SOUTH.ordinal());
+ world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.SOUTH.ordinal(),0);
break;
case EAST:
- world.setBlockMetadata(i, j, k, ForgeDirection.NORTH.ordinal());
+ world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.NORTH.ordinal(),0);
break;
case NORTH:
- world.setBlockMetadata(i, j, k, ForgeDirection.WEST.ordinal());
+ world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.WEST.ordinal(),0);
break;
case SOUTH:
default:
- world.setBlockMetadata(i, j, k, ForgeDirection.EAST.ordinal());
+ world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.EAST.ordinal(),0);
break;
}
@@ -108,16 +101,16 @@ public class BlockArchitect extends BlockContainer {
}
@Override
- public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) {
- super.onBlockPlacedBy(world, i, j, k, entityliving);
+ public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving, ItemStack stack) {
+ super.onBlockPlacedBy(world, i, j, k, entityliving, stack);
ForgeDirection orientation = Utils.get2dOrientation(new Position(entityliving.posX, entityliving.posY, entityliving.posZ), new Position(i, j, k));
- world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal());
+ world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal(),1);
}
@SuppressWarnings({ "all" })
- public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) {
+ public Icon getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) {
int m = iblockaccess.getBlockMetadata(i, j, k);
if (l == 1)
@@ -127,7 +120,7 @@ public class BlockArchitect extends BlockContainer {
}
@Override
- public int getBlockTextureFromSideAndMetadata(int i, int j) {
+ public Icon getBlockTextureFromSideAndMetadata(int i, int j) {
if (j == 0 && i == 3)
return blockTextureFront;
@@ -145,4 +138,15 @@ public class BlockArchitect extends BlockContainer {
public void addCreativeItems(ArrayList itemList) {
itemList.add(new ItemStack(this));
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ blockTextureSides = par1IconRegister.registerIcon("buildcraft:architect_sides");
+ blockTextureTopNeg = par1IconRegister.registerIcon("buildcraft:architect_top_neg");
+ blockTextureTopPos = par1IconRegister.registerIcon("buildcraft:architect_top_pos");
+ blockTextureTopArchitect = par1IconRegister.registerIcon("buildcraft:architect_top");
+ blockTextureFront = par1IconRegister.registerIcon("buildcraft:architect_front");
+ }
}
diff --git a/common/buildcraft/builders/BlockBlueprintLibrary.java b/common/buildcraft/builders/BlockBlueprintLibrary.java
index 2246d3e1..7f3d443d 100644
--- a/common/buildcraft/builders/BlockBlueprintLibrary.java
+++ b/common/buildcraft/builders/BlockBlueprintLibrary.java
@@ -13,30 +13,31 @@ import java.util.ArrayList;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import net.minecraft.world.World;
import buildcraft.BuildCraftBuilders;
import buildcraft.core.CreativeTabBuildCraft;
-import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.proxy.CoreProxy;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockBlueprintLibrary extends BlockContainer {
- public BlockBlueprintLibrary(int i) {
+ private Icon textureTop;
+ private Icon textureSide;
+
+ public BlockBlueprintLibrary(int i) {
super(i, Material.wood);
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
setHardness(0.7F);
}
- @Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
@Override
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int par6, float par7, float par8, float par9) {
super.onBlockActivated(world, i, j, k, entityplayer, par6, par7, par8, par9);
@@ -61,18 +62,18 @@ public class BlockBlueprintLibrary extends BlockContainer {
}
@Override
- public int getBlockTextureFromSide(int i) {
+ public Icon getBlockTextureFromSideAndMetadata(int i, int j) {
switch (i) {
case 0:
case 1:
- return 3 * 16 + 5;
+ return textureTop;
default:
- return 3 * 16 + 8;
+ return textureSide;
}
}
@Override
- public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) {
+ public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving, ItemStack stack) {
if (CoreProxy.proxy.isSimulating(world) && entityliving instanceof EntityPlayer) {
TileBlueprintLibrary tile = (TileBlueprintLibrary) world.getBlockTileEntity(i, j, k);
tile.owner = ((EntityPlayer) entityliving).username;
@@ -84,4 +85,12 @@ public class BlockBlueprintLibrary extends BlockContainer {
public void addCreativeItems(ArrayList itemList) {
itemList.add(new ItemStack(this));
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ textureTop = par1IconRegister.registerIcon("buildcraft:library_topbottom");
+ textureSide = par1IconRegister.registerIcon("buildcraft:library_side");
+ }
}
diff --git a/common/buildcraft/builders/BlockBuilder.java b/common/buildcraft/builders/BlockBuilder.java
index 7671c26a..1bd86ba1 100644
--- a/common/buildcraft/builders/BlockBuilder.java
+++ b/common/buildcraft/builders/BlockBuilder.java
@@ -13,33 +13,33 @@ import java.util.ArrayList;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import buildcraft.BuildCraftBuilders;
import buildcraft.api.core.Position;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.CreativeTabBuildCraft;
-import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.Utils;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockBuilder extends BlockContainer {
- int blockTextureTop;
- int blockTextureSide;
- int blockTextureFront;
+ Icon blockTextureTop;
+ Icon blockTextureSide;
+ Icon blockTextureFront;
public BlockBuilder(int i) {
super(i, Material.iron);
- blockTextureSide = 3 * 16 + 5;
- blockTextureTop = 3 * 16 + 6;
- blockTextureFront = 3 * 16 + 7;
setHardness(0.7F);
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
}
@@ -50,12 +50,7 @@ public class BlockBuilder extends BlockContainer {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
- @Override
- public int getBlockTextureFromSideAndMetadata(int i, int j) {
+ public Icon getBlockTextureFromSideAndMetadata(int i, int j) {
if (j == 0 && i == 3)
return blockTextureFront;
@@ -84,17 +79,17 @@ public class BlockBuilder extends BlockContainer {
switch (ForgeDirection.values()[meta]) {
case WEST:
- world.setBlockMetadata(i, j, k, ForgeDirection.SOUTH.ordinal());
+ world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.SOUTH.ordinal(),0);
break;
case EAST:
- world.setBlockMetadata(i, j, k, ForgeDirection.NORTH.ordinal());
+ world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.NORTH.ordinal(),0);
break;
case NORTH:
- world.setBlockMetadata(i, j, k, ForgeDirection.WEST.ordinal());
+ world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.WEST.ordinal(),0);
break;
case SOUTH:
default:
- world.setBlockMetadata(i, j, k, ForgeDirection.EAST.ordinal());
+ world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.EAST.ordinal(),0);
break;
}
@@ -112,11 +107,11 @@ public class BlockBuilder extends BlockContainer {
}
@Override
- public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) {
- super.onBlockPlacedBy(world, i, j, k, entityliving);
+ public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving, ItemStack stack) {
+ super.onBlockPlacedBy(world, i, j, k, entityliving, stack);
ForgeDirection orientation = Utils.get2dOrientation(new Position(entityliving.posX, entityliving.posY, entityliving.posZ), new Position(i, j, k));
- world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal());
+ world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal(),1);
}
@Override
@@ -131,4 +126,12 @@ public class BlockBuilder extends BlockContainer {
itemList.add(new ItemStack(this));
}
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ blockTextureTop = par1IconRegister.registerIcon("buildcraft:builder_top");
+ blockTextureSide = par1IconRegister.registerIcon("buildcraft:builder_side");
+ blockTextureFront = par1IconRegister.registerIcon("buildcraft:builder_front");
+ }
}
diff --git a/common/buildcraft/builders/BlockFiller.java b/common/buildcraft/builders/BlockFiller.java
index cd72158a..da62d996 100644
--- a/common/buildcraft/builders/BlockFiller.java
+++ b/common/buildcraft/builders/BlockFiller.java
@@ -13,24 +13,27 @@ import java.util.ArrayList;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import buildcraft.BuildCraftBuilders;
import buildcraft.api.filler.IFillerPattern;
import buildcraft.core.CreativeTabBuildCraft;
-import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.Utils;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockFiller extends BlockContainer {
- int textureSides;
- int textureTopOn;
- int textureTopOff;
+ Icon textureSides;
+ Icon textureTopOn;
+ Icon textureTopOff;
public IFillerPattern currentPattern;
public BlockFiller(int i) {
@@ -38,10 +41,6 @@ public class BlockFiller extends BlockContainer {
setHardness(0.5F);
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
-
- textureSides = 4 * 16 + 2;
- textureTopOn = 4 * 16 + 0;
- textureTopOff = 4 * 16 + 1;
}
@Override
@@ -59,7 +58,7 @@ public class BlockFiller extends BlockContainer {
}
@SuppressWarnings({ "all" })
- public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) {
+ public Icon getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) {
int m = iblockaccess.getBlockMetadata(i, j, k);
if (iblockaccess == null)
@@ -75,7 +74,7 @@ public class BlockFiller extends BlockContainer {
else
return textureTopOn;
} else if (filler.currentPattern != null)
- return filler.currentPattern.getTextureIndex();
+ return filler.currentPattern.getTexture();
else
return textureSides;
}
@@ -84,7 +83,7 @@ public class BlockFiller extends BlockContainer {
}
@Override
- public int getBlockTextureFromSide(int i) {
+ public Icon getBlockTextureFromSideAndMetadata(int i, int j) {
if (i == 0 || i == 1)
return textureTopOn;
else
@@ -102,14 +101,17 @@ public class BlockFiller extends BlockContainer {
super.breakBlock(world, x, y, z, par5, par6);
}
- @Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void addCreativeItems(ArrayList itemList) {
itemList.add(new ItemStack(this));
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister) {
+ textureTopOn = par1IconRegister.registerIcon("buildcraft:blockFillerTopOn");
+ textureTopOff = par1IconRegister.registerIcon("buildcraft:blockFillerTopOff");
+ textureSides = par1IconRegister.registerIcon("buildcraft:blockFillerSides");
+ }
}
diff --git a/common/buildcraft/builders/BlockMarker.java b/common/buildcraft/builders/BlockMarker.java
index d63391e2..d327a860 100644
--- a/common/buildcraft/builders/BlockMarker.java
+++ b/common/buildcraft/builders/BlockMarker.java
@@ -14,26 +14,28 @@ import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.Icon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
+import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import buildcraft.BuildCraftBuilders;
import buildcraft.BuildCraftCore;
import buildcraft.core.CreativeTabBuildCraft;
-import buildcraft.core.DefaultProps;
import buildcraft.core.utils.Utils;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockMarker extends BlockContainer {
public BlockMarker(int i) {
super(i, Material.circuits);
- blockIndexInTexture = 3 * 16 + 9;
-
setLightValue(0.5F);
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
}
@@ -130,7 +132,7 @@ public class BlockMarker extends BlockContainer {
}
if (flag) {
dropBlockAsItem(world, i, j, k, BuildCraftBuilders.markerBlock.blockID, 0);
- world.setBlockWithNotify(i, j, k, 0);
+ world.setBlock(i, j, k, 0);
}
}
}
@@ -187,17 +189,17 @@ public class BlockMarker extends BlockContainer {
super.onBlockAdded(world, i, j, k);
if (BuildersProxy.canPlaceTorch(world, i - 1, j, k)) {
- world.setBlockMetadataWithNotify(i, j, k, 1);
+ world.setBlockMetadataWithNotify(i, j, k, 1,1);
} else if (BuildersProxy.canPlaceTorch(world, i + 1, j, k)) {
- world.setBlockMetadataWithNotify(i, j, k, 2);
+ world.setBlockMetadataWithNotify(i, j, k, 2,1);
} else if (BuildersProxy.canPlaceTorch(world, i, j, k - 1)) {
- world.setBlockMetadataWithNotify(i, j, k, 3);
+ world.setBlockMetadataWithNotify(i, j, k, 3,1);
} else if (BuildersProxy.canPlaceTorch(world, i, j, k + 1)) {
- world.setBlockMetadataWithNotify(i, j, k, 4);
+ world.setBlockMetadataWithNotify(i, j, k, 4,1);
} else if (BuildersProxy.canPlaceTorch(world, i, j - 1, k)) {
- world.setBlockMetadataWithNotify(i, j, k, 5);
+ world.setBlockMetadataWithNotify(i, j, k, 5,1);
} else if (BuildersProxy.canPlaceTorch(world, i, j + 1, k)) {
- world.setBlockMetadataWithNotify(i, j, k, 0);
+ world.setBlockMetadataWithNotify(i, j, k, 0,1);
}
dropTorchIfCantStay(world, i, j, k);
@@ -206,20 +208,28 @@ public class BlockMarker extends BlockContainer {
private boolean dropTorchIfCantStay(World world, int i, int j, int k) {
if (!canPlaceBlockAt(world, i, j, k)) {
dropBlockAsItem(world, i, j, k, BuildCraftBuilders.markerBlock.blockID, 0);
- world.setBlockWithNotify(i, j, k, 0);
+ world.setBlock(i, j, k, 0);
return false;
} else
return true;
}
- @Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void addCreativeItems(ArrayList itemList) {
itemList.add(new ItemStack(this));
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ this.blockIcon = par1IconRegister.registerIcon("buildcraft:blockMarker");
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public Icon getBlockTexture(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5) {
+ return this.blockIcon;
+ }
}
diff --git a/common/buildcraft/builders/BlockPathMarker.java b/common/buildcraft/builders/BlockPathMarker.java
index 2cf04851..23595389 100644
--- a/common/buildcraft/builders/BlockPathMarker.java
+++ b/common/buildcraft/builders/BlockPathMarker.java
@@ -1,8 +1,8 @@
-/**
+/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
@@ -11,18 +11,22 @@ package buildcraft.builders;
import java.util.ArrayList;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import buildcraft.core.utils.Utils;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockPathMarker extends BlockMarker {
- public BlockPathMarker(int i) {
- super(i);
+ private Icon activeMarker;
- blockIndexInTexture = 3 * 16 + 10;
+ public BlockPathMarker(int i) {
+ super(i);
}
@Override
@@ -38,13 +42,13 @@ public class BlockPathMarker extends BlockMarker {
@SuppressWarnings({ "all" })
// @Override (client only)
- public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) {
+ public Icon getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) {
TilePathMarker marker = (TilePathMarker) iblockaccess.getBlockTileEntity(i, j, k);
if (l == 1 || (marker != null && marker.tryingToConnect))
- return 3 * 16 + 11;
+ return activeMarker;
else
- return 3 * 16 + 10;
+ return super.getBlockTexture(iblockaccess, i, j, k, l);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -52,4 +56,12 @@ public class BlockPathMarker extends BlockMarker {
public void addCreativeItems(ArrayList itemList) {
itemList.add(new ItemStack(this));
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ blockIcon = par1IconRegister.registerIcon("buildcraft:blockPathMarker");
+ activeMarker = par1IconRegister.registerIcon("buildcraft:blockPathMarkerActive");
+ }
}
diff --git a/common/buildcraft/builders/BptBlockFiller.java b/common/buildcraft/builders/BptBlockFiller.java
index 4988213e..c3ae883f 100644
--- a/common/buildcraft/builders/BptBlockFiller.java
+++ b/common/buildcraft/builders/BptBlockFiller.java
@@ -22,6 +22,7 @@ import buildcraft.api.core.LaserKind;
import buildcraft.api.core.Position;
import buildcraft.core.Box;
+@Deprecated
public class BptBlockFiller extends BptBlock {
public BptBlockFiller(int blockId) {
@@ -69,7 +70,7 @@ public class BptBlockFiller extends BptBlock {
@Override
public void buildBlock(BptSlotInfo slot, IBptContext context) {
- context.world().setBlockWithNotify(slot.x, slot.y, slot.z, slot.blockId);
+ context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId);
TileFiller filler = (TileFiller) context.world().getBlockTileEntity(slot.x, slot.y, slot.z);
diff --git a/common/buildcraft/builders/BuilderProxyClient.java b/common/buildcraft/builders/BuilderProxyClient.java
index 2976ca4b..d0546463 100644
--- a/common/buildcraft/builders/BuilderProxyClient.java
+++ b/common/buildcraft/builders/BuilderProxyClient.java
@@ -1,9 +1,17 @@
package buildcraft.builders;
+import net.minecraft.util.Icon;
import buildcraft.BuildCraftBuilders;
public class BuilderProxyClient extends BuilderProxy {
- @Override
+ public static Icon fillerFillAllTexture;
+ public static Icon fillerClearTexture;
+ public static Icon fillerWallsTexture;
+ public static Icon fillerStairsTexture;
+ public static Icon fillerFlattenTexture;
+ public static Icon fillerPyramidTexture;
+
+ @Override
public void registerClientHook() {
BuildCraftBuilders.addHook(new ClientBuilderHook());
}
diff --git a/common/buildcraft/builders/FillerFillAll.java b/common/buildcraft/builders/FillerFillAll.java
index 993d16d5..b74c271a 100644
--- a/common/buildcraft/builders/FillerFillAll.java
+++ b/common/buildcraft/builders/FillerFillAll.java
@@ -11,8 +11,10 @@ package buildcraft.builders;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import buildcraft.api.core.IBox;
-import buildcraft.core.DefaultProps;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class FillerFillAll extends FillerPattern {
@@ -30,13 +32,9 @@ public class FillerFillAll extends FillerPattern {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
- @Override
- public int getTextureIndex() {
- return 4 * 16 + 3;
+ @SideOnly(Side.CLIENT)
+ public Icon getTexture() {
+ return BuilderProxyClient.fillerFillAllTexture;
}
@Override
diff --git a/common/buildcraft/builders/FillerFillPyramid.java b/common/buildcraft/builders/FillerFillPyramid.java
index 6ac74b2b..293348a2 100644
--- a/common/buildcraft/builders/FillerFillPyramid.java
+++ b/common/buildcraft/builders/FillerFillPyramid.java
@@ -11,8 +11,10 @@ package buildcraft.builders;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import buildcraft.api.core.IBox;
-import buildcraft.core.DefaultProps;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class FillerFillPyramid extends FillerPattern {
@@ -58,13 +60,9 @@ public class FillerFillPyramid extends FillerPattern {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
- @Override
- public int getTextureIndex() {
- return 4 * 16 + 7;
+ @SideOnly(Side.CLIENT)
+ public Icon getTexture() {
+ return BuilderProxyClient.fillerPyramidTexture;
}
@Override
diff --git a/common/buildcraft/builders/FillerFillStairs.java b/common/buildcraft/builders/FillerFillStairs.java
index 47686d5f..dca31535 100644
--- a/common/buildcraft/builders/FillerFillStairs.java
+++ b/common/buildcraft/builders/FillerFillStairs.java
@@ -11,8 +11,10 @@ package buildcraft.builders;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import buildcraft.api.core.IBox;
-import buildcraft.core.DefaultProps;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class FillerFillStairs extends FillerPattern {
@@ -189,13 +191,9 @@ public class FillerFillStairs extends FillerPattern {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
- @Override
- public int getTextureIndex() {
- return 4 * 16 + 8;
+ @SideOnly(Side.CLIENT)
+ public Icon getTexture() {
+ return BuilderProxyClient.fillerStairsTexture;
}
@Override
diff --git a/common/buildcraft/builders/FillerFillWalls.java b/common/buildcraft/builders/FillerFillWalls.java
index bad8eb98..f057e14a 100644
--- a/common/buildcraft/builders/FillerFillWalls.java
+++ b/common/buildcraft/builders/FillerFillWalls.java
@@ -11,8 +11,10 @@ package buildcraft.builders;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import buildcraft.api.core.IBox;
-import buildcraft.core.DefaultProps;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class FillerFillWalls extends FillerPattern {
@@ -47,14 +49,10 @@ public class FillerFillWalls extends FillerPattern {
return true;
}
+ @SideOnly(Side.CLIENT)
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
- @Override
- public int getTextureIndex() {
- return 4 * 16 + 6;
+ public Icon getTexture() {
+ return BuilderProxyClient.fillerWallsTexture;
}
@Override
diff --git a/common/buildcraft/builders/FillerFlattener.java b/common/buildcraft/builders/FillerFlattener.java
index 26f0ca72..19725688 100644
--- a/common/buildcraft/builders/FillerFlattener.java
+++ b/common/buildcraft/builders/FillerFlattener.java
@@ -11,10 +11,12 @@ package buildcraft.builders;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import buildcraft.api.core.IBox;
-import buildcraft.core.DefaultProps;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.BlockUtil;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class FillerFlattener extends FillerPattern {
@@ -76,14 +78,10 @@ public class FillerFlattener extends FillerPattern {
return !empty(xMin, yMin, zMin, xMax, 64 * 4, zMax, tile.worldObj);
}
+ @SideOnly(Side.CLIENT)
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
- @Override
- public int getTextureIndex() {
- return 4 * 16 + 5;
+ public Icon getTexture() {
+ return BuilderProxyClient.fillerFlattenTexture;
}
@Override
diff --git a/common/buildcraft/builders/FillerPattern.java b/common/buildcraft/builders/FillerPattern.java
index ea8cd081..68b72660 100644
--- a/common/buildcraft/builders/FillerPattern.java
+++ b/common/buildcraft/builders/FillerPattern.java
@@ -11,12 +11,15 @@ package buildcraft.builders;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import net.minecraft.world.World;
import buildcraft.BuildCraftBuilders;
import buildcraft.api.core.IBox;
import buildcraft.api.filler.IFillerPattern;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.BlockUtil;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public abstract class FillerPattern implements IFillerPattern {
@@ -29,11 +32,9 @@ public abstract class FillerPattern implements IFillerPattern {
@Override
public abstract boolean iteratePattern(TileEntity tile, IBox box, ItemStack stackToPlace);
+ @SideOnly(Side.CLIENT)
@Override
- public abstract String getTextureFile();
-
- @Override
- public abstract int getTextureIndex();
+ public abstract Icon getTexture();
@Override
public void setId(int id) {
@@ -72,6 +73,7 @@ public abstract class FillerPattern implements IFillerPattern {
}
if (found && stackToPlace != null) {
+ BlockUtil.breakBlock(world, xSlot, ySlot, zSlot);
stackToPlace.getItem().onItemUse(stackToPlace, CoreProxy.proxy.getBuildCraftPlayer(world), world, xSlot, ySlot - 1, zSlot, 1, 0.0f, 0.0f, 0.0f);
}
@@ -110,7 +112,7 @@ public abstract class FillerPattern implements IFillerPattern {
if (lastX != Integer.MAX_VALUE) {
if (BuildCraftBuilders.fillerDestroy) {
- world.setBlockWithNotify(lastX, lastY, lastZ, 0);
+ world.setBlock(lastX, lastY, lastZ, 0);
} else {
BlockUtil.breakBlock(world, lastX, lastY, lastZ, 20);
}
diff --git a/common/buildcraft/builders/FillerRemover.java b/common/buildcraft/builders/FillerRemover.java
index 0a2c826a..226ab765 100644
--- a/common/buildcraft/builders/FillerRemover.java
+++ b/common/buildcraft/builders/FillerRemover.java
@@ -11,8 +11,10 @@ package buildcraft.builders;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import buildcraft.api.core.IBox;
-import buildcraft.core.DefaultProps;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class FillerRemover extends FillerPattern {
@@ -29,14 +31,10 @@ public class FillerRemover extends FillerPattern {
return !empty(xMin, yMin, zMin, xMax, yMax, zMax, tile.worldObj);
}
+ @SideOnly(Side.CLIENT)
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
- @Override
- public int getTextureIndex() {
- return 4 * 16 + 4;
+ public Icon getTexture() {
+ return BuilderProxyClient.fillerClearTexture;
}
@Override
diff --git a/common/buildcraft/builders/ItemBptBase.java b/common/buildcraft/builders/ItemBptBase.java
index fd1630aa..44509d71 100644
--- a/common/buildcraft/builders/ItemBptBase.java
+++ b/common/buildcraft/builders/ItemBptBase.java
@@ -14,6 +14,7 @@ import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
+import net.minecraft.util.Icon;
import net.minecraft.world.World;
import buildcraft.BuildCraftBuilders;
import buildcraft.core.CreativeTabBuildCraft;
@@ -27,13 +28,12 @@ public abstract class ItemBptBase extends ItemBuildCraft {
super(i);
maxStackSize = 1;
- iconIndex = 5 * 16 + 0;
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
}
@SuppressWarnings({ "all" })
// @Override (client only)
- public abstract int getIconFromDamage(int i);
+ public abstract Icon getIconFromDamage(int i);
@SuppressWarnings({ "all" })
// @Override (client only)
@@ -56,5 +56,4 @@ public abstract class ItemBptBase extends ItemBuildCraft {
@Override
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) {
}
-
}
diff --git a/common/buildcraft/builders/ItemBptBluePrint.java b/common/buildcraft/builders/ItemBptBluePrint.java
index f155d429..7c97379e 100644
--- a/common/buildcraft/builders/ItemBptBluePrint.java
+++ b/common/buildcraft/builders/ItemBptBluePrint.java
@@ -1,25 +1,41 @@
-/**
+/**
* Copyright (c) SpaceToad, 2011-2012
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.builders;
+import net.minecraft.client.renderer.texture.IconRegister;
+import net.minecraft.util.Icon;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
public class ItemBptBluePrint extends ItemBptBase {
+ private Icon cleanBlueprint;
+ private Icon usedBlueprint;
+
public ItemBptBluePrint(int i) {
super(i);
}
@Override
- public int getIconFromDamage(int i) {
+ public Icon getIconFromDamage(int i) {
if (i == 0)
- return 5 * 16 + 2;
+ return cleanBlueprint;
else
- return 5 * 16 + 3;
+ return usedBlueprint;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void updateIcons(IconRegister par1IconRegister)
+ {
+ cleanBlueprint = par1IconRegister.registerIcon("buildcraft:blueprint_clean");
+ usedBlueprint = par1IconRegister.registerIcon("buildcraft:blueprint_used");
}
}
diff --git a/common/buildcraft/builders/ItemBptTemplate.java b/common/buildcraft/builders/ItemBptTemplate.java
index 36ea77ce..a4741cc4 100644
--- a/common/buildcraft/builders/ItemBptTemplate.java
+++ b/common/buildcraft/builders/ItemBptTemplate.java
@@ -1,16 +1,29 @@
package buildcraft.builders;
-public class ItemBptTemplate extends ItemBptBase {
+import net.minecraft.client.renderer.texture.IconRegister;
+import net.minecraft.util.Icon;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+public class ItemBptTemplate extends ItemBptBase {
+ private Icon usedTemplate;
public ItemBptTemplate(int i) {
super(i);
}
@Override
- public int getIconFromDamage(int i) {
+ public Icon getIconFromDamage(int i) {
if (i == 0)
- return 5 * 16 + 0;
+ return iconIndex;
else
- return 5 * 16 + 1;
+ return usedTemplate;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void updateIcons(IconRegister par1IconRegister)
+ {
+ iconIndex = par1IconRegister.registerIcon("buildcraft:template_clean");
+ usedTemplate = par1IconRegister.registerIcon("buildcraft:template_used");
}
}
diff --git a/common/buildcraft/builders/TileBuilder.java b/common/buildcraft/builders/TileBuilder.java
index cebac08a..032cb771 100644
--- a/common/buildcraft/builders/TileBuilder.java
+++ b/common/buildcraft/builders/TileBuilder.java
@@ -197,7 +197,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
path = ((TilePathMarker) tile).getPath();
for (BlockIndex b : path) {
- worldObj.setBlockWithNotify(b.i, b.j, b.k, 0);
+ worldObj.setBlock(b.i, b.j, b.k, 0);
BuildCraftBuilders.pathMarkerBlock.dropBlockAsItem(worldObj, b.i, b.j, b.k, BuildCraftBuilders.pathMarkerBlock.blockID, 0);
}
@@ -561,7 +561,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
}
@Override
- public int powerRequest() {
+ public int powerRequest(ForgeDirection from) {
if ((bluePrintBuilder != null || currentPathIterator != null) && !done)
return powerProvider.getMaxEnergyReceived();
else
diff --git a/common/buildcraft/builders/TileFiller.java b/common/buildcraft/builders/TileFiller.java
index bbbdaeef..3ffb4000 100644
--- a/common/buildcraft/builders/TileFiller.java
+++ b/common/buildcraft/builders/TileFiller.java
@@ -356,7 +356,7 @@ public class TileFiller extends TileBuildCraft implements ISidedInventory, IPowe
}
@Override
- public int powerRequest() {
+ public int powerRequest(ForgeDirection from) {
if (isActive())
return powerProvider.getMaxEnergyReceived();
else
diff --git a/common/buildcraft/builders/TileMarker.java b/common/buildcraft/builders/TileMarker.java
index ce432fba..31933e14 100644
--- a/common/buildcraft/builders/TileMarker.java
+++ b/common/buildcraft/builders/TileMarker.java
@@ -404,13 +404,13 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
for (TileWrapper m : o.vect.clone()) {
if (m.isSet()) {
- worldObj.setBlockWithNotify(m.x, m.y, m.z, 0);
+ worldObj.setBlock(m.x, m.y, m.z, 0);
BuildCraftBuilders.markerBlock.dropBlockAsItem(worldObj, m.x, m.y, m.z, BuildCraftBuilders.markerBlock.blockID, 0);
}
}
- worldObj.setBlockWithNotify(o.vectO.x, o.vectO.y, o.vectO.z, 0);
+ worldObj.setBlock(o.vectO.x, o.vectO.y, o.vectO.z, 0);
BuildCraftBuilders.markerBlock.dropBlockAsItem(worldObj, o.vectO.x, o.vectO.y, o.vectO.z, BuildCraftBuilders.markerBlock.blockID, 0);
}
diff --git a/common/buildcraft/builders/gui/GuiBlueprintLibrary.java b/common/buildcraft/builders/gui/GuiBlueprintLibrary.java
index c40282c5..d6ab7c05 100644
--- a/common/buildcraft/builders/gui/GuiBlueprintLibrary.java
+++ b/common/buildcraft/builders/gui/GuiBlueprintLibrary.java
@@ -63,15 +63,15 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
prevPageButton = new GuiButton(0, j + 100, k + 23, 20, 20, "<");
nextPageButton = new GuiButton(1, j + 122, k + 23, 20, 20, ">");
- controlList.add(prevPageButton);
- controlList.add(nextPageButton);
+ buttonList.add(prevPageButton);
+ buttonList.add(nextPageButton);
// if (library.owner.equals(player.username)) {
deleteButton = new GuiButton(2, j + 100, k + 114, 25, 20, StringUtil.localize("gui.del"));
- controlList.add(deleteButton);
+ buttonList.add(deleteButton);
lockButton = new GuiButton(3, j + 127, k + 114, 40, 20, StringUtil.localize("gui.lock"));
- controlList.add(lockButton);
+ buttonList.add(lockButton);
if (library.locked) {
lockButton.displayString = StringUtil.localize("gui.unlock");
} else {
@@ -110,16 +110,9 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
- int i = 0;
- // if (library.owner.equals(player.username)) {
- i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/library_rw.png");
- // } else {
- // i = mc.renderEngine
- // .getTexture("/net/minecraft/src/buildcraft/builders/gui/library_r.png");
- // }
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ mc.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_GUI + "/library_rw.png");
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- mc.renderEngine.bindTexture(i);
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
diff --git a/common/buildcraft/builders/gui/GuiBuilder.java b/common/buildcraft/builders/gui/GuiBuilder.java
index 86ae53dd..bd84e21c 100644
--- a/common/buildcraft/builders/gui/GuiBuilder.java
+++ b/common/buildcraft/builders/gui/GuiBuilder.java
@@ -60,22 +60,19 @@ public class GuiBuilder extends GuiAdvancedInterface {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
- int i = 0;
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;
int realXSize = 0;
if (builder.isBuildingBlueprint()) {
- i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/builder_blueprint.png");
+ mc.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_GUI + "/builder_blueprint.png");
realXSize = 256;
} else {
- i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/builder.png");
+ mc.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_GUI + "/builder.png");
realXSize = 176;
}
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- mc.renderEngine.bindTexture(i);
-
drawTexturedModalRect(j, k, 0, 0, realXSize, ySize);
for (int s = 0; s < slots.length; ++s) {
diff --git a/common/buildcraft/builders/gui/GuiFiller.java b/common/buildcraft/builders/gui/GuiFiller.java
index 9427c435..8c34f81d 100644
--- a/common/buildcraft/builders/gui/GuiFiller.java
+++ b/common/buildcraft/builders/gui/GuiFiller.java
@@ -46,21 +46,14 @@ public class GuiFiller extends GuiBuildCraft {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
- int i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/filler.png");
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- mc.renderEngine.bindTexture(i);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ mc.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_GUI + "/filler.png");
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if (filler.currentPattern != null) {
- i = mc.renderEngine.getTexture(filler.currentPattern.getTextureFile());
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- mc.renderEngine.bindTexture(i);
-
- int textureI = filler.currentPattern.getTextureIndex() >> 4;
- int textureJ = filler.currentPattern.getTextureIndex() - textureI * 16;
-
- drawTexturedModalRect(guiLeft + patternSymbolX, guiTop + patternSymbolY, 16 * textureJ, 16 * textureI, 16, 16);
+ mc.renderEngine.bindTexture("/terrain.png");
+ drawTexturedModelRectFromIcon(guiLeft + patternSymbolX, guiTop + patternSymbolY, filler.currentPattern.getTexture(), 16, 16);
}
}
diff --git a/common/buildcraft/builders/gui/GuiTemplate.java b/common/buildcraft/builders/gui/GuiTemplate.java
index 51cfd97d..7d032538 100644
--- a/common/buildcraft/builders/gui/GuiTemplate.java
+++ b/common/buildcraft/builders/gui/GuiTemplate.java
@@ -54,9 +54,8 @@ public class GuiTemplate extends GuiBuildCraft {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
- int i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/template_gui.png");
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- mc.renderEngine.bindTexture(i);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ mc.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_GUI + "/template_gui.png");
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
diff --git a/common/buildcraft/core/BlockBuildCraft.java b/common/buildcraft/core/BlockBuildCraft.java
index b3d8e8e0..c0cb4705 100644
--- a/common/buildcraft/core/BlockBuildCraft.java
+++ b/common/buildcraft/core/BlockBuildCraft.java
@@ -24,9 +24,4 @@ public abstract class BlockBuildCraft extends BlockContainer {
super.breakBlock(world, x, y, z, par5, par6);
}
- @Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
}
diff --git a/common/buildcraft/core/BlockSpring.java b/common/buildcraft/core/BlockSpring.java
index f788e179..72bd0434 100644
--- a/common/buildcraft/core/BlockSpring.java
+++ b/common/buildcraft/core/BlockSpring.java
@@ -4,12 +4,15 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockSpring extends Block {
public BlockSpring(int id) {
- super(id, 17, Material.rock);
+ super(id, Material.rock);
setBlockUnbreakable();
setResistance(6000000.0F);
setStepSound(soundStoneFootstep);
@@ -22,17 +25,24 @@ public class BlockSpring extends Block {
public void updateTick(World world, int x, int y, int z, Random random) {
assertSpring(world, x, y, z);
}
-
+
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, int blockid) {
assertSpring(world, x, y, z);
}
-
+
private void assertSpring(World world, int x, int y, int z) {
-
+
if(!world.isAirBlock(x, y + 1, z))
return;
-
- world.setBlockWithNotify(x, y + 1, z, Block.waterStill.blockID);
+
+ world.setBlock(x, y + 1, z, Block.waterStill.blockID);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ blockIcon = par1IconRegister.registerIcon("water");
}
}
diff --git a/common/buildcraft/core/BuildCraftConfiguration.java b/common/buildcraft/core/BuildCraftConfiguration.java
index 2db5dfc6..af53ef39 100644
--- a/common/buildcraft/core/BuildCraftConfiguration.java
+++ b/common/buildcraft/core/BuildCraftConfiguration.java
@@ -22,18 +22,8 @@ public class BuildCraftConfiguration extends Configuration {
@Override
public void save() {
- Property versionProp = null;
-
- if (!categories.get(CATEGORY_GENERAL).containsKey("version")) {
- versionProp = new Property();
- versionProp.setName("version");
- categories.get(CATEGORY_GENERAL).put("version", versionProp);
- } else {
- versionProp = categories.get(CATEGORY_GENERAL).get("version");
- }
-
- versionProp.value = Version.VERSION;
-
+ Property versionProp = get(CATEGORY_GENERAL, "version", Version.VERSION);
+ versionProp.set(Version.VERSION);
super.save();
}
diff --git a/common/buildcraft/core/CommandBuildCraft.java b/common/buildcraft/core/CommandBuildCraft.java
index 9815cf13..b7102ca7 100644
--- a/common/buildcraft/core/CommandBuildCraft.java
+++ b/common/buildcraft/core/CommandBuildCraft.java
@@ -30,6 +30,7 @@ public class CommandBuildCraft extends CommandBase {
return true;
}
+ @SuppressWarnings("rawtypes")
@Override
public List getCommandAliases() {
return null;
diff --git a/common/buildcraft/core/CoreIconProvider.java b/common/buildcraft/core/CoreIconProvider.java
new file mode 100644
index 00000000..69de9650
--- /dev/null
+++ b/common/buildcraft/core/CoreIconProvider.java
@@ -0,0 +1,32 @@
+package buildcraft.core;
+
+import net.minecraft.client.renderer.texture.IconRegister;
+import net.minecraft.util.Icon;
+import buildcraft.api.core.IIconProvider;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class CoreIconProvider implements IIconProvider {
+
+ public static int ENERGY = 0;
+
+ public static int MAX = 1;
+
+ private Icon[] _icons;
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public Icon getIcon(int iconIndex) {
+ return _icons[iconIndex];
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister iconRegister) {
+ _icons = new Icon[MAX];
+
+ _icons[ENERGY] = iconRegister.registerIcon("buildcraft:icons/energy");
+
+ }
+
+}
diff --git a/common/buildcraft/core/CreativeTabBuildCraft.java b/common/buildcraft/core/CreativeTabBuildCraft.java
index dcb77115..d0e81c30 100644
--- a/common/buildcraft/core/CreativeTabBuildCraft.java
+++ b/common/buildcraft/core/CreativeTabBuildCraft.java
@@ -1,8 +1,8 @@
package buildcraft.core;
-import buildcraft.BuildCraftCore;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
+import buildcraft.BuildCraftCore;
public class CreativeTabBuildCraft extends CreativeTabs {
diff --git a/common/buildcraft/core/EntityBlock.java b/common/buildcraft/core/EntityBlock.java
index 9780cc09..2ca8871f 100644
--- a/common/buildcraft/core/EntityBlock.java
+++ b/common/buildcraft/core/EntityBlock.java
@@ -11,11 +11,15 @@ package buildcraft.core;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.Icon;
import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class EntityBlock extends Entity {
- public int texture = -1;
+ @SideOnly(Side.CLIENT)
+ public Icon texture = null;
public float shadowSize = 0;
public float rotationX = 0;
@@ -47,9 +51,9 @@ public class EntityBlock extends Entity {
this.motionZ = 0.0;
}
- public EntityBlock(World world, double i, double j, double k, double iSize, double jSize, double kSize, int textureID) {
+ public EntityBlock(World world, double i, double j, double k, double iSize, double jSize, double kSize, Icon texture) {
this(world, i, j, k, iSize, jSize, kSize);
- texture = textureID;
+ this.texture = texture;
}
@Override
diff --git a/common/buildcraft/core/EntityPassiveItem.java b/common/buildcraft/core/EntityPassiveItem.java
index a497fceb..e3854caf 100644
--- a/common/buildcraft/core/EntityPassiveItem.java
+++ b/common/buildcraft/core/EntityPassiveItem.java
@@ -22,7 +22,6 @@ import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import buildcraft.BuildCraftCore;
import buildcraft.api.core.Position;
-import buildcraft.api.core.SafeTimeTracker;
import buildcraft.api.transport.IPassiveItemContribution;
import buildcraft.api.transport.IPipedItem;
import buildcraft.core.proxy.CoreProxy;
@@ -38,12 +37,6 @@ public class EntityPassiveItem implements IPipedItem {
protected TileEntity container;
- @Deprecated
- protected SafeTimeTracker synchroTracker = new SafeTimeTracker();
-
- @Deprecated
- protected int deterministicRandomization = 0;
-
protected Position position;
protected int entityId;
@@ -181,50 +174,6 @@ public class EntityPassiveItem implements IPipedItem {
this.container = container;
}
- /*
- * (non-Javadoc)
- *
- * @see net.minecraft.src.buildcraft.api.IPipedItem#getSynchroTracker()
- */
- @Override
- @Deprecated
- public SafeTimeTracker getSynchroTracker() {
- return synchroTracker;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see net.minecraft.src.buildcraft.api.IPipedItem#setSynchroTracker(net.minecraft.src.buildcraft.api.SafeTimeTracker)
- */
- @Override
- @Deprecated
- public void setSynchroTracker(SafeTimeTracker synchroTracker) {
- this.synchroTracker = synchroTracker;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see net.minecraft.src.buildcraft.api.IPipedItem#getDeterministicRandomization()
- */
- @Override
- @Deprecated
- public int getDeterministicRandomization() {
- return deterministicRandomization;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see net.minecraft.src.buildcraft.api.IPipedItem#setDeterministicRandomization(int)
- */
- @Override
- @Deprecated
- public void setDeterministicRandomization(int deterministicRandomization) {
- this.deterministicRandomization = deterministicRandomization;
- }
-
/*
* (non-Javadoc)
*
diff --git a/common/buildcraft/core/EntityRobot.java b/common/buildcraft/core/EntityRobot.java
index 855e01c2..0d291710 100644
--- a/common/buildcraft/core/EntityRobot.java
+++ b/common/buildcraft/core/EntityRobot.java
@@ -13,8 +13,6 @@ import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
-import javax.management.RuntimeErrorException;
-
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
@@ -207,6 +205,7 @@ public class EntityRobot extends Entity implements IEntityAdditionalSpawnData {
if (a.slot != null) {
BptSlot target = a.slot;
+ //System.out.printf("RobotChanging %d %d %d %s\n",target.x, target.y, target.z, target.mode);
if (wait <= 0 && BlockUtil.canChangeBlock(worldObj, target.x, target.y, target.z)) {
if (!CoreProxy.proxy.isRenderWorld(worldObj)) {
@@ -214,13 +213,13 @@ public class EntityRobot extends Entity implements IEntityAdditionalSpawnData {
if (target.mode == Mode.ClearIfInvalid) {
if (!target.isValid(a.context)) {
- worldObj.setBlockAndMetadataWithNotify(target.x, target.y, target.z, 0, 0);
+ worldObj.setBlock(target.x, target.y, target.z, 0, 0,3);
}
} else if (target.stackToUse != null) {
- worldObj.setBlockWithNotify(target.x, target.y, target.z, 0);
- throw new RuntimeErrorException(null, "NOT IMPLEMENTED");
+ worldObj.setBlock(target.x, target.y, target.z, 0);
+ throw new RuntimeException("NOT IMPLEMENTED");
// target.stackToUse.getItem().onItemUse(target.stackToUse,
// CoreProxy.getBuildCraftPlayer(worldObj), worldObj, target.x, target.y - 1,
// target.z, 1);
diff --git a/common/buildcraft/core/ItemBlockBuildCraft.java b/common/buildcraft/core/ItemBlockBuildCraft.java
index 5d2383ab..f969c40f 100644
--- a/common/buildcraft/core/ItemBlockBuildCraft.java
+++ b/common/buildcraft/core/ItemBlockBuildCraft.java
@@ -20,7 +20,7 @@ public class ItemBlockBuildCraft extends ItemBlock {
@Override
public String getItemDisplayName(ItemStack itemstack) {
- return StringUtil.localize(getItemNameIS(itemstack));
+ return StringUtil.localize(getUnlocalizedName(itemstack));
}
}
diff --git a/common/buildcraft/core/ItemBuildCraft.java b/common/buildcraft/core/ItemBuildCraft.java
index 1723f057..04fc657e 100644
--- a/common/buildcraft/core/ItemBuildCraft.java
+++ b/common/buildcraft/core/ItemBuildCraft.java
@@ -9,20 +9,36 @@
package buildcraft.core;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import buildcraft.core.utils.StringUtil;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class ItemBuildCraft extends Item {
+ private String iconName;
public ItemBuildCraft(int i) {
super(i);
- setTextureFile(DefaultProps.TEXTURE_ITEMS);
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
}
@Override
public String getItemDisplayName(ItemStack itemstack) {
- return StringUtil.localize(getItemNameIS(itemstack));
+ return StringUtil.localize(getUnlocalizedName(itemstack));
}
+
+ @Override
+ public Item setUnlocalizedName(String par1Str) {
+ iconName = par1Str;
+ return super.setUnlocalizedName(par1Str);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void updateIcons(IconRegister par1IconRegister)
+ {
+ this.iconIndex = par1IconRegister.registerIcon("buildcraft:" + iconName);
+ }
}
diff --git a/common/buildcraft/core/ItemRedstoneChipset.java b/common/buildcraft/core/ItemRedstoneChipset.java
index 1fc02f47..90d58572 100644
--- a/common/buildcraft/core/ItemRedstoneChipset.java
+++ b/common/buildcraft/core/ItemRedstoneChipset.java
@@ -2,14 +2,18 @@ package buildcraft.core;
import java.util.List;
+import net.minecraft.client.renderer.texture.IconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.Icon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.ItemStack;
-
public class ItemRedstoneChipset extends ItemBuildCraft {
+ @SideOnly(Side.CLIENT)
+ private Icon[] icons;
+
public ItemRedstoneChipset(int i) {
super(i);
@@ -19,26 +23,16 @@ public class ItemRedstoneChipset extends ItemBuildCraft {
@SuppressWarnings({ "all" })
@Override
- public int getIconFromDamage(int i) {
- switch (i) {
- case 0:
- return 6 * 16 + 0;
- case 1:
- return 6 * 16 + 1;
- case 2:
- return 6 * 16 + 2;
- case 3:
- return 6 * 16 + 3;
- default:
- return 6 * 16 + 4;
- }
+ public Icon getIconFromDamage(int i) {
+ return i < icons.length ? icons[i] : null;
}
@Override
- public String getItemNameIS(ItemStack itemstack) {
- return (new StringBuilder()).append(super.getItemName()).append(".").append(itemstack.getItemDamage()).toString();
+ public String getUnlocalizedName(ItemStack itemstack) {
+ return (new StringBuilder()).append(super.getUnlocalizedName()).append(".").append(itemstack.getItemDamage()).toString();
}
+ @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
@@ -46,4 +40,16 @@ public class ItemRedstoneChipset extends ItemBuildCraft {
itemList.add(new ItemStack(this, 1, i));
}
}
+
+ private static String[] chipsetNames = { "redstone_red", "redstone_iron", "redstone_gold", "redstone_diamond", "redstone_pulsating" };
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void updateIcons(IconRegister par1IconRegister)
+ {
+ icons = new Icon[chipsetNames.length];
+ int i = 0;
+ for (String csName : chipsetNames) {
+ icons[i++] = par1IconRegister.registerIcon("buildcraft:"+csName+"_chipset");
+ }
+ }
}
diff --git a/common/buildcraft/core/SpringPopulate.java b/common/buildcraft/core/SpringPopulate.java
index 69f3f800..309692d3 100644
--- a/common/buildcraft/core/SpringPopulate.java
+++ b/common/buildcraft/core/SpringPopulate.java
@@ -9,20 +9,19 @@ package buildcraft.core;
import java.util.Random;
-import buildcraft.BuildCraftCore;
-
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
import net.minecraftforge.event.terraingen.TerrainGen;
+import buildcraft.BuildCraftCore;
public class SpringPopulate {
@ForgeSubscribe
public void populate(PopulateChunkEvent.Post event) {
-
+
boolean doGen = TerrainGen.populate(event.chunkProvider, event.world, event.rand, event.chunkX, event.chunkX, event.hasVillageGenerated, PopulateChunkEvent.Populate.EventType.CUSTOM);
if (!doGen) {
@@ -35,13 +34,13 @@ public class SpringPopulate {
doPopulate(event.world, event.rand, worldX, worldZ);
}
-
+
private void doPopulate(World world, Random random, int x, int z) {
// A spring will be generated every 40th chunk.
if(random.nextFloat() > 0.025f)
return;
-
+
// Do not generate water in the End or the Nether
BiomeGenBase biomegenbase = world.getWorldChunkManager().getBiomeGenAt(x, z);
if (biomegenbase.biomeID == BiomeGenBase.sky.biomeID || biomegenbase.biomeID == BiomeGenBase.hell.biomeID)
@@ -49,17 +48,17 @@ public class SpringPopulate {
int posX = x + random.nextInt(16);
int posZ = z + random.nextInt(16);
-
+
for(int i = 0; i < 5; i++) {
int candidate = world.getBlockId(posX, i, posZ);
if(candidate != Block.bedrock.blockID)
continue;
-
+
world.setBlock(posX, i + 1, posZ, BuildCraftCore.springBlock.blockID);
for(int j = i + 2; j < world.getActualHeight() - 10; j++) {
if(!boreToSurface(world, posX, j, posZ)) {
if(world.isAirBlock(posX, j, posZ))
- world.setBlockWithNotify(posX, j, posZ, Block.waterStill.blockID);
+ world.setBlock(posX, j, posZ, Block.waterStill.blockID);
break;
}
}
@@ -70,15 +69,15 @@ public class SpringPopulate {
private boolean boreToSurface(World world, int x, int y, int z) {
if(world.isAirBlock(x, y, z))
return false;
-
+
int existing = world.getBlockId(x, y, z);
if(existing != Block.stone.blockID
&& existing != Block.dirt.blockID
&& existing != Block.gravel.blockID
&& existing != Block.grass.blockID)
return false;
-
- world.setBlockWithNotify(x, y, z, Block.waterStill.blockID);
+
+ world.setBlock(x, y, z, Block.waterStill.blockID);
return true;
}
}
diff --git a/common/buildcraft/core/TileBuildCraft.java b/common/buildcraft/core/TileBuildCraft.java
index 41577c12..70457a24 100644
--- a/common/buildcraft/core/TileBuildCraft.java
+++ b/common/buildcraft/core/TileBuildCraft.java
@@ -12,6 +12,7 @@ package buildcraft.core;
import java.util.HashMap;
import java.util.Map;
+import net.minecraft.item.ItemStack;
import net.minecraft.network.packet.Packet;
import net.minecraft.tileentity.TileEntity;
import buildcraft.api.power.IPowerReceptor;
@@ -113,4 +114,15 @@ public abstract class TileBuildCraft extends TileEntity implements ISynchronized
}
+ public boolean isInvNameLocalized()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isStackValidForSlot(int i, ItemStack itemstack)
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
}
diff --git a/common/buildcraft/core/Version.java b/common/buildcraft/core/Version.java
index d1e439d3..b6110953 100644
--- a/common/buildcraft/core/Version.java
+++ b/common/buildcraft/core/Version.java
@@ -11,7 +11,7 @@ import buildcraft.BuildCraftCore;
import buildcraft.core.proxy.CoreProxy;
public class Version implements Runnable {
-
+
private static Version instance = new Version();
public enum EnumUpdateState {
@@ -46,12 +46,12 @@ public class Version implements Runnable {
Property property = BuildCraftCore.mainConfiguration.get("vars", "version.seen", VERSION);
property.comment = "indicates the last version the user has been informed about and will suppress further notices on it.";
- String seenVersion = property.value;
+ String seenVersion = property.getString();
if (recommendedVersion == null || recommendedVersion.equals(seenVersion))
return false;
- property.value = recommendedVersion;
+ property.set(recommendedVersion);
BuildCraftCore.mainConfiguration.save();
return true;
}
@@ -63,6 +63,8 @@ public class Version implements Runnable {
public static void versionCheck() {
try {
+ if ("0.0.0".equals(VERSION)) return;
+
String location = REMOTE_VERSION_FILE;
HttpURLConnection conn = null;
while (location != null && !location.isEmpty()) {
@@ -158,14 +160,14 @@ public class Version implements Runnable {
int count = 0;
currentVersion = null;
-
+
BuildCraftCore.bcLog.info("Beginning version check");
-
+
try {
while ((count < 3) && ((currentVersion == null) || (currentVersion == EnumUpdateState.CONNECTION_ERROR))) {
versionCheck();
count++;
-
+
if (currentVersion == EnumUpdateState.CONNECTION_ERROR) {
BuildCraftCore.bcLog.info("Version check attempt " + count + " failed, trying again in 10 seconds");
Thread.sleep(10000);
@@ -175,15 +177,15 @@ public class Version implements Runnable {
catch (InterruptedException e) {
e.printStackTrace();
}
-
+
if (currentVersion == EnumUpdateState.CONNECTION_ERROR) {
BuildCraftCore.bcLog.info("Version check failed");
}
-
+
}
-
+
public static void check() {
-
+
new Thread(instance).start();
}
diff --git a/common/buildcraft/core/blueprints/BptBlueprint.java b/common/buildcraft/core/blueprints/BptBlueprint.java
index 80f8fd69..ce08322b 100644
--- a/common/buildcraft/core/blueprints/BptBlueprint.java
+++ b/common/buildcraft/core/blueprints/BptBlueprint.java
@@ -358,7 +358,7 @@ public class BptBlueprint extends BptBase {
if (!"*".equals(sig.itemClassName) && !item.getClass().getSimpleName().equals(sig.itemClassName))
return false;
- if (!"*".equals(sig.itemName) && !item.getItemNameIS(new ItemStack(item)).equals(sig.itemName))
+ if (!"*".equals(sig.itemName) && !item.getUnlocalizedName(new ItemStack(item)).equals(sig.itemName))
return false;
return true;
diff --git a/common/buildcraft/core/blueprints/BptBuilderTemplate.java b/common/buildcraft/core/blueprints/BptBuilderTemplate.java
index a2b28244..c8c07ea5 100644
--- a/common/buildcraft/core/blueprints/BptBuilderTemplate.java
+++ b/common/buildcraft/core/blueprints/BptBuilderTemplate.java
@@ -123,7 +123,7 @@ public class BptBuilderTemplate extends BptBuilderBase {
BptSlot slot = list.getFirst();
// Note from CJ: I have no idea what this code is supposed to do, so I'm not touching it.
- if (BuildCraftAPI.softBlock(slot.blockId) == BuildCraftAPI.softBlock(world.getBlockId(slot.x, slot.y, slot.z))) {
+ if (slot.blockId == world.getBlockId(slot.x, slot.y, slot.z)) {
list.removeFirst();
} else if (slot.mode == Mode.ClearIfInvalid) {
result = slot;
diff --git a/common/buildcraft/core/gui/GuiAdvancedInterface.java b/common/buildcraft/core/gui/GuiAdvancedInterface.java
index d512b838..5f69c49a 100644
--- a/common/buildcraft/core/gui/GuiAdvancedInterface.java
+++ b/common/buildcraft/core/gui/GuiAdvancedInterface.java
@@ -4,6 +4,7 @@ import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
+import net.minecraft.util.Icon;
import org.lwjgl.opengl.GL11;
@@ -25,12 +26,8 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft {
return "";
}
- public String getTexture() {
- return "";
- }
-
- public int getTextureIndex() {
- return 0;
+ public Icon getTexture() {
+ return null;
}
public ItemStack getItemStack() {
@@ -47,14 +44,10 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft {
if (getItemStack() != null) {
drawStack(getItemStack());
- } else if (getTexture() != null && !getTexture().equals("")) {
- int texture = mc.renderEngine.getTexture(getTexture());
- mc.renderEngine.bindTexture(texture);
-
- int textureI = getTextureIndex() >> 4;
- int textureJ = getTextureIndex() - textureI * 16;
-
- drawTexturedModalRect(cornerX + x, cornerY + y, 16 * textureJ, 16 * textureI, 16, 16);
+ } else if (getTexture() != null) {
+ mc.renderEngine.bindTexture("/gui/items.png");
+ //System.out.printf("Drawing advanced sprite %s (%d,%d) at %d %d\n", getTexture().getIconName(), getTexture().getOriginX(),getTexture().getOriginY(),cornerX + x, cornerY + y);
+ drawTexturedModelRectFromIcon(cornerX + x, cornerY + y, getTexture(), 16, 16);
}
}
diff --git a/common/buildcraft/core/gui/GuiBuildCraft.java b/common/buildcraft/core/gui/GuiBuildCraft.java
index ee7f4190..c5403bc3 100644
--- a/common/buildcraft/core/gui/GuiBuildCraft.java
+++ b/common/buildcraft/core/gui/GuiBuildCraft.java
@@ -5,6 +5,7 @@ import java.util.ArrayList;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.inventory.IInventory;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import org.lwjgl.opengl.GL11;
@@ -34,7 +35,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
/**
* Inserts a ledger into the next-to-last position.
- *
+ *
* @param ledger
*/
public void insert(Ledger ledger) {
@@ -197,7 +198,6 @@ public abstract class GuiBuildCraft extends GuiContainer {
}
protected void drawBackground(int x, int y) {
- int texture = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/ledger.png");
float colorR = (overlayColor >> 16 & 255) / 255.0F;
float colorG = (overlayColor >> 8 & 255) / 255.0F;
@@ -205,7 +205,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
GL11.glColor4f(colorR, colorG, colorB, 1.0F);
- mc.renderEngine.bindTexture(texture);
+ mc.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_GUI + "/ledger.png");
drawTexturedModalRect(x, y, 0, 256 - currentHeight, 4, currentHeight);
drawTexturedModalRect(x + 4, y, 256 - currentWidth + 4, 0, currentWidth - 4, 4);
// Add in top left corner again
@@ -216,15 +216,10 @@ public abstract class GuiBuildCraft extends GuiContainer {
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0F);
}
- protected void drawIcon(String texture, int iconIndex, int x, int y) {
+ protected void drawIcon(Icon icon, int x, int y) {
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0F);
- int tex = mc.renderEngine.getTexture(texture);
- mc.renderEngine.bindTexture(tex);
- int textureRow = iconIndex >> 4;
- int textureColumn = iconIndex - 16 * textureRow;
- drawTexturedModalRect(x, y, 16 * textureColumn, 16 * textureRow, 16, 16);
-
+ drawTexturedModelRectFromIcon(x, y, icon, 16, 16);
}
}
diff --git a/common/buildcraft/core/proxy/CoreProxy.java b/common/buildcraft/core/proxy/CoreProxy.java
index f3dcbea4..558b62b4 100644
--- a/common/buildcraft/core/proxy/CoreProxy.java
+++ b/common/buildcraft/core/proxy/CoreProxy.java
@@ -71,6 +71,7 @@ public class CoreProxy {
}
/* WRAPPER */
+ @SuppressWarnings("rawtypes")
public void feedSubBlocks(int id, CreativeTabs tab, List itemList) {
}
@@ -98,9 +99,10 @@ public class CoreProxy {
/* REGISTRATION */
public void registerBlock(Block block) {
Item.itemsList[block.blockID] = null;
- Item.itemsList[block.blockID] = new ItemBlockBuildCraft(block.blockID - 256, block.getBlockName());
+ Item.itemsList[block.blockID] = new ItemBlockBuildCraft(block.blockID - 256, block.getUnlocalizedName());
}
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public void registerTileEntity(Class clas, String ident) {
GameRegistry.registerTileEntity(clas, ident);
}
@@ -109,6 +111,7 @@ public class CoreProxy {
stack.onCrafting(world, player, stack.stackSize);
}
+ @SuppressWarnings("unchecked")
public void addCraftingRecipe(ItemStack result, Object[] recipe) {
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(result, recipe));
//GameRegistry.addRecipe(result, recipe);
diff --git a/common/buildcraft/core/proxy/CoreProxyClient.java b/common/buildcraft/core/proxy/CoreProxyClient.java
index 832137a1..bdf36723 100644
--- a/common/buildcraft/core/proxy/CoreProxyClient.java
+++ b/common/buildcraft/core/proxy/CoreProxyClient.java
@@ -26,9 +26,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.StringTranslate;
import net.minecraft.world.World;
-import net.minecraftforge.client.MinecraftForgeClient;
import buildcraft.BuildCraftCore;
-import buildcraft.core.DefaultProps;
import buildcraft.core.EntityBlock;
import buildcraft.core.EntityEnergyLaser;
import buildcraft.core.EntityPowerLaser;
@@ -67,6 +65,7 @@ public class CoreProxyClient extends CoreProxy {
}
/* WRAPPER */
+ @SuppressWarnings("rawtypes")
public void feedSubBlocks(int id, CreativeTabs tab, List itemList) {
if (Block.blocksList[id] == null)
return;
@@ -115,9 +114,6 @@ public class CoreProxyClient extends CoreProxy {
RenderingRegistry.registerBlockHandler(BuildCraftCore.legacyPipeModel, new RenderingEntityBlocks());
RenderingRegistry.registerBlockHandler(new RenderingOil());
RenderingRegistry.registerBlockHandler(new RenderingMarkers());
-
- MinecraftForgeClient.preloadTexture(DefaultProps.TEXTURE_BLOCKS);
- MinecraftForgeClient.preloadTexture(DefaultProps.TEXTURE_ITEMS);
}
@Override
@@ -131,7 +127,7 @@ public class CoreProxyClient extends CoreProxy {
/* NETWORKING */
@Override
public void sendToServer(Packet packet) {
- FMLClientHandler.instance().getClient().getSendQueue().addToSendQueue(packet);
+ FMLClientHandler.instance().getClient().getNetHandler().addToSendQueue(packet);
}
/* FILE SYSTEM */
diff --git a/common/buildcraft/core/render/RenderEntityBlock.java b/common/buildcraft/core/render/RenderEntityBlock.java
index ddba60bb..be2f12da 100644
--- a/common/buildcraft/core/render/RenderEntityBlock.java
+++ b/common/buildcraft/core/render/RenderEntityBlock.java
@@ -10,20 +10,23 @@
package buildcraft.core.render;
import net.minecraft.block.Block;
+import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
+import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import net.minecraftforge.client.ForgeHooksClient;
import org.lwjgl.opengl.GL11;
-import buildcraft.core.DefaultProps;
import buildcraft.core.EntityBlock;
public class RenderEntityBlock extends Render {
+ private static RenderBlocks renderBlocks = new RenderBlocks();
+ static {
+ }
public static class BlockInterface {
public double minX;
@@ -35,10 +38,10 @@ public class RenderEntityBlock extends Render {
public Block baseBlock = Block.sand;
- public int texture = -1;
+ public Icon texture = null;
- public int getBlockTextureFromSide(int i) {
- if (texture == -1)
+ public Icon getBlockTextureFromSide(int i) {
+ if (texture == null)
return baseBlock.getBlockTextureFromSide(i);
else
return texture;
@@ -65,6 +68,7 @@ public class RenderEntityBlock extends Render {
World world = entity.worldObj;
BlockInterface util = new BlockInterface();
util.texture = entity.texture;
+ loadTexture("/terrain.png");
for (int iBase = 0; iBase < entity.iSize; ++iBase) {
for (int jBase = 0; jBase < entity.jSize; ++jBase) {
@@ -83,14 +87,12 @@ public class RenderEntityBlock extends Render {
util.maxZ = (remainZ > 1.0 ? 1.0 : remainZ);
GL11.glPushMatrix();
- GL11.glTranslatef((float) i + 0.5F, (float) j + 0.5F, (float) k + 0.5F);
+ GL11.glTranslatef((float) i, (float) j, (float) k);
GL11.glRotatef(entity.rotationX, 1, 0, 0);
GL11.glRotatef(entity.rotationY, 0, 1, 0);
GL11.glRotatef(entity.rotationZ, 0, 0, 1);
GL11.glTranslatef(iBase, jBase, kBase);
- ForgeHooksClient.bindTexture(DefaultProps.TEXTURE_BLOCKS, 0);
-
int lightX, lightY, lightZ;
lightX = (int) (Math.floor(entity.posX) + iBase);
@@ -113,6 +115,15 @@ public class RenderEntityBlock extends Render {
float f2 = 0.8F;
float f3 = 0.6F;
+ renderBlocks.renderMaxX = block.maxX;
+ renderBlocks.renderMinX = block.minX;
+ renderBlocks.renderMaxY = block.maxY;
+ renderBlocks.renderMinY = block.minY;
+ renderBlocks.renderMaxZ = block.maxZ;
+ renderBlocks.renderMinZ = block.minZ;
+ renderBlocks.enableAO = false;
+
+
Tessellator tessellator = Tessellator.instance;
if (doTessellating) {
@@ -130,7 +141,7 @@ public class RenderEntityBlock extends Render {
tessellator.setColorOpaque_F(f * f5, f * f5, f * f5);
}
- renderBottomFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(0));
+ renderBlocks.renderBottomFace(null, 0, 0, 0, block.getBlockTextureFromSide(0));
if (doLight) {
f5 = block.getBlockBrightness(blockAccess, i, j, k);
@@ -140,7 +151,7 @@ public class RenderEntityBlock extends Render {
tessellator.setColorOpaque_F(f1 * f5, f1 * f5, f1 * f5);
}
- renderTopFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(1));
+ renderBlocks.renderTopFace(null, 0, 0, 0, block.getBlockTextureFromSide(1));
if (doLight) {
f5 = block.getBlockBrightness(blockAccess, i, j, k);
@@ -150,7 +161,7 @@ public class RenderEntityBlock extends Render {
tessellator.setColorOpaque_F(f2 * f5, f2 * f5, f2 * f5);
}
- renderEastFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(2));
+ renderBlocks.renderEastFace(null, 0, 0, 0, block.getBlockTextureFromSide(2));
if (doLight) {
f5 = block.getBlockBrightness(blockAccess, i, j, k);
@@ -160,7 +171,7 @@ public class RenderEntityBlock extends Render {
tessellator.setColorOpaque_F(f2 * f5, f2 * f5, f2 * f5);
}
- renderWestFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(3));
+ renderBlocks.renderWestFace(null, 0, 0, 0, block.getBlockTextureFromSide(3));
if (doLight) {
f5 = block.getBlockBrightness(blockAccess, i, j, k);
@@ -170,7 +181,7 @@ public class RenderEntityBlock extends Render {
tessellator.setColorOpaque_F(f3 * f5, f3 * f5, f3 * f5);
}
- renderNorthFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(4));
+ renderBlocks.renderNorthFace(null, 0, 0, 0, block.getBlockTextureFromSide(4));
if (doLight) {
f5 = block.getBlockBrightness(blockAccess, i, j, k);
@@ -180,189 +191,10 @@ public class RenderEntityBlock extends Render {
tessellator.setColorOpaque_F(f3 * f5, f3 * f5, f3 * f5);
}
- renderSouthFace(block, -0.5D, -0.5D, -0.5D, block.getBlockTextureFromSide(5));
+ renderBlocks.renderSouthFace(null, 0, 0, 0, block.getBlockTextureFromSide(5));
if (doTessellating) {
tessellator.draw();
}
}
-
- public static void renderBottomFace(BlockInterface block, double d, double d1, double d2, int i) {
- Tessellator tessellator = Tessellator.instance;
-
- int j = (i & 0xf) << 4;
- int k = i & 0xf0;
- double d3 = (j + block.minX * 16D) / 256D;
- double d4 = ((j + block.maxX * 16D) - 0.01D) / 256D;
- double d5 = (k + block.minZ * 16D) / 256D;
- double d6 = ((k + block.maxZ * 16D) - 0.01D) / 256D;
- if (block.minX < 0.0D || block.maxX > 1.0D) {
- d3 = (j + 0.0F) / 256F;
- d4 = (j + 15.99F) / 256F;
- }
- if (block.minZ < 0.0D || block.maxZ > 1.0D) {
- d5 = (k + 0.0F) / 256F;
- d6 = (k + 15.99F) / 256F;
- }
- double d7 = d + block.minX;
- double d8 = d + block.maxX;
- double d9 = d1 + block.minY;
- double d10 = d2 + block.minZ;
- double d11 = d2 + block.maxZ;
-
- tessellator.addVertexWithUV(d7, d9, d11, d3, d6);
- tessellator.addVertexWithUV(d7, d9, d10, d3, d5);
- tessellator.addVertexWithUV(d8, d9, d10, d4, d5);
- tessellator.addVertexWithUV(d8, d9, d11, d4, d6);
- }
-
- public static void renderTopFace(BlockInterface block, double d, double d1, double d2, int i) {
- Tessellator tessellator = Tessellator.instance;
-
- int j = (i & 0xf) << 4;
- int k = i & 0xf0;
- double d3 = (j + block.minX * 16D) / 256D;
- double d4 = ((j + block.maxX * 16D) - 0.01D) / 256D;
- double d5 = (k + block.minZ * 16D) / 256D;
- double d6 = ((k + block.maxZ * 16D) - 0.01D) / 256D;
- if (block.minX < 0.0D || block.maxX > 1.0D) {
- d3 = (j + 0.0F) / 256F;
- d4 = (j + 15.99F) / 256F;
- }
- if (block.minZ < 0.0D || block.maxZ > 1.0D) {
- d5 = (k + 0.0F) / 256F;
- d6 = (k + 15.99F) / 256F;
- }
- double d7 = d + block.minX;
- double d8 = d + block.maxX;
- double d9 = d1 + block.maxY;
- double d10 = d2 + block.minZ;
- double d11 = d2 + block.maxZ;
-
- tessellator.addVertexWithUV(d8, d9, d11, d4, d6);
- tessellator.addVertexWithUV(d8, d9, d10, d4, d5);
- tessellator.addVertexWithUV(d7, d9, d10, d3, d5);
- tessellator.addVertexWithUV(d7, d9, d11, d3, d6);
- }
-
- public static void renderEastFace(BlockInterface block, double d, double d1, double d2, int i) {
- Tessellator tessellator = Tessellator.instance;
-
- int j = (i & 0xf) << 4;
- int k = i & 0xf0;
- double d3 = (j + block.minX * 16D) / 256D;
- double d4 = ((j + block.maxX * 16D) - 0.01D) / 256D;
- double d5 = (k + block.minY * 16D) / 256D;
- double d6 = ((k + block.maxY * 16D) - 0.01D) / 256D;
-
- if (block.minX < 0.0D || block.maxX > 1.0D) {
- d3 = (j + 0.0F) / 256F;
- d4 = (j + 15.99F) / 256F;
- }
- if (block.minY < 0.0D || block.maxY > 1.0D) {
- d5 = (k + 0.0F) / 256F;
- d6 = (k + 15.99F) / 256F;
- }
- double d8 = d + block.minX;
- double d9 = d + block.maxX;
- double d10 = d1 + block.minY;
- double d11 = d1 + block.maxY;
- double d12 = d2 + block.minZ;
-
- tessellator.addVertexWithUV(d8, d11, d12, d4, d5);
- tessellator.addVertexWithUV(d9, d11, d12, d3, d5);
- tessellator.addVertexWithUV(d9, d10, d12, d3, d6);
- tessellator.addVertexWithUV(d8, d10, d12, d4, d6);
- }
-
- public static void renderWestFace(BlockInterface block, double d, double d1, double d2, int i) {
- Tessellator tessellator = Tessellator.instance;
-
- int j = (i & 0xf) << 4;
- int k = i & 0xf0;
- double d3 = (j + block.minX * 16D) / 256D;
- double d4 = ((j + block.maxX * 16D) - 0.01D) / 256D;
- double d5 = (k + block.minY * 16D) / 256D;
- double d6 = ((k + block.maxY * 16D) - 0.01D) / 256D;
-
- if (block.minX < 0.0D || block.maxX > 1.0D) {
- d3 = (j + 0.0F) / 256F;
- d4 = (j + 15.99F) / 256F;
- }
- if (block.minY < 0.0D || block.maxY > 1.0D) {
- d5 = (k + 0.0F) / 256F;
- d6 = (k + 15.99F) / 256F;
- }
- double d8 = d + block.minX;
- double d9 = d + block.maxX;
- double d10 = d1 + block.minY;
- double d11 = d1 + block.maxY;
- double d12 = d2 + block.maxZ;
-
- tessellator.addVertexWithUV(d8, d11, d12, d3, d5);
- tessellator.addVertexWithUV(d8, d10, d12, d3, d6);
- tessellator.addVertexWithUV(d9, d10, d12, d4, d6);
- tessellator.addVertexWithUV(d9, d11, d12, d4, d5);
- }
-
- public static void renderNorthFace(BlockInterface block, double d, double d1, double d2, int i) {
- Tessellator tessellator = Tessellator.instance;
-
- int j = (i & 0xf) << 4;
- int k = i & 0xf0;
- double d3 = (j + block.minZ * 16D) / 256D;
- double d4 = ((j + block.maxZ * 16D) - 0.01D) / 256D;
- double d5 = (k + block.minY * 16D) / 256D;
- double d6 = ((k + block.maxY * 16D) - 0.01D) / 256D;
-
- if (block.minZ < 0.0D || block.maxZ > 1.0D) {
- d3 = (j + 0.0F) / 256F;
- d4 = (j + 15.99F) / 256F;
- }
- if (block.minY < 0.0D || block.maxY > 1.0D) {
- d5 = (k + 0.0F) / 256F;
- d6 = (k + 15.99F) / 256F;
- }
- double d8 = d + block.minX;
- double d9 = d1 + block.minY;
- double d10 = d1 + block.maxY;
- double d11 = d2 + block.minZ;
- double d12 = d2 + block.maxZ;
-
- tessellator.addVertexWithUV(d8, d10, d12, d4, d5);
- tessellator.addVertexWithUV(d8, d10, d11, d3, d5);
- tessellator.addVertexWithUV(d8, d9, d11, d3, d6);
- tessellator.addVertexWithUV(d8, d9, d12, d4, d6);
- }
-
- public static void renderSouthFace(BlockInterface block, double d, double d1, double d2, int i) {
- Tessellator tessellator = Tessellator.instance;
-
- int j = (i & 0xf) << 4;
- int k = i & 0xf0;
- double d3 = (j + block.minZ * 16D) / 256D;
- double d4 = ((j + block.maxZ * 16D) - 0.01D) / 256D;
- double d5 = (k + block.minY * 16D) / 256D;
- double d6 = ((k + block.maxY * 16D) - 0.01D) / 256D;
-
- if (block.minZ < 0.0D || block.maxZ > 1.0D) {
- d3 = (j + 0.0F) / 256F;
- d4 = (j + 15.99F) / 256F;
- }
- if (block.minY < 0.0D || block.maxY > 1.0D) {
- d5 = (k + 0.0F) / 256F;
- d6 = (k + 15.99F) / 256F;
- }
- double d8 = d + block.maxX;
- double d9 = d1 + block.minY;
- double d10 = d1 + block.maxY;
- double d11 = d2 + block.minZ;
- double d12 = d2 + block.maxZ;
-
- tessellator.addVertexWithUV(d8, d9, d12, d3, d6);
- tessellator.addVertexWithUV(d8, d9, d11, d4, d6);
- tessellator.addVertexWithUV(d8, d10, d11, d4, d5);
- tessellator.addVertexWithUV(d8, d10, d12, d3, d5);
- }
-
}
diff --git a/common/buildcraft/core/render/RenderLaser.java b/common/buildcraft/core/render/RenderLaser.java
index 22785691..82052715 100644
--- a/common/buildcraft/core/render/RenderLaser.java
+++ b/common/buildcraft/core/render/RenderLaser.java
@@ -4,7 +4,6 @@ import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
-import net.minecraftforge.client.ForgeHooksClient;
import org.lwjgl.opengl.GL11;
@@ -47,7 +46,7 @@ public class RenderLaser extends Render {
GL11.glRotatef((float) laser.angleZ, 0, 1, 0);
GL11.glRotatef((float) laser.angleY, 0, 0, 1);
- ForgeHooksClient.bindTexture(laser.getTexture(), 0);
+ renderManager.renderEngine.bindTexture(laser.getTexture());
float factor = (float) (1.0 / 16.0);
diff --git a/common/buildcraft/core/render/RenderRobot.java b/common/buildcraft/core/render/RenderRobot.java
index 8450d162..f2ea96c7 100644
--- a/common/buildcraft/core/render/RenderRobot.java
+++ b/common/buildcraft/core/render/RenderRobot.java
@@ -4,7 +4,6 @@ import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
-import net.minecraftforge.client.ForgeHooksClient;
import org.lwjgl.opengl.GL11;
@@ -36,7 +35,7 @@ public class RenderRobot extends Render {
GL11.glDisable(2896 /* GL_LIGHTING */);
GL11.glTranslated(x, y, z);
- ForgeHooksClient.bindTexture(DefaultProps.TEXTURE_PATH_ENTITIES + "/robot.png", 0);
+ renderManager.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_ENTITIES + "/robot.png");
float factor = (float) (1.0 / 16.0);
diff --git a/common/buildcraft/core/render/RenderingEntityBlocks.java b/common/buildcraft/core/render/RenderingEntityBlocks.java
index 943817d8..a44bf9d3 100644
--- a/common/buildcraft/core/render/RenderingEntityBlocks.java
+++ b/common/buildcraft/core/render/RenderingEntityBlocks.java
@@ -3,6 +3,7 @@ package buildcraft.core.render;
import java.util.HashMap;
import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.IBlockAccess;
@@ -96,7 +97,7 @@ public class RenderingEntityBlocks implements ISimpleBlockRenderingHandler {
// renderblocks.renderStandardBlock(block, i, j, k);
} else if (block.getRenderType() == BuildCraftCore.legacyPipeModel) {
-
+ Minecraft.getMinecraft().renderEngine.bindTexture("/terrain.png");
legacyPipeRender(renderer, world, x, y, z, block, modelId);
}
@@ -114,7 +115,7 @@ public class RenderingEntityBlocks implements ISimpleBlockRenderingHandler {
return BuildCraftCore.blockByEntityModel;
}
- /* LEGACY PIPE RENDERING */
+ /* LEGACY PIPE RENDERING and quarry frames! */
private void legacyPipeRender(RenderBlocks renderblocks, IBlockAccess iblockaccess, int i, int j, int k, Block block, int l) {
float minSize = Utils.pipeMinPos;
float maxSize = Utils.pipeMaxPos;
diff --git a/common/buildcraft/core/render/RenderingMarkers.java b/common/buildcraft/core/render/RenderingMarkers.java
index 9398013e..a1be4f77 100644
--- a/common/buildcraft/core/render/RenderingMarkers.java
+++ b/common/buildcraft/core/render/RenderingMarkers.java
@@ -3,6 +3,7 @@ package buildcraft.core.render;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import buildcraft.BuildCraftCore;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
@@ -116,105 +117,97 @@ public class RenderingMarkers implements ISimpleBlockRenderingHandler {
int yCoord = (int) y;
int zCoord = (int) z;
- int i = block.getBlockTexture(iblockaccess, xCoord, yCoord, zCoord, 1);
+ Icon i = block.getBlockTexture(iblockaccess, xCoord, yCoord, zCoord, 1);
int m = meta;
- int j = (i & 0xf) << 4;
- int k = i & 0xf0;
- float f = j / 256F;
- float f1 = (j + 15.99F) / 256F;
- float f2 = k / 256F;
- float f3 = (k + 15.99F) / 256F;
- double d5 = f + 0.02734375D;
- double d6 = f2 + 0.0234375D;
- double d7 = f + 0.02734375D;
- double d8 = f2 + 0.0234375D;
x += 0.5D;
z += 0.5D;
+
+ double minU = (double)i.getInterpolatedU(7);
+ double minV = (double)i.getInterpolatedV(7);
+ double maxU = (double)i.getInterpolatedU(9);
+ double maxV = (double)i.getInterpolatedV(9);
+
tessellator.setBrightness(block.getMixedBrightnessForBlock(iblockaccess, xCoord, yCoord, zCoord));
- double s = 0.0625D;
-
+ double s = 1F / 16F;
+
if (meta == 5) {
- tessellator.addVertexWithUV(x - s, y + 0.5 + s, z - s, d5, d6);
- tessellator.addVertexWithUV(x - s, y + 0.5 + s, z + s, d5, d8);
- tessellator.addVertexWithUV(x + s, y + 0.5 + s, z + s, d7, d8);
- tessellator.addVertexWithUV(x + s, y + 0.5 + s, z - s, d7, d6);
+ tessellator.addVertexWithUV(x - s, y + 0.5 + s, z - s, minU, minV);
+ tessellator.addVertexWithUV(x - s, y + 0.5 + s, z + s, minU, maxV);
+ tessellator.addVertexWithUV(x + s, y + 0.5 + s, z + s, maxU, maxV);
+ tessellator.addVertexWithUV(x + s, y + 0.5 + s, z - s, maxU, minV);
} else if (meta == 0) {
- tessellator.addVertexWithUV(x + s, y + 0.5 - s, z - s, d7, d6);
- tessellator.addVertexWithUV(x + s, y + 0.5 - s, z + s, d7, d8);
- tessellator.addVertexWithUV(x - s, y + 0.5 - s, z + s, d5, d8);
- tessellator.addVertexWithUV(x - s, y + 0.5 - s, z - s, d5, d6);
+ tessellator.addVertexWithUV(x + s, y + 0.5 - s, z - s, maxU, minV);
+ tessellator.addVertexWithUV(x + s, y + 0.5 - s, z + s, maxU, maxV);
+ tessellator.addVertexWithUV(x - s, y + 0.5 - s, z + s, minU, maxV);
+ tessellator.addVertexWithUV(x - s, y + 0.5 - s, z - s, minU, minV);
} else if (meta == 2) {
- tessellator.addVertexWithUV(x - s, y + 0.5 - s, z - s, d5, d6);
- tessellator.addVertexWithUV(x - s, y + 0.5 - s, z + s, d5, d8);
- tessellator.addVertexWithUV(x - s, y + 0.5 + s, z + s, d7, d8);
- tessellator.addVertexWithUV(x - s, y + 0.5 + s, z - s, d7, d6);
+ tessellator.addVertexWithUV(x - s, y + 0.5 - s, z - s, minU, minV);
+ tessellator.addVertexWithUV(x - s, y + 0.5 - s, z + s, minU, maxV);
+ tessellator.addVertexWithUV(x - s, y + 0.5 + s, z + s, maxU, maxV);
+ tessellator.addVertexWithUV(x - s, y + 0.5 + s, z - s, maxU, minV);
} else if (meta == 1) {
- tessellator.addVertexWithUV(x + s, y + 0.5 + s, z - s, d7, d6);
- tessellator.addVertexWithUV(x + s, y + 0.5 + s, z + s, d7, d8);
- tessellator.addVertexWithUV(x + s, y + 0.5 - s, z + s, d5, d8);
- tessellator.addVertexWithUV(x + s, y + 0.5 - s, z - s, d5, d6);
+ tessellator.addVertexWithUV(x + s, y + 0.5 + s, z - s, maxU, minV);
+ tessellator.addVertexWithUV(x + s, y + 0.5 + s, z + s, maxU, maxV);
+ tessellator.addVertexWithUV(x + s, y + 0.5 - s, z + s, minU, maxV);
+ tessellator.addVertexWithUV(x + s, y + 0.5 - s, z - s, minU, minV);
} else if (meta == 3) {
- tessellator.addVertexWithUV(x - s, y + 0.5 - s, z + s, d5, d6);
- tessellator.addVertexWithUV(x + s, y + 0.5 - s, z + s, d5, d8);
- tessellator.addVertexWithUV(x + s, y + 0.5 + s, z + s, d7, d8);
- tessellator.addVertexWithUV(x - s, y + 0.5 + s, z + s, d7, d6);
+ tessellator.addVertexWithUV(x - s, y + 0.5 - s, z + s, minU, minV);
+ tessellator.addVertexWithUV(x + s, y + 0.5 - s, z + s, minU, maxV);
+ tessellator.addVertexWithUV(x + s, y + 0.5 + s, z + s, maxU, maxV);
+ tessellator.addVertexWithUV(x - s, y + 0.5 + s, z + s, maxU, minV);
} else if (meta == 4) {
- tessellator.addVertexWithUV(x - s, y + 0.5 + s, z - s, d7, d6);
- tessellator.addVertexWithUV(x + s, y + 0.5 + s, z - s, d7, d8);
- tessellator.addVertexWithUV(x + s, y + 0.5 - s, z - s, d5, d8);
- tessellator.addVertexWithUV(x - s, y + 0.5 - s, z - s, d5, d6);
+ tessellator.addVertexWithUV(x - s, y + 0.5 + s, z - s, maxU, minV);
+ tessellator.addVertexWithUV(x + s, y + 0.5 + s, z - s, maxU, maxV);
+ tessellator.addVertexWithUV(x + s, y + 0.5 - s, z - s, minU, maxV);
+ tessellator.addVertexWithUV(x - s, y + 0.5 - s, z - s, minU, minV);
}
-
+
i = block.getBlockTexture(iblockaccess, xCoord, yCoord, zCoord, 0);
- j = (i & 0xf) << 4;
- k = i & 0xf0;
- f = j / 256F;
- f1 = (j + 15.99F) / 256F;
- f2 = k / 256F;
- f3 = (k + 15.99F) / 256F;
- d5 = f + 0.02734375D;
- d6 = f2 + 0.0234375D;
- d7 = f + 0.02734375D;
- d8 = f2 + 0.0234375D;
+
+
+ minU = i.getMinU();
+ maxU = i.getMaxU();
+ minV = i.getMinV();
+ maxV = i.getMaxV();
if (meta == 5 || meta == 4 || meta == 3 || meta == 0) {
- tessellator.addVertexWithUV(x + frontX[m][0][0], y + frontX[m][1][0], z + frontX[m][2][0], f, f2);
- tessellator.addVertexWithUV(x + frontX[m][0][1], y + frontX[m][1][1], z + frontX[m][2][1], f, f3);
- tessellator.addVertexWithUV(x + frontX[m][0][2], y + frontX[m][1][2], z + frontX[m][2][2], f1, f3);
- tessellator.addVertexWithUV(x + frontX[m][0][3], y + frontX[m][1][3], z + frontX[m][2][3], f1, f2);
+ tessellator.addVertexWithUV(x + frontX[m][0][0], y + frontX[m][1][0], z + frontX[m][2][0], minU, minV);
+ tessellator.addVertexWithUV(x + frontX[m][0][1], y + frontX[m][1][1], z + frontX[m][2][1], minU, maxV);
+ tessellator.addVertexWithUV(x + frontX[m][0][2], y + frontX[m][1][2], z + frontX[m][2][2], maxU, maxV);
+ tessellator.addVertexWithUV(x + frontX[m][0][3], y + frontX[m][1][3], z + frontX[m][2][3], maxU, minV);
- tessellator.addVertexWithUV(x - frontX[m][0][3], y + frontX[m][1][3], z + frontX[m][2][3], f1, f2);
- tessellator.addVertexWithUV(x - frontX[m][0][2], y + frontX[m][1][2], z + frontX[m][2][2], f1, f3);
- tessellator.addVertexWithUV(x - frontX[m][0][1], y + frontX[m][1][1], z + frontX[m][2][1], f, f3);
- tessellator.addVertexWithUV(x - frontX[m][0][0], y + frontX[m][1][0], z + frontX[m][2][0], f, f2);
+ tessellator.addVertexWithUV(x - frontX[m][0][3], y + frontX[m][1][3], z + frontX[m][2][3], maxU, minV);
+ tessellator.addVertexWithUV(x - frontX[m][0][2], y + frontX[m][1][2], z + frontX[m][2][2], maxU, maxV);
+ tessellator.addVertexWithUV(x - frontX[m][0][1], y + frontX[m][1][1], z + frontX[m][2][1], minU, maxV);
+ tessellator.addVertexWithUV(x - frontX[m][0][0], y + frontX[m][1][0], z + frontX[m][2][0], minU, minV);
}
if (meta == 5 || meta == 2 || meta == 1 || meta == 0) {
- tessellator.addVertexWithUV(x + frontZ[m][0][0], y + frontZ[m][1][0], z + frontZ[m][2][0], f, f2);
- tessellator.addVertexWithUV(x + frontZ[m][0][1], y + frontZ[m][1][1], z + frontZ[m][2][1], f, f3);
- tessellator.addVertexWithUV(x + frontZ[m][0][2], y + frontZ[m][1][2], z + frontZ[m][2][2], f1, f3);
- tessellator.addVertexWithUV(x + frontZ[m][0][3], y + frontZ[m][1][3], z + frontZ[m][2][3], f1, f2);
+ tessellator.addVertexWithUV(x + frontZ[m][0][0], y + frontZ[m][1][0], z + frontZ[m][2][0], minU, minV);
+ tessellator.addVertexWithUV(x + frontZ[m][0][1], y + frontZ[m][1][1], z + frontZ[m][2][1], minU, maxV);
+ tessellator.addVertexWithUV(x + frontZ[m][0][2], y + frontZ[m][1][2], z + frontZ[m][2][2], maxU, maxV);
+ tessellator.addVertexWithUV(x + frontZ[m][0][3], y + frontZ[m][1][3], z + frontZ[m][2][3], maxU, minV);
- tessellator.addVertexWithUV(x + frontZ[m][0][3], y + frontZ[m][1][3], z - frontZ[m][2][3], f1, f2);
- tessellator.addVertexWithUV(x + frontZ[m][0][2], y + frontZ[m][1][2], z - frontZ[m][2][2], f1, f3);
- tessellator.addVertexWithUV(x + frontZ[m][0][1], y + frontZ[m][1][1], z - frontZ[m][2][1], f, f3);
- tessellator.addVertexWithUV(x + frontZ[m][0][0], y + frontZ[m][1][0], z - frontZ[m][2][0], f, f2);
+ tessellator.addVertexWithUV(x + frontZ[m][0][3], y + frontZ[m][1][3], z - frontZ[m][2][3], maxU, minV);
+ tessellator.addVertexWithUV(x + frontZ[m][0][2], y + frontZ[m][1][2], z - frontZ[m][2][2], maxU, maxV);
+ tessellator.addVertexWithUV(x + frontZ[m][0][1], y + frontZ[m][1][1], z - frontZ[m][2][1], minU, maxV);
+ tessellator.addVertexWithUV(x + frontZ[m][0][0], y + frontZ[m][1][0], z - frontZ[m][2][0], minU, minV);
}
if (meta == 4 || meta == 3 || meta == 2 || meta == 1) {
- tessellator.addVertexWithUV(x + frontY[m][0][0], y + 0.5 + frontY[m][1][0], z + frontY[m][2][0], f, f2);
- tessellator.addVertexWithUV(x + frontY[m][0][1], y + 0.5 + frontY[m][1][1], z + frontY[m][2][1], f, f3);
- tessellator.addVertexWithUV(x + frontY[m][0][2], y + 0.5 + frontY[m][1][2], z + frontY[m][2][2], f1, f3);
- tessellator.addVertexWithUV(x + frontY[m][0][3], y + 0.5 + frontY[m][1][3], z + frontY[m][2][3], f1, f2);
+ tessellator.addVertexWithUV(x + frontY[m][0][0], y + 0.5 + frontY[m][1][0], z + frontY[m][2][0], minU, minV);
+ tessellator.addVertexWithUV(x + frontY[m][0][1], y + 0.5 + frontY[m][1][1], z + frontY[m][2][1], minU, maxV);
+ tessellator.addVertexWithUV(x + frontY[m][0][2], y + 0.5 + frontY[m][1][2], z + frontY[m][2][2], maxU, maxV);
+ tessellator.addVertexWithUV(x + frontY[m][0][3], y + 0.5 + frontY[m][1][3], z + frontY[m][2][3], maxU, minV);
- tessellator.addVertexWithUV(x + frontY[m][0][3], y + 0.5 - frontY[m][1][3], z + frontY[m][2][3], f1, f2);
- tessellator.addVertexWithUV(x + frontY[m][0][2], y + 0.5 - frontY[m][1][2], z + frontY[m][2][2], f1, f3);
- tessellator.addVertexWithUV(x + frontY[m][0][1], y + 0.5 - frontY[m][1][1], z + frontY[m][2][1], f, f3);
- tessellator.addVertexWithUV(x + frontY[m][0][0], y + 0.5 - frontY[m][1][0], z + frontY[m][2][0], f, f2);
+ tessellator.addVertexWithUV(x + frontY[m][0][3], y + 0.5 - frontY[m][1][3], z + frontY[m][2][3], maxU, minV);
+ tessellator.addVertexWithUV(x + frontY[m][0][2], y + 0.5 - frontY[m][1][2], z + frontY[m][2][2], maxU, maxV);
+ tessellator.addVertexWithUV(x + frontY[m][0][1], y + 0.5 - frontY[m][1][1], z + frontY[m][2][1], minU, maxV);
+ tessellator.addVertexWithUV(x + frontY[m][0][0], y + 0.5 - frontY[m][1][0], z + frontY[m][2][0], minU, minV);
}
}
diff --git a/common/buildcraft/core/render/TextureLiquidsFX.java b/common/buildcraft/core/render/TextureLiquidsFX.java
deleted file mode 100644
index 9bab2ded..00000000
--- a/common/buildcraft/core/render/TextureLiquidsFX.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/**
- * Copyright (c) SpaceToad, 2011
- * http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
- * License 1.0, or MMPL. Please check the contents of the license located in
- * http://www.mod-buildcraft.com/MMPL-1.0.txt
- */
-
-package buildcraft.core.render;
-
-import net.minecraft.client.renderer.RenderEngine;
-import net.minecraftforge.client.ForgeHooksClient;
-import cpw.mods.fml.client.FMLTextureFX;
-
-public class TextureLiquidsFX extends FMLTextureFX {
-
- private final int redMin, redMax, greenMin, greenMax, blueMin, blueMax;
- private final String texture;
-
- public TextureLiquidsFX(int redMin, int redMax, int greenMin, int greenMax, int blueMin, int blueMax, int spriteIndex, String texture) {
- super(spriteIndex);
-
- this.redMin = redMin;
- this.redMax = redMax;
- this.greenMin = greenMin;
- this.greenMax = greenMax;
- this.blueMin = blueMin;
- this.blueMax = blueMax;
- this.texture = texture;
- setup();
- }
-
- @Override
- public void setup() {
- super.setup();
-
- red = new float[tileSizeSquare];
- green = new float[tileSizeSquare];
- blue = new float[tileSizeSquare];
- alpha = new float[tileSizeSquare];
- }
-
- @Override
- public void bindImage(RenderEngine renderengine) {
- ForgeHooksClient.bindTexture(texture, 0);
- }
-
- @Override
- public void onTick() {
-
- for (int i = 0; i < tileSizeBase; ++i) {
- for (int j = 0; j < tileSizeBase; ++j) {
- float var3 = 0.0F;
-
- for (int k = i - 1; k <= i + 1; ++k) {
- int r = k & tileSizeMask;
- int g = j & tileSizeMask;
- var3 += this.red[r + g * tileSizeBase];
- }
-
- this.green[i + j * tileSizeBase] = var3 / 3.3F + this.blue[i + j * tileSizeBase] * 0.8F;
- }
- }
-
- for (int i = 0; i < tileSizeBase; ++i) {
- for (int j = 0; j < tileSizeBase; ++j) {
- this.blue[i + j * tileSizeBase] += this.alpha[i + j * tileSizeBase] * 0.05F;
-
- if (this.blue[i + j * tileSizeBase] < 0.0F) {
- this.blue[i + j * tileSizeBase] = 0.0F;
- }
-
- this.alpha[i + j * tileSizeBase] -= 0.1F;
-
- if (Math.random() < 0.05D) {
- this.alpha[i + j * tileSizeBase] = 0.5F;
- }
- }
- }
-
- float af[] = green;
- green = red;
- red = af;
- for (int i1 = 0; i1 < tileSizeSquare; i1++) {
- float f1 = red[i1];
- if (f1 > 1.0F) {
- f1 = 1.0F;
- }
- if (f1 < 0.0F) {
- f1 = 0.0F;
- }
- float f2 = f1 * f1;
- int r = (int) (redMin + f2 * (redMax - redMin));
- int g = (int) (greenMin + f2 * (greenMax - greenMin));
- int b = (int) (blueMin + f2 * (blueMax - blueMin));
- if (anaglyphEnabled) {
- int i3 = (r * 30 + g * 59 + b * 11) / 100;
- int j3 = (r * 30 + g * 70) / 100;
- int k3 = (r * 30 + b * 70) / 100;
- r = i3;
- g = j3;
- b = k3;
- }
-
- imageData[i1 * 4 + 0] = (byte) r;
- imageData[i1 * 4 + 1] = (byte) g;
- imageData[i1 * 4 + 2] = (byte) b;
- imageData[i1 * 4 + 3] = (byte) 255;
- }
-
- }
-
- protected float red[];
- protected float green[];
- protected float blue[];
- protected float alpha[];
-}
diff --git a/common/buildcraft/core/triggers/ActionMachineControl.java b/common/buildcraft/core/triggers/ActionMachineControl.java
index 811a6307..a8ba5bc0 100644
--- a/common/buildcraft/core/triggers/ActionMachineControl.java
+++ b/common/buildcraft/core/triggers/ActionMachineControl.java
@@ -1,9 +1,10 @@
package buildcraft.core.triggers;
-import buildcraft.api.gates.Action;
-import buildcraft.core.DefaultProps;
+import net.minecraft.util.Icon;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class ActionMachineControl extends Action {
+public class ActionMachineControl extends BCAction {
public enum Mode {
Unknown, On, Off, Loop
@@ -17,20 +18,6 @@ public class ActionMachineControl extends Action {
this.mode = mode;
}
- @Override
- public int getIndexInTexture() {
- switch (mode) {
- case On:
- return 4 * 16 + 2;
- case Off:
- return 4 * 16 + 3;
- case Loop:
- return 4 * 16 + 4;
- default:
- return 0;
- }
- }
-
@Override
public String getDescription() {
switch (mode) {
@@ -46,8 +33,18 @@ public class ActionMachineControl extends Action {
}
@Override
- public String getTexture() {
- return DefaultProps.TEXTURE_TRIGGERS;
+ @SideOnly(Side.CLIENT)
+ public Icon getTexture() {
+ switch (mode) {
+ case On:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Action_MachineControl_On);
+ case Off:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Action_MachineControl_Off);
+ case Loop:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Action_MachineControl_Loop);
+ default:
+ return null;
+ }
}
}
diff --git a/common/buildcraft/core/triggers/ActionRedstoneOutput.java b/common/buildcraft/core/triggers/ActionRedstoneOutput.java
index c504d9b8..93364bf4 100644
--- a/common/buildcraft/core/triggers/ActionRedstoneOutput.java
+++ b/common/buildcraft/core/triggers/ActionRedstoneOutput.java
@@ -9,27 +9,24 @@
package buildcraft.core.triggers;
-import buildcraft.api.gates.Action;
-import buildcraft.core.DefaultProps;
+import net.minecraft.util.Icon;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class ActionRedstoneOutput extends Action {
+public class ActionRedstoneOutput extends BCAction {
public ActionRedstoneOutput(int id) {
super(id);
}
- @Override
- public int getIndexInTexture() {
- return 0 * 16 + 0;
- }
-
@Override
public String getDescription() {
return "Redstone Signal";
}
@Override
- public String getTexture() {
- return DefaultProps.TEXTURE_TRIGGERS;
+ @SideOnly(Side.CLIENT)
+ public Icon getTexture() {
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_RedstoneInput_Active);
}
}
diff --git a/common/buildcraft/core/triggers/ActionTriggerIconProvider.java b/common/buildcraft/core/triggers/ActionTriggerIconProvider.java
new file mode 100644
index 00000000..f3d242f1
--- /dev/null
+++ b/common/buildcraft/core/triggers/ActionTriggerIconProvider.java
@@ -0,0 +1,95 @@
+package buildcraft.core.triggers;
+
+import net.minecraft.client.renderer.texture.IconRegister;
+import net.minecraft.util.Icon;
+import buildcraft.api.core.IIconProvider;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class ActionTriggerIconProvider implements IIconProvider {
+
+ public static final int Action_MachineControl_On = 0;
+ public static final int Action_MachineControl_Off = 1;
+ public static final int Action_MachineControl_Loop = 2;
+
+ public static final int Trigger_EngineHeat_Blue = 3;
+ public static final int Trigger_EngineHeat_Green = 4;
+ public static final int Trigger_EngineHeat_Yellow = 5;
+ public static final int Trigger_EngineHeat_Red = 6;
+ public static final int Trigger_Inventory_Empty = 7;
+ public static final int Trigger_Inventory_Contains = 8;
+ public static final int Trigger_Inventory_Space = 9;
+ public static final int Trigger_Inventory_Full = 10;
+ public static final int Trigger_LiquidContainer_Empty = 11;
+ public static final int Trigger_LiquidContainer_Contains = 12;
+ public static final int Trigger_LiquidContainer_Space = 13;
+ public static final int Trigger_LiquidContainer_Full = 14;
+ public static final int Trigger_Machine_Active = 15;
+ public static final int Trigger_Machine_Inactive = 16;
+ public static final int Trigger_PipeContents_Empty = 17;
+ public static final int Trigger_PipeContents_ContainsItems = 18;
+ public static final int Trigger_PipeContents_ContainsLiquid = 19;
+ public static final int Trigger_PipeContents_ContainsEnergy = 20;
+ public static final int Trigger_PipeSignal_Red_Active = 21;
+ public static final int Trigger_PipeSignal_Blue_Active = 22;
+ public static final int Trigger_PipeSignal_Green_Active = 23;
+ public static final int Trigger_PipeSignal_Yellow_Active = 24;
+ public static final int Trigger_PipeSignal_Red_Inactive = 25;
+ public static final int Trigger_PipeSignal_Blue_Inactive = 26;
+ public static final int Trigger_PipeSignal_Green_Inactive = 27;
+ public static final int Trigger_PipeSignal_Yellow_Inactive = 28;
+ public static final int Trigger_RedstoneInput_Active = 29;
+ public static final int Trigger_RedstoneInput_Inactive = 30;
+
+ public static final int MAX = 31;
+
+
+ @SideOnly(Side.CLIENT)
+ private Icon[] icons;
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public Icon getIcon(int iconIndex) {
+ return icons[iconIndex];
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister iconRegister) {
+ icons = new Icon[MAX];
+
+ icons[ActionTriggerIconProvider.Action_MachineControl_On] = iconRegister.registerIcon("buildcraft:triggers/action_machinecontrol_on");
+ icons[ActionTriggerIconProvider.Action_MachineControl_Off] = iconRegister.registerIcon("buildcraft:triggers/action_machinecontrol_off");
+ icons[ActionTriggerIconProvider.Action_MachineControl_Loop] = iconRegister.registerIcon("buildcraft:triggers/action_machinecontrol_loop");
+
+ icons[ActionTriggerIconProvider.Trigger_EngineHeat_Blue] = iconRegister.registerIcon("buildcraft:triggers/trigger_engineheat_blue");
+ icons[ActionTriggerIconProvider.Trigger_EngineHeat_Green] = iconRegister.registerIcon("buildcraft:triggers/trigger_engineheat_green");
+ icons[ActionTriggerIconProvider.Trigger_EngineHeat_Yellow] = iconRegister.registerIcon("buildcraft:triggers/trigger_engineheat_yellow");
+ icons[ActionTriggerIconProvider.Trigger_EngineHeat_Red] = iconRegister.registerIcon("buildcraft:triggers/trigger_engineheat_red");
+ icons[ActionTriggerIconProvider.Trigger_Inventory_Empty] = iconRegister.registerIcon("buildcraft:triggers/trigger_inventory_empty");
+ icons[ActionTriggerIconProvider.Trigger_Inventory_Contains] = iconRegister.registerIcon("buildcraft:triggers/trigger_inventory_contains");
+ icons[ActionTriggerIconProvider.Trigger_Inventory_Space] = iconRegister.registerIcon("buildcraft:triggers/trigger_inventory_space");
+ icons[ActionTriggerIconProvider.Trigger_Inventory_Full] = iconRegister.registerIcon("buildcraft:triggers/trigger_inventory_full");
+ icons[ActionTriggerIconProvider.Trigger_LiquidContainer_Empty] = iconRegister.registerIcon("buildcraft:triggers/trigger_liquidcontainer_empty");
+ icons[ActionTriggerIconProvider.Trigger_LiquidContainer_Contains] = iconRegister.registerIcon("buildcraft:triggers/trigger_liquidcontainer_contains");
+ icons[ActionTriggerIconProvider.Trigger_LiquidContainer_Space] = iconRegister.registerIcon("buildcraft:triggers/trigger_liquidcontainer_space");
+ icons[ActionTriggerIconProvider.Trigger_LiquidContainer_Full] = iconRegister.registerIcon("buildcraft:triggers/trigger_liquidcontainer_full");
+ icons[ActionTriggerIconProvider.Trigger_Machine_Active] = iconRegister.registerIcon("buildcraft:triggers/trigger_machine_active");
+ icons[ActionTriggerIconProvider.Trigger_Machine_Inactive] = iconRegister.registerIcon("buildcraft:triggers/trigger_machine_inactive");
+ icons[ActionTriggerIconProvider.Trigger_PipeContents_Empty] = iconRegister.registerIcon("buildcraft:triggers/trigger_pipecontents_empty");
+ icons[ActionTriggerIconProvider.Trigger_PipeContents_ContainsItems] = iconRegister.registerIcon("buildcraft:triggers/trigger_pipecontents_containsitems");
+ icons[ActionTriggerIconProvider.Trigger_PipeContents_ContainsLiquid] = iconRegister.registerIcon("buildcraft:triggers/trigger_pipecontents_containsliquid");
+ icons[ActionTriggerIconProvider.Trigger_PipeContents_ContainsEnergy] = iconRegister.registerIcon("buildcraft:triggers/trigger_pipecontents_containsenergy");
+ icons[ActionTriggerIconProvider.Trigger_PipeSignal_Red_Active] = iconRegister.registerIcon("buildcraft:triggers/trigger_pipesignal_red_active");
+ icons[ActionTriggerIconProvider.Trigger_PipeSignal_Red_Inactive] = iconRegister.registerIcon("buildcraft:triggers/trigger_pipesignal_red_inactive");
+ icons[ActionTriggerIconProvider.Trigger_PipeSignal_Blue_Active] = iconRegister.registerIcon("buildcraft:triggers/trigger_pipesignal_blue_active");
+ icons[ActionTriggerIconProvider.Trigger_PipeSignal_Blue_Inactive] = iconRegister.registerIcon("buildcraft:triggers/trigger_pipesignal_blue_inactive");
+ icons[ActionTriggerIconProvider.Trigger_PipeSignal_Green_Active] = iconRegister.registerIcon("buildcraft:triggers/trigger_pipesignal_green_active");
+ icons[ActionTriggerIconProvider.Trigger_PipeSignal_Green_Inactive] = iconRegister.registerIcon("buildcraft:triggers/trigger_pipesignal_green_inactive");
+ icons[ActionTriggerIconProvider.Trigger_PipeSignal_Yellow_Active] = iconRegister.registerIcon("buildcraft:triggers/trigger_pipesignal_yellow_active");
+ icons[ActionTriggerIconProvider.Trigger_PipeSignal_Yellow_Inactive] = iconRegister.registerIcon("buildcraft:triggers/trigger_pipesignal_yellow_inactive");
+ icons[ActionTriggerIconProvider.Trigger_RedstoneInput_Active] = iconRegister.registerIcon("buildcraft:triggers/trigger_redstoneinput_active");
+ icons[ActionTriggerIconProvider.Trigger_RedstoneInput_Inactive] = iconRegister.registerIcon("buildcraft:triggers/trigger_redstoneinput_inactive");
+ }
+
+}
diff --git a/common/buildcraft/core/triggers/BCAction.java b/common/buildcraft/core/triggers/BCAction.java
new file mode 100644
index 00000000..a46683fd
--- /dev/null
+++ b/common/buildcraft/core/triggers/BCAction.java
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) SpaceToad, 2011
+ * http://www.mod-buildcraft.com
+ *
+ * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ * License 1.0, or MMPL. Please check the contents of the license located in
+ * http://www.mod-buildcraft.com/MMPL-1.0.txt
+ */
+
+package buildcraft.core.triggers;
+
+import net.minecraft.util.Icon;
+import buildcraft.BuildCraftCore;
+import buildcraft.api.core.IIconProvider;
+import buildcraft.api.gates.ActionManager;
+import buildcraft.api.gates.IAction;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public abstract class BCAction implements IAction {
+
+ protected int id;
+
+ public BCAction(int id) {
+ this.id = id;
+ ActionManager.actions[id] = this;
+ }
+
+ @Override
+ public int getId() {
+ return this.id;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public abstract Icon getTexture();
+
+ @Override
+ public boolean hasParameter() {
+ return false;
+ }
+
+ @Override
+ public String getDescription() {
+ return "";
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftCore.instance.actionTriggerIconProvider;
+ }
+
+
+}
diff --git a/common/buildcraft/core/triggers/BCTrigger.java b/common/buildcraft/core/triggers/BCTrigger.java
new file mode 100644
index 00000000..80d2ee93
--- /dev/null
+++ b/common/buildcraft/core/triggers/BCTrigger.java
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) SpaceToad, 2011
+ * http://www.mod-buildcraft.com
+ *
+ * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ * License 1.0, or MMPL. Please check the contents of the license located in
+ * http://www.mod-buildcraft.com/MMPL-1.0.txt
+ */
+
+package buildcraft.core.triggers;
+
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
+import buildcraft.BuildCraftCore;
+import buildcraft.api.core.IIconProvider;
+import buildcraft.api.gates.ActionManager;
+import buildcraft.api.gates.ITrigger;
+import buildcraft.api.gates.ITriggerParameter;
+import buildcraft.api.gates.TriggerParameter;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import net.minecraftforge.common.ForgeDirection;
+
+/**
+ * This class has to be implemented to create new triggers kinds to BuildCraft gates. There is an instance per kind, which will get called wherever the trigger
+ * can be active.
+ */
+public abstract class BCTrigger implements ITrigger {
+
+ protected int id;
+
+ public BCTrigger(int id) {
+ this.id = id;
+ ActionManager.triggers[id] = this;
+ }
+
+ @Override
+ public int getId() {
+ return this.id;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public abstract Icon getTextureIcon();
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftCore.instance.actionTriggerIconProvider;
+ }
+
+ @Override
+ public boolean hasParameter() {
+ return false;
+ }
+
+ @Override
+ public String getDescription() {
+ return "";
+ }
+
+ @Override
+ public boolean isTriggerActive(ForgeDirection side, TileEntity tile, ITriggerParameter parameter) {
+ return false;
+ }
+
+ @Override
+ public final ITriggerParameter createParameter() {
+ return new TriggerParameter();
+ }
+}
diff --git a/common/buildcraft/core/triggers/TriggerInventory.java b/common/buildcraft/core/triggers/TriggerInventory.java
index 41b9928d..d6142f65 100644
--- a/common/buildcraft/core/triggers/TriggerInventory.java
+++ b/common/buildcraft/core/triggers/TriggerInventory.java
@@ -12,16 +12,16 @@ package buildcraft.core.triggers;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.ISidedInventory;
-import buildcraft.api.gates.ITriggerDirectional;
import buildcraft.api.gates.ITriggerParameter;
-import buildcraft.api.gates.Trigger;
-import buildcraft.core.DefaultProps;
import buildcraft.core.utils.SidedInventoryAdapter;
import buildcraft.core.utils.Utils;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class TriggerInventory extends Trigger implements ITriggerDirectional {
+public class TriggerInventory extends BCTrigger {
public enum State {
Empty, Contains, Space, Full
@@ -35,20 +35,6 @@ public class TriggerInventory extends Trigger implements ITriggerDirectional {
this.state = state;
}
- @Override
- public int getIndexInTexture() {
- switch (state) {
- case Empty:
- return 2 * 16 + 4;
- case Contains:
- return 2 * 16 + 5;
- case Space:
- return 2 * 16 + 6;
- default:
- return 2 * 16 + 7;
- }
- }
-
@Override
public boolean hasParameter() {
if (state == State.Contains || state == State.Space)
@@ -129,12 +115,17 @@ public class TriggerInventory extends Trigger implements ITriggerDirectional {
}
@Override
- public boolean isTriggerActive(TileEntity tile, ITriggerParameter parameter) {
- return isTriggerActive(ForgeDirection.UNKNOWN, tile, parameter);
- }
-
- @Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_TRIGGERS;
+ @SideOnly(Side.CLIENT)
+ public Icon getTextureIcon() {
+ switch (state) {
+ case Empty:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_Inventory_Empty);
+ case Contains:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_Inventory_Contains);
+ case Space:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_Inventory_Space);
+ default:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_Inventory_Full);
+ }
}
}
diff --git a/common/buildcraft/core/triggers/TriggerLiquidContainer.java b/common/buildcraft/core/triggers/TriggerLiquidContainer.java
index 757ccba0..0d50bc83 100644
--- a/common/buildcraft/core/triggers/TriggerLiquidContainer.java
+++ b/common/buildcraft/core/triggers/TriggerLiquidContainer.java
@@ -10,16 +10,17 @@
package buildcraft.core.triggers;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.ILiquidTank;
import net.minecraftforge.liquids.ITankContainer;
import net.minecraftforge.liquids.LiquidContainerRegistry;
import net.minecraftforge.liquids.LiquidStack;
import buildcraft.api.gates.ITriggerParameter;
-import buildcraft.api.gates.Trigger;
-import buildcraft.core.DefaultProps;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class TriggerLiquidContainer extends Trigger {
+public class TriggerLiquidContainer extends BCTrigger {
public enum State {
Empty, Contains, Space, Full
@@ -32,20 +33,6 @@ public class TriggerLiquidContainer extends Trigger {
this.state = state;
}
- @Override
- public int getIndexInTexture() {
- switch (state) {
- case Empty:
- return 2 * 16 + 0;
- case Contains:
- return 2 * 16 + 1;
- case Space:
- return 2 * 16 + 2;
- default:
- return 2 * 16 + 3;
- }
- }
-
@Override
public boolean hasParameter() {
if (state == State.Contains || state == State.Space)
@@ -69,7 +56,7 @@ public class TriggerLiquidContainer extends Trigger {
}
@Override
- public boolean isTriggerActive(TileEntity tile, ITriggerParameter parameter) {
+ public boolean isTriggerActive(ForgeDirection side, TileEntity tile, ITriggerParameter parameter) {
if (tile instanceof ITankContainer) {
ITankContainer container = (ITankContainer) tile;
@@ -137,7 +124,17 @@ public class TriggerLiquidContainer extends Trigger {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_TRIGGERS;
+ @SideOnly(Side.CLIENT)
+ public Icon getTextureIcon() {
+ switch (state) {
+ case Empty:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_LiquidContainer_Empty);
+ case Contains:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_LiquidContainer_Contains);
+ case Space:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_LiquidContainer_Space);
+ default:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_LiquidContainer_Full);
+ }
}
}
diff --git a/common/buildcraft/core/triggers/TriggerMachine.java b/common/buildcraft/core/triggers/TriggerMachine.java
index 4ef00b6a..1c457347 100644
--- a/common/buildcraft/core/triggers/TriggerMachine.java
+++ b/common/buildcraft/core/triggers/TriggerMachine.java
@@ -10,12 +10,14 @@
package buildcraft.core.triggers;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import buildcraft.api.gates.ITriggerParameter;
-import buildcraft.api.gates.Trigger;
-import buildcraft.core.DefaultProps;
import buildcraft.core.IMachine;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import net.minecraftforge.common.ForgeDirection;
-public class TriggerMachine extends Trigger {
+public class TriggerMachine extends BCTrigger {
boolean active;
@@ -25,14 +27,6 @@ public class TriggerMachine extends Trigger {
this.active = active;
}
- @Override
- public int getIndexInTexture() {
- if (active)
- return 4 * 16 + 0;
- else
- return 4 * 16 + 1;
- }
-
@Override
public String getDescription() {
if (active)
@@ -42,7 +36,7 @@ public class TriggerMachine extends Trigger {
}
@Override
- public boolean isTriggerActive(TileEntity tile, ITriggerParameter parameter) {
+ public boolean isTriggerActive(ForgeDirection side, TileEntity tile, ITriggerParameter parameter) {
if (tile instanceof IMachine) {
IMachine machine = (IMachine) tile;
@@ -56,7 +50,11 @@ public class TriggerMachine extends Trigger {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_TRIGGERS;
+ @SideOnly(Side.CLIENT)
+ public Icon getTextureIcon() {
+ if (active)
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_Machine_Active);
+ else
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_Machine_Inactive);
}
}
diff --git a/common/buildcraft/core/utils/BlockUtil.java b/common/buildcraft/core/utils/BlockUtil.java
index 88312ad8..8e6809ad 100644
--- a/common/buildcraft/core/utils/BlockUtil.java
+++ b/common/buildcraft/core/utils/BlockUtil.java
@@ -10,8 +10,6 @@ package buildcraft.core.utils;
import java.util.List;
-import cpw.mods.fml.common.FMLCommonHandler;
-
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
@@ -24,6 +22,7 @@ import net.minecraft.world.World;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftEnergy;
import buildcraft.api.core.BuildCraftAPI;
+import cpw.mods.fml.common.FMLCommonHandler;
public class BlockUtil {
@@ -61,7 +60,7 @@ public class BlockUtil {
}
}
- world.setBlockWithNotify(x, y, z, 0);
+ world.setBlock(x, y, z, 0);
}
public static boolean canChangeBlock(World world, int x, int y, int z) {
@@ -99,6 +98,7 @@ public class BlockUtil {
/**
* Create an explosion which only affects a single block.
*/
+ @SuppressWarnings("unchecked")
public static void explodeBlock(World world, int x, int y, int z) {
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) return;
diff --git a/common/buildcraft/core/utils/CraftingHelper.java b/common/buildcraft/core/utils/CraftingHelper.java
index 2a4bfe12..19d6306d 100644
--- a/common/buildcraft/core/utils/CraftingHelper.java
+++ b/common/buildcraft/core/utils/CraftingHelper.java
@@ -12,6 +12,7 @@ import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraft.world.World;
public class CraftingHelper {
+ @SuppressWarnings({ "unchecked", "rawtypes" })
public static IRecipe findMatchingRecipe(InventoryCrafting par1InventoryCrafting, World par2World)
{
int var3 = 0;
diff --git a/common/buildcraft/core/utils/SessionVars.java b/common/buildcraft/core/utils/SessionVars.java
index 1c55534c..74c00965 100644
--- a/common/buildcraft/core/utils/SessionVars.java
+++ b/common/buildcraft/core/utils/SessionVars.java
@@ -2,12 +2,15 @@ package buildcraft.core.utils;
public class SessionVars {
+ @SuppressWarnings("rawtypes")
private static Class openedLedger;
+ @SuppressWarnings("rawtypes")
public static void setOpenedLedger(Class ledgerClass) {
openedLedger = ledgerClass;
}
+ @SuppressWarnings("rawtypes")
public static Class getOpenedLedger() {
return openedLedger;
}
diff --git a/common/buildcraft/core/utils/SidedInventoryAdapter.java b/common/buildcraft/core/utils/SidedInventoryAdapter.java
index 8249d3d3..3f42ee75 100644
--- a/common/buildcraft/core/utils/SidedInventoryAdapter.java
+++ b/common/buildcraft/core/utils/SidedInventoryAdapter.java
@@ -8,9 +8,9 @@ import net.minecraftforge.common.ISidedInventory;
/**
* This class is responsible for abstracting an ISidedInventory as a normal IInventory
- *
+ *
* @author Krapht
- *
+ *
*/
public class SidedInventoryAdapter implements IInventory {
@@ -78,4 +78,18 @@ public class SidedInventoryAdapter implements IInventory {
public ItemStack getStackInSlotOnClosing(int slot) {
return _sidedInventory.getStackInSlotOnClosing(slot + _slotOffset);
}
+
+ @Override
+ public boolean isInvNameLocalized()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isStackValidForSlot(int i, ItemStack itemstack)
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
}
diff --git a/common/buildcraft/core/utils/SimpleInventory.java b/common/buildcraft/core/utils/SimpleInventory.java
index c22a6b94..c154ac24 100644
--- a/common/buildcraft/core/utils/SimpleInventory.java
+++ b/common/buildcraft/core/utils/SimpleInventory.java
@@ -137,4 +137,16 @@ public class SimpleInventory implements IInventory, INBTTagable {
{
return _contents;
}
+
+ @Override
+ public boolean isInvNameLocalized() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isStackValidForSlot(int i, ItemStack itemstack) {
+ // TODO Auto-generated method stub
+ return false;
+ }
}
diff --git a/common/buildcraft/core/utils/SurroundingInventory.java b/common/buildcraft/core/utils/SurroundingInventory.java
index 32704eb3..15b24a0d 100644
--- a/common/buildcraft/core/utils/SurroundingInventory.java
+++ b/common/buildcraft/core/utils/SurroundingInventory.java
@@ -175,4 +175,18 @@ public class SurroundingInventory implements IInventory, IBuilderInventory {
return false;
}
+
+ @Override
+ public boolean isInvNameLocalized()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isStackValidForSlot(int i, ItemStack itemstack)
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
}
diff --git a/common/buildcraft/core/utils/Utils.java b/common/buildcraft/core/utils/Utils.java
index c0594f6d..54eab2cb 100644
--- a/common/buildcraft/core/utils/Utils.java
+++ b/common/buildcraft/core/utils/Utils.java
@@ -21,6 +21,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest;
+import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
@@ -55,7 +56,7 @@ public class Utils {
/**
* Tries to add the passed stack to any valid inventories around the given coordinates.
- *
+ *
* @param stack
* @param world
* @param x
@@ -219,7 +220,7 @@ public class Utils {
/**
* Ensures that the given inventory is the full inventory, i.e. takes double chests into account.
- *
+ *
* @param inv
* @return Modified inventory if double chest, unmodified otherwise.
*/
@@ -315,7 +316,7 @@ public class Utils {
jSize = 0.10;
}
- int texture = BuildCraftCore.redLaserTexture;
+ Icon texture = BuildCraftCore.redLaserTexture;
switch (kind) {
case Blue:
diff --git a/common/buildcraft/energy/BlockEngine.java b/common/buildcraft/energy/BlockEngine.java
index 668a9fdd..419a9cfb 100644
--- a/common/buildcraft/energy/BlockEngine.java
+++ b/common/buildcraft/energy/BlockEngine.java
@@ -14,6 +14,7 @@ import java.util.Random;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -28,6 +29,8 @@ import buildcraft.core.CreativeTabBuildCraft;
import buildcraft.core.GuiIds;
import buildcraft.core.IItemPipe;
import buildcraft.core.proxy.CoreProxy;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockEngine extends BlockContainer {
@@ -36,7 +39,7 @@ public class BlockEngine extends BlockContainer {
setHardness(0.5F);
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
- setBlockName("engineBlock");
+ setUnlocalizedName("engineBlock");
}
@Override
@@ -49,6 +52,13 @@ public class BlockEngine extends BlockContainer {
return false;
}
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ // NOOP
+ }
+
@Override
public int getRenderType() {
return BuildCraftCore.blockByEntityModel;
diff --git a/common/buildcraft/energy/BlockOilFlowing.java b/common/buildcraft/energy/BlockOilFlowing.java
index 89264b38..2e8a8e37 100644
--- a/common/buildcraft/energy/BlockOilFlowing.java
+++ b/common/buildcraft/energy/BlockOilFlowing.java
@@ -11,21 +11,25 @@ package buildcraft.energy;
import java.util.Random;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
import net.minecraft.block.Block;
import net.minecraft.block.BlockFluid;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
+import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.liquids.ILiquid;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftEnergy;
-import buildcraft.core.DefaultProps;
public class BlockOilFlowing extends BlockFluid implements ILiquid {
int numAdjacentSources = 0;
boolean isOptimalFlowDirection[] = new boolean[4];
int flowCost[] = new int[4];
-
+
public BlockOilFlowing(int i, Material material) {
super(i, material);
@@ -38,14 +42,9 @@ public class BlockOilFlowing extends BlockFluid implements ILiquid {
return BuildCraftCore.oilModel;
}
- @Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
private void updateFlow(World world, int i, int j, int k) {
int l = world.getBlockMetadata(i, j, k);
- world.setBlockAndMetadata(i, j, k, blockID + 1, l);
+ world.setBlock(i, j, k, blockID + 1, l, 1);
world.markBlockRangeForRenderUpdate(i, j, k, i, j, k);
world.markBlockForUpdate(i, j, k);
}
@@ -77,10 +76,10 @@ public class BlockOilFlowing extends BlockFluid implements ILiquid {
if (j1 != l) {
l = j1;
if (l < 0) {
- world.setBlockWithNotify(i, j, k, 0);
+ world.setBlock(i, j, k, 0);
} else {
- world.setBlockMetadataWithNotify(i, j, k, l);
- world.scheduleBlockUpdate(i, j, k, blockID, tickRate());
+ world.setBlockMetadataWithNotify(i, j, k, l,1);
+ world.scheduleBlockUpdate(i, j, k, blockID, tickRate(world));
world.notifyBlocksOfNeighborChange(i, j, k, blockID);
}
} else if (flag) {
@@ -91,9 +90,9 @@ public class BlockOilFlowing extends BlockFluid implements ILiquid {
}
if (liquidCanDisplaceBlock(world, i, j - 1, k)) {
if (l >= 8) {
- world.setBlockAndMetadataWithNotify(i, j - 1, k, blockID, l);
+ world.setBlock(i, j - 1, k, blockID, l,1);
} else {
- world.setBlockAndMetadataWithNotify(i, j - 1, k, blockID, l + 8);
+ world.setBlock(i, j - 1, k, blockID, l + 8,1);
}
} else if (l >= 0 && (l == 0 || blockBlocksFlow(world, i, j - 1, k))) {
boolean aflag[] = getOptimalFlowDirections(world, i, j, k);
@@ -124,7 +123,7 @@ public class BlockOilFlowing extends BlockFluid implements ILiquid {
if (i1 > 0) {
Block.blocksList[i1].dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
}
- world.setBlockAndMetadataWithNotify(i, j, k, blockID, l);
+ world.setBlock(i, j, k, blockID, l,1);
}
}
@@ -240,7 +239,7 @@ public class BlockOilFlowing extends BlockFluid implements ILiquid {
public void onBlockAdded(World world, int i, int j, int k) {
super.onBlockAdded(world, i, j, k);
if (world.getBlockId(i, j, k) == blockID) {
- world.scheduleBlockUpdate(i, j, k, blockID, tickRate());
+ world.scheduleBlockUpdate(i, j, k, blockID, tickRate(world));
}
}
@@ -263,5 +262,11 @@ public class BlockOilFlowing extends BlockFluid implements ILiquid {
public boolean isBlockReplaceable(World world, int i, int j, int k) {
return true;
}
-
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister iconRegister){
+ this.theIcon = new Icon[] {iconRegister.registerIcon("buildcraft:oil"), iconRegister.registerIcon("buildcraft:oil_flow")};
+ }
+
}
diff --git a/common/buildcraft/energy/BlockOilStill.java b/common/buildcraft/energy/BlockOilStill.java
index b34b596e..21bf3eed 100644
--- a/common/buildcraft/energy/BlockOilStill.java
+++ b/common/buildcraft/energy/BlockOilStill.java
@@ -11,11 +11,14 @@ package buildcraft.energy;
import net.minecraft.block.BlockStationary;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
+import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.liquids.ILiquid;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftEnergy;
-import buildcraft.core.DefaultProps;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockOilStill extends BlockStationary implements ILiquid {
@@ -31,11 +34,6 @@ public class BlockOilStill extends BlockStationary implements ILiquid {
return BuildCraftCore.oilModel;
}
- @Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
@Override
public int stillLiquidId() {
return BuildCraftEnergy.oilStill.blockID;
@@ -56,4 +54,10 @@ public class BlockOilStill extends BlockStationary implements ILiquid {
return true;
}
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister iconRegister) {
+ this.theIcon = new Icon[] { iconRegister.registerIcon("buildcraft:oil"), iconRegister.registerIcon("buildcraft:oil_flow") };
+ }
+
}
diff --git a/common/buildcraft/energy/BlockPollution.java b/common/buildcraft/energy/BlockPollution.java
index 8afcc224..5b3887c4 100644
--- a/common/buildcraft/energy/BlockPollution.java
+++ b/common/buildcraft/energy/BlockPollution.java
@@ -1,8 +1,8 @@
-/**
+/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
@@ -11,21 +11,16 @@ package buildcraft.energy;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import buildcraft.core.DefaultProps;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockPollution extends BlockContainer {
public BlockPollution(int i) {
super(i, Material.air);
- blockIndexInTexture = 5 * 16 + 0;
- }
-
- @Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
}
@Override
@@ -43,8 +38,10 @@ public class BlockPollution extends BlockContainer {
return new TilePollution();
}
- @SuppressWarnings({ "all" })
- public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) {
- return 5 * 16 + iblockaccess.getBlockMetadata(i, j, k);
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ par1IconRegister.registerIcon("buildcraft:blockPollution");
}
}
diff --git a/common/buildcraft/energy/BptBlockEngine.java b/common/buildcraft/energy/BptBlockEngine.java
index 3d5d1422..d0a2f187 100644
--- a/common/buildcraft/energy/BptBlockEngine.java
+++ b/common/buildcraft/energy/BptBlockEngine.java
@@ -17,6 +17,7 @@ import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
import buildcraft.core.Version;
+@Deprecated
public class BptBlockEngine extends BptBlock {
public BptBlockEngine(int blockId) {
@@ -41,7 +42,7 @@ public class BptBlockEngine extends BptBlock {
@Override
public void buildBlock(BptSlotInfo slot, IBptContext context) {
- context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, slot.meta);
+ context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,1);
TileEngine engine = (TileEngine) context.world().getBlockTileEntity(slot.x, slot.y, slot.z);
diff --git a/common/buildcraft/energy/EnergyProxy.java b/common/buildcraft/energy/EnergyProxy.java
index 0c635308..0a241d4a 100644
--- a/common/buildcraft/energy/EnergyProxy.java
+++ b/common/buildcraft/energy/EnergyProxy.java
@@ -11,9 +11,6 @@ public class EnergyProxy {
GameRegistry.registerTileEntity(TileEngine.class, "net.minecraft.src.buildcraft.energy.Engine");
}
- public void registerTextureFX() {
- }
-
public void registerBlockRenderers() {
}
}
diff --git a/common/buildcraft/energy/EnergyProxyClient.java b/common/buildcraft/energy/EnergyProxyClient.java
index dbd96404..b69a7691 100644
--- a/common/buildcraft/energy/EnergyProxyClient.java
+++ b/common/buildcraft/energy/EnergyProxyClient.java
@@ -5,10 +5,6 @@ import buildcraft.core.DefaultProps;
import buildcraft.core.render.RenderingEntityBlocks;
import buildcraft.core.render.RenderingEntityBlocks.EntityRenderIndex;
import buildcraft.energy.render.RenderEngine;
-import buildcraft.energy.render.TextureFuelFX;
-import buildcraft.energy.render.TextureOilFX;
-import buildcraft.energy.render.TextureOilFlowFX;
-import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
public class EnergyProxyClient extends EnergyProxy {
@@ -18,15 +14,6 @@ public class EnergyProxyClient extends EnergyProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEngine.class, new RenderEngine());
}
- @Override
- public void registerTextureFX() {
- net.minecraft.client.renderer.RenderEngine renderEngine = FMLClientHandler.instance().getClient().renderEngine;
-
- renderEngine.registerTextureFX(new TextureOilFX());
- renderEngine.registerTextureFX(new TextureFuelFX());
- renderEngine.registerTextureFX(new TextureOilFlowFX());
- }
-
@Override
public void registerBlockRenderers() {
RenderingEntityBlocks.blockByEntityRenders.put(new EntityRenderIndex(BuildCraftEnergy.engineBlock, 0), new RenderEngine(
diff --git a/common/buildcraft/energy/EngineIron.java b/common/buildcraft/energy/EngineIron.java
index 6373bd6b..a465bc59 100644
--- a/common/buildcraft/energy/EngineIron.java
+++ b/common/buildcraft/energy/EngineIron.java
@@ -107,7 +107,7 @@ public class EngineIron extends Engine {
if (burnTime > 0 || fuel.amount > 0) {
if (burnTime > 0) {
burnTime--;
- }
+ }
if (burnTime <= 0) {
if(fuel != null) {
if (--fuel.amount <= 0) {
@@ -125,7 +125,7 @@ public class EngineIron extends Engine {
}
} else if (penaltyCooling <= 0) {
if (lastPowered) {
- lastPowered = false;
+ lastPowered = false;
penaltyCooling = 30 * 20;
// 30 sec of penalty on top of the cooling
}
@@ -207,8 +207,8 @@ public class EngineIron extends Engine {
if (nbttagcompound.hasKey("liquidId")) {
fuelTank.setLiquid(new LiquidStack(nbttagcompound.getInteger("liquidId"), nbttagcompound.getInteger("liquidQty"), nbttagcompound
.getInteger("liquidMeta")));
- } else if (nbttagcompound.hasKey("fuelTank")) {
- fuelTank.setLiquid(LiquidStack.loadLiquidStackFromNBT(nbttagcompound.getCompoundTag("fuelTank")));
+ } else {
+ fuelTank.readFromNBT(nbttagcompound.getCompoundTag("fuelTank"));
}
burnTime = nbttagcompound.getInteger("burnTime");
@@ -216,8 +216,8 @@ public class EngineIron extends Engine {
if (nbttagcompound.hasKey("coolantId")) {
coolantTank.setLiquid(new LiquidStack(nbttagcompound.getInteger("coolantId"), nbttagcompound.getInteger("coolantQty"), nbttagcompound
.getInteger("coolantMeta")));
- } else if (nbttagcompound.hasKey("coolantTank")) {
- coolantTank.setLiquid(LiquidStack.loadLiquidStackFromNBT(nbttagcompound.getCompoundTag("coolantTank")));
+ } else {
+ coolantTank.readFromNBT(nbttagcompound.getCompoundTag("coolantTank"));
}
heat = nbttagcompound.getInteger("heat");
@@ -232,13 +232,8 @@ public class EngineIron extends Engine {
@Override
public void writeToNBT(NBTTagCompound nbttagcompound) {
- if (fuelTank.getLiquid() != null) {
- nbttagcompound.setTag("fuelTank", fuelTank.getLiquid().writeToNBT(new NBTTagCompound()));
- }
-
- if (coolantTank.getLiquid() != null) {
- nbttagcompound.setTag("coolantTank", coolantTank.getLiquid().writeToNBT(new NBTTagCompound()));
- }
+ nbttagcompound.setTag("fuelTank", fuelTank.writeToNBT(new NBTTagCompound()));
+ nbttagcompound.setTag("coolantTank", coolantTank.writeToNBT(new NBTTagCompound()));
nbttagcompound.setInteger("burnTime", burnTime);
nbttagcompound.setInteger("heat", heat);
@@ -294,7 +289,7 @@ public class EngineIron extends Engine {
if (fuelTank.getLiquid() == null) {
fuelTank.setLiquid(new LiquidStack(j, 0));
} else {
- fuelTank.getLiquid().itemID = j;
+ fuelTank.setLiquid(new LiquidStack(j,fuelTank.getLiquid().amount,fuelTank.getLiquid().itemMeta));
}
break;
case 7:
@@ -308,21 +303,21 @@ public class EngineIron extends Engine {
if (coolantTank.getLiquid() == null) {
coolantTank.setLiquid(new LiquidStack(j, 0));
} else {
- coolantTank.getLiquid().itemID = j;
+ coolantTank.setLiquid(new LiquidStack(j,coolantTank.getLiquid().amount,coolantTank.getLiquid().itemMeta));
}
break;
case 9:
if (fuelTank.getLiquid() == null) {
fuelTank.setLiquid(new LiquidStack(0, 0, j));
} else {
- fuelTank.getLiquid().itemMeta = j;
+ fuelTank.setLiquid(new LiquidStack(fuelTank.getLiquid().itemID,fuelTank.getLiquid().amount,j));
}
break;
case 10:
if (coolantTank.getLiquid() == null) {
coolantTank.setLiquid(new LiquidStack(0, 0, j));
} else {
- coolantTank.getLiquid().itemMeta = j;
+ coolantTank.setLiquid(new LiquidStack(coolantTank.getLiquid().itemID,coolantTank.getLiquid().amount,j));
}
}
}
@@ -431,19 +426,11 @@ public class EngineIron extends Engine {
}
}
- public int getFuelId() {
- return fuelTank.getLiquid() != null ? fuelTank.getLiquid().itemID : 0;
+ public LiquidStack getFuel() {
+ return fuelTank.getLiquid();
}
- public int getFuelMeta() {
- return fuelTank.getLiquid() != null ? fuelTank.getLiquid().itemMeta : 0;
- }
-
- public int getCoolantId() {
- return coolantTank.getLiquid() != null ? coolantTank.getLiquid().itemID : 0;
- }
-
- public int getCoolantMeta() {
- return coolantTank.getLiquid() != null ? coolantTank.getLiquid().itemMeta : 0;
+ public LiquidStack getCoolant() {
+ return coolantTank.getLiquid();
}
}
diff --git a/common/buildcraft/energy/EngineStone.java b/common/buildcraft/energy/EngineStone.java
index 24f8a576..8fde6d7b 100644
--- a/common/buildcraft/energy/EngineStone.java
+++ b/common/buildcraft/energy/EngineStone.java
@@ -21,9 +21,16 @@ import buildcraft.core.utils.Utils;
import buildcraft.energy.gui.ContainerEngine;
public class EngineStone extends Engine {
+ final float maxProduction = 1f;
+ final float minProduction = maxProduction / 3;
+ final float target = 0.375f;
+ final float kp = 1f;
+ final float ki = 0.05f;
+ final float eLimit = (maxProduction - minProduction) / ki;
int burnTime = 0;
int totalBurnTime = 0;
+ float esum = 0;
private ItemStack itemInInventory;
@@ -75,8 +82,13 @@ public class EngineStone extends Engine {
currentOutput = 0;
if (burnTime > 0) {
burnTime--;
- currentOutput = 1;
- addEnergy(1);
+
+ float e = target * maxEnergy - energy;
+
+ esum = Math.min(Math.max(esum + e, -eLimit), eLimit);
+ currentOutput = Math.min(Math.max(e * kp + esum * ki, minProduction), maxProduction);
+
+ addEnergy(currentOutput);
}
if (burnTime == 0 && tile.isRedstonePowered) {
@@ -142,7 +154,7 @@ public class EngineStone extends Engine {
energy = j;
break;
case 1:
- currentOutput = j;
+ currentOutput = j / 100f;
break;
case 2:
burnTime = j;
@@ -156,7 +168,7 @@ public class EngineStone extends Engine {
@Override
public void sendGUINetworkData(ContainerEngine containerEngine, ICrafting iCrafting) {
iCrafting.sendProgressBarUpdate(containerEngine, 0, Math.round(energy));
- iCrafting.sendProgressBarUpdate(containerEngine, 1, Math.round(currentOutput));
+ iCrafting.sendProgressBarUpdate(containerEngine, 1, Math.round(currentOutput * 100f));
iCrafting.sendProgressBarUpdate(containerEngine, 2, burnTime);
iCrafting.sendProgressBarUpdate(containerEngine, 3, totalBurnTime);
}
@@ -214,4 +226,4 @@ public class EngineStone extends Engine {
public ILiquidTank getTank(ForgeDirection direction, LiquidStack type) {
return null;
}
-}
+}
\ No newline at end of file
diff --git a/common/buildcraft/energy/ItemBucketOil.java b/common/buildcraft/energy/ItemBucketOil.java
index 84c69d21..eb617b09 100644
--- a/common/buildcraft/energy/ItemBucketOil.java
+++ b/common/buildcraft/energy/ItemBucketOil.java
@@ -1,37 +1,39 @@
-/**
+/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.energy;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.ItemBucket;
import net.minecraft.item.ItemStack;
import buildcraft.BuildCraftEnergy;
import buildcraft.core.CreativeTabBuildCraft;
-import buildcraft.core.DefaultProps;
import buildcraft.core.utils.StringUtil;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class ItemBucketOil extends ItemBucket {
public ItemBucketOil(int i) {
super(i, BuildCraftEnergy.oilMoving.blockID);
- iconIndex = 0 * 16 + 1;
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
}
@Override
public String getItemDisplayName(ItemStack itemstack) {
- return StringUtil.localize(getItemNameIS(itemstack));
+ return StringUtil.localize(getUnlocalizedName(itemstack));
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_ITEMS;
+ @SideOnly(Side.CLIENT)
+ public void updateIcons(IconRegister par1IconRegister)
+ {
+ this.iconIndex = par1IconRegister.registerIcon("buildcraft:oil_bucket");
}
-
}
diff --git a/common/buildcraft/energy/OilBucketHandler.java b/common/buildcraft/energy/OilBucketHandler.java
index e1fa9ae2..4cd9c400 100644
--- a/common/buildcraft/energy/OilBucketHandler.java
+++ b/common/buildcraft/energy/OilBucketHandler.java
@@ -38,7 +38,7 @@ public class OilBucketHandler {
if ((blockID == BuildCraftEnergy.oilStill.blockID || blockID == BuildCraftEnergy.oilMoving.blockID)
&& world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) {
- world.setBlockWithNotify(pos.blockX, pos.blockY, pos.blockZ, 0);
+ world.setBlock(pos.blockX, pos.blockY, pos.blockZ, 0);
return new ItemStack(BuildCraftEnergy.bucketOil);
} else
diff --git a/common/buildcraft/energy/OilPopulate.java b/common/buildcraft/energy/OilPopulate.java
index b47ee66c..c7ce17aa 100644
--- a/common/buildcraft/energy/OilPopulate.java
+++ b/common/buildcraft/energy/OilPopulate.java
@@ -12,11 +12,11 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
-import buildcraft.BuildCraftCore;
-import buildcraft.BuildCraftEnergy;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
import net.minecraftforge.event.terraingen.TerrainGen;
+import buildcraft.BuildCraftCore;
+import buildcraft.BuildCraftEnergy;
public class OilPopulate {
@@ -92,7 +92,7 @@ public class OilPopulate {
int d2 = bx * bx + by * by + bz * bz;
if (d2 <= r2) {
- world.setBlockWithNotify(bx + cx, by + cy, bz + cz, BuildCraftEnergy.oilStill.blockID);
+ world.setBlock(bx + cx, by + cy, bz + cz, BuildCraftEnergy.oilStill.blockID);
}
}
}
@@ -121,11 +121,11 @@ public class OilPopulate {
}
for (int h = y + 1; h <= ymax; ++h) {
- world.setBlockWithNotify(cx, h, cz, BuildCraftEnergy.oilStill.blockID);
+ world.setBlock(cx, h, cz, BuildCraftEnergy.oilStill.blockID);
}
} else if (started) {
- world.setBlockWithNotify(cx, y, cz, BuildCraftEnergy.oilStill.blockID);
+ world.setBlock(cx, y, cz, BuildCraftEnergy.oilStill.blockID);
}
}
@@ -176,12 +176,12 @@ public class OilPopulate {
if (adjacentOil || force) {
if (world.getBlockId(x, y, z) == Block.waterMoving.blockID || world.getBlockId(x, y, z) == Block.waterStill.blockID || isOil(world, x, y, z)) {
- world.setBlockWithNotify(x, y, z, BuildCraftEnergy.oilStill.blockID);
+ world.setBlock(x, y, z, BuildCraftEnergy.oilStill.blockID);
} else {
- world.setBlockWithNotify(x, y, z, 0);
+ world.setBlock(x, y, z, 0);
}
- world.setBlockWithNotify(x, y - 1, z, BuildCraftEnergy.oilStill.blockID);
+ world.setBlock(x, y - 1, z, BuildCraftEnergy.oilStill.blockID);
}
}
}
diff --git a/common/buildcraft/energy/TileEngine.java b/common/buildcraft/energy/TileEngine.java
index d1a565ca..ff8b1d4b 100644
--- a/common/buildcraft/energy/TileEngine.java
+++ b/common/buildcraft/energy/TileEngine.java
@@ -120,7 +120,8 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
if (isPoweredTile(tile)) {
IPowerProvider receptor = ((IPowerReceptor) tile).getPowerProvider();
- float extracted = engine.extractEnergy(receptor.getMinEnergyReceived(), receptor.getMaxEnergyReceived(), true);
+ float extracted = engine.extractEnergy(receptor.getMinEnergyReceived(),
+ Math.min(receptor.getMaxEnergyReceived(), receptor.getMaxEnergyStored() - (int) receptor.getEnergyStored()), true);
if (extracted > 0) {
receptor.receiveEnergy(extracted, engine.orientation.getOpposite());
@@ -389,7 +390,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
}
@Override
- public int powerRequest() {
+ public int powerRequest(ForgeDirection from) {
return 0;
}
diff --git a/common/buildcraft/energy/TriggerEngineHeat.java b/common/buildcraft/energy/TriggerEngineHeat.java
index ffae84ef..4cdcbf77 100644
--- a/common/buildcraft/energy/TriggerEngineHeat.java
+++ b/common/buildcraft/energy/TriggerEngineHeat.java
@@ -10,11 +10,15 @@
package buildcraft.energy;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import buildcraft.api.gates.ITriggerParameter;
-import buildcraft.api.gates.Trigger;
-import buildcraft.core.DefaultProps;
+import buildcraft.core.triggers.ActionTriggerIconProvider;
+import buildcraft.core.triggers.BCTrigger;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import net.minecraftforge.common.ForgeDirection;
-public class TriggerEngineHeat extends Trigger {
+public class TriggerEngineHeat extends BCTrigger {
public Engine.EnergyStage stage;
@@ -24,20 +28,6 @@ public class TriggerEngineHeat extends Trigger {
this.stage = stage;
}
- @Override
- public int getIndexInTexture() {
- switch (stage) {
- case Blue:
- return 1 * 16 + 0;
- case Green:
- return 1 * 16 + 1;
- case Yellow:
- return 1 * 16 + 2;
- default:
- return 1 * 16 + 3;
- }
- }
-
@Override
public String getDescription() {
switch (stage) {
@@ -53,7 +43,7 @@ public class TriggerEngineHeat extends Trigger {
}
@Override
- public boolean isTriggerActive(TileEntity tile, ITriggerParameter parameter) {
+ public boolean isTriggerActive(ForgeDirection side, TileEntity tile, ITriggerParameter parameter) {
if (tile instanceof TileEngine) {
Engine engine = ((TileEngine) tile).engine;
@@ -64,7 +54,17 @@ public class TriggerEngineHeat extends Trigger {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_TRIGGERS;
+ @SideOnly(Side.CLIENT)
+ public Icon getTextureIcon() {
+ switch (stage) {
+ case Blue:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_EngineHeat_Blue);
+ case Green:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_EngineHeat_Green);
+ case Yellow:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_EngineHeat_Yellow);
+ default:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_EngineHeat_Red);
+ }
}
}
diff --git a/common/buildcraft/energy/gui/GuiCombustionEngine.java b/common/buildcraft/energy/gui/GuiCombustionEngine.java
index 76db9c90..ca02bd90 100644
--- a/common/buildcraft/energy/gui/GuiCombustionEngine.java
+++ b/common/buildcraft/energy/gui/GuiCombustionEngine.java
@@ -9,10 +9,8 @@
package buildcraft.energy.gui;
-import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.Item;
-import net.minecraftforge.client.ForgeHooksClient;
+import net.minecraftforge.liquids.LiquidStack;
import org.lwjgl.opengl.GL11;
@@ -37,9 +35,8 @@ public class GuiCombustionEngine extends GuiEngine {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
- int i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/combustion_engine_gui.png");
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- mc.renderEngine.bindTexture(i);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ mc.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_GUI + "/combustion_engine_gui.png");
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
@@ -48,31 +45,19 @@ public class GuiCombustionEngine extends GuiEngine {
EngineIron engineIron = ((EngineIron) engine.engine);
if (engine.getScaledBurnTime(58) > 0) {
- displayGauge(j, k, 19, 104, engine.getScaledBurnTime(58), engineIron.getFuelId(), engineIron.getFuelMeta());
+ displayGauge(j, k, 19, 104, engine.getScaledBurnTime(58), engineIron.getFuel());
}
if (engineIron.getScaledCoolant(58) > 0) {
- displayGauge(j, k, 19, 122, engineIron.getScaledCoolant(58), engineIron.getCoolantId(), engineIron.getCoolantMeta());
+ displayGauge(j, k, 19, 122, engineIron.getScaledCoolant(58), engineIron.getCoolant());
}
}
- private void displayGauge(int j, int k, int line, int col, int squaled, int liquidId, int liquidMeta) {
- int liquidImgIndex = 0;
-
- if (liquidId <= 0)
- return;
- if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) {
- ForgeHooksClient.bindTexture(Block.blocksList[liquidId].getTextureFile(), 0);
- liquidImgIndex = Block.blocksList[liquidId].blockIndexInTexture;
- } else if (Item.itemsList[liquidId] != null) {
- ForgeHooksClient.bindTexture(Item.itemsList[liquidId].getTextureFile(), 0);
- liquidImgIndex = Item.itemsList[liquidId].getIconFromDamage(liquidMeta);
- } else
- return;
-
- int imgLine = liquidImgIndex / 16;
- int imgColumn = liquidImgIndex - imgLine * 16;
-
+ private void displayGauge(int j, int k, int line, int col, int squaled, LiquidStack liquid) {
+ if (liquid == null)
+ {
+ return;
+ }
int start = 0;
while (true) {
@@ -86,7 +71,8 @@ public class GuiCombustionEngine extends GuiEngine {
squaled = 0;
}
- drawTexturedModalRect(j + col, k + line + 58 - x - start, imgColumn * 16, imgLine * 16 + (16 - x), 16, 16 - (16 - x));
+ mc.renderEngine.bindTexture(liquid.canonical().getTextureSheet());
+ drawTexturedModelRectFromIcon(j + col, k + line + 58 - x - start, liquid.canonical().getRenderingIcon(), 16, 16 - (16 - x));
start = start + 16;
if (x == 0 || squaled == 0) {
@@ -94,9 +80,7 @@ public class GuiCombustionEngine extends GuiEngine {
}
}
- int i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/combustion_engine_gui.png");
-
- mc.renderEngine.bindTexture(i);
+ mc.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_GUI + "/combustion_engine_gui.png");
drawTexturedModalRect(j + col, k + line, 176, 0, 16, 60);
}
}
diff --git a/common/buildcraft/energy/gui/GuiEngine.java b/common/buildcraft/energy/gui/GuiEngine.java
index b2e8269a..e23856f7 100644
--- a/common/buildcraft/energy/gui/GuiEngine.java
+++ b/common/buildcraft/energy/gui/GuiEngine.java
@@ -1,7 +1,9 @@
package buildcraft.energy.gui;
+import net.minecraft.client.Minecraft;
import net.minecraft.inventory.IInventory;
-import buildcraft.core.DefaultProps;
+import buildcraft.BuildCraftCore;
+import buildcraft.core.CoreIconProvider;
import buildcraft.core.gui.BuildCraftContainer;
import buildcraft.core.gui.GuiBuildCraft;
import buildcraft.core.utils.StringUtil;
@@ -30,7 +32,8 @@ public abstract class GuiEngine extends GuiBuildCraft {
drawBackground(x, y);
// Draw icon
- drawIcon(DefaultProps.TEXTURE_ICONS, 0, x + 3, y + 4);
+ Minecraft.getMinecraft().renderEngine.bindTexture("/gui/items.png");
+ drawIcon(BuildCraftCore.iconProvider.getIcon(CoreIconProvider.ENERGY), x + 3, y + 4);
if (!isFullyOpened())
return;
diff --git a/common/buildcraft/energy/gui/GuiSteamEngine.java b/common/buildcraft/energy/gui/GuiSteamEngine.java
index fcb73570..d988d954 100644
--- a/common/buildcraft/energy/gui/GuiSteamEngine.java
+++ b/common/buildcraft/energy/gui/GuiSteamEngine.java
@@ -33,9 +33,8 @@ public class GuiSteamEngine extends GuiEngine {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
- int i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/steam_engine_gui.png");
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- mc.renderEngine.bindTexture(i);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ mc.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_GUI + "/steam_engine_gui.png");
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
diff --git a/common/buildcraft/energy/render/RenderEngine.java b/common/buildcraft/energy/render/RenderEngine.java
index 94ec95ee..4e965087 100644
--- a/common/buildcraft/energy/render/RenderEngine.java
+++ b/common/buildcraft/energy/render/RenderEngine.java
@@ -11,9 +11,9 @@ package buildcraft.energy.render;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
+import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.common.ForgeDirection;
import org.lwjgl.opengl.GL11;
@@ -68,6 +68,7 @@ public class RenderEngine extends TileEntitySpecialRenderer implements IInventor
public RenderEngine(String baseTexture) {
this();
this.baseTexture = baseTexture;
+ setTileEntityRenderer(TileEntityRenderer.instance);
}
@Override
@@ -152,7 +153,7 @@ public class RenderEngine extends TileEntitySpecialRenderer implements IInventor
float factor = (float) (1.0 / 16.0);
- ForgeHooksClient.bindTexture(baseTexture, 0);
+ bindTextureByName(baseTexture);
box.render(factor);
@@ -160,7 +161,7 @@ public class RenderEngine extends TileEntitySpecialRenderer implements IInventor
movingBox.render(factor);
GL11.glTranslatef(-translate[0] * translatefact, -translate[1] * translatefact, -translate[2] * translatefact);
- ForgeHooksClient.bindTexture(DefaultProps.TEXTURE_PATH_BLOCKS + "/chamber.png", 0);
+ bindTextureByName(DefaultProps.TEXTURE_PATH_BLOCKS + "/chamber.png");
float chamberf = 2F / 16F;
@@ -190,7 +191,7 @@ public class RenderEngine extends TileEntitySpecialRenderer implements IInventor
break;
}
- ForgeHooksClient.bindTexture(texture, 0);
+ bindTextureByName(texture);
trunk.render(factor);
diff --git a/common/buildcraft/energy/render/TextureFuelFX.java b/common/buildcraft/energy/render/TextureFuelFX.java
deleted file mode 100644
index ec089d16..00000000
--- a/common/buildcraft/energy/render/TextureFuelFX.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * Copyright (c) SpaceToad, 2011
- * http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
- * License 1.0, or MMPL. Please check the contents of the license located in
- * http://www.mod-buildcraft.com/MMPL-1.0.txt
- */
-
-package buildcraft.energy.render;
-
-import buildcraft.BuildCraftEnergy;
-import buildcraft.core.render.TextureLiquidsFX;
-
-public class TextureFuelFX extends TextureLiquidsFX {
-
- public TextureFuelFX() {
- super(150, 250, 150, 250, 0, 10, BuildCraftEnergy.fuel.getIconFromDamage(0), BuildCraftEnergy.fuel.getTextureFile());
- }
-}
diff --git a/common/buildcraft/energy/render/TextureOilFX.java b/common/buildcraft/energy/render/TextureOilFX.java
deleted file mode 100644
index 4eef2419..00000000
--- a/common/buildcraft/energy/render/TextureOilFX.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * Copyright (c) SpaceToad, 2011
- * http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
- * License 1.0, or MMPL. Please check the contents of the license located in
- * http://www.mod-buildcraft.com/MMPL-1.0.txt
- */
-
-package buildcraft.energy.render;
-
-import buildcraft.BuildCraftEnergy;
-import buildcraft.core.render.TextureLiquidsFX;
-
-public class TextureOilFX extends TextureLiquidsFX {
-
- public TextureOilFX() {
- super(10, 31, 10, 31, 10, 31, BuildCraftEnergy.oilStill.blockIndexInTexture, BuildCraftEnergy.oilStill.getTextureFile());
- }
-}
diff --git a/common/buildcraft/energy/render/TextureOilFlowFX.java b/common/buildcraft/energy/render/TextureOilFlowFX.java
deleted file mode 100644
index f19f6ac9..00000000
--- a/common/buildcraft/energy/render/TextureOilFlowFX.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- * Copyright (c) SpaceToad, 2011
- * http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
- * License 1.0, or MMPL. Please check the contents of the license located in
- * http://www.mod-buildcraft.com/MMPL-1.0.txt
- */
-
-package buildcraft.energy.render;
-
-import net.minecraft.client.renderer.RenderEngine;
-
-import org.lwjgl.opengl.GL11;
-
-import buildcraft.BuildCraftEnergy;
-import buildcraft.core.DefaultProps;
-import cpw.mods.fml.client.FMLTextureFX;
-
-public class TextureOilFlowFX extends FMLTextureFX {
-
- public TextureOilFlowFX() {
- super(BuildCraftEnergy.oilMoving.blockIndexInTexture + 1);
-
- tileSize = 2;
-
- }
-
- @Override
- protected void setup() {
- super.setup();
- field_1138_g = new float[tileSizeSquare];
- field_1137_h = new float[tileSizeSquare];
- field_1136_i = new float[tileSizeSquare];
- field_1135_j = new float[tileSizeSquare];
- field_1134_k = 0;
- }
-
- @Override
- public void bindImage(RenderEngine renderengine) {
- GL11.glBindTexture(3553, renderengine.getTexture(DefaultProps.TEXTURE_BLOCKS));
- }
-
- @Override
- public void onTick() {
- field_1134_k++;
- for (int i = 0; i < tileSizeBase; i++) {
- for (int k = 0; k < tileSizeBase; k++) {
- float f = 0.0F;
- for (int j1 = k - 2; j1 <= k; j1++) {
- int k1 = i & tileSizeMask;
- int i2 = j1 & tileSizeMask;
- f += field_1138_g[k1 + i2 * tileSizeBase];
- }
-
- field_1137_h[i + k * tileSizeBase] = f / 3.2F + field_1136_i[i + k * tileSizeBase] * 0.8F;
- }
- }
-
- for (int j = 0; j < tileSizeBase; j++) {
- for (int l = 0; l < tileSizeBase; l++) {
- field_1136_i[j + l * tileSizeBase] += field_1135_j[j + l * tileSizeBase] * 0.05F;
- if (field_1136_i[j + l * tileSizeBase] < 0.0F) {
- field_1136_i[j + l * tileSizeBase] = 0.0F;
- }
- field_1135_j[j + l * tileSizeBase] -= 0.3F;
- if (Math.random() < 0.20000000000000001D) {
- field_1135_j[j + l * tileSizeBase] = 0.5F;
- }
- }
- }
-
- float af[] = field_1137_h;
- field_1137_h = field_1138_g;
- field_1138_g = af;
- for (int i1 = 0; i1 < tileSizeSquare; i1++) {
- float f1 = field_1138_g[i1 - field_1134_k * tileSizeBase & tileSizeSquareMask];
- if (f1 > 1.0F) {
- f1 = 1.0F;
- }
- if (f1 < 0.0F) {
- f1 = 0.0F;
- }
- float f2 = f1 * f1;
- int l1 = (int) (10F + f2 * 22F);
- int j2 = (int) (50F + f2 * 64F);
- int k2 = 255;
- if (anaglyphEnabled) {
- int i3 = (l1 * 30 + j2 * 59 + k2 * 11) / 100;
- int j3 = (l1 * 30 + j2 * 70) / 100;
- int k3 = (l1 * 30 + k2 * 70) / 100;
- l1 = i3;
- j2 = j3;
- k2 = k3;
- }
- // imageData[i1 * 4 + 0] = (byte)l1;
- // imageData[i1 * 4 + 1] = (byte)j2;
- // imageData[i1 * 4 + 2] = (byte) k2;
- // imageData[i1 * 4 + 3] = /*(byte)l2*/(byte)255;
-
- imageData[i1 * 4 + 0] = (byte) l1;
- imageData[i1 * 4 + 1] = (byte) l1;
- imageData[i1 * 4 + 2] = (byte) l1;
- imageData[i1 * 4 + 3] = /* (byte)l2 */(byte) 255;
- }
-
- }
-
- protected float field_1138_g[];
- protected float field_1137_h[];
- protected float field_1136_i[];
- protected float field_1135_j[];
- private int field_1134_k;
-}
diff --git a/common/buildcraft/factory/BlockAutoWorkbench.java b/common/buildcraft/factory/BlockAutoWorkbench.java
index 22c06264..872451b4 100644
--- a/common/buildcraft/factory/BlockAutoWorkbench.java
+++ b/common/buildcraft/factory/BlockAutoWorkbench.java
@@ -12,30 +12,32 @@ package buildcraft.factory;
import java.util.ArrayList;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import net.minecraft.world.World;
import buildcraft.BuildCraftFactory;
import buildcraft.core.BlockBuildCraft;
import buildcraft.core.GuiIds;
import buildcraft.core.IItemPipe;
import buildcraft.core.proxy.CoreProxy;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockAutoWorkbench extends BlockBuildCraft {
- int topTexture;
- int sideTexture;
+ Icon topTexture;
+ Icon sideTexture;
public BlockAutoWorkbench(int i) {
super(i, Material.wood);
- topTexture = 2 * 16 + 11;
- sideTexture = 2 * 16 + 12;
setHardness(1.0F);
}
@Override
- public int getBlockTextureFromSide(int i) {
+ public Icon getBlockTextureFromSideAndMetadata(int i, int j) {
if (i == 1 || i == 0)
return topTexture;
else
@@ -72,4 +74,11 @@ public class BlockAutoWorkbench extends BlockBuildCraft {
public void addCreativeItems(ArrayList itemList) {
itemList.add(new ItemStack(this));
}
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ topTexture = par1IconRegister.registerIcon("buildcraft:autoWorkbench_top");
+ sideTexture = par1IconRegister.registerIcon("buildcraft:autoWorkbench_side");
+ }
}
diff --git a/common/buildcraft/factory/BlockFrame.java b/common/buildcraft/factory/BlockFrame.java
index 2780f4ab..911a4b95 100644
--- a/common/buildcraft/factory/BlockFrame.java
+++ b/common/buildcraft/factory/BlockFrame.java
@@ -1,8 +1,8 @@
-/**
+/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
@@ -15,6 +15,7 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
@@ -23,16 +24,15 @@ import net.minecraft.util.Vec3;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import buildcraft.BuildCraftCore;
-import buildcraft.core.DefaultProps;
import buildcraft.core.IFramePipeConnection;
import buildcraft.core.utils.Utils;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockFrame extends Block implements IFramePipeConnection {
public BlockFrame(int i) {
super(i, Material.glass);
-
- blockIndexInTexture = 16 * 2 + 2;
setHardness(0.5F);
setTickRandomly(true);
}
@@ -44,7 +44,7 @@ public class BlockFrame extends Block implements IFramePipeConnection {
int meta = world.getBlockMetadata(i, j, k);
if (meta == 1 && random.nextInt(10) > 5) {
- world.setBlockWithNotify(i, j, k, 0);
+ world.setBlock(i, j, k, 0);
}
}
@@ -107,38 +107,38 @@ public class BlockFrame extends Block implements IFramePipeConnection {
@SuppressWarnings("rawtypes")
@Override
- public void addCollidingBlockToList(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List arraylist, Entity par7Entity) {
+ public void addCollisionBoxesToList(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List arraylist, Entity par7Entity) {
setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
if (Utils.checkLegacyPipesConnections(world, i, j, k, i - 1, j, k)) {
setBlockBounds(0.0F, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
if (Utils.checkLegacyPipesConnections(world, i, j, k, i + 1, j, k)) {
setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, 1.0F, Utils.pipeMaxPos, Utils.pipeMaxPos);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
if (Utils.checkLegacyPipesConnections(world, i, j, k, i, j - 1, k)) {
setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
if (Utils.checkLegacyPipesConnections(world, i, j, k, i, j + 1, k)) {
setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
if (Utils.checkLegacyPipesConnections(world, i, j, k, i, j, k - 1)) {
setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, 0.0F, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
if (Utils.checkLegacyPipesConnections(world, i, j, k, i, j, k + 1)) {
setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, 1.0F);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
@@ -186,14 +186,16 @@ public class BlockFrame extends Block implements IFramePipeConnection {
return blockAccess.getBlockId(x2, y2, z2) == blockID;
}
- @Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void addCreativeItems(ArrayList itemList) {
itemList.add(new ItemStack(this));
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ blockIcon = par1IconRegister.registerIcon("buildcraft:blockFrame");
+ }
}
diff --git a/common/buildcraft/factory/BlockHopper.java b/common/buildcraft/factory/BlockHopper.java
index 7746a75a..254c47fd 100644
--- a/common/buildcraft/factory/BlockHopper.java
+++ b/common/buildcraft/factory/BlockHopper.java
@@ -3,6 +3,7 @@ package buildcraft.factory;
import java.util.ArrayList;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@@ -13,6 +14,8 @@ import buildcraft.core.BlockBuildCraft;
import buildcraft.core.GuiIds;
import buildcraft.core.IItemPipe;
import buildcraft.core.proxy.CoreProxy;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockHopper extends BlockBuildCraft {
@@ -41,11 +44,6 @@ public class BlockHopper extends BlockBuildCraft {
return BuildCraftCore.blockByEntityModel;
}
- @Override
- public int getBlockTextureFromSide(int par1) {
- return 1;
- }
-
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int par6, float par7, float par8, float par9) {
super.onBlockActivated(world, x, y, z, entityplayer, par6, par7, par8, par9);
@@ -72,4 +70,11 @@ public class BlockHopper extends BlockBuildCraft {
itemList.add(new ItemStack(this));
}
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+// field_94336_cN = par1IconRegister.registerIcons("buildcraft:hopper");
+ }
+
}
diff --git a/common/buildcraft/factory/BlockMiningWell.java b/common/buildcraft/factory/BlockMiningWell.java
index a25ccdaf..afbcee18 100644
--- a/common/buildcraft/factory/BlockMiningWell.java
+++ b/common/buildcraft/factory/BlockMiningWell.java
@@ -12,19 +12,22 @@ package buildcraft.factory;
import java.util.ArrayList;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLiving;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import buildcraft.BuildCraftFactory;
import buildcraft.api.core.Position;
-import buildcraft.core.DefaultProps;
import buildcraft.core.utils.Utils;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockMiningWell extends BlockMachineRoot {
- int textureFront, textureSides, textureBack, textureTop;
+ Icon textureFront, textureSides, textureBack, textureTop;
public BlockMiningWell(int i) {
super(i, Material.ground);
@@ -32,15 +35,10 @@ public class BlockMiningWell extends BlockMachineRoot {
setHardness(1.5F);
setResistance(10F);
setStepSound(soundStoneFootstep);
-
- textureFront = 16 * 2 + 3;
- textureSides = 16 * 2 + 5;
- textureBack = 16 * 2 + 6;
- textureTop = 16 * 2 + 4;
}
@Override
- public int getBlockTextureFromSideAndMetadata(int i, int j) {
+ public Icon getBlockTextureFromSideAndMetadata(int i, int j) {
if (j == 0 && i == 3)
return textureFront;
@@ -57,10 +55,10 @@ public class BlockMiningWell extends BlockMachineRoot {
}
@Override
- public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) {
+ public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving, ItemStack stack) {
ForgeDirection orientation = Utils.get2dOrientation(new Position(entityliving.posX, entityliving.posY, entityliving.posZ), new Position(i, j, k));
- world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal());
+ world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal(),1);
}
@Override
@@ -72,7 +70,7 @@ public class BlockMiningWell extends BlockMachineRoot {
if (pipeID != BuildCraftFactory.plainPipeBlock.blockID) {
break;
}
- world.setBlockWithNotify(x, depth, z, 0);
+ world.setBlock(x, depth, z, 0);
}
}
@@ -81,14 +79,19 @@ public class BlockMiningWell extends BlockMachineRoot {
return new TileMiningWell();
}
- @Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void addCreativeItems(ArrayList itemList) {
itemList.add(new ItemStack(this));
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ textureFront = par1IconRegister.registerIcon("buildcraft:miningwell_front");
+ textureSides = par1IconRegister.registerIcon("buildcraft:miningwell_side");
+ textureBack = par1IconRegister.registerIcon("buildcraft:miningwell_back");
+ textureTop = par1IconRegister.registerIcon("buildcraft:miningwell_top");
+ }
}
diff --git a/common/buildcraft/factory/BlockPlainPipe.java b/common/buildcraft/factory/BlockPlainPipe.java
index 2853c744..a70cf2e6 100644
--- a/common/buildcraft/factory/BlockPlainPipe.java
+++ b/common/buildcraft/factory/BlockPlainPipe.java
@@ -1,8 +1,8 @@
-/**
+/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
@@ -14,19 +14,19 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.world.IBlockAccess;
-import buildcraft.core.DefaultProps;
import buildcraft.core.IFramePipeConnection;
import buildcraft.core.utils.Utils;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockPlainPipe extends Block implements IFramePipeConnection {
public BlockPlainPipe(int i) {
super(i, Material.glass);
- blockIndexInTexture = 16 * 2 + 0;
-
minX = Utils.pipeMinPos;
minY = 0.0;
minZ = Utils.pipeMinPos;
@@ -60,11 +60,6 @@ public class BlockPlainPipe extends Block implements IFramePipeConnection {
return false;
}
- @Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
public float getHeightInPipe() {
return 0.5F;
}
@@ -75,4 +70,11 @@ public class BlockPlainPipe extends Block implements IFramePipeConnection {
itemList.add(new ItemStack(this));
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ par1IconRegister.registerIcon("buildcraft:blockPlainPipe");
+ }
}
diff --git a/common/buildcraft/factory/BlockPump.java b/common/buildcraft/factory/BlockPump.java
index b65080e3..1a251dcf 100644
--- a/common/buildcraft/factory/BlockPump.java
+++ b/common/buildcraft/factory/BlockPump.java
@@ -1,8 +1,8 @@
-/**
+/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
- *
- * BuildCraft is distributed under the terms of the Minecraft Mod Public
+ *
+ * BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
@@ -13,16 +13,23 @@ import java.util.ArrayList;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import net.minecraft.world.World;
import buildcraft.core.CreativeTabBuildCraft;
-import buildcraft.core.DefaultProps;
import buildcraft.core.utils.Utils;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockPump extends BlockContainer {
- public BlockPump(int i) {
+ private Icon textureTop;
+ private Icon textureBottom;
+ private Icon textureSide;
+
+ public BlockPump(int i) {
super(i, Material.iron);
setHardness(5F);
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
@@ -34,19 +41,14 @@ public class BlockPump extends BlockContainer {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
- @Override
- public int getBlockTextureFromSide(int i) {
+ public Icon getBlockTextureFromSideAndMetadata(int i, int j) {
switch (i) {
case 0:
- return 6 * 16 + 4;
+ return textureBottom;
case 1:
- return 6 * 16 + 5;
+ return textureTop;
default:
- return 6 * 16 + 3;
+ return textureSide;
}
}
@@ -61,4 +63,13 @@ public class BlockPump extends BlockContainer {
public void addCreativeItems(ArrayList itemList) {
itemList.add(new ItemStack(this));
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ textureTop = par1IconRegister.registerIcon("buildcraft:pump_top");
+ textureBottom = par1IconRegister.registerIcon("buildcraft:pump_bottom");
+ textureSide = par1IconRegister.registerIcon("buildcraft:pump_side");
+ }
}
diff --git a/common/buildcraft/factory/BlockQuarry.java b/common/buildcraft/factory/BlockQuarry.java
index 53e4295e..3e4704ea 100644
--- a/common/buildcraft/factory/BlockQuarry.java
+++ b/common/buildcraft/factory/BlockQuarry.java
@@ -12,26 +12,29 @@ package buildcraft.factory;
import java.util.ArrayList;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import buildcraft.BuildCraftFactory;
import buildcraft.api.core.Position;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.Box;
-import buildcraft.core.DefaultProps;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.Utils;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockQuarry extends BlockMachineRoot {
- int textureTop;
- int textureFront;
- int textureSide;
+ Icon textureTop;
+ Icon textureFront;
+ Icon textureSide;
public BlockQuarry(int i) {
super(i, Material.iron);
@@ -39,20 +42,15 @@ public class BlockQuarry extends BlockMachineRoot {
setHardness(1.5F);
setResistance(10F);
setStepSound(soundStoneFootstep);
-
- textureSide = 2 * 16 + 9;
- textureFront = 2 * 16 + 7;
- textureTop = 2 * 16 + 8;
-
}
@Override
- public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) {
- super.onBlockPlacedBy(world, i, j, k, entityliving);
+ public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving, ItemStack stack) {
+ super.onBlockPlacedBy(world, i, j, k, entityliving, stack);
ForgeDirection orientation = Utils.get2dOrientation(new Position(entityliving.posX, entityliving.posY, entityliving.posZ), new Position(i, j, k));
- world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal());
+ world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal(),1);
if (entityliving instanceof EntityPlayer) {
TileQuarry tq = (TileQuarry) world.getBlockTileEntity(i, j, k);
tq.placedBy = (EntityPlayer) entityliving;
@@ -60,7 +58,7 @@ public class BlockQuarry extends BlockMachineRoot {
}
@Override
- public int getBlockTextureFromSideAndMetadata(int i, int j) {
+ public Icon getBlockTextureFromSideAndMetadata(int i, int j) {
// If no metadata is set, then this is an icon.
if (j == 0 && i == 3)
return textureFront;
@@ -94,7 +92,7 @@ public class BlockQuarry extends BlockMachineRoot {
int meta = world.getBlockMetadata(i, j, k);
if ((meta & 8) == 0) {
- world.setBlockMetadata(i, j, k, meta | 8);
+ world.setBlockMetadataWithNotify(i, j, k, meta | 8,0);
ForgeDirection[] dirs = ForgeDirection.VALID_DIRECTIONS;
@@ -120,7 +118,7 @@ public class BlockQuarry extends BlockMachineRoot {
private void markFrameForDecay(World world, int x, int y, int z) {
if (world.getBlockId(x, y, z) == BuildCraftFactory.frameBlock.blockID) {
- world.setBlockMetadata(x, y, z, 1);
+ world.setBlockMetadataWithNotify(x, y, z, 1,0);
}
}
@@ -217,14 +215,18 @@ public class BlockQuarry extends BlockMachineRoot {
return false;
}
- @Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void addCreativeItems(ArrayList itemList) {
itemList.add(new ItemStack(this));
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ textureSide = par1IconRegister.registerIcon("buildcraft:quarry_side");
+ textureTop = par1IconRegister.registerIcon("buildcraft:quarry_top");
+ textureFront = par1IconRegister.registerIcon("buildcraft:quarry_front");
+ }
}
diff --git a/common/buildcraft/factory/BlockRefinery.java b/common/buildcraft/factory/BlockRefinery.java
index 93b1f88a..bcbb2f74 100644
--- a/common/buildcraft/factory/BlockRefinery.java
+++ b/common/buildcraft/factory/BlockRefinery.java
@@ -13,6 +13,7 @@ import java.util.ArrayList;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -30,6 +31,8 @@ import buildcraft.core.CreativeTabBuildCraft;
import buildcraft.core.GuiIds;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.Utils;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockRefinery extends BlockContainer {
@@ -65,12 +68,12 @@ public class BlockRefinery extends BlockContainer {
}
@Override
- public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) {
- super.onBlockPlacedBy(world, i, j, k, entityliving);
+ public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving, ItemStack stack) {
+ super.onBlockPlacedBy(world, i, j, k, entityliving, stack);
ForgeDirection orientation = Utils.get2dOrientation(new Position(entityliving.posX, entityliving.posY, entityliving.posZ), new Position(i, j, k));
- world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal());
+ world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal(),1);
}
@Override
@@ -86,17 +89,17 @@ public class BlockRefinery extends BlockContainer {
switch (ForgeDirection.values()[meta]) {
case WEST:
- world.setBlockMetadata(i, j, k, ForgeDirection.SOUTH.ordinal());
+ world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.SOUTH.ordinal(),0);
break;
case EAST:
- world.setBlockMetadata(i, j, k, ForgeDirection.NORTH.ordinal());
+ world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.NORTH.ordinal(),0);
break;
case NORTH:
- world.setBlockMetadata(i, j, k, ForgeDirection.WEST.ordinal());
+ world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.WEST.ordinal(),0);
break;
case SOUTH:
default:
- world.setBlockMetadata(i, j, k, ForgeDirection.EAST.ordinal());
+ world.setBlockMetadataWithNotify(i, j, k, ForgeDirection.EAST.ordinal(),0);
break;
}
((IToolWrench) equipped).wrenchUsed(entityplayer, i, j, k);
@@ -131,4 +134,10 @@ public class BlockRefinery extends BlockContainer {
itemList.add(new ItemStack(this));
}
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ // NOOP
+ }
}
diff --git a/common/buildcraft/factory/BlockTank.java b/common/buildcraft/factory/BlockTank.java
index fb67bf4e..7998573e 100644
--- a/common/buildcraft/factory/BlockTank.java
+++ b/common/buildcraft/factory/BlockTank.java
@@ -13,9 +13,11 @@ import java.util.ArrayList;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
@@ -23,12 +25,17 @@ import net.minecraftforge.liquids.LiquidContainerRegistry;
import net.minecraftforge.liquids.LiquidStack;
import buildcraft.BuildCraftCore;
import buildcraft.core.CreativeTabBuildCraft;
-import buildcraft.core.DefaultProps;
import buildcraft.core.utils.Utils;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockTank extends BlockContainer {
- public BlockTank(int i) {
+ private Icon textureStackedSide;
+ private Icon textureBottomSide;
+ private Icon textureTop;
+
+ public BlockTank(int i) {
super(i, Material.glass);
setBlockBounds(0.125F, 0F, 0.125F, 0.875F, 1F, 0.875F);
setHardness(0.5F);
@@ -55,32 +62,28 @@ public class BlockTank extends BlockContainer {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
- @Override
- public int getBlockTextureFromSide(int i) {
- switch (i) {
+ @SideOnly(Side.CLIENT)
+ public Icon getBlockTextureFromSideAndMetadata(int par1, int par2) {
+ switch(par1){
case 0:
case 1:
- return 6 * 16 + 2;
+ return textureTop;
default:
- return 6 * 16 + 0;
+ return textureBottomSide;
}
}
-
+
@SuppressWarnings({ "all" })
- public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) {
+ public Icon getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) {
switch (l) {
case 0:
case 1:
- return 6 * 16 + 2;
+ return textureTop;
default:
if (iblockaccess.getBlockId(i, j - 1, k) == blockID)
- return 6 * 16 + 1;
+ return textureStackedSide;
else
- return 6 * 16 + 0;
+ return textureBottomSide;
}
}
@@ -142,4 +145,13 @@ public class BlockTank extends BlockContainer {
itemList.add(new ItemStack(this));
}
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ textureStackedSide = par1IconRegister.registerIcon("buildcraft:tank_stacked_side");
+ textureBottomSide = par1IconRegister.registerIcon("buildcraft:tank_bottom_side");
+ textureTop = par1IconRegister.registerIcon("buildcraft:tank_top");
+ }
+
}
diff --git a/common/buildcraft/factory/BptBlockAutoWorkbench.java b/common/buildcraft/factory/BptBlockAutoWorkbench.java
index a120b6e8..5fad3b8c 100644
--- a/common/buildcraft/factory/BptBlockAutoWorkbench.java
+++ b/common/buildcraft/factory/BptBlockAutoWorkbench.java
@@ -18,6 +18,7 @@ import buildcraft.api.blueprints.BptBlockUtils;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockAutoWorkbench extends BptBlock {
public BptBlockAutoWorkbench(int blockId) {
diff --git a/common/buildcraft/factory/BptBlockFrame.java b/common/buildcraft/factory/BptBlockFrame.java
index fe268f90..fd860e13 100644
--- a/common/buildcraft/factory/BptBlockFrame.java
+++ b/common/buildcraft/factory/BptBlockFrame.java
@@ -16,6 +16,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockFrame extends BptBlock {
public BptBlockFrame(int blockId) {
diff --git a/common/buildcraft/factory/BptBlockRefinery.java b/common/buildcraft/factory/BptBlockRefinery.java
index 5f9420fa..f4d6a094 100644
--- a/common/buildcraft/factory/BptBlockRefinery.java
+++ b/common/buildcraft/factory/BptBlockRefinery.java
@@ -13,6 +13,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockRefinery extends BptBlock {
public BptBlockRefinery(int blockId) {
diff --git a/common/buildcraft/factory/BptBlockTank.java b/common/buildcraft/factory/BptBlockTank.java
index 89791c8e..4ba90ca4 100644
--- a/common/buildcraft/factory/BptBlockTank.java
+++ b/common/buildcraft/factory/BptBlockTank.java
@@ -4,6 +4,7 @@ import buildcraft.api.blueprints.BptBlock;
import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
+@Deprecated
public class BptBlockTank extends BptBlock {
public BptBlockTank(int blockId) {
@@ -17,7 +18,7 @@ public class BptBlockTank extends BptBlock {
@Override
public void buildBlock(BptSlotInfo slot, IBptContext context) {
- context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, slot.meta);
+ context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,1);
}
}
diff --git a/common/buildcraft/factory/EntityMechanicalArm.java b/common/buildcraft/factory/EntityMechanicalArm.java
index 7f78f6ad..6137e288 100644
--- a/common/buildcraft/factory/EntityMechanicalArm.java
+++ b/common/buildcraft/factory/EntityMechanicalArm.java
@@ -13,7 +13,6 @@ import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-import buildcraft.BuildCraftFactory;
import buildcraft.core.EntityBlock;
public class EntityMechanicalArm extends Entity {
@@ -71,17 +70,11 @@ public class EntityMechanicalArm extends Entity {
}
private void makeParts(World world) {
- xArm = new EntityBlock(world, 0, 0, 0, 1, 0.5, 0.5);
- xArm.texture = BuildCraftFactory.drillTexture;
+ xArm = FactoryProxy.proxy.newDrill(world, 0, 0, 0, 1, 0.5, 0.5);
+ yArm = FactoryProxy.proxy.newDrill(world, 0, 0, 0, 0.5, 1, 0.5);
+ zArm = FactoryProxy.proxy.newDrill(world, 0, 0, 0, 0.5, 0.5, 1);
- yArm = new EntityBlock(world, 0, 0, 0, 0.5, 1, 0.5);
- yArm.texture = BuildCraftFactory.drillTexture;
-
- zArm = new EntityBlock(world, 0, 0, 0, 0.5, 0.5, 1);
- zArm.texture = BuildCraftFactory.drillTexture;
-
- head = new EntityBlock(world, 0, 0, 0, 0.2, 1, 0.2);
- head.texture = 2 * 16 + 10;
+ head = FactoryProxy.proxy.newDrillHead(world, 0, 0, 0, 0.2, 1, 0.2);
head.shadowSize = 1.0F;
world.spawnEntityInWorld(xArm);
diff --git a/common/buildcraft/factory/FactoryProxy.java b/common/buildcraft/factory/FactoryProxy.java
index 0f7f6769..47d097be 100644
--- a/common/buildcraft/factory/FactoryProxy.java
+++ b/common/buildcraft/factory/FactoryProxy.java
@@ -1,5 +1,7 @@
package buildcraft.factory;
+import net.minecraft.world.World;
+import buildcraft.core.EntityBlock;
import cpw.mods.fml.common.SidedProxy;
public class FactoryProxy {
@@ -14,4 +16,19 @@ public class FactoryProxy {
public void initializeNEIIntegration() {
}
+
+ public EntityBlock newPumpTube(World w)
+ {
+ return new EntityBlock(w);
+ }
+
+ public EntityBlock newDrill(World w, double i, double j, double k, double l, double d, double e)
+ {
+ return new EntityBlock(w, i, j, k, l, d, e);
+ }
+
+ public EntityBlock newDrillHead(World w, double i, double j, double k, double l, double d, double e)
+ {
+ return new EntityBlock(w, i, j, k, l, d, e);
+ }
}
diff --git a/common/buildcraft/factory/FactoryProxyClient.java b/common/buildcraft/factory/FactoryProxyClient.java
index 8008a6c6..276a6e5e 100644
--- a/common/buildcraft/factory/FactoryProxyClient.java
+++ b/common/buildcraft/factory/FactoryProxyClient.java
@@ -2,8 +2,11 @@ package buildcraft.factory;
import java.lang.reflect.Method;
+import net.minecraft.util.Icon;
+import net.minecraft.world.World;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftFactory;
+import buildcraft.core.EntityBlock;
import buildcraft.core.render.RenderVoid;
import buildcraft.core.render.RenderingEntityBlocks;
import buildcraft.core.render.RenderingEntityBlocks.EntityRenderIndex;
@@ -15,7 +18,11 @@ import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
public class FactoryProxyClient extends FactoryProxy {
- @Override
+ public static Icon pumpTexture;
+ public static Icon drillTexture;
+ public static Icon drillHeadTexture;
+
+ @Override
public void initializeTileEntities() {
super.initializeTileEntities();
ClientRegistry.bindTileEntitySpecialRenderer(TileTank.class, new RenderTank());
@@ -45,4 +52,28 @@ public class FactoryProxyClient extends FactoryProxy {
BuildCraftCore.bcLog.fine("NEI not detected.");
}
}
+
+ @Override
+ public EntityBlock newPumpTube(World w)
+ {
+ EntityBlock eb = super.newPumpTube(w);
+ eb.texture = pumpTexture;
+ return eb;
+ }
+
+ @Override
+ public EntityBlock newDrill(World w, double i, double j, double k, double l, double d, double e)
+ {
+ EntityBlock eb = super.newDrill(w, i, j, k, l, d, e);
+ eb.texture = drillTexture;
+ return eb;
+ }
+
+ @Override
+ public EntityBlock newDrillHead(World w, double i, double j, double k, double l, double d, double e)
+ {
+ EntityBlock eb = super.newDrillHead(w, i, j, k, l, d, e);
+ eb.texture = drillHeadTexture;
+ return eb;
+ }
}
diff --git a/common/buildcraft/factory/TileAutoWorkbench.java b/common/buildcraft/factory/TileAutoWorkbench.java
index a3c3f92c..170ca502 100644
--- a/common/buildcraft/factory/TileAutoWorkbench.java
+++ b/common/buildcraft/factory/TileAutoWorkbench.java
@@ -16,7 +16,6 @@ import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
-import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
@@ -28,15 +27,15 @@ import buildcraft.api.core.Position;
import buildcraft.api.inventory.ISpecialInventory;
import buildcraft.core.inventory.TransactorRoundRobin;
import buildcraft.core.proxy.CoreProxy;
+import buildcraft.core.utils.CraftingHelper;
import buildcraft.core.utils.SidedInventoryAdapter;
import buildcraft.core.utils.Utils;
-import buildcraft.core.utils.CraftingHelper;
public class TileAutoWorkbench extends TileEntity implements ISpecialInventory {
private ItemStack stackList[] = new ItemStack[9];
private IRecipe currentRecipe = null;
-
+
class LocalInventoryCrafting extends InventoryCrafting {
public LocalInventoryCrafting() {
@@ -193,7 +192,7 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory {
if(this.currentRecipe == null || !this.currentRecipe.matches(craftMatrix, worldObj))
currentRecipe = buildcraft.core.utils.CraftingHelper.findMatchingRecipe(craftMatrix, worldObj);
-
+
ItemStack resultStack = null;
if(currentRecipe != null) {
resultStack = currentRecipe.getCraftingResult(craftMatrix);
@@ -274,22 +273,22 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory {
public StackPointer getNearbyItemFromOrientation(ItemStack itemStack, ForgeDirection direction) {
TileEntity tile = worldObj.getBlockTileEntity(xCoord + direction.offsetX, yCoord + direction.offsetY, zCoord + direction.offsetZ);
-
+
if (tile instanceof ISpecialInventory) {
// Don't get stuff out of ISpecialInventory for now / we wouldn't
// know how to put it back... And it's not clear if we want to
// have workbenches automatically getting things from one another.
return null;
}
-
+
IInventory inventory = null;
if (tile instanceof ISidedInventory){
inventory = new SidedInventoryAdapter((ISidedInventory) tile, direction.getOpposite());
} else if (tile instanceof IInventory) {
inventory = Utils.getInventory((IInventory) tile);
}
-
- if (inventory == null) return null;
+
+ if (inventory == null) return null;
for (int j = 0; j < inventory.getSizeInventory(); ++j) {
ItemStack stack = inventory.getStackInSlot(j);
@@ -407,4 +406,18 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory {
return new ItemStack[] { extractItem(doRemove, false) };
}
+ @Override
+ public boolean isInvNameLocalized()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isStackValidForSlot(int i, ItemStack itemstack)
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
}
diff --git a/common/buildcraft/factory/TileHopper.java b/common/buildcraft/factory/TileHopper.java
index 56ef8bda..c476b953 100644
--- a/common/buildcraft/factory/TileHopper.java
+++ b/common/buildcraft/factory/TileHopper.java
@@ -6,9 +6,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
+import buildcraft.core.TileBuildCraft;
import buildcraft.core.inventory.ITransactor;
import buildcraft.core.inventory.Transactor;
-import buildcraft.core.TileBuildCraft;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.SimpleInventory;
@@ -34,7 +34,7 @@ public class TileHopper extends TileBuildCraft implements IInventory {
@Override
public void updateEntity() {
super.updateEntity();
- if (CoreProxy.proxy.isRenderWorld(worldObj) || worldObj.getWorldTime() % 5 != 0)
+ if (CoreProxy.proxy.isRenderWorld(worldObj) || worldObj.getWorldTime() % 2 != 0)
return;
TileEntity tile = this.worldObj.getBlockTileEntity(xCoord, yCoord - 1, zCoord);
diff --git a/common/buildcraft/factory/TileMachine.java b/common/buildcraft/factory/TileMachine.java
index 92fb99c3..1a7d57b4 100644
--- a/common/buildcraft/factory/TileMachine.java
+++ b/common/buildcraft/factory/TileMachine.java
@@ -9,6 +9,7 @@
package buildcraft.factory;
+import net.minecraftforge.common.ForgeDirection;
import buildcraft.api.power.IPowerReceptor;
import buildcraft.core.IMachine;
import buildcraft.core.TileBuildCraft;
@@ -16,7 +17,7 @@ import buildcraft.core.TileBuildCraft;
public abstract class TileMachine extends TileBuildCraft implements IMachine, IPowerReceptor {
@Override
- public int powerRequest() {
+ public int powerRequest(ForgeDirection from) {
if (isActive())
return (int) Math.ceil(Math.min(getPowerProvider().getMaxEnergyReceived(), getPowerProvider().getMaxEnergyStored()
- getPowerProvider().getEnergyStored()));
diff --git a/common/buildcraft/factory/TileMiningWell.java b/common/buildcraft/factory/TileMiningWell.java
index 7de83b7b..72ed2d51 100644
--- a/common/buildcraft/factory/TileMiningWell.java
+++ b/common/buildcraft/factory/TileMiningWell.java
@@ -61,7 +61,7 @@ public class TileMiningWell extends TileMachine implements IMachine, IPowerRecep
List stacks = BlockUtil.getItemStackFromBlock(worldObj, xCoord, depth, zCoord);
- world.setBlockWithNotify(xCoord, depth, zCoord, BuildCraftFactory.plainPipeBlock.blockID);
+ world.setBlock(xCoord, depth, zCoord, BuildCraftFactory.plainPipeBlock.blockID);
if (blockId == 0)
return;
@@ -78,7 +78,7 @@ public class TileMiningWell extends TileMachine implements IMachine, IPowerRecep
}
if (Utils.addToRandomPipeEntry(this, ForgeDirection.UNKNOWN, stack) && stack.stackSize <= 0)
- return;
+ continue;
// Throw the object away.
// TODO: factorize that code
diff --git a/common/buildcraft/factory/TilePump.java b/common/buildcraft/factory/TilePump.java
index 00a49cf4..0f1d8471 100644
--- a/common/buildcraft/factory/TilePump.java
+++ b/common/buildcraft/factory/TilePump.java
@@ -89,7 +89,7 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor, I
index = getNextIndexToPump(true);
if (liquidToPump.itemID != Block.waterStill.blockID || BuildCraftCore.consumeWaterSources) {
- worldObj.setBlockWithNotify(index.i, index.j, index.k, 0);
+ worldObj.setBlock(index.i, index.j, index.k, 0);
}
tank.fill(liquidToPump, true);
@@ -140,8 +140,7 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor, I
@Override
public void initialize() {
- tube = new EntityBlock(worldObj);
- tube.texture = 6 * 16 + 6;
+ tube = FactoryProxy.proxy.newPumpTube(worldObj);
if (!Double.isNaN(tubeY)) {
tube.posY = tubeY;
diff --git a/common/buildcraft/factory/TileQuarry.java b/common/buildcraft/factory/TileQuarry.java
index 86126fb2..76e4d34c 100755
--- a/common/buildcraft/factory/TileQuarry.java
+++ b/common/buildcraft/factory/TileQuarry.java
@@ -389,6 +389,7 @@ public class TileQuarry extends TileMachine implements IMachine, IPowerReceptor,
nbttagcompound.setTag("box", boxTag);
}
+ @SuppressWarnings("rawtypes")
public void positionReached() {
inProcess = false;
@@ -417,7 +418,7 @@ public class TileQuarry extends TileMachine implements IMachine, IPowerReceptor,
}
worldObj.playAuxSFXAtEntity(null, 2001, i, j, k, blockId + (worldObj.getBlockMetadata(i, j, k) << 12));
- worldObj.setBlockWithNotify(i, j, k, 0);
+ worldObj.setBlock(i, j, k, 0);
}
// Collect any lost items laying around
diff --git a/common/buildcraft/factory/TileTank.java b/common/buildcraft/factory/TileTank.java
index 2e50da29..08440487 100644
--- a/common/buildcraft/factory/TileTank.java
+++ b/common/buildcraft/factory/TileTank.java
@@ -23,7 +23,6 @@ import buildcraft.core.TileBuildCraft;
import buildcraft.core.network.PacketPayload;
import buildcraft.core.network.PacketUpdate;
import buildcraft.core.proxy.CoreProxy;
-import net.minecraft.item.Item;
public class TileTank extends TileBuildCraft implements ITankContainer {
@@ -84,9 +83,8 @@ public class TileTank extends TileBuildCraft implements ITankContainer {
LiquidStack liquid = new LiquidStack(data.getInteger("liquidId"), data.getInteger("stored"), 0);
tank.setLiquid(liquid);
} else {
- LiquidStack liquid = new LiquidStack(0, 0, 0);
- liquid.readFromNBT(data.getCompoundTag("tank"));
- if (Item.itemsList[liquid.itemID] != null && liquid.amount > 0) {
+ LiquidStack liquid = LiquidStack.loadLiquidStackFromNBT(data.getCompoundTag("tank"));
+ if (liquid != null) {
tank.setLiquid(liquid);
}
}
@@ -95,7 +93,7 @@ public class TileTank extends TileBuildCraft implements ITankContainer {
@Override
public void writeToNBT(NBTTagCompound data) {
super.writeToNBT(data);
- if (tank.getLiquid() != null) {
+ if (tank.containsValidLiquid()) {
data.setTag("tank", tank.getLiquid().writeToNBT(new NBTTagCompound()));
}
}
@@ -184,7 +182,7 @@ public class TileTank extends TileBuildCraft implements ITankContainer {
resource = resource.copy();
int totalUsed = 0;
TileTank tankToFill = getBottomTank();
-
+
LiquidStack liquid = tankToFill.tank.getLiquid();
if (liquid != null && liquid.amount > 0 && !liquid.isLiquidEqual(resource)) {
return 0;
diff --git a/common/buildcraft/factory/gui/ContainerAutoWorkbench.java b/common/buildcraft/factory/gui/ContainerAutoWorkbench.java
index c892548e..0946b844 100644
--- a/common/buildcraft/factory/gui/ContainerAutoWorkbench.java
+++ b/common/buildcraft/factory/gui/ContainerAutoWorkbench.java
@@ -52,7 +52,7 @@ public class ContainerAutoWorkbench extends BuildCraftContainer {
thePlayer.addStat(AchievementList.buildWorkBench, 1);
} else if (itemstack.itemID == Item.pickaxeWood.itemID) {
thePlayer.addStat(AchievementList.buildPickaxe, 1);
- } else if (itemstack.itemID == Block.stoneOvenIdle.blockID) {
+ } else if (itemstack.itemID == Block.furnaceIdle.blockID) {
thePlayer.addStat(AchievementList.buildFurnace, 1);
} else if (itemstack.itemID == Item.hoeWood.itemID) {
thePlayer.addStat(AchievementList.buildHoe, 1);
diff --git a/common/buildcraft/factory/gui/GuiAutoCrafting.java b/common/buildcraft/factory/gui/GuiAutoCrafting.java
index e2783d91..14bb32e5 100644
--- a/common/buildcraft/factory/gui/GuiAutoCrafting.java
+++ b/common/buildcraft/factory/gui/GuiAutoCrafting.java
@@ -41,9 +41,8 @@ public class GuiAutoCrafting extends GuiBuildCraft {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
- int i = mc.renderEngine.getTexture("/gui/crafting.png");
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- mc.renderEngine.bindTexture(i);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ mc.renderEngine.bindTexture("/gui/crafting.png");
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
diff --git a/common/buildcraft/factory/gui/GuiHopper.java b/common/buildcraft/factory/gui/GuiHopper.java
index 11892b22..00659245 100644
--- a/common/buildcraft/factory/gui/GuiHopper.java
+++ b/common/buildcraft/factory/gui/GuiHopper.java
@@ -17,9 +17,8 @@ public class GuiHopper extends GuiContainer {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
- int i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/hopper_gui.png");
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- mc.renderEngine.bindTexture(i);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ mc.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_GUI + "/hopper_gui.png");
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
diff --git a/common/buildcraft/factory/gui/GuiRefinery.java b/common/buildcraft/factory/gui/GuiRefinery.java
index 2e3154ba..c2b913a0 100644
--- a/common/buildcraft/factory/gui/GuiRefinery.java
+++ b/common/buildcraft/factory/gui/GuiRefinery.java
@@ -54,9 +54,8 @@ public class GuiRefinery extends GuiAdvancedInterface {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
- int i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/refinery_filter.png");
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- mc.renderEngine.bindTexture(i);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ mc.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_GUI + "/refinery_filter.png");
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
diff --git a/common/buildcraft/factory/render/RenderHopper.java b/common/buildcraft/factory/render/RenderHopper.java
index 1ef1bb39..0b855d2a 100644
--- a/common/buildcraft/factory/render/RenderHopper.java
+++ b/common/buildcraft/factory/render/RenderHopper.java
@@ -3,9 +3,9 @@ package buildcraft.factory.render;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.client.ForgeHooksClient;
import org.lwjgl.opengl.GL11;
@@ -35,6 +35,7 @@ public class RenderHopper extends TileEntitySpecialRenderer implements IInventor
bottom.rotationPointX = 8F;
bottom.rotationPointY = 8F;
bottom.rotationPointZ = 8F;
+ setTileEntityRenderer(TileEntityRenderer.instance);
}
@Override
@@ -55,10 +56,10 @@ public class RenderHopper extends TileEntitySpecialRenderer implements IInventor
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslated(x, y, z);
- ForgeHooksClient.bindTexture(DefaultProps.TEXTURE_PATH_BLOCKS + "/hopper.png", 0);
+ bindTextureByName(DefaultProps.TEXTURE_PATH_BLOCKS + "/hopper.png");
top.render((float) (1.0 / 16.0));
bottom.render((float) (1.0 / 16.0));
- ForgeHooksClient.bindTexture(DefaultProps.TEXTURE_PATH_BLOCKS + "/hopper_middle.png", 0);
+ bindTextureByName(DefaultProps.TEXTURE_PATH_BLOCKS + "/hopper_middle.png");
middle.render(Tessellator.instance, 1F / 16F);
GL11.glEnable(GL11.GL_LIGHTING);
diff --git a/common/buildcraft/factory/render/RenderRefinery.java b/common/buildcraft/factory/render/RenderRefinery.java
index 4f467d1f..1c4b8b6f 100644
--- a/common/buildcraft/factory/render/RenderRefinery.java
+++ b/common/buildcraft/factory/render/RenderRefinery.java
@@ -12,14 +12,15 @@ package buildcraft.factory.render;
import java.util.HashMap;
import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GLAllocation;
+import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-import net.minecraftforge.client.ForgeHooksClient;
import org.lwjgl.opengl.GL11;
@@ -33,10 +34,10 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements IInvent
static final float factor = (float) (1.0 / 16.0);
- private ModelRenderer tank;
- private ModelRenderer magnet[] = new ModelRenderer[4];
+ private final ModelRenderer tank;
+ private final ModelRenderer magnet[] = new ModelRenderer[4];
- private ModelBase model = new ModelBase() {
+ private final ModelBase model = new ModelBase() {
};
public RenderRefinery() {
@@ -59,11 +60,12 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements IInvent
}
+ setTileEntityRenderer(TileEntityRenderer.instance);
}
final static private int displayStages = 100;
- private HashMap> stage = new HashMap>();
+ private final HashMap> stage = new HashMap>();
private int[] getDisplayLists(int liquidId, int damage, World world) {
@@ -80,10 +82,14 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements IInvent
BlockInterface block = new BlockInterface();
+ String spriteSet = "/gui/items.png";
+
// Retrieve the texture depending on type of item.
if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) {
- block.texture = Block.blocksList[liquidId].getBlockTextureFromSideAndMetadata(0, damage);
+ block.baseBlock = Block.blocksList[liquidId];
+ spriteSet = "/terrain.png";
} else if (Item.itemsList[liquidId] != null) {
+ block.baseBlock = Block.waterStill;
block.texture = Item.itemsList[liquidId].getIconFromDamage(damage);
} else
return null;
@@ -92,6 +98,8 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements IInvent
d[s] = GLAllocation.generateDisplayLists(1);
GL11.glNewList(d[s], 4864 /* GL_COMPILE */);
+ Minecraft.getMinecraft().renderEngine.bindTexture(spriteSet);
+
block.minX = 0.5 - 4F * factor + 0.01;
block.minY = 0;
block.minZ = 0.5 - 4F * factor + 0.01;
@@ -189,7 +197,7 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements IInvent
GL11.glRotatef(angle, 0, 1, 0);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
- ForgeHooksClient.bindTexture(DefaultProps.TEXTURE_PATH_BLOCKS + "/refinery.png", 0);
+ bindTextureByName(DefaultProps.TEXTURE_PATH_BLOCKS + "/refinery.png");
GL11.glTranslatef(-4F * factor, 0, -4F * factor);
tank.render(factor);
GL11.glTranslatef(4F * factor, 0, 4F * factor);
@@ -223,14 +231,11 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements IInvent
theMagnet.render(factor);
GL11.glTranslatef(0, -trans2, -12F * factor);
- GL11.glTranslatef(0.5F, 0.5F, 0.5F);
-
GL11.glTranslatef(-4F * factor, 0, -4F * factor);
if (qty1 > 0) {
int[] list1 = getDisplayLists(liquid1, liquidMeta1, tile.worldObj);
if (list1 != null) {
- setTextureFor(liquid1);
GL11.glCallList(list1[(int) ((float) qty1 / (float) TileRefinery.LIQUID_PER_SLOT * (displayStages - 1))]);
}
}
@@ -241,7 +246,6 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements IInvent
int[] list2 = getDisplayLists(liquid2, liquidMeta2, tile.worldObj);
if (list2 != null) {
- setTextureFor(liquid2);
GL11.glCallList(list2[(int) ((float) qty2 / (float) TileRefinery.LIQUID_PER_SLOT * (displayStages - 1))]);
}
}
@@ -252,7 +256,6 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements IInvent
int[] list3 = getDisplayLists(liquid3, liquidMeta3, tile.worldObj);
if (list3 != null) {
- setTextureFor(liquid3);
GL11.glCallList(list3[(int) ((float) qty3 / (float) TileRefinery.LIQUID_PER_SLOT * (displayStages - 1))]);
}
}
@@ -261,13 +264,4 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements IInvent
GL11.glEnable(2896 /* GL_LIGHTING */);
GL11.glPopMatrix();
}
-
- public void setTextureFor(int liquidId) {
- if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) {
- ForgeHooksClient.bindTexture(Block.blocksList[liquidId].getTextureFile(), 0);
- } else {
- ForgeHooksClient.bindTexture(Item.itemsList[liquidId].getTextureFile(), 0);
- }
-
- }
}
diff --git a/common/buildcraft/factory/render/RenderTank.java b/common/buildcraft/factory/render/RenderTank.java
index 0fc49e37..435585fb 100644
--- a/common/buildcraft/factory/render/RenderTank.java
+++ b/common/buildcraft/factory/render/RenderTank.java
@@ -12,12 +12,11 @@ package buildcraft.factory.render;
import java.util.HashMap;
import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
-import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.liquids.LiquidStack;
import org.lwjgl.opengl.GL11;
@@ -30,33 +29,33 @@ public class RenderTank extends TileEntitySpecialRenderer {
final static private int displayStages = 100;
- private HashMap> stage = new HashMap>();
+ private final HashMap stage = new HashMap();
- private int[] getDisplayLists(int liquidId, int damage, World world) {
+ private int[] getDisplayLists(LiquidStack liquid, World world) {
- if (stage.containsKey(liquidId)) {
- HashMap x = stage.get(liquidId);
- if (x.containsKey(damage))
- return x.get(damage);
- } else {
- stage.put(liquidId, new HashMap());
+ if (stage.containsKey(liquid)) {
+ return stage.get(liquid);
}
int[] d = new int[displayStages];
- stage.get(liquidId).put(damage, d);
+ stage.put(liquid, d);
BlockInterface block = new BlockInterface();
- if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) {
- block.texture = Block.blocksList[liquidId].getBlockTextureFromSideAndMetadata(0, damage);
- } else if (Item.itemsList[liquidId] != null) {
- block.texture = Item.itemsList[liquidId].getIconFromDamage(damage);
- } else
- return null;
+ block.baseBlock = Block.waterStill;
+ block.texture = liquid.getRenderingIcon();
+
+ String spriteSet = liquid.getTextureSheet();
+
+ if (liquid.itemID < Block.blocksList.length && Block.blocksList[liquid.itemID] != null) {
+ block.baseBlock = Block.blocksList[liquid.itemID];
+ }
for (int s = 0; s < displayStages; ++s) {
d[s] = GLAllocation.generateDisplayLists(1);
GL11.glNewList(d[s], 4864 /* GL_COMPILE */);
+ Minecraft.getMinecraft().renderEngine.bindTexture(spriteSet);
+
block.minX = 0.125 + 0.01;
block.minY = 0;
block.minZ = 0.125 + 0.01;
@@ -79,29 +78,22 @@ public class RenderTank extends TileEntitySpecialRenderer {
TileTank tank = ((TileTank) tileentity);
LiquidStack liquid = tank.tank.getLiquid();
+ if (liquid == null)
+ return;
- if (liquid == null || liquid.amount <= 0 || liquid.itemID <= 0)
+ LiquidStack refLiquid = liquid.canonical();
+
+ if (refLiquid == null || liquid.amount <= 0)
return;
- int[] displayList = getDisplayLists(liquid.itemID, liquid.itemMeta, tileentity.worldObj);
+ int[] displayList = getDisplayLists(refLiquid, tileentity.worldObj);
if (displayList == null)
return;
-
- String textureFile;
- if (liquid.itemID < Block.blocksList.length && Block.blocksList[liquid.itemID] != null) {
- textureFile = Block.blocksList[liquid.itemID].getTextureFile();
- } else if (Item.itemsList[liquid.itemID] != null){
- textureFile = Item.itemsList[liquid.itemID].getTextureFile();
- } else {
- return;
- }
GL11.glPushMatrix();
GL11.glDisable(2896 /* GL_LIGHTING */);
-
- ForgeHooksClient.bindTexture(textureFile, 0);
- GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F);
+ GL11.glTranslatef((float) x, (float) y, (float) z);
GL11.glCallList(displayList[(int) ((float) liquid.amount / (float) (tank.tank.getCapacity()) * (displayStages - 1))]);
diff --git a/common/buildcraft/silicon/BlockAssemblyTable.java b/common/buildcraft/silicon/BlockAssemblyTable.java
index 790eb22b..0bf12d00 100644
--- a/common/buildcraft/silicon/BlockAssemblyTable.java
+++ b/common/buildcraft/silicon/BlockAssemblyTable.java
@@ -2,31 +2,33 @@ package buildcraft.silicon;
import java.util.List;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import net.minecraft.world.World;
import buildcraft.BuildCraftSilicon;
import buildcraft.core.CreativeTabBuildCraft;
-import buildcraft.core.DefaultProps;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.Utils;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockAssemblyTable extends BlockContainer {
+ @SideOnly(Side.CLIENT)
+ private Icon[][] icons;
+
public BlockAssemblyTable(int i) {
super(i, Material.iron);
setBlockBounds(0, 0, 0, 1, 9F / 16F, 1);
setHardness(0.5F);
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
-
}
@Override
@@ -63,18 +65,13 @@ public class BlockAssemblyTable extends BlockContainer {
}
@Override
- public int getBlockTextureFromSideAndMetadata(int i, int j) {
- if (i == 1) {
- return j == 0 ? 16 * 6 + 12 : 16 * 3 + 15;
- } else if (i == 0) {
- return 16 * 2 + 15;
- } else {
- return j == 0 ? 16 * 6 + 11 : 16 * 3 + 14;
- }
+ public Icon getBlockTextureFromSideAndMetadata(int i, int j) {
+ int s = i > 1 ? 2 : i;
+ return icons[j][s];
}
@Override
- public TileEntity createNewTileEntity(World world, int metadata) {
+ public TileEntity createTileEntity(World world, int metadata) {
return metadata == 0 ? new TileAssemblyTable() : new TileAssemblyAdvancedWorkbench();
}
@@ -83,20 +80,31 @@ public class BlockAssemblyTable extends BlockContainer {
return null;
}
- @Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
@Override
public int damageDropped(int par1) {
return par1;
}
+ @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) {
par3List.add(new ItemStack(this, 1, 0));
par3List.add(new ItemStack(this, 1, 1));
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ icons = new Icon[2][];
+ icons[0] = new Icon[3];
+ icons[1] = new Icon[3];
+ icons[0][0] = par1IconRegister.registerIcon("buildcraft:assemblytable_bottom");
+ icons[1][0] = par1IconRegister.registerIcon("buildcraft:advworkbenchtable_bottom");
+ icons[0][1] = par1IconRegister.registerIcon("buildcraft:assemblytable_top");
+ icons[1][1] = par1IconRegister.registerIcon("buildcraft:advworkbenchtable_top");
+ icons[0][2] = par1IconRegister.registerIcon("buildcraft:assemblytable_side");
+ icons[1][2] = par1IconRegister.registerIcon("buildcraft:advworkbenchtable_side");
+ }
}
diff --git a/common/buildcraft/silicon/BlockLaser.java b/common/buildcraft/silicon/BlockLaser.java
index 3c964ff1..cba892e3 100644
--- a/common/buildcraft/silicon/BlockLaser.java
+++ b/common/buildcraft/silicon/BlockLaser.java
@@ -13,15 +13,21 @@ import java.util.ArrayList;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import buildcraft.core.CreativeTabBuildCraft;
-import buildcraft.core.DefaultProps;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockLaser extends BlockContainer {
+ @SideOnly(Side.CLIENT)
+ private Icon textureTop, textureBottom, textureSide;
+
public BlockLaser(int i) {
super(i, Material.iron);
setHardness(0.5F);
@@ -53,18 +59,13 @@ public class BlockLaser extends BlockContainer {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
- @Override
- public int getBlockTextureFromSideAndMetadata(int i, int j) {
+ public Icon getBlockTextureFromSideAndMetadata(int i, int j) {
if (i == ForgeDirection.values()[j].getOpposite().ordinal())
- return 16 * 2 + 15;
+ return textureBottom;
else if (i == j)
- return 16 * 2 + 14;
+ return textureTop;
else
- return 16 * 2 + 13;
+ return textureSide;
}
@@ -84,4 +85,13 @@ public class BlockLaser extends BlockContainer {
public void addCreativeItems(ArrayList itemList) {
itemList.add(new ItemStack(this));
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister par1IconRegister)
+ {
+ textureTop = par1IconRegister.registerIcon("buildcraft:laser_top");
+ textureBottom = par1IconRegister.registerIcon("buildcraft:laser_bottom");
+ textureSide = par1IconRegister.registerIcon("buildcraft:laser_side");
+ }
}
diff --git a/common/buildcraft/silicon/ItemAssemblyTable.java b/common/buildcraft/silicon/ItemAssemblyTable.java
index 83af6d3e..6d8beb04 100644
--- a/common/buildcraft/silicon/ItemAssemblyTable.java
+++ b/common/buildcraft/silicon/ItemAssemblyTable.java
@@ -11,7 +11,7 @@ public class ItemAssemblyTable extends ItemBlock {
}
@Override
- public String getItemNameIS(ItemStack par1ItemStack) {
+ public String getUnlocalizedName(ItemStack par1ItemStack) {
return par1ItemStack.getItemDamage() == 0 ? "block.assemblyTableBlock" : "block.assemblyWorkbenchBlock";
}
diff --git a/common/buildcraft/silicon/TileAssemblyAdvancedWorkbench.java b/common/buildcraft/silicon/TileAssemblyAdvancedWorkbench.java
index 4aa1b058..16ead5c0 100644
--- a/common/buildcraft/silicon/TileAssemblyAdvancedWorkbench.java
+++ b/common/buildcraft/silicon/TileAssemblyAdvancedWorkbench.java
@@ -11,7 +11,6 @@ import net.minecraft.inventory.InventoryCraftResult;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.SlotCrafting;
import net.minecraft.item.ItemStack;
-import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
@@ -22,9 +21,9 @@ import buildcraft.core.IMachine;
import buildcraft.core.network.PacketIds;
import buildcraft.core.network.PacketSlotChange;
import buildcraft.core.proxy.CoreProxy;
+import buildcraft.core.utils.CraftingHelper;
import buildcraft.core.utils.SimpleInventory;
import buildcraft.core.utils.Utils;
-import buildcraft.core.utils.CraftingHelper;
import com.google.common.collect.Lists;
@@ -466,4 +465,16 @@ public class TileAssemblyAdvancedWorkbench extends TileEntity implements IInvent
iCrafting.sendProgressBarUpdate(container, 5, (lRecentEnergy >>> 16) & 0xFFFF);
}
+ @Override
+ public boolean isInvNameLocalized() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isStackValidForSlot(int i, ItemStack itemstack) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
}
diff --git a/common/buildcraft/silicon/TileAssemblyTable.java b/common/buildcraft/silicon/TileAssemblyTable.java
index 8dbeb10a..a5bbe29c 100644
--- a/common/buildcraft/silicon/TileAssemblyTable.java
+++ b/common/buildcraft/silicon/TileAssemblyTable.java
@@ -492,4 +492,18 @@ public class TileAssemblyTable extends TileEntity implements IMachine, IInventor
public int getZCoord() {
return zCoord;
}
+
+ @Override
+ public boolean isInvNameLocalized()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isStackValidForSlot(int i, ItemStack itemstack)
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
}
diff --git a/common/buildcraft/silicon/TileLaser.java b/common/buildcraft/silicon/TileLaser.java
index daa4abda..ae124029 100644
--- a/common/buildcraft/silicon/TileLaser.java
+++ b/common/buildcraft/silicon/TileLaser.java
@@ -38,7 +38,7 @@ public class TileLaser extends TileBuildCraft implements IPowerReceptor {
private int nextNetworkUpdate = 3;
private int nextLaserUpdate = 10;
- private int nextLaserSearch = 10;
+ private int nextLaserSearch = 100;
public TileLaser() {
powerProvider = PowerFramework.currentFramework.createPowerProvider();
@@ -65,7 +65,10 @@ public class TileLaser extends TileBuildCraft implements IPowerReceptor {
// If we still don't have a valid table or the existing has
// become invalid, we disable the laser and do nothing.
+ // Also bleed some energy from the provider which will result that a
+ // laser will eventually run out of power and stop searching
if (!isValidTable()) {
+ powerProvider.useEnergy(0F, 0.1F, true);
removeLaser();
return;
}
@@ -109,7 +112,6 @@ public class TileLaser extends TileBuildCraft implements IPowerReceptor {
}
protected void findTable() {
-
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
int minX = xCoord - 5;
@@ -235,7 +237,7 @@ public class TileLaser extends TileBuildCraft implements IPowerReceptor {
}
@Override
- public int powerRequest() {
+ public int powerRequest(ForgeDirection from) {
if (powerProvider.getEnergyStored() < 200 || laser != null)
return 25;
else
diff --git a/common/buildcraft/silicon/gui/ContainerAssemblyAdvancedWorkbench.java b/common/buildcraft/silicon/gui/ContainerAssemblyAdvancedWorkbench.java
index dfc58e16..05301fcf 100644
--- a/common/buildcraft/silicon/gui/ContainerAssemblyAdvancedWorkbench.java
+++ b/common/buildcraft/silicon/gui/ContainerAssemblyAdvancedWorkbench.java
@@ -46,6 +46,7 @@ public class ContainerAssemblyAdvancedWorkbench extends BuildCraftContainer {
return workbench.isUseableByPlayer(var1);
}
+ @SuppressWarnings("rawtypes")
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
diff --git a/common/buildcraft/silicon/gui/GuiAssemblyAdvancedWorkbench.java b/common/buildcraft/silicon/gui/GuiAssemblyAdvancedWorkbench.java
index bc5a147b..55a9567d 100644
--- a/common/buildcraft/silicon/gui/GuiAssemblyAdvancedWorkbench.java
+++ b/common/buildcraft/silicon/gui/GuiAssemblyAdvancedWorkbench.java
@@ -1,5 +1,6 @@
package buildcraft.silicon.gui;
+import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
@@ -7,6 +8,8 @@ import net.minecraft.item.crafting.IRecipe;
import org.lwjgl.opengl.GL11;
+import buildcraft.BuildCraftCore;
+import buildcraft.core.CoreIconProvider;
import buildcraft.core.DefaultProps;
import buildcraft.core.gui.GuiAdvancedInterface;
import buildcraft.core.utils.StringUtil;
@@ -30,7 +33,8 @@ public class GuiAssemblyAdvancedWorkbench extends GuiAdvancedInterface {
drawBackground(x, y);
// Draw icon
- drawIcon(DefaultProps.TEXTURE_ICONS, 0, x + 3, y + 4);
+ Minecraft.getMinecraft().renderEngine.bindTexture("/gui/items.png");
+ drawIcon(BuildCraftCore.iconProvider.getIcon(CoreIconProvider.ENERGY), x + 3, y + 4);
if (!isFullyOpened())
return;
@@ -97,9 +101,8 @@ public class GuiAssemblyAdvancedWorkbench extends GuiAdvancedInterface {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
- int i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/assembly_advancedworkbench.png");
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- mc.renderEngine.bindTexture(i);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ mc.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_GUI + "/assembly_advancedworkbench.png");
int cornerX = (width - xSize) / 2;
int cornerY = (height - ySize) / 2;
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);
diff --git a/common/buildcraft/silicon/gui/GuiAssemblyTable.java b/common/buildcraft/silicon/gui/GuiAssemblyTable.java
index 0b4bd810..8ee5e60b 100644
--- a/common/buildcraft/silicon/gui/GuiAssemblyTable.java
+++ b/common/buildcraft/silicon/gui/GuiAssemblyTable.java
@@ -12,12 +12,15 @@ package buildcraft.silicon.gui;
import java.util.Iterator;
import java.util.LinkedList;
+import net.minecraft.client.Minecraft;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
+import buildcraft.BuildCraftCore;
import buildcraft.api.recipes.AssemblyRecipe;
+import buildcraft.core.CoreIconProvider;
import buildcraft.core.DefaultProps;
import buildcraft.core.gui.GuiAdvancedInterface;
import buildcraft.core.network.PacketCoordinates;
@@ -50,7 +53,8 @@ public class GuiAssemblyTable extends GuiAdvancedInterface {
drawBackground(x, y);
// Draw icon
- drawIcon(DefaultProps.TEXTURE_ICONS, 0, x + 3, y + 4);
+ Minecraft.getMinecraft().renderEngine.bindTexture("/gui/items.png");
+ drawIcon(BuildCraftCore.iconProvider.getIcon(CoreIconProvider.ENERGY), x + 3, y + 4);
if (!isFullyOpened())
return;
@@ -139,9 +143,8 @@ public class GuiAssemblyTable extends GuiAdvancedInterface {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
- int i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/assembly_table.png");
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- mc.renderEngine.bindTexture(i);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ mc.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_GUI + "/assembly_table.png");
int cornerX = (width - xSize) / 2;
int cornerY = (height - ySize) / 2;
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);
diff --git a/common/buildcraft/transport/BlockGenericPipe.java b/common/buildcraft/transport/BlockGenericPipe.java
index 2f457097..ac0c72fa 100644
--- a/common/buildcraft/transport/BlockGenericPipe.java
+++ b/common/buildcraft/transport/BlockGenericPipe.java
@@ -9,15 +9,18 @@
package buildcraft.transport;
+import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.TreeMap;
-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.client.Minecraft;
+import net.minecraft.client.particle.EffectRenderer;
+import net.minecraft.client.particle.EntityDiggingFX;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
@@ -26,6 +29,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.Icon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.IBlockAccess;
@@ -35,28 +39,34 @@ import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftTransport;
import buildcraft.api.tools.IToolWrench;
import buildcraft.api.transport.IPipe;
+import buildcraft.api.transport.ISolidSideTile;
import buildcraft.core.BlockIndex;
-import buildcraft.core.DefaultProps;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.Utils;
import buildcraft.transport.render.PipeWorldRenderer;
import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class BlockGenericPipe extends BlockContainer {
static enum Part {
Pipe,
Gate
}
-
+
static class RaytraceResult {
RaytraceResult(Part hitPart, MovingObjectPosition movingObjectPosition) {
this.hitPart = hitPart;
this.movingObjectPosition = movingObjectPosition;
}
-
+
public Part hitPart;
public MovingObjectPosition movingObjectPosition;
}
+
+ private static Random rand = new Random();
+
+ private boolean skippedFirstIconRegister;
/* Defined subprograms ************************************************* */
@@ -90,47 +100,56 @@ public class BlockGenericPipe extends BlockContainer {
return false;
}
+ @Override
+ public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side) {
+ TileEntity tile = world.getBlockTileEntity(x, y, z);
+ if (tile instanceof ISolidSideTile) {
+ return ((ISolidSideTile) tile).isSolidOnSide(side);
+ }
+ return false;
+ }
+
public boolean isACube() {
return false;
}
@SuppressWarnings("rawtypes")
@Override
- public void addCollidingBlockToList(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List arraylist, Entity par7Entity) {
+ public void addCollisionBoxesToList(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List arraylist, Entity par7Entity) {
setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
TileEntity tile1 = world.getBlockTileEntity(i, j, k);
TileGenericPipe tileG = (TileGenericPipe) tile1;
if (Utils.checkPipesConnections(world, tile1, i - 1, j, k)) {
setBlockBounds(0.0F, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
if (Utils.checkPipesConnections(world, tile1, i + 1, j, k)) {
setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, 1.0F, Utils.pipeMaxPos, Utils.pipeMaxPos);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
if (Utils.checkPipesConnections(world, tile1, i, j - 1, k)) {
setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
if (Utils.checkPipesConnections(world, tile1, i, j + 1, k)) {
setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
if (Utils.checkPipesConnections(world, tile1, i, j, k - 1)) {
setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, 0.0F, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
if (Utils.checkPipesConnections(world, tile1, i, j, k + 1)) {
setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, 1.0F);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
if (tileG != null) {
@@ -138,32 +157,32 @@ public class BlockGenericPipe extends BlockContainer {
if (tileG.hasFacade(ForgeDirection.EAST)) {
setBlockBounds(1 - facadeThickness, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
if (tileG.hasFacade(ForgeDirection.WEST)) {
setBlockBounds(0.0F, 0.0F, 0.0F, facadeThickness, 1.0F, 1.0F);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
if (tileG.hasFacade(ForgeDirection.UP)) {
setBlockBounds(0.0F, 1 - facadeThickness, 0.0F, 1.0F, 1.0F, 1.0F);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
if (tileG.hasFacade(ForgeDirection.DOWN)) {
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, facadeThickness, 1.0F);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
if (tileG.hasFacade(ForgeDirection.SOUTH)) {
setBlockBounds(0.0F, 0.0F, 1 - facadeThickness, 1.0F, 1.0F, 1.0F);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
if (tileG.hasFacade(ForgeDirection.NORTH)) {
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, facadeThickness);
- super.addCollidingBlockToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
+ super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
}
}
@@ -230,14 +249,14 @@ public class BlockGenericPipe extends BlockContainer {
@Override
public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 origin, Vec3 direction) {
RaytraceResult raytraceResult = doRayTrace(world, x, y, z, origin, direction);
-
+
if (raytraceResult == null) {
return null;
} else {
return raytraceResult.movingObjectPosition;
}
}
-
+
public RaytraceResult doRayTrace(World world, int x, int y, int z, EntityPlayer entityPlayer) {
double pitch = Math.toRadians(entityPlayer.rotationPitch);
double yaw = Math.toRadians(entityPlayer.rotationYaw);
@@ -245,39 +264,39 @@ public class BlockGenericPipe extends BlockContainer {
double dirX = -Math.sin(yaw) * Math.cos(pitch);
double dirY = -Math.sin(pitch);
double dirZ = Math.cos(yaw) * Math.cos(pitch);
-
+
double reachDistance = 5;
-
+
if (entityPlayer instanceof EntityPlayerMP) {
reachDistance = ((EntityPlayerMP) entityPlayer).theItemInWorldManager.getBlockReachDistance();
}
-
- Vec3 origin = Vec3.vec3dPool.getVecFromPool(entityPlayer.posX, entityPlayer.posY + 1.62 - entityPlayer.yOffset, entityPlayer.posZ);
+
+ Vec3 origin = Vec3.fakePool.getVecFromPool(entityPlayer.posX, entityPlayer.posY + 1.62 - entityPlayer.yOffset, entityPlayer.posZ);
Vec3 direction = origin.addVector(dirX * reachDistance, dirY * reachDistance, dirZ * reachDistance);
-
+
return doRayTrace(world, x, y, z, origin, direction);
}
-
+
public RaytraceResult doRayTrace(World world, int x, int y, int z, Vec3 origin, Vec3 direction) {
float xMin = Utils.pipeMinPos, xMax = Utils.pipeMaxPos, yMin = Utils.pipeMinPos, yMax = Utils.pipeMaxPos, zMin = Utils.pipeMinPos, zMax = Utils.pipeMaxPos;
TileEntity pipeTileEntity = world.getBlockTileEntity(x, y, z);
Pipe pipe = getPipe(world, x, y, z);
-
+
if (pipeTileEntity == null || !isValid(pipe)) {
return null;
}
-
+
/**
- * pipe hits along x, y, and z axis, gate (all 6 sides) [and wires+facades]
+ * pipe hits along x, y, and z axis, gate (all 6 sides) [and wires+facades]
*/
MovingObjectPosition[] hits = new MovingObjectPosition[] { null, null, null, null, null, null, null, null, null };
-
+
boolean needAxisCheck = false;
boolean needCenterCheck = true;
-
+
// check along the x axis
-
+
if (Utils.checkPipesConnections(world, pipeTileEntity, x - 1, y, z)) {
xMin = 0.0F;
needAxisCheck = true;
@@ -287,7 +306,7 @@ public class BlockGenericPipe extends BlockContainer {
xMax = 1.0F;
needAxisCheck = true;
}
-
+
if (needAxisCheck) {
setBlockBounds(xMin, yMin, zMin, xMax, yMax, zMax);
@@ -297,7 +316,7 @@ public class BlockGenericPipe extends BlockContainer {
needAxisCheck = false;
needCenterCheck = false; // center already checked through this axis
}
-
+
// check along the y axis
if (Utils.checkPipesConnections(world, pipeTileEntity, x, y - 1, z)) {
@@ -309,7 +328,7 @@ public class BlockGenericPipe extends BlockContainer {
yMax = 1.0F;
needAxisCheck = true;
}
-
+
if (needAxisCheck) {
setBlockBounds(xMin, yMin, zMin, xMax, yMax, zMax);
@@ -319,7 +338,7 @@ public class BlockGenericPipe extends BlockContainer {
needAxisCheck = false;
needCenterCheck = false; // center already checked through this axis
}
-
+
// check along the z axis
if (Utils.checkPipesConnections(world, pipeTileEntity, x, y, z - 1)) {
@@ -331,7 +350,7 @@ public class BlockGenericPipe extends BlockContainer {
zMax = 1.0F;
needAxisCheck = true;
}
-
+
if (needAxisCheck) {
setBlockBounds(xMin, yMin, zMin, xMax, yMax, zMax);
@@ -341,7 +360,7 @@ public class BlockGenericPipe extends BlockContainer {
needAxisCheck = false;
needCenterCheck = false; // center already checked through this axis
}
-
+
// check center (only if no axis were checked/the pipe has no connections)
if (needCenterCheck) {
@@ -349,59 +368,59 @@ public class BlockGenericPipe extends BlockContainer {
hits[0] = super.collisionRayTrace(world, x, y, z, origin, direction);
}
-
+
// gates
-
+
if (pipe.hasGate()) {
for (int side = 0; side < 6; side++) {
setBlockBoundsToGate(ForgeDirection.VALID_DIRECTIONS[side]);
-
+
hits[3 + side] = super.collisionRayTrace(world, x, y, z, origin, direction);
}
}
-
+
// TODO: check wires, facades
// get closest hit
-
+
double minLengthSquared = Double.POSITIVE_INFINITY;
int minIndex = -1;
-
+
for (int i = 0; i < hits.length; i++) {
MovingObjectPosition hit = hits[i];
if (hit == null) continue;
-
+
double lengthSquared = hit.hitVec.squareDistanceTo(origin);
-
+
if (lengthSquared < minLengthSquared) {
minLengthSquared = lengthSquared;
minIndex = i;
}
}
-
+
// reset bounds
-
+
setBlockBounds(0, 0, 0, 1, 1, 1);
-
+
if (minIndex == -1) {
return null;
} else {
Part hitPart;
-
+
if (minIndex < 3) {
hitPart = Part.Pipe;
} else {
hitPart = Part.Gate;
}
-
+
return new RaytraceResult(hitPart, hits[minIndex]);
}
}
-
+
private void setBlockBoundsToGate(ForgeDirection dir) {
float min = Utils.pipeMinPos + 0.05F;
float max = Utils.pipeMaxPos - 0.05F;
-
+
switch (dir) {
case DOWN:
setBlockBounds(min, Utils.pipeMinPos - 0.10F, min, max, Utils.pipeMinPos, max);
@@ -458,11 +477,30 @@ public class BlockGenericPipe extends BlockContainer {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
+ public ArrayList getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) {
- @Override
+ if (CoreProxy.proxy.isRenderWorld(world))
+ return null;
+
+ ArrayList list = new ArrayList();
+
+ int count = quantityDropped(metadata, fortune, world.rand);
+ for (int i = 0; i < count; i++) {
+ Pipe pipe = getPipe(world, x, y, z);
+
+ if (pipe == null) {
+ pipe = pipeRemoved.get(new BlockIndex(x, y, z));
+ }
+
+ if (pipe != null) {
+ if (pipe.itemID > 0) {
+ pipe.dropContents();
+ list.add(new ItemStack(pipe.itemID, 1, damageDropped(metadata)));
+ }
+ }
+ }
+ return list;
+ }
public TileEntity createNewTileEntity(World var1) {
return new TileGenericPipe();
}
@@ -537,17 +575,17 @@ public class BlockGenericPipe extends BlockContainer {
return meta;
}
-
+
@Override
- public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving placer) {
- super.onBlockPlacedBy(world, x, y, z, placer);
+ public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving placer, ItemStack stack) {
+ super.onBlockPlacedBy(world, x, y, z, placer, stack);
Pipe pipe = getPipe(world, x, y, z);
if (isValid(pipe)) {
pipe.onBlockPlacedBy(placer);
}
}
-
+
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int par6, float xOffset, float yOffset, float zOffset) {
super.onBlockActivated(world, x, y, z, entityplayer, par6, xOffset, yOffset, zOffset);
@@ -629,17 +667,17 @@ public class BlockGenericPipe extends BlockContainer {
pipe.container.scheduleRenderUpdate();
return true;
}
-
+
boolean openGateGui = false;
if (pipe.hasGate()) {
RaytraceResult rayTraceResult = doRayTrace(world, x, y, z, entityplayer);
-
+
if (rayTraceResult != null && rayTraceResult.hitPart == Part.Gate) {
openGateGui = true;
}
}
-
+
if (openGateGui) {
pipe.gate.openGui(entityplayer);
@@ -679,7 +717,7 @@ public class BlockGenericPipe extends BlockContainer {
/**
* Drops a pipe wire item of the passed color.
- *
+ *
* @param color
*/
private void dropWire(IPipe.WireColor color, World world, int i, int j, int k) {
@@ -703,12 +741,13 @@ public class BlockGenericPipe extends BlockContainer {
}
@SuppressWarnings({ "all" })
- public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) {
+ @SideOnly(Side.CLIENT)
+ public Icon getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) {
TileEntity tile = iblockaccess.getBlockTileEntity(i, j, k);
if (!(tile instanceof IPipeRenderState))
- return 0;
- return ((IPipeRenderState) tile).getRenderState().currentTextureIndex;
+ return null;
+ return ((IPipeRenderState) tile).getRenderState().currentTexture;
// Pipe pipe = getPipe(iblockaccess, i, j, k);
// if (!isValid(pipe)) {
@@ -746,13 +785,13 @@ public class BlockGenericPipe extends BlockContainer {
}
@Override
- public boolean isProvidingStrongPower(IBlockAccess iblockaccess, int x, int y, int z, int l) {
+ public int isProvidingStrongPower(IBlockAccess iblockaccess, int x, int y, int z, int l) {
Pipe pipe = getPipe(iblockaccess, x, y, z);
if (isValid(pipe))
return pipe.isPoweringTo(l);
else
- return false;
+ return 0;
}
@Override
@@ -761,13 +800,13 @@ public class BlockGenericPipe extends BlockContainer {
}
@Override
- public boolean isProvidingWeakPower(IBlockAccess world, int i, int j, int k, int l) {
+ public int isProvidingWeakPower(IBlockAccess world, int i, int j, int k, int l) {
Pipe pipe = getPipe(world, i, j, k);
if (isValid(pipe))
return pipe.isIndirectlyPoweringTo(l);
else
- return false;
+ return 0;
}
@SuppressWarnings({ "all" })
@@ -789,17 +828,16 @@ public class BlockGenericPipe extends BlockContainer {
public static ItemPipe registerPipe(int key, Class extends Pipe> clas) {
ItemPipe item = new ItemPipe(key);
- item.setItemName("buildcraftPipe." + clas.getSimpleName().toLowerCase());
- GameRegistry.registerItem(item, item.getItemName());
+ item.setUnlocalizedName("buildcraftPipe." + clas.getSimpleName().toLowerCase());
+ GameRegistry.registerItem(item, item.getUnlocalizedName());
pipes.put(item.itemID, clas);
Pipe dummyPipe = createPipe(item.itemID);
if (dummyPipe != null) {
- item.setTextureFile(dummyPipe.getTextureFile());
- item.setTextureIndex(dummyPipe.getTextureIndexForItem());
+ item.setPipeIconIndex(dummyPipe.getIconIndexForItem());
+ TransportProxy.proxy.setIconProviderFromPipe(item, dummyPipe);
}
-
return item;
}
@@ -824,7 +862,7 @@ public class BlockGenericPipe extends BlockContainer {
if (world.isRemote)
return true;
- boolean placed = world.setBlockAndMetadataWithNotify(i, j, k, blockId, meta);
+ boolean placed = world.setBlock(i, j, k, blockId, meta, 1);
if (placed) {
@@ -852,4 +890,128 @@ public class BlockGenericPipe extends BlockContainer {
public static boolean isValid(Pipe pipe) {
return isFullyDefined(pipe);
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister iconRegister)
+ {
+ if (!skippedFirstIconRegister){
+ skippedFirstIconRegister = true;
+ return;
+ }
+ BuildCraftTransport.instance.gateIconProvider.registerIcons(iconRegister);
+ BuildCraftTransport.instance.wireIconProvider.registerIcons(iconRegister);
+ for (int i : pipes.keySet()){
+ Pipe dummyPipe = createPipe(i);
+ if (dummyPipe != null){
+ dummyPipe.getIconProvider().registerIcons(iconRegister);
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public Icon getBlockTextureFromSideAndMetadata(int par1, int par2) {
+ return BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.Stripes);
+ }
+
+ /**
+ * Spawn a digging particle effect in the world, this is a wrapper around
+ * EffectRenderer.addBlockHitEffects to allow the block more control over
+ * the particles. Useful when you have entirely different texture sheets for
+ * different sides/locations in the world.
+ *
+ * @param world The current world
+ * @param target The target the player is looking at {x/y/z/side/sub}
+ * @param effectRenderer A reference to the current effect renderer.
+ * @return True to prevent vanilla digging particles form spawning.
+ */
+ @SideOnly(Side.CLIENT)
+ @Override
+ public boolean addBlockHitEffects(World worldObj, MovingObjectPosition target, EffectRenderer effectRenderer) {
+ int x = target.blockX;
+ int y = target.blockY;
+ int z = target.blockZ;
+
+ Pipe pipe = getPipe(worldObj, x, y, z);
+ if (pipe == null) return false;
+
+ Icon icon = pipe.getIconProvider().getIcon(pipe.getIconIndexForItem());
+
+ int sideHit = target.sideHit;
+
+ Block block = BuildCraftTransport.genericPipeBlock;
+ float b = 0.1F;
+ double px = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - (b * 2.0F)) + b + block.getBlockBoundsMinX();
+ double py = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - (b * 2.0F)) + b + block.getBlockBoundsMinY();
+ double pz = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - (b * 2.0F)) + b + block.getBlockBoundsMinZ();
+
+ if (sideHit == 0) {
+ py = (double) y + block.getBlockBoundsMinY() - (double) b;
+ }
+
+ if (sideHit == 1) {
+ py = (double) y + block.getBlockBoundsMaxY() + (double) b;
+ }
+
+ if (sideHit == 2) {
+ pz = (double) z + block.getBlockBoundsMinZ() - (double) b;
+ }
+
+ if (sideHit == 3) {
+ pz = (double) z + block.getBlockBoundsMaxZ() + (double) b;
+ }
+
+ if (sideHit == 4) {
+ px = (double) x + block.getBlockBoundsMinX() - (double) b;
+ }
+
+ if (sideHit == 5) {
+ px = (double) x + block.getBlockBoundsMaxX() + (double) b;
+ }
+
+ EntityDiggingFX fx = new EntityDiggingFX(worldObj, px, py, pz, 0.0D, 0.0D, 0.0D, block, sideHit, worldObj.getBlockMetadata(x, y, z), Minecraft.getMinecraft().renderEngine);
+ fx.func_94052_a(Minecraft.getMinecraft().renderEngine, icon);
+ effectRenderer.addEffect(fx.func_70596_a(x, y, z).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
+ return true;
+ }
+
+ /**
+ * Spawn particles for when the block is destroyed. Due to the nature of how
+ * this is invoked, the x/y/z locations are not always guaranteed to host
+ * your block. So be sure to do proper sanity checks before assuming that
+ * the location is this block.
+ *
+ * @param world The current world
+ * @param x X position to spawn the particle
+ * @param y Y position to spawn the particle
+ * @param z Z position to spawn the particle
+ * @param meta The metadata for the block before it was destroyed.
+ * @param effectRenderer A reference to the current effect renderer.
+ * @return True to prevent vanilla break particles from spawning.
+ */
+ @SideOnly(Side.CLIENT)
+ @Override
+ public boolean addBlockDestroyEffects(World worldObj, int x, int y, int z, int meta, EffectRenderer effectRenderer) {
+ Pipe pipe = getPipe(worldObj, x, y, z);
+ if (pipe == null) return false;
+
+ Icon icon = pipe.getIconProvider().getIcon(pipe.getIconIndexForItem());
+
+ byte its = 4;
+ for (int i = 0; i < its; ++i) {
+ for (int j = 0; j < its; ++j) {
+ for (int k = 0; k < its; ++k) {
+ double px = x + (i + 0.5D) / (double) its;
+ double py = y + (j + 0.5D) / (double) its;
+ double pz = z + (k + 0.5D) / (double) its;
+ int random = rand.nextInt(6);
+ EntityDiggingFX fx = new EntityDiggingFX(worldObj, px, py, pz, px - x - 0.5D, py - y - 0.5D, pz - z - 0.5D, BuildCraftTransport.genericPipeBlock, random, meta, Minecraft.getMinecraft().renderEngine);
+ fx.func_94052_a(Minecraft.getMinecraft().renderEngine, icon);
+ effectRenderer.addEffect(fx.func_70596_a(x, y, z));
+ }
+ }
+ }
+ return true;
+ }
}
diff --git a/common/buildcraft/transport/Gate.java b/common/buildcraft/transport/Gate.java
index c3fb6bf6..8b347bee 100644
--- a/common/buildcraft/transport/Gate.java
+++ b/common/buildcraft/transport/Gate.java
@@ -96,7 +96,7 @@ public abstract class Gate {
public abstract void addTrigger(LinkedList list);
// / TEXTURES
- public abstract int getTexture(boolean isSignalActive);
+ public abstract int getTextureIconIndex(boolean isSignalActive);
public abstract String getGuiFile();
diff --git a/common/buildcraft/transport/GateIconProvider.java b/common/buildcraft/transport/GateIconProvider.java
new file mode 100644
index 00000000..0e62c9aa
--- /dev/null
+++ b/common/buildcraft/transport/GateIconProvider.java
@@ -0,0 +1,92 @@
+package buildcraft.transport;
+
+import net.minecraft.client.renderer.texture.IconRegister;
+import net.minecraft.util.Icon;
+import buildcraft.api.core.IIconProvider;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class GateIconProvider implements IIconProvider {
+
+ public static final int Gate_Dark = 0;
+ public static final int Gate_Lit = 1;
+ public static final int Gate_Iron_And_Dark = 2;
+ public static final int Gate_Iron_And_Lit = 3;
+ public static final int Gate_Iron_Or_Dark = 4;
+ public static final int Gate_Iron_Or_Lit = 5;
+ public static final int Gate_Gold_And_Dark = 6;
+ public static final int Gate_Gold_And_Lit = 7;
+ public static final int Gate_Gold_Or_Dark = 8;
+ public static final int Gate_Gold_Or_Lit = 9;
+ public static final int Gate_Diamond_And_Dark = 10;
+ public static final int Gate_Diamond_And_Lit = 11;
+ public static final int Gate_Diamond_Or_Dark = 12;
+ public static final int Gate_Diamond_Or_Lit = 13;
+
+ public static final int Gate_Autarchic_Dark = 14;
+ public static final int Gate_Autarchic_Lit = 15;
+ public static final int Gate_Autarchic_Iron_And_Dark = 16;
+ public static final int Gate_Autarchic_Iron_And_Lit = 17;
+ public static final int Gate_Autarchic_Iron_Or_Dark = 18;
+ public static final int Gate_Autarchic_Iron_Or_Lit = 19;
+ public static final int Gate_Autarchic_Gold_And_Dark = 20;
+ public static final int Gate_Autarchic_Gold_And_Lit = 21;
+ public static final int Gate_Autarchic_Gold_Or_Dark = 22;
+ public static final int Gate_Autarchic_Gold_Or_Lit = 23;
+ public static final int Gate_Autarchic_Diamond_And_Dark = 24;
+ public static final int Gate_Autarchic_Diamond_And_Lit = 25;
+ public static final int Gate_Autarchic_Diamond_Or_Dark = 26;
+ public static final int Gate_Autarchic_Diamond_Or_Lit = 27;
+
+ public static final int MAX = 28;
+
+ @SideOnly(Side.CLIENT)
+ private Icon[] icons;
+
+ private boolean registered = false;
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public Icon getIcon(int pipeIconIndex) {
+ return icons[pipeIconIndex];
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister iconRegister) {
+ if (registered) return;
+ registered = true;
+
+ icons = new Icon[MAX];
+ icons[GateIconProvider.Gate_Dark] = iconRegister.registerIcon("buildcraft:gate_dark");
+ icons[GateIconProvider.Gate_Lit] = iconRegister.registerIcon("buildcraft:gate_lit");
+ icons[GateIconProvider.Gate_Iron_And_Dark] = iconRegister.registerIcon("buildcraft:gate_iron_and_dark");
+ icons[GateIconProvider.Gate_Iron_And_Lit] = iconRegister.registerIcon("buildcraft:gate_iron_and_lit");
+ icons[GateIconProvider.Gate_Iron_Or_Dark] = iconRegister.registerIcon("buildcraft:gate_iron_or_dark");
+ icons[GateIconProvider.Gate_Iron_Or_Lit] = iconRegister.registerIcon("buildcraft:gate_iron_or_lit");
+ icons[GateIconProvider.Gate_Gold_And_Dark] = iconRegister.registerIcon("buildcraft:gate_gold_and_dark");
+ icons[GateIconProvider.Gate_Gold_And_Lit] = iconRegister.registerIcon("buildcraft:gate_gold_and_lit");
+ icons[GateIconProvider.Gate_Gold_Or_Dark] = iconRegister.registerIcon("buildcraft:gate_gold_or_dark");
+ icons[GateIconProvider.Gate_Gold_Or_Lit] = iconRegister.registerIcon("buildcraft:gate_gold_or_lit");
+ icons[GateIconProvider.Gate_Diamond_And_Dark] = iconRegister.registerIcon("buildcraft:gate_diamond_and_dark");
+ icons[GateIconProvider.Gate_Diamond_And_Lit] = iconRegister.registerIcon("buildcraft:gate_diamond_and_lit");
+ icons[GateIconProvider.Gate_Diamond_Or_Dark] = iconRegister.registerIcon("buildcraft:gate_diamond_or_dark");
+ icons[GateIconProvider.Gate_Diamond_Or_Lit] = iconRegister.registerIcon("buildcraft:gate_diamond_or_lit");
+
+ icons[GateIconProvider.Gate_Autarchic_Dark] = iconRegister.registerIcon("buildcraft:gate_autarchic_dark");
+ icons[GateIconProvider.Gate_Autarchic_Lit] = iconRegister.registerIcon("buildcraft:gate_autarchic_lit");
+ icons[GateIconProvider.Gate_Autarchic_Iron_And_Dark] = iconRegister.registerIcon("buildcraft:gate_autarchic_iron_and_dark");
+ icons[GateIconProvider.Gate_Autarchic_Iron_And_Lit] = iconRegister.registerIcon("buildcraft:gate_autarchic_iron_and_lit");
+ icons[GateIconProvider.Gate_Autarchic_Iron_Or_Dark] = iconRegister.registerIcon("buildcraft:gate_autarchic_iron_or_dark");
+ icons[GateIconProvider.Gate_Autarchic_Iron_Or_Lit] = iconRegister.registerIcon("buildcraft:gate_autarchic_iron_or_lit");
+ icons[GateIconProvider.Gate_Autarchic_Gold_And_Dark] = iconRegister.registerIcon("buildcraft:gate_autarchic_gold_and_dark");
+ icons[GateIconProvider.Gate_Autarchic_Gold_And_Lit] = iconRegister.registerIcon("buildcraft:gate_autarchic_gold_and_lit");
+ icons[GateIconProvider.Gate_Autarchic_Gold_Or_Dark] = iconRegister.registerIcon("buildcraft:gate_autarchic_gold_or_dark");
+ icons[GateIconProvider.Gate_Autarchic_Gold_Or_Lit] = iconRegister.registerIcon("buildcraft:gate_autarchic_gold_or_lit");
+ icons[GateIconProvider.Gate_Autarchic_Diamond_And_Dark] = iconRegister.registerIcon("buildcraft:gate_autarchic_diamond_and_dark");
+ icons[GateIconProvider.Gate_Autarchic_Diamond_And_Lit] = iconRegister.registerIcon("buildcraft:gate_autarchic_diamond_and_lit");
+ icons[GateIconProvider.Gate_Autarchic_Diamond_Or_Dark] = iconRegister.registerIcon("buildcraft:gate_autarchic_diamond_or_dark");
+ icons[GateIconProvider.Gate_Autarchic_Diamond_Or_Lit] = iconRegister.registerIcon("buildcraft:gate_autarchic_diamond_or_lit");
+ }
+
+}
diff --git a/common/buildcraft/transport/GateVanilla.java b/common/buildcraft/transport/GateVanilla.java
index 35222c21..2270559b 100644
--- a/common/buildcraft/transport/GateVanilla.java
+++ b/common/buildcraft/transport/GateVanilla.java
@@ -254,76 +254,42 @@ public class GateVanilla extends Gate {
}
- // / TEXTURES
+ // / ICONS
@Override
- public final int getTexture(boolean isSignalActive) {
+ public final int getTextureIconIndex(boolean isSignalActive) {
boolean isGateActive = isSignalActive;
if (hasPulser() && pulser.isActive()) {
isGateActive = true;
}
-
- int n = getTextureRow();
- switch (kind) {
- case None:
- break;
- case Single:
- if (!isGateActive)
- return n * 16 + 12;
- else
- return n * 16 + 13;
- case AND_2:
- if (!isGateActive) {
- if (hasPulser())
- return 9 * 16 + 0;
- else
- return 6 * 16 + 7;
- } else if (hasPulser())
- return 9 * 16 + 1;
- else
- return 6 * 16 + 8;
- case OR_2:
- if (!isGateActive) {
- if (hasPulser())
- return 9 * 16 + 2;
- else
- return 6 * 16 + 9;
- } else if (hasPulser())
- return 9 * 16 + 3;
- else
- return 6 * 16 + 10;
- case AND_3:
- if (!isGateActive)
- return n * 16 + 4;
- else
- return n * 16 + 5;
- case OR_3:
- if (!isGateActive)
- return n * 16 + 6;
- else
- return n * 16 + 7;
- case AND_4:
- if (!isGateActive)
- return n * 16 + 8;
- else
- return n * 16 + 9;
- case OR_4:
- if (!isGateActive)
- return n * 16 + 10;
- else
- return n * 16 + 11;
+
+ if (!hasPulser()){
+ switch (kind){
+ case None: return 0;
+ case Single: return isGateActive ? GateIconProvider.Gate_Lit : GateIconProvider.Gate_Dark;
+ case AND_2: return isGateActive ? GateIconProvider.Gate_Iron_And_Lit : GateIconProvider.Gate_Iron_And_Dark;
+ case OR_2: return isGateActive ? GateIconProvider.Gate_Iron_Or_Lit : GateIconProvider.Gate_Iron_Or_Dark;
+ case AND_3: return isGateActive ? GateIconProvider.Gate_Gold_And_Lit : GateIconProvider.Gate_Gold_And_Dark;
+ case OR_3: return isGateActive ? GateIconProvider.Gate_Gold_Or_Lit : GateIconProvider.Gate_Gold_Or_Dark;
+ case AND_4: return isGateActive ? GateIconProvider.Gate_Diamond_And_Lit : GateIconProvider.Gate_Diamond_And_Dark;
+ case OR_4: return isGateActive ? GateIconProvider.Gate_Diamond_Or_Lit : GateIconProvider.Gate_Diamond_Or_Dark;
+ }
+ } else {
+ switch (kind){
+ case None: return 0;
+ case Single: return isGateActive ? GateIconProvider.Gate_Autarchic_Lit : GateIconProvider.Gate_Autarchic_Dark;
+ case AND_2: return isGateActive ? GateIconProvider.Gate_Autarchic_Iron_And_Lit : GateIconProvider.Gate_Autarchic_Iron_And_Dark;
+ case OR_2: return isGateActive ? GateIconProvider.Gate_Autarchic_Iron_Or_Lit : GateIconProvider.Gate_Autarchic_Iron_Or_Dark;
+ case AND_3: return isGateActive ? GateIconProvider.Gate_Autarchic_Gold_And_Lit : GateIconProvider.Gate_Autarchic_Gold_And_Dark;
+ case OR_3: return isGateActive ? GateIconProvider.Gate_Autarchic_Gold_Or_Lit : GateIconProvider.Gate_Autarchic_Gold_Or_Dark;
+ case AND_4: return isGateActive ? GateIconProvider.Gate_Autarchic_Diamond_And_Lit : GateIconProvider.Gate_Autarchic_Diamond_And_Dark;
+ case OR_4: return isGateActive ? GateIconProvider.Gate_Autarchic_Diamond_Or_Lit : GateIconProvider.Gate_Autarchic_Diamond_Or_Dark;
+ }
}
return 0;
}
- private int getTextureRow() {
- if (hasPulser())
- return 9;
- else
- return 8;
- }
-
@Override
public String getGuiFile() {
if (kind == GateKind.Single)
diff --git a/common/buildcraft/transport/GuiHandler.java b/common/buildcraft/transport/GuiHandler.java
index 35d2cb65..7beeb17c 100644
--- a/common/buildcraft/transport/GuiHandler.java
+++ b/common/buildcraft/transport/GuiHandler.java
@@ -1,6 +1,7 @@
package buildcraft.transport;
import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import buildcraft.core.GuiIds;
@@ -12,7 +13,6 @@ import buildcraft.transport.gui.GuiEmeraldPipe;
import buildcraft.transport.gui.GuiGateInterface;
import buildcraft.transport.pipes.PipeLogicDiamond;
import cpw.mods.fml.common.network.IGuiHandler;
-import net.minecraft.inventory.IInventory;
public class GuiHandler implements IGuiHandler {
diff --git a/common/buildcraft/transport/IPipeRenderState.java b/common/buildcraft/transport/IPipeRenderState.java
index 1e946e6f..3170b31c 100644
--- a/common/buildcraft/transport/IPipeRenderState.java
+++ b/common/buildcraft/transport/IPipeRenderState.java
@@ -1,5 +1,12 @@
package buildcraft.transport;
+import buildcraft.api.core.IIconProvider;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
public interface IPipeRenderState {
public PipeRenderState getRenderState();
+
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getPipeIcons();
}
diff --git a/common/buildcraft/transport/ItemFacade.java b/common/buildcraft/transport/ItemFacade.java
index 43b7e368..cd215279 100644
--- a/common/buildcraft/transport/ItemFacade.java
+++ b/common/buildcraft/transport/ItemFacade.java
@@ -7,6 +7,7 @@ import java.util.List;
import java.util.Set;
import net.minecraft.block.Block;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -53,10 +54,11 @@ public class ItemFacade extends ItemBuildCraft {
}
@Override
- public String getItemNameIS(ItemStack itemstack) {
+ public String getUnlocalizedName(ItemStack itemstack) {
return "item.Facade";
}
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
@@ -92,7 +94,6 @@ public class ItemFacade extends ItemBuildCraft {
}
}
- @SuppressWarnings("rawtypes")
public static void initialize() {
for (Field f : Block.class.getDeclaredFields()) {
if (Modifier.isStatic(f.getModifiers()) && Block.class.isAssignableFrom(f.getType())) {
@@ -102,7 +103,7 @@ public class ItemFacade extends ItemBuildCraft {
} catch (Exception e) {
continue;
}
-
+
if (!(b.blockID == 20)){
if (b.blockID == 7 || b.blockID == 18 || b.blockID == 19 || b.blockID == 95) {
continue;
@@ -146,4 +147,18 @@ public class ItemFacade extends ItemBuildCraft {
AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(BuildCraftTransport.pipeStructureCobblestone, 3), itemStack },
8000, new ItemStack(BuildCraftTransport.facadeItem, 6, ItemFacade.encode(itemStack.itemID, itemStack.getItemDamage()))));
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void updateIcons(IconRegister par1IconRegister)
+ {
+ // NOOP
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getSpriteNumber()
+ {
+ return 0;
+ }
}
diff --git a/common/buildcraft/transport/ItemGate.java b/common/buildcraft/transport/ItemGate.java
index 4f0ca64f..7c3d6e89 100644
--- a/common/buildcraft/transport/ItemGate.java
+++ b/common/buildcraft/transport/ItemGate.java
@@ -2,18 +2,43 @@ package buildcraft.transport;
import java.util.List;
+import net.minecraft.client.renderer.texture.IconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.Icon;
+import buildcraft.api.gates.ActionManager;
+import buildcraft.api.gates.IAction;
+import buildcraft.api.gates.ITrigger;
+import buildcraft.core.CreativeTabBuildCraft;
+import buildcraft.core.ItemBuildCraft;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.ItemStack;
-import buildcraft.core.CreativeTabBuildCraft;
-import buildcraft.core.ItemBuildCraft;
-
public class ItemGate extends ItemBuildCraft {
+ public static final int Gate = 0;
+ public static final int Gate_Iron_And = 1;
+ public static final int Gate_Iron_Or = 2;
+ public static final int Gate_Gold_And = 3;
+ public static final int Gate_Gold_Or = 4;
+ public static final int Gate_Diamond_And = 5;
+ public static final int Gate_Diamond_Or = 6;
+
+ public static final int Autarchic_Gate = 7;
+ public static final int Autarchic_Gate_Iron_And = 8;
+ public static final int Autarchic_Gate_Iron_Or = 9;
+ public static final int Autarchic_Gate_Gold_And = 10;
+ public static final int Autarchic_Gate_Gold_Or = 11;
+ public static final int Autarchic_Gate_Diamond_And = 12;
+ public static final int Autarchic_Gate_Diamond_Or = 13;
+
+ public static final int MAX = 14;
+
private int series;
+ @SideOnly(Side.CLIENT)
+ private Icon[] icons;
+
public ItemGate(int i, int series) {
super(i);
@@ -26,38 +51,52 @@ public class ItemGate extends ItemBuildCraft {
@SuppressWarnings({ "all" })
@Override
- public int getIconFromDamage(int i) {
- int n = 0;
- if (series > 0) {
- n = 3;
- } else {
- n = 2;
- }
-
- switch (i) {
- case 0:
- return n * 16 + 6;
- case 1:
- return n * 16 + 7;
- case 2:
- return n * 16 + 8;
- case 3:
- return n * 16 + 9;
- case 4:
- return n * 16 + 10;
- case 5:
- return n * 16 + 11;
- default:
- return n * 16 + 12;
+ @SideOnly(Side.CLIENT)
+ public Icon getIconFromDamage(int i) {
+ if (series == 0){ //Normal Gates
+ switch (i) {
+ case 0:
+ return icons[ItemGate.Gate];
+ case 1:
+ return icons[ItemGate.Gate_Iron_And];
+ case 2:
+ return icons[ItemGate.Gate_Iron_Or];
+ case 3:
+ return icons[ItemGate.Gate_Gold_And];
+ case 4:
+ return icons[ItemGate.Gate_Gold_Or];
+ case 5:
+ return icons[ItemGate.Gate_Diamond_And];
+ default:
+ return icons[ItemGate.Gate_Diamond_Or];
+ }
+ } else if (series == 1){
+ switch (i) {
+ case 0:
+ return icons[ItemGate.Autarchic_Gate];
+ case 1:
+ return icons[ItemGate.Autarchic_Gate_Iron_And];
+ case 2:
+ return icons[ItemGate.Autarchic_Gate_Iron_Or];
+ case 3:
+ return icons[ItemGate.Autarchic_Gate_Gold_And];
+ case 4:
+ return icons[ItemGate.Autarchic_Gate_Gold_Or];
+ case 5:
+ return icons[ItemGate.Autarchic_Gate_Diamond_And];
+ default:
+ return icons[ItemGate.Autarchic_Gate_Diamond_Or];
+ }
}
+ return null;
}
@Override
- public String getItemNameIS(ItemStack itemstack) {
- return (new StringBuilder()).append(super.getItemName()).append(".").append(itemstack.getItemDamage()).toString();
+ public String getUnlocalizedName(ItemStack itemstack) {
+ return (new StringBuilder()).append(super.getUnlocalizedName()).append(".").append(itemstack.getItemDamage()).toString();
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
@@ -69,4 +108,39 @@ public class ItemGate extends ItemBuildCraft {
itemList.add(new ItemStack(this, 1, 5));
itemList.add(new ItemStack(this, 1, 6));
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void updateIcons(IconRegister iconRegister)
+ {
+
+ for (IAction action : ActionManager.actions){
+ if (action == null) continue;
+ action.getIconProvider().registerIcons(iconRegister);
+ }
+
+ for (ITrigger trigger : ActionManager.triggers){
+ if (trigger == null) continue;
+ trigger.getIconProvider().registerIcons(iconRegister);
+ }
+
+ icons = new Icon[ItemGate.MAX];
+ icons[ItemGate.Gate] = iconRegister.registerIcon("buildcraft:gate");
+ icons[ItemGate.Gate_Iron_And] = iconRegister.registerIcon("buildcraft:gate_iron_and");
+ icons[ItemGate.Gate_Iron_Or] = iconRegister.registerIcon("buildcraft:gate_iron_or");
+ icons[ItemGate.Gate_Gold_And] = iconRegister.registerIcon("buildcraft:gate_gold_and");
+ icons[ItemGate.Gate_Gold_Or] = iconRegister.registerIcon("buildcraft:gate_gold_or");
+ icons[ItemGate.Gate_Diamond_And] = iconRegister.registerIcon("buildcraft:gate_diamond_and");
+ icons[ItemGate.Gate_Diamond_Or] = iconRegister.registerIcon("buildcraft:gate_diamond_or");
+
+ icons[ItemGate.Autarchic_Gate] = iconRegister.registerIcon("buildcraft:autarchic_gate");
+ icons[ItemGate.Autarchic_Gate_Iron_And] = iconRegister.registerIcon("buildcraft:autarchic_gate_iron_and");
+ icons[ItemGate.Autarchic_Gate_Iron_Or] = iconRegister.registerIcon("buildcraft:autarchic_gate_iron_or");
+ icons[ItemGate.Autarchic_Gate_Gold_And] = iconRegister.registerIcon("buildcraft:autarchic_gate_gold_and");
+ icons[ItemGate.Autarchic_Gate_Gold_Or] = iconRegister.registerIcon("buildcraft:autarchic_gate_gold_or");
+ icons[ItemGate.Autarchic_Gate_Diamond_And] = iconRegister.registerIcon("buildcraft:autarchic_gate_diamond_and");
+ icons[ItemGate.Autarchic_Gate_Diamond_Or] = iconRegister.registerIcon("buildcraft:autarchic_gate_diamond_or");
+
+
+ }
}
diff --git a/common/buildcraft/transport/ItemPipe.java b/common/buildcraft/transport/ItemPipe.java
index 4376475a..01abc785 100644
--- a/common/buildcraft/transport/ItemPipe.java
+++ b/common/buildcraft/transport/ItemPipe.java
@@ -10,20 +10,26 @@
package buildcraft.transport;
import net.minecraft.block.Block;
+import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
+import net.minecraft.util.Icon;
import net.minecraft.world.World;
+import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.core.CreativeTabBuildCraft;
import buildcraft.core.IItemPipe;
import buildcraft.core.ItemBuildCraft;
-import buildcraft.BuildCraftCore;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class ItemPipe extends ItemBuildCraft implements IItemPipe {
- Pipe dummyPipe;
-
- private int textureIndex = 0;
+ @SideOnly(Side.CLIENT)
+ private IIconProvider iconProvider;
+
+ private int pipeIconIndex;
protected ItemPipe(int i) {
super(i);
@@ -65,7 +71,7 @@ public class ItemPipe extends ItemBuildCraft implements IItemPipe {
if (itemstack.stackSize == 0)
return false;
- if (entityplayer.canCurrentToolHarvestBlock(i, j, k) && world.canPlaceEntityOnSide(blockID, i, j, k, false, side, entityplayer)) {
+ if (entityplayer.canCurrentToolHarvestBlock(i, j, k) && world.canPlaceEntityOnSide(blockID, i, j, k, false, side, entityplayer,itemstack)) {
Pipe pipe = BlockGenericPipe.createPipe(itemID);
if (pipe == null) {
@@ -74,7 +80,7 @@ public class ItemPipe extends ItemBuildCraft implements IItemPipe {
}
if (BlockGenericPipe.placePipe(pipe, world, i, j, k, blockID, 0)) {
- Block.blocksList[blockID].onBlockPlacedBy(world, i, j, k, entityplayer);
+ Block.blocksList[blockID].onBlockPlacedBy(world, i, j, k, entityplayer, itemstack);
world.playSoundEffect(i + 0.5F, j + 0.5F, k + 0.5F,
block.stepSound.getPlaceSound(),
(block.stepSound.getVolume() + 1.0F) / 2.0F,
@@ -85,13 +91,32 @@ public class ItemPipe extends ItemBuildCraft implements IItemPipe {
} else
return false;
}
-
- public ItemPipe setTextureIndex(int textureIndex) {
- this.textureIndex = textureIndex;
- return this;
+
+ @SideOnly(Side.CLIENT)
+ public void setPipesIcons(IIconProvider iconProvider){
+ this.iconProvider = iconProvider;
}
-
- public int getTextureIndex() {
- return textureIndex;
+
+ public void setPipeIconIndex(int index){
+ this.pipeIconIndex = index;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public Icon getIconFromDamage(int par1) {
+ return iconProvider.getIcon(pipeIconIndex);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void updateIcons(IconRegister par1IconRegister)
+ {
+ // NOOP
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getSpriteNumber() {
+ return 0;
}
}
diff --git a/common/buildcraft/transport/Pipe.java b/common/buildcraft/transport/Pipe.java
index ed41706b..efded9c5 100644
--- a/common/buildcraft/transport/Pipe.java
+++ b/common/buildcraft/transport/Pipe.java
@@ -27,15 +27,13 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.api.core.SafeTimeTracker;
-import buildcraft.api.gates.Action;
import buildcraft.api.gates.ActionManager;
import buildcraft.api.gates.IAction;
import buildcraft.api.gates.IActionReceptor;
import buildcraft.api.gates.ITrigger;
-import buildcraft.api.gates.ITriggerDirectional;
import buildcraft.api.gates.ITriggerParameter;
-import buildcraft.api.gates.Trigger;
import buildcraft.api.gates.TriggerParameter;
import buildcraft.api.transport.IPipe;
import buildcraft.core.IDropControlInventory;
@@ -45,6 +43,8 @@ import buildcraft.core.utils.Utils;
import buildcraft.transport.Gate.GateConditional;
import buildcraft.transport.pipes.PipeLogic;
import buildcraft.transport.triggers.ActionSignalOutput;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public abstract class Pipe implements IPipe, IDropControlInventory {
@@ -69,9 +69,9 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
@SuppressWarnings("rawtypes")
private static Map networkWrappers = new HashMap();
- public ITrigger[] activatedTriggers = new Trigger[8];
+ public ITrigger[] activatedTriggers = new ITrigger[8];
public ITriggerParameter[] triggerParameters = new ITriggerParameter[8];
- public IAction[] activatedActions = new Action[8];
+ public IAction[] activatedActions = new IAction[8];
public boolean broadcastSignal[] = new boolean[] { false, false, false, false };
public boolean broadcastRedstone = false;
@@ -140,30 +140,33 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
return logic.isPipeConnected(tile) && transport.isPipeConnected(tile, side);
}
- /**
- * Should return the texture file that is used to render this pipe
- */
- public abstract String getTextureFile();
-
- /**
- * Should return the textureindex in the file specified by getTextureFile()
- *
- * @param direction
- * The orientation for the texture that is requested. Unknown for the center pipe center
- * @return the index in the texture sheet
- */
- public abstract int getTextureIndex(ForgeDirection direction);
-
/**
* Should return the textureindex used by the Pipe Item Renderer, as this is done client-side the default implementation might not work if your
- * getTextureIndex(Orienations.Unknown) has logic
+ * getTextureIndex(Orienations.Unknown) has logic. Then override this
*
* @return
*/
- public int getTextureIndexForItem() {
- return getTextureIndex(ForgeDirection.UNKNOWN);
+ public int getIconIndexForItem() {
+ return getIconIndex(ForgeDirection.UNKNOWN);
}
+ /**
+ * Should return the IIconProvider that provides icons for this pipe
+ * @return An array of icons
+ */
+ @SideOnly(Side.CLIENT)
+ public abstract IIconProvider getIconProvider();
+
+ /**
+ * Should return the index in the array returned by GetTextureIcons() for a specified direction
+ * @param direction - The direction for which the indexed should be rendered. Unknown for pipe center
+ *
+ * @return An index valid in the array returned by getTextureIcons()
+ */
+ public abstract int getIconIndex(ForgeDirection direction);
+
+
+
public void updateEntity() {
transport.updateEntity();
@@ -377,20 +380,20 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
return false;
}
- public boolean isPoweringTo(int l) {
+ public int isPoweringTo(int l) {
if (!broadcastRedstone)
- return false;
+ return 0;
ForgeDirection o = ForgeDirection.values()[l].getOpposite();
TileEntity tile = container.getTile(o);
if (tile instanceof TileGenericPipe && Utils.checkPipesConnections(this.container, tile))
- return false;
+ return 0;
- return true;
+ return 15;
}
- public boolean isIndirectlyPoweringTo(int l) {
+ public int isIndirectlyPoweringTo(int l) {
return isPoweringTo(l);
}
@@ -488,10 +491,7 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
TileEntity tile = container.getTile(o);
if (tile != null && !(tile instanceof TileGenericPipe)) {
- if (trigger instanceof ITriggerDirectional) {
- if (((ITriggerDirectional) trigger).isTriggerActive(o.getOpposite(), tile, parameter))
- return true;
- } else if (trigger.isTriggerActive(tile, parameter))
+ if (trigger.isTriggerActive(o.getOpposite(), tile, parameter))
return true;
}
}
@@ -524,9 +524,9 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
public void resetGate() {
gate = null;
- activatedTriggers = new Trigger[activatedTriggers.length];
+ activatedTriggers = new ITrigger[activatedTriggers.length];
triggerParameters = new ITriggerParameter[triggerParameters.length];
- activatedActions = new Action[activatedActions.length];
+ activatedActions = new IAction[activatedActions.length];
broadcastSignal = new boolean[] { false, false, false, false };
if (broadcastRedstone) {
updateNeighbors(true);
@@ -564,7 +564,6 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
actions.put(action.getId(), isNearbyTriggerActive(trigger, parameter));
} else if (gate.getConditional() == GateConditional.AND) {
actions.put(action.getId(), actions.get(action.getId()) && isNearbyTriggerActive(trigger, parameter));
-
} else {
actions.put(action.getId(), actions.get(action.getId()) || isNearbyTriggerActive(trigger, parameter));
}
diff --git a/common/buildcraft/transport/PipeIconProvider.java b/common/buildcraft/transport/PipeIconProvider.java
new file mode 100644
index 00000000..a0ad7945
--- /dev/null
+++ b/common/buildcraft/transport/PipeIconProvider.java
@@ -0,0 +1,115 @@
+package buildcraft.transport;
+
+import net.minecraft.client.renderer.texture.IconRegister;
+import net.minecraft.util.Icon;
+import buildcraft.api.core.IIconProvider;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class PipeIconProvider implements IIconProvider {
+
+ public static final int PipeStructureCobblestone = 0;
+ public static final int PipeItemsCobbleStone = 1;
+ public static final int PipeItemsDiamond_Center = 2;
+ public static final int PipeItemsDiamond_Down = 3;
+ public static final int PipeItemsDiamond_Up = 4;
+ public static final int PipeItemsDiamond_North = 5;
+ public static final int PipeItemsDiamond_South = 6;
+ public static final int PipeItemsDiamond_West = 7;
+ public static final int PipeItemsDiamond_East = 8;
+ public static final int PipeItemsWood_Standard = 9;
+ public static final int PipeAllWood_Solid = 10;
+ public static final int PipeItemsEmerald_Standard = 11;
+ public static final int PipeAllEmerald_Solid = 12;
+ public static final int PipeItemsGold = 13;
+ public static final int PipeItemsIron_Standard = 14;
+ public static final int PipeAllIron_Solid = 15;
+ public static final int PipeItemsObsidian = 16;
+ public static final int PipeItemsSandstone = 17;
+ public static final int PipeItemsStone = 18;
+ public static final int PipeItemsVoid = 19;
+ public static final int PipeLiquidsCobblestone = 20;
+ public static final int PipeLiquidsWood_Standard = 21;
+ public static final int PipeLiquidsEmerald_Standard = 22;
+ public static final int PipeLiquidsGold = 23;
+ public static final int PipeLiquidsIron_Standard = 24;
+ public static final int PipeLiquidsSandstone = 25;
+ public static final int PipeLiquidsStone = 26;
+ public static final int PipeLiquidsVoid = 27;
+ public static final int PipePowerGold = 28;
+ public static final int PipePowerStone = 29;
+ public static final int PipePowerWood_Standard = 30;
+
+ public static final int Power_Normal = 31;
+ public static final int Power_Overload = 32;
+
+ public static final int Stripes = 33;
+
+ public static final int MAX = 34;
+
+ private boolean registered = false;
+
+ @SideOnly(Side.CLIENT)
+ private Icon[] _icons;
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public Icon getIcon(int pipeIconIndex) {
+ return _icons[pipeIconIndex];
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister iconRegister) {
+ if (registered) return;
+ registered = true;
+
+ _icons = new Icon[PipeIconProvider.MAX];
+
+ _icons[PipeIconProvider.PipeStructureCobblestone] = iconRegister.registerIcon("buildcraft:pipeStructureCobblestone");
+
+ _icons[PipeIconProvider.PipeItemsCobbleStone] = iconRegister.registerIcon("buildcraft:pipeItemsCobblestone");
+
+ _icons[PipeIconProvider.PipeItemsDiamond_Center] = iconRegister.registerIcon("buildcraft:pipeItemsDiamond_center");
+ _icons[PipeIconProvider.PipeItemsDiamond_Down] = iconRegister.registerIcon("buildcraft:pipeItemsDiamond_down");
+ _icons[PipeIconProvider.PipeItemsDiamond_Up] = iconRegister.registerIcon("buildcraft:pipeItemsDiamond_up");
+ _icons[PipeIconProvider.PipeItemsDiamond_North] = iconRegister.registerIcon("buildcraft:pipeItemsDiamond_north");
+ _icons[PipeIconProvider.PipeItemsDiamond_South] = iconRegister.registerIcon("buildcraft:pipeItemsDiamond_south");
+ _icons[PipeIconProvider.PipeItemsDiamond_West] = iconRegister.registerIcon("buildcraft:pipeItemsDiamond_west");
+ _icons[PipeIconProvider.PipeItemsDiamond_East] = iconRegister.registerIcon("buildcraft:pipeItemsDiamond_east");
+
+ _icons[PipeIconProvider.PipeItemsWood_Standard] = iconRegister.registerIcon("buildcraft:pipeItemsWood_standard");
+ _icons[PipeIconProvider.PipeAllWood_Solid] = iconRegister.registerIcon("buildcraft:pipeAllWood_solid");
+
+ _icons[PipeIconProvider.PipeItemsEmerald_Standard] = iconRegister.registerIcon("buildcraft:pipeItemsEmerald_standard");
+ _icons[PipeIconProvider.PipeAllEmerald_Solid] = iconRegister.registerIcon("buildcraft:pipeAllEmerald_solid");
+
+ _icons[PipeIconProvider.PipeItemsGold] = iconRegister.registerIcon("buildcraft:pipeItemsGold");
+
+ _icons[PipeIconProvider.PipeItemsIron_Standard] = iconRegister.registerIcon("buildcraft:pipeItemsIron_standard");
+ _icons[PipeIconProvider.PipeAllIron_Solid] = iconRegister.registerIcon("buildcraft:pipeAllIron_solid");
+
+ _icons[PipeIconProvider.PipeItemsObsidian] = iconRegister.registerIcon("buildcraft:pipeItemsObsidian");
+ _icons[PipeIconProvider.PipeItemsSandstone] = iconRegister.registerIcon("buildcraft:pipeItemsSandstone");
+ _icons[PipeIconProvider.PipeItemsStone] = iconRegister.registerIcon("buildcraft:pipeItemsStone");
+ _icons[PipeIconProvider.PipeItemsVoid] = iconRegister.registerIcon("buildcraft:pipeItemsVoid");
+
+ _icons[PipeIconProvider.PipeLiquidsCobblestone] = iconRegister.registerIcon("buildcraft:pipeLiquidsCobblestone");
+ _icons[PipeIconProvider.PipeLiquidsWood_Standard] = iconRegister.registerIcon("buildcraft:pipeLiquidsWood_standard");
+ _icons[PipeIconProvider.PipeLiquidsEmerald_Standard] = iconRegister.registerIcon("buildcraft:pipeLiquidsEmerald_standard");
+ _icons[PipeIconProvider.PipeLiquidsGold] = iconRegister.registerIcon("buildcraft:pipeLiquidsGold");
+ _icons[PipeIconProvider.PipeLiquidsIron_Standard] = iconRegister.registerIcon("buildcraft:pipeLiquidsIron_standard");
+ _icons[PipeIconProvider.PipeLiquidsSandstone] = iconRegister.registerIcon("buildcraft:pipeLiquidsSandstone");
+ _icons[PipeIconProvider.PipeLiquidsStone] = iconRegister.registerIcon("buildcraft:pipeLiquidsStone");
+ _icons[PipeIconProvider.PipeLiquidsVoid] = iconRegister.registerIcon("buildcraft:pipeLiquidsVoid");
+
+ _icons[PipeIconProvider.PipePowerGold] = iconRegister.registerIcon("buildcraft:pipePowerGold");
+ _icons[PipeIconProvider.PipePowerStone] = iconRegister.registerIcon("buildcraft:pipePowerStone");
+ _icons[PipeIconProvider.PipePowerWood_Standard] = iconRegister.registerIcon("buildcraft:pipePowerWood_standard");
+
+ _icons[PipeIconProvider.Power_Normal] = iconRegister.registerIcon("buildcraft:texture_cyan");
+ _icons[PipeIconProvider.Power_Overload] = iconRegister.registerIcon("buildcraft:texture_red_dark");
+ _icons[PipeIconProvider.Stripes] = iconRegister.registerIcon("buildcraft:pipeStripes");
+ }
+
+}
diff --git a/common/buildcraft/transport/PipeRenderState.java b/common/buildcraft/transport/PipeRenderState.java
index 2e43fcc9..e283b30a 100644
--- a/common/buildcraft/transport/PipeRenderState.java
+++ b/common/buildcraft/transport/PipeRenderState.java
@@ -4,18 +4,19 @@ import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
-import buildcraft.core.DefaultProps;
+import net.minecraft.util.Icon;
import buildcraft.core.network.IClientState;
import buildcraft.transport.utils.ConnectionMatrix;
import buildcraft.transport.utils.FacadeMatrix;
import buildcraft.transport.utils.TextureMatrix;
import buildcraft.transport.utils.WireMatrix;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeRenderState implements IClientState {
- private String textureFile = DefaultProps.TEXTURE_BLOCKS;
private boolean hasGate = false;
- private int gateTextureIndex = 0;
+ private int gateIconIndex = 0;
public final ConnectionMatrix pipeConnectionMatrix = new ConnectionMatrix();
public final TextureMatrix textureMatrix = new TextureMatrix();
@@ -23,31 +24,13 @@ public class PipeRenderState implements IClientState {
public final FacadeMatrix facadeMatrix = new FacadeMatrix();
- private boolean dirty = false;
+ private boolean dirty = true;
/*
* This is a placeholder for the pipe renderer to set to a value that the BlockGenericPipe->TileGenericPipe will then return the the WorldRenderer
*/
- public int currentTextureIndex;
-
- public PipeRenderState() {
- // for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS){
- // facadeMatrix.setConnected(direction, true);
- // facadeMatrix.setTextureFile(direction, "/terrain.png");
- // facadeMatrix.setTextureIndex(direction, direction.ordinal());
- // }
- }
-
- public void setTextureFile(String textureFile) {
- if (this.textureFile != textureFile) {
- this.textureFile = textureFile;
- this.dirty = true;
- }
- }
-
- public String getTextureFile() {
- return this.textureFile;
- }
+ @SideOnly(Side.CLIENT)
+ public Icon currentTexture;
public void setHasGate(boolean value) {
if (hasGate != value) {
@@ -60,15 +43,15 @@ public class PipeRenderState implements IClientState {
return hasGate;
}
- public void setGateTexture(int value) {
- if (gateTextureIndex != value) {
- gateTextureIndex = value;
+ public void setGateIconIndex(int value) {
+ if (gateIconIndex != value) {
+ gateIconIndex = value;
dirty = true;
}
}
- public int getGateTextureIndex() {
- return gateTextureIndex;
+ public int getGateIconIndex() {
+ return gateIconIndex;
}
public void clean() {
@@ -85,9 +68,8 @@ public class PipeRenderState implements IClientState {
@Override
public void writeData(DataOutputStream data) throws IOException {
- data.writeUTF(textureFile);
data.writeBoolean(hasGate);
- data.writeInt(gateTextureIndex);
+ data.writeInt(gateIconIndex);
pipeConnectionMatrix.writeData(data);
textureMatrix.writeData(data);
wireMatrix.writeData(data);
@@ -96,13 +78,11 @@ public class PipeRenderState implements IClientState {
@Override
public void readData(DataInputStream data) throws IOException {
- textureFile = data.readUTF();
hasGate = data.readBoolean();
- gateTextureIndex = data.readInt();
+ gateIconIndex = data.readInt();
pipeConnectionMatrix.readData(data);
textureMatrix.readData(data);
wireMatrix.readData(data);
facadeMatrix.readData(data);
}
-
}
diff --git a/common/buildcraft/transport/PipeTransportItems.java b/common/buildcraft/transport/PipeTransportItems.java
index f67cdffb..e8878a63 100644
--- a/common/buildcraft/transport/PipeTransportItems.java
+++ b/common/buildcraft/transport/PipeTransportItems.java
@@ -18,6 +18,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
+
import net.minecraft.entity.item.EntityItem;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
diff --git a/common/buildcraft/transport/PipeTransportLiquids.java b/common/buildcraft/transport/PipeTransportLiquids.java
index 6ceddf19..64e7f9e6 100644
--- a/common/buildcraft/transport/PipeTransportLiquids.java
+++ b/common/buildcraft/transport/PipeTransportLiquids.java
@@ -99,16 +99,17 @@ public class PipeTransportLiquids extends PipeTransport implements ITankContaine
return all;
}
- public void readFromNBT(NBTTagCompound compoundTag) {
+ public LiquidTank readFromNBT(NBTTagCompound compoundTag) {
this.setCapacity(compoundTag.getInteger("capacity"));
for (int i = 0; i < travelDelay; ++i) {
incomming[i] = compoundTag.getShort("in[" + i + "]");
}
setLiquid(LiquidStack.loadLiquidStackFromNBT(compoundTag));
+ return this;
}
- public void writeToNBT(NBTTagCompound subTag) {
+ public NBTTagCompound writeToNBT(NBTTagCompound subTag) {
subTag.setInteger("capacity", this.getCapacity());
for (int i = 0; i < travelDelay; ++i) {
@@ -118,6 +119,7 @@ public class PipeTransportLiquids extends PipeTransport implements ITankContaine
if (this.getLiquid() != null) {
this.getLiquid().writeToNBT(subTag);
}
+ return subTag;
}
}
@@ -209,7 +211,7 @@ public class PipeTransportLiquids extends PipeTransport implements ITankContaine
/**
* Computes the PacketLiquidUpdate packet for transmission to a client
- *
+ *
* @param initPacket
* everything is sent, no delta stuff ( first packet )
* @param persistChange
@@ -257,16 +259,11 @@ public class PipeTransportLiquids extends PipeTransport implements ITankContaine
continue;
}
- if (prev.itemID != current.itemID || initPacket) {
+ if (!prev.equals(current) || initPacket) {
changed = true;
- renderCache[dir.ordinal()].itemID = current.itemID;
+ renderCache[dir.ordinal()] = current;
delta.set(dir.ordinal() * 3 + 0);
- }
-
- if (prev.itemMeta != current.itemMeta || initPacket) {
- changed = true;
- renderCache[dir.ordinal()].itemMeta = current.itemMeta;
- delta.set(dir.ordinal() * 3 + 1);
+ delta.set(dir.ordinal() * 3 + 1);
}
int displayQty = (prev.amount * 4 + current.amount) / 5;
diff --git a/common/buildcraft/transport/PipeTransportPower.java b/common/buildcraft/transport/PipeTransportPower.java
index 87e55a1b..4e4d2af7 100644
--- a/common/buildcraft/transport/PipeTransportPower.java
+++ b/common/buildcraft/transport/PipeTransportPower.java
@@ -161,7 +161,7 @@ public class PipeTransportPower extends PipeTransport {
for (int i = 0; i < 6; ++i) {
if (tiles[i] instanceof IPowerReceptor && !(tiles[i] instanceof TileGenericPipe)) {
IPowerReceptor receptor = (IPowerReceptor) tiles[i];
- int request = receptor.powerRequest();
+ int request = receptor.powerRequest(ForgeDirection.VALID_DIRECTIONS[i].getOpposite());
if (request > 0) {
requestEnergy(ForgeDirection.VALID_DIRECTIONS[i], request);
@@ -244,7 +244,7 @@ public class PipeTransportPower extends PipeTransport {
if (internalNextPower[from.ordinal()] >= MAX_POWER_INTERNAL) {
worldObj.createExplosion(null, xCoord, yCoord, zCoord, 3, false);
- worldObj.setBlockWithNotify(xCoord, yCoord, zCoord, 0);
+ worldObj.setBlock(xCoord, yCoord, zCoord, 0);
}
}
}
diff --git a/common/buildcraft/transport/TileGenericPipe.java b/common/buildcraft/transport/TileGenericPipe.java
index 9b81234b..47d8a63f 100644
--- a/common/buildcraft/transport/TileGenericPipe.java
+++ b/common/buildcraft/transport/TileGenericPipe.java
@@ -14,9 +14,6 @@ import java.io.DataOutputStream;
import java.io.IOException;
import java.util.LinkedList;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -29,6 +26,7 @@ import net.minecraftforge.liquids.ITankContainer;
import net.minecraftforge.liquids.LiquidStack;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.api.core.Position;
import buildcraft.api.core.SafeTimeTracker;
import buildcraft.api.gates.IOverrideDefaultTriggers;
@@ -36,11 +34,11 @@ import buildcraft.api.gates.ITrigger;
import buildcraft.api.power.IPowerProvider;
import buildcraft.api.power.IPowerReceptor;
import buildcraft.api.transport.IPipe;
-import buildcraft.api.transport.IPipe.WireColor;
import buildcraft.api.transport.IPipeConnection;
import buildcraft.api.transport.IPipeEntry;
import buildcraft.api.transport.IPipeTile;
import buildcraft.api.transport.IPipedItem;
+import buildcraft.api.transport.ISolidSideTile;
import buildcraft.core.DefaultProps;
import buildcraft.core.EntityPassiveItem;
import buildcraft.core.IDropControlInventory;
@@ -52,9 +50,11 @@ import buildcraft.core.network.PacketTileState;
import buildcraft.core.utils.Utils;
import buildcraft.transport.Gate.GateKind;
import buildcraft.transport.network.PipeRenderStatePacket;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITankContainer, IPipeEntry, IPipeTile, IOverrideDefaultTriggers, ITileBufferHolder,
- IPipeConnection, IDropControlInventory, IPipeRenderState, ISyncedTile {
+ IPipeConnection, IDropControlInventory, IPipeRenderState, ISyncedTile, ISolidSideTile {
private class CoreState implements IClientState {
@@ -203,9 +203,8 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
}
// Pipe Textures
- renderState.setTextureFile(pipe.getTextureFile());
for (ForgeDirection o : ForgeDirection.values()) {
- renderState.textureMatrix.setTextureIndex(o, pipe.getTextureIndex(o));
+ renderState.textureMatrix.setIconIndex(o, pipe.getIconIndex(o));
}
// WireState
@@ -214,47 +213,37 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
renderState.wireMatrix.setWireConnected(color, direction, pipe.isWireConnectedTo(this.getTile(direction), color));
}
- }
-
- // Wire Textures
-
- if (pipe.wireSet[IPipe.WireColor.Red.ordinal()]) {
- renderState.wireMatrix.setTextureIndex(WireColor.Red, pipe.signalStrength[IPipe.WireColor.Red.ordinal()] > 0 ? 6 : 5);
- } else {
- renderState.wireMatrix.setTextureIndex(WireColor.Red, 0);
- }
-
- if (pipe.wireSet[IPipe.WireColor.Blue.ordinal()]) {
- renderState.wireMatrix.setTextureIndex(WireColor.Blue, pipe.signalStrength[IPipe.WireColor.Blue.ordinal()] > 0 ? 8 : 7);
- } else {
- renderState.wireMatrix.setTextureIndex(WireColor.Blue, 0);
- }
-
- if (pipe.wireSet[IPipe.WireColor.Green.ordinal()]) {
- renderState.wireMatrix.setTextureIndex(WireColor.Green, pipe.signalStrength[IPipe.WireColor.Green.ordinal()] > 0 ? 10 : 9);
- } else {
- renderState.wireMatrix.setTextureIndex(WireColor.Green, 0);
- }
-
- if (pipe.wireSet[IPipe.WireColor.Yellow.ordinal()]) {
- renderState.wireMatrix.setTextureIndex(WireColor.Yellow, pipe.signalStrength[IPipe.WireColor.Yellow.ordinal()] > 0 ? 12 : 11);
- } else {
- renderState.wireMatrix.setTextureIndex(WireColor.Yellow, 0);
+ boolean lit = pipe.signalStrength[color.ordinal()] > 0;
+
+ switch(color){
+ case Red:
+ renderState.wireMatrix.setWireIndex(color, lit? WireIconProvider.Texture_Red_Lit : WireIconProvider.Texture_Red_Dark);
+ break;
+ case Blue:
+ renderState.wireMatrix.setWireIndex(color, lit? WireIconProvider.Texture_Blue_Lit : WireIconProvider.Texture_Blue_Dark);
+ break;
+ case Green:
+ renderState.wireMatrix.setWireIndex(color, lit? WireIconProvider.Texture_Green_Lit : WireIconProvider.Texture_Green_Dark);
+ break;
+ case Yellow:
+ renderState.wireMatrix.setWireIndex(color, lit? WireIconProvider.Texture_Yellow_Lit : WireIconProvider.Texture_Yellow_Dark);
+ break;
+ default:
+ break;
+
+ }
}
// Gate Textures
renderState.setHasGate(pipe.hasGate());
- renderState.setGateTexture(!pipe.hasGate() ? 0 : pipe.gate.getTexture(pipe.isGateActive()));
+ renderState.setGateIconIndex(!pipe.hasGate() ? 0 : pipe.gate.getTextureIconIndex(pipe.isGateActive()));
// Facades
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
int blockId = this.facadeBlocks[direction.ordinal()];
renderState.facadeMatrix.setConnected(direction, blockId != 0 && Block.blocksList[blockId] != null);
if (Block.blocksList[blockId] != null) {
- Block block = Block.blocksList[blockId];
- renderState.facadeMatrix.setTextureFile(direction, block.getTextureFile());
- renderState.facadeMatrix.setTextureIndex(direction,
- block.getBlockTextureFromSideAndMetadata(direction.ordinal(), this.facadeMeta[direction.ordinal()]));
+ renderState.facadeMatrix.setFacade(direction, blockId, this.facadeMeta[direction.ordinal()]);
}
}
@@ -417,9 +406,9 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
}
@Override
- public int powerRequest() {
+ public int powerRequest(ForgeDirection from) {
if (BlockGenericPipe.isValid(pipe) && pipe instanceof IPowerReceptor)
- return ((IPowerReceptor) pipe).powerRequest();
+ return ((IPowerReceptor) pipe).powerRequest(from);
return 0;
}
@@ -487,7 +476,6 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
private void computeConnections() {
if (tileBuffer != null) {
- boolean[] oldConnections = pipeConnectionsBuffer;
pipeConnectionsBuffer = new boolean[6];
for (int i = 0; i < tileBuffer.length; ++i) {
@@ -579,11 +567,12 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
return false;
if (hasFacade(direction)) {
- dropFacade(direction);
+ dropFacadeItem(direction);
}
this.facadeBlocks[direction.ordinal()] = blockid;
this.facadeMeta[direction.ordinal()] = meta;
+ worldObj.notifyBlockChange(this.xCoord, this.yCoord, this.zCoord, worldObj.getBlockId(this.xCoord, this.yCoord, this.zCoord));
scheduleRenderUpdate();
return true;
}
@@ -593,18 +582,20 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
return renderState.facadeMatrix.isConnected(direction);
return (this.facadeBlocks[direction.ordinal()] != 0);
}
+
+ private void dropFacadeItem(ForgeDirection direction){
+ Utils.dropItems(worldObj, new ItemStack(BuildCraftTransport.facadeItem, 1, ItemFacade.encode(this.facadeBlocks[direction.ordinal()], this.facadeMeta[direction.ordinal()])), this.xCoord, this.yCoord, this.zCoord);
+ }
public void dropFacade(ForgeDirection direction) {
if (this.worldObj.isRemote)
return;
if (!hasFacade(direction))
return;
- Utils.dropItems(
- worldObj,
- new ItemStack(BuildCraftTransport.facadeItem, 1,
- ItemFacade.encode(this.facadeBlocks[direction.ordinal()], this.facadeMeta[direction.ordinal()])), this.xCoord, this.yCoord, this.zCoord);
+ dropFacadeItem(direction);
this.facadeBlocks[direction.ordinal()] = 0;
this.facadeMeta[direction.ordinal()] = 0;
+ worldObj.notifyBlockChange(this.xCoord, this.yCoord, this.zCoord, worldObj.getBlockId(this.xCoord, this.yCoord, this.zCoord));
scheduleRenderUpdate();
}
@@ -614,6 +605,13 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
public PipeRenderState getRenderState() {
return renderState;
}
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getPipeIcons() {
+ if (pipe == null) return null;
+ return pipe.getIconProvider();
+ }
@Override
public IClientState getStateInstance(byte stateId) {
@@ -651,7 +649,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
@Override
@SideOnly(Side.CLIENT)
- public double func_82115_m() {
+ public double getMaxRenderDistanceSquared() {
return DefaultProps.PIPE_CONTENTS_RENDER_DIST * DefaultProps.PIPE_CONTENTS_RENDER_DIST;
}
@@ -667,4 +665,16 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
public boolean shouldRefresh(int oldID, int newID, int oldMeta, int newMeta, World world, int x, int y, int z) {
return oldID != newID;
}
+
+ @Override
+ public boolean isSolidOnSide(ForgeDirection side) {
+ if (hasFacade(side))
+ return true;
+
+ if (BlockGenericPipe.isValid(pipe) && pipe instanceof ISolidSideTile) {
+ if (((ISolidSideTile) pipe).isSolidOnSide(side))
+ return true;
+ }
+ return false;
+ }
}
diff --git a/common/buildcraft/transport/TransportProxy.java b/common/buildcraft/transport/TransportProxy.java
index 9d3804f4..08e329d1 100644
--- a/common/buildcraft/transport/TransportProxy.java
+++ b/common/buildcraft/transport/TransportProxy.java
@@ -1,5 +1,6 @@
package buildcraft.transport;
+import buildcraft.BuildCraftTransport;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.registry.GameRegistry;
@@ -17,4 +18,12 @@ public class TransportProxy {
public void registerRenderers() {
}
+ public void initIconProviders(BuildCraftTransport instance){
+
+ }
+
+ public void setIconProviderFromPipe(ItemPipe item, Pipe dummyPipe) {
+
+ }
+
}
diff --git a/common/buildcraft/transport/TransportProxyClient.java b/common/buildcraft/transport/TransportProxyClient.java
index 95f6bf3f..6741010f 100644
--- a/common/buildcraft/transport/TransportProxyClient.java
+++ b/common/buildcraft/transport/TransportProxyClient.java
@@ -57,4 +57,9 @@ public class TransportProxyClient extends TransportProxy {
RenderingRegistry.registerBlockHandler(pipeWorldRenderer);
}
+
+ @Override
+ public void setIconProviderFromPipe(ItemPipe item, Pipe dummyPipe) {
+ item.setPipesIcons(dummyPipe.getIconProvider());
+ }
}
diff --git a/common/buildcraft/transport/WireIconProvider.java b/common/buildcraft/transport/WireIconProvider.java
new file mode 100644
index 00000000..f9e6dbe6
--- /dev/null
+++ b/common/buildcraft/transport/WireIconProvider.java
@@ -0,0 +1,52 @@
+package buildcraft.transport;
+
+import net.minecraft.client.renderer.texture.IconRegister;
+import net.minecraft.util.Icon;
+import buildcraft.api.core.IIconProvider;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class WireIconProvider implements IIconProvider {
+
+ public static final int Texture_Red_Dark = 0;
+ public static final int Texture_Red_Lit = 1;
+ public static final int Texture_Blue_Dark = 2;
+ public static final int Texture_Blue_Lit = 3;
+ public static final int Texture_Green_Dark = 4;
+ public static final int Texture_Green_Lit = 5;
+ public static final int Texture_Yellow_Dark = 6;
+ public static final int Texture_Yellow_Lit = 7;
+
+ public static final int MAX = 8;
+
+ @SideOnly(Side.CLIENT)
+ private Icon[] icons;
+
+ private boolean registered = false;
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public Icon getIcon(int pipeIconIndex) {
+ return icons[pipeIconIndex];
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IconRegister iconRegister) {
+ if (registered) return;
+ registered = true;
+
+ icons = new Icon[MAX];
+
+ icons[WireIconProvider.Texture_Red_Dark] = iconRegister.registerIcon("buildcraft:texture_red_dark");
+ icons[WireIconProvider.Texture_Red_Lit] = iconRegister.registerIcon("buildcraft:texture_red_lit");
+ icons[WireIconProvider.Texture_Blue_Dark] = iconRegister.registerIcon("buildcraft:texture_blue_dark");
+ icons[WireIconProvider.Texture_Blue_Lit] = iconRegister.registerIcon("buildcraft:texture_blue_lit");
+ icons[WireIconProvider.Texture_Green_Dark] = iconRegister.registerIcon("buildcraft:texture_green_dark");
+ icons[WireIconProvider.Texture_Green_Lit] = iconRegister.registerIcon("buildcraft:texture_green_lit");
+ icons[WireIconProvider.Texture_Yellow_Dark] = iconRegister.registerIcon("buildcraft:texture_yellow_dark");
+ icons[WireIconProvider.Texture_Yellow_Lit] = iconRegister.registerIcon("buildcraft:texture_yellow_lit");
+
+ }
+
+}
diff --git a/common/buildcraft/transport/blueprints/BptBlockPipe.java b/common/buildcraft/transport/blueprints/BptBlockPipe.java
index ff938765..4c9ff027 100644
--- a/common/buildcraft/transport/blueprints/BptBlockPipe.java
+++ b/common/buildcraft/transport/blueprints/BptBlockPipe.java
@@ -27,6 +27,7 @@ import buildcraft.transport.BlockGenericPipe;
import buildcraft.transport.GateVanilla;
import buildcraft.transport.Pipe;
+@Deprecated
public class BptBlockPipe extends BptBlock {
public BptBlockPipe(int blockId) {
diff --git a/common/buildcraft/transport/blueprints/BptItemPipeIron.java b/common/buildcraft/transport/blueprints/BptItemPipeIron.java
index 1ae7157c..3a7ceb62 100644
--- a/common/buildcraft/transport/blueprints/BptItemPipeIron.java
+++ b/common/buildcraft/transport/blueprints/BptItemPipeIron.java
@@ -30,7 +30,7 @@ public class BptItemPipeIron extends BptItem {
@Override
public void postProcessing(BptSlotInfo slot, IBptContext context) {
- context.world().setBlockMetadata(slot.x, slot.y, slot.z, slot.meta);
+ context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,0);
}
@Override
diff --git a/common/buildcraft/transport/blueprints/BptItemPipeWooden.java b/common/buildcraft/transport/blueprints/BptItemPipeWooden.java
index 4bfaa47e..6fb4d146 100644
--- a/common/buildcraft/transport/blueprints/BptItemPipeWooden.java
+++ b/common/buildcraft/transport/blueprints/BptItemPipeWooden.java
@@ -30,7 +30,7 @@ public class BptItemPipeWooden extends BptItem {
@Override
public void postProcessing(BptSlotInfo slot, IBptContext context) {
- context.world().setBlockMetadata(slot.x, slot.y, slot.z, slot.meta);
+ context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,0);
}
@Override
diff --git a/common/buildcraft/transport/gui/GuiDiamondPipe.java b/common/buildcraft/transport/gui/GuiDiamondPipe.java
index a8a919a6..83c37310 100644
--- a/common/buildcraft/transport/gui/GuiDiamondPipe.java
+++ b/common/buildcraft/transport/gui/GuiDiamondPipe.java
@@ -55,9 +55,8 @@ public class GuiDiamondPipe extends GuiAdvancedInterface {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
- int i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/filter.png");
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- mc.renderEngine.bindTexture(i);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ mc.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_GUI + "/filter.png");
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
diff --git a/common/buildcraft/transport/gui/GuiEmeraldPipe.java b/common/buildcraft/transport/gui/GuiEmeraldPipe.java
index 3b04b342..dfac88c7 100644
--- a/common/buildcraft/transport/gui/GuiEmeraldPipe.java
+++ b/common/buildcraft/transport/gui/GuiEmeraldPipe.java
@@ -52,9 +52,8 @@ public class GuiEmeraldPipe extends GuiAdvancedInterface {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
- int i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/filter_2.png");
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- mc.renderEngine.bindTexture(i);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ mc.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_GUI + "/filter_2.png");
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
diff --git a/common/buildcraft/transport/gui/GuiGateInterface.java b/common/buildcraft/transport/gui/GuiGateInterface.java
index ce33d98a..ac0a2f39 100644
--- a/common/buildcraft/transport/gui/GuiGateInterface.java
+++ b/common/buildcraft/transport/gui/GuiGateInterface.java
@@ -13,6 +13,7 @@ import java.util.Iterator;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
+import net.minecraft.util.Icon;
import org.lwjgl.opengl.GL11;
@@ -23,6 +24,8 @@ import buildcraft.core.gui.GuiAdvancedInterface;
import buildcraft.core.utils.StringUtil;
import buildcraft.transport.Gate.GateKind;
import buildcraft.transport.Pipe;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class GuiGateInterface extends GuiAdvancedInterface {
@@ -53,22 +56,14 @@ public class GuiGateInterface extends GuiAdvancedInterface {
return "";
}
+ @SideOnly(Side.CLIENT)
@Override
- public String getTexture() {
+ public Icon getTexture() {
ITrigger trigger = pipe.getTrigger(slot);
if (trigger != null)
- return trigger.getTextureFile();
+ return trigger.getTextureIcon();
else
- return "";
- }
-
- @Override
- public int getTextureIndex() {
- ITrigger trigger = pipe.getTrigger(slot);
- if (trigger != null)
- return trigger.getIndexInTexture();
- else
- return 0;
+ return null;
}
@Override
@@ -102,22 +97,14 @@ public class GuiGateInterface extends GuiAdvancedInterface {
return "";
}
+ @SideOnly(Side.CLIENT)
@Override
- public String getTexture() {
+ public Icon getTexture() {
IAction action = pipe.getAction(slot);
if (action != null)
return action.getTexture();
else
- return "";
- }
-
- @Override
- public int getTextureIndex() {
- IAction action = pipe.getAction(slot);
- if (action != null)
- return action.getIndexInTexture();
- else
- return 0;
+ return null;
}
@Override
@@ -250,12 +237,12 @@ public class GuiGateInterface extends GuiAdvancedInterface {
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
_container.synchronize();
- int texture = 0;
-
- texture = mc.renderEngine.getTexture(_container.getGateGuiFile());
-
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+
+ String texture = _container.getGateGuiFile();
+
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(texture);
+
int cornerX = (width - xSize) / 2;
int cornerY = (height - ySize) / 2;
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);
diff --git a/common/buildcraft/transport/network/PacketLiquidUpdate.java b/common/buildcraft/transport/network/PacketLiquidUpdate.java
index 056cebc4..7d602621 100644
--- a/common/buildcraft/transport/network/PacketLiquidUpdate.java
+++ b/common/buildcraft/transport/network/PacketLiquidUpdate.java
@@ -62,18 +62,15 @@ public class PacketLiquidUpdate extends PacketCoordinates {
// System.out.printf("read %d, %d, %d = %s, %s%n", posX, posY, posZ, Arrays.toString(dBytes), delta);
for (ForgeDirection dir : ForgeDirection.values()) {
- if (renderCache[dir.ordinal()] == null) {
- renderCache[dir.ordinal()] = new LiquidStack(0, 0, 0);
- }
-
if (delta.get(dir.ordinal() * 3 + 0)) {
- renderCache[dir.ordinal()].itemID = data.readShort();
- }
- if (delta.get(dir.ordinal() * 3 + 1)) {
- renderCache[dir.ordinal()].itemMeta = data.readShort();
+ int amt = renderCache[dir.ordinal()] != null ? renderCache[dir.ordinal()].amount : 0;
+ renderCache[dir.ordinal()] = new LiquidStack(data.readShort(),amt,data.readShort());
}
if (delta.get(dir.ordinal() * 3 + 2)) {
- renderCache[dir.ordinal()].amount = Math.min(transLiq.getCapacity(), data.readShort());
+ if (renderCache[dir.ordinal()] == null) {
+ renderCache[dir.ordinal()] = new LiquidStack(0,0);
+ }
+ renderCache[dir.ordinal()].amount = Math.min(transLiq.getCapacity(), data.readShort());
}
}
}
@@ -92,15 +89,10 @@ public class PacketLiquidUpdate extends PacketCoordinates {
if (delta.get(dir.ordinal() * 3 + 0)) {
if (liquid != null) {
data.writeShort(liquid.itemID);
+ data.writeShort(liquid.itemMeta);
} else {
data.writeShort(0);
- }
- }
- if (delta.get(dir.ordinal() * 3 + 1)) {
- if (liquid != null) {
- data.writeShort(liquid.itemMeta);
- } else {
- data.writeShort(0);
+ data.writeShort(0);
}
}
if (delta.get(dir.ordinal() * 3 + 2)) {
diff --git a/common/buildcraft/transport/pipes/PipeItemsCobblestone.java b/common/buildcraft/transport/pipes/PipeItemsCobblestone.java
index 9920c1ee..2f693abe 100644
--- a/common/buildcraft/transport/pipes/PipeItemsCobblestone.java
+++ b/common/buildcraft/transport/pipes/PipeItemsCobblestone.java
@@ -9,9 +9,13 @@
package buildcraft.transport.pipes;
import net.minecraftforge.common.ForgeDirection;
-import buildcraft.core.DefaultProps;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportItems;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeItemsCobblestone extends Pipe {
@@ -21,13 +25,14 @@ public class PipeItemsCobblestone extends Pipe {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
- public int getTextureIndex(ForgeDirection direction) {
- return 1 * 16 + 1;
+ public int getIconIndex(ForgeDirection direction) {
+ return PipeIconProvider.PipeItemsCobbleStone;
}
}
diff --git a/common/buildcraft/transport/pipes/PipeItemsDiamond.java b/common/buildcraft/transport/pipes/PipeItemsDiamond.java
index 8cd93894..e8f2abac 100644
--- a/common/buildcraft/transport/pipes/PipeItemsDiamond.java
+++ b/common/buildcraft/transport/pipes/PipeItemsDiamond.java
@@ -19,13 +19,16 @@ import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.ForgeDirection;
import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.api.core.Position;
import buildcraft.api.transport.IPipedItem;
-import buildcraft.core.DefaultProps;
import buildcraft.core.network.IClientState;
import buildcraft.transport.IPipeTransportItemsHook;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportItems;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeItemsDiamond extends Pipe implements IPipeTransportItemsHook, IClientState {
@@ -34,15 +37,23 @@ public class PipeItemsDiamond extends Pipe implements IPipeTransportItemsHook, I
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
- public int getTextureIndex(ForgeDirection direction) {
- if (direction == ForgeDirection.UNKNOWN)
- return 1 * 16 + 5;
- return BuildCraftTransport.diamondTextures[direction.ordinal()];
+ public int getIconIndex(ForgeDirection direction) {
+ switch(direction){
+ case UNKNOWN: return PipeIconProvider.PipeItemsDiamond_Center;
+ case DOWN: return PipeIconProvider.PipeItemsDiamond_Down;
+ case UP: return PipeIconProvider.PipeItemsDiamond_Up;
+ case NORTH: return PipeIconProvider.PipeItemsDiamond_North;
+ case SOUTH: return PipeIconProvider.PipeItemsDiamond_South;
+ case WEST: return PipeIconProvider.PipeItemsDiamond_West;
+ case EAST: return PipeIconProvider.PipeItemsDiamond_East;
+ default: throw new IllegalArgumentException("direction out of bounds");
+ }
}
@Override
diff --git a/common/buildcraft/transport/pipes/PipeItemsEmerald.java b/common/buildcraft/transport/pipes/PipeItemsEmerald.java
index 24bd9a5e..aa66ca14 100644
--- a/common/buildcraft/transport/pipes/PipeItemsEmerald.java
+++ b/common/buildcraft/transport/pipes/PipeItemsEmerald.java
@@ -8,13 +8,21 @@
*/
package buildcraft.transport.pipes;
-import buildcraft.BuildCraftTransport;
-import buildcraft.api.inventory.ISelectiveInventory;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTBase;
+import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.ISidedInventory;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.inventory.ISelectiveInventory;
import buildcraft.api.inventory.ISpecialInventory;
import buildcraft.core.GuiIds;
import buildcraft.core.network.IClientState;
@@ -22,14 +30,8 @@ import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.SimpleInventory;
import buildcraft.core.utils.Utils;
import buildcraft.transport.BlockGenericPipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportItems;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.nbt.NBTBase;
-import net.minecraft.nbt.NBTTagCompound;
public class PipeItemsEmerald extends PipeItemsWood implements ISpecialInventory, IClientState {
@@ -39,8 +41,8 @@ public class PipeItemsEmerald extends PipeItemsWood implements ISpecialInventory
protected PipeItemsEmerald(int itemID, PipeTransportItems transport) {
super(transport, new PipeLogicEmerald(), itemID);
- baseTexture = 6 * 16 + 13;
- plainTexture = baseTexture + 1;
+ standardIconIndex = PipeIconProvider.PipeItemsEmerald_Standard;
+ solidIconIndex = PipeIconProvider.PipeAllEmerald_Solid;
}
public PipeItemsEmerald(int itemID) {
@@ -96,7 +98,7 @@ public class PipeItemsEmerald extends PipeItemsWood implements ISpecialInventory
for (ItemStack stack : stacks) {
if(stack == null)
continue;
-
+
boolean matches = false;
for (int i = 0; i < filters.getSizeInventory(); i++) {
ItemStack filter = filters.getStackInSlot(i);
@@ -293,4 +295,16 @@ public class PipeItemsEmerald extends PipeItemsWood implements ISpecialInventory
}
}
+
+ @Override
+ public boolean isInvNameLocalized() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isStackValidForSlot(int i, ItemStack itemstack) {
+ // TODO Auto-generated method stub
+ return false;
+ }
}
diff --git a/common/buildcraft/transport/pipes/PipeItemsGold.java b/common/buildcraft/transport/pipes/PipeItemsGold.java
index ac5e2286..d39653a7 100644
--- a/common/buildcraft/transport/pipes/PipeItemsGold.java
+++ b/common/buildcraft/transport/pipes/PipeItemsGold.java
@@ -11,13 +11,17 @@ package buildcraft.transport.pipes;
import java.util.LinkedList;
import net.minecraftforge.common.ForgeDirection;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.api.core.Position;
import buildcraft.api.transport.IPipedItem;
-import buildcraft.core.DefaultProps;
import buildcraft.core.utils.Utils;
import buildcraft.transport.IPipeTransportItemsHook;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportItems;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeItemsGold extends Pipe implements IPipeTransportItemsHook {
@@ -26,31 +30,16 @@ public class PipeItemsGold extends Pipe implements IPipeTransportItemsHook {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
- public int getTextureIndex(ForgeDirection direction) {
- return 1 * 16 + 14;
+ public int getIconIndex(ForgeDirection direction) {
+ return PipeIconProvider.PipeItemsGold;
}
- // @Override
- // public boolean isPipeConnected(TileEntity tile) {
- // if (!super.isPipeConnected(tile))
- // return false;
- //
- // Pipe pipe2 = null;
- //
- // if (tile instanceof TileGenericPipe)
- // pipe2 = ((TileGenericPipe) tile).pipe;
- //
- // if (BuildCraftTransport.alwaysConnectPipes)
- // return super.isPipeConnected(tile);
- // else
- // return (pipe2 == null || !(pipe2.logic instanceof PipeLogicGold)) && super.isPipeConnected(tile);
- // }
-
@Override
public LinkedList filterPossibleMovements(LinkedList possibleOrientations, Position pos, IPipedItem item) {
return possibleOrientations;
diff --git a/common/buildcraft/transport/pipes/PipeItemsIron.java b/common/buildcraft/transport/pipes/PipeItemsIron.java
index 900988af..8fd64a62 100644
--- a/common/buildcraft/transport/pipes/PipeItemsIron.java
+++ b/common/buildcraft/transport/pipes/PipeItemsIron.java
@@ -9,14 +9,18 @@
package buildcraft.transport.pipes;
import net.minecraftforge.common.ForgeDirection;
-import buildcraft.core.DefaultProps;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportItems;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeItemsIron extends Pipe {
- private int baseTexture = 1 * 16 + 2;
- private int plainTexture = 1 * 16 + 3;
+ private int standardIconIndex = PipeIconProvider.PipeItemsIron_Standard;
+ private int solidIconIndex = PipeIconProvider.PipeAllIron_Solid;
public PipeItemsIron(int itemID) {
super(new PipeTransportItems(), new PipeLogicIron(), itemID);
@@ -25,24 +29,25 @@ public class PipeItemsIron extends Pipe {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
- }
-
- @Override
- public int getTextureIndex(ForgeDirection direction) {
+ public int getIconIndex(ForgeDirection direction) {
if (direction == ForgeDirection.UNKNOWN)
- return baseTexture;
+ return standardIconIndex;
else {
int metadata = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
if (metadata == direction.ordinal())
- return baseTexture;
+ return solidIconIndex;
else
- return plainTexture;
+ return standardIconIndex;
}
}
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
+ }
+
@Override
public boolean canConnectRedstone() {
return true;
diff --git a/common/buildcraft/transport/pipes/PipeItemsObsidian.java b/common/buildcraft/transport/pipes/PipeItemsObsidian.java
index a34bfa8e..fa2f20bc 100644
--- a/common/buildcraft/transport/pipes/PipeItemsObsidian.java
+++ b/common/buildcraft/transport/pipes/PipeItemsObsidian.java
@@ -12,24 +12,28 @@ import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.item.EntityMinecart;
+import net.minecraft.entity.item.EntityMinecartChest;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.ForgeDirection;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.api.core.Position;
import buildcraft.api.power.IPowerProvider;
import buildcraft.api.power.IPowerReceptor;
import buildcraft.api.power.PowerFramework;
import buildcraft.api.transport.IPipedItem;
-import buildcraft.core.DefaultProps;
import buildcraft.core.EntityPassiveItem;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.Utils;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportItems;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeItemsObsidian extends Pipe implements IPowerReceptor {
@@ -53,13 +57,14 @@ public class PipeItemsObsidian extends Pipe implements IPowerReceptor {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
-
+
@Override
- public int getTextureIndex(ForgeDirection direction) {
- return 1 * 16 + 12;
+ public int getIconIndex(ForgeDirection direction) {
+ return PipeIconProvider.PipeItemsObsidian;
}
@Override
@@ -166,9 +171,9 @@ public class PipeItemsObsidian extends Pipe implements IPowerReceptor {
return true;
}
- if (distance == 1 && list.get(g) instanceof EntityMinecart) {
- EntityMinecart cart = (EntityMinecart) list.get(g);
- if (!cart.isDead && cart.minecartType == 1) {
+ if (distance == 1 && list.get(g) instanceof EntityMinecartChest) {
+ EntityMinecartChest cart = (EntityMinecartChest) list.get(g);
+ if (!cart.isDead) {
ItemStack stack = checkExtractGeneric(cart, true, getOpenOrientation());
if (stack != null && powerProvider.useEnergy(1, 1, true) == 1) {
EntityItem entityitem = new EntityItem(worldObj, cart.posX, cart.posY + 0.3F, cart.posZ, stack);
@@ -216,7 +221,7 @@ public class PipeItemsObsidian extends Pipe implements IPowerReceptor {
if (entity instanceof EntityItem) {
EntityItem item = (EntityItem) entity;
ItemStack contained = item.getEntityItem();
-
+
CoreProxy.proxy.obsidianPipePickup(worldObj, item, this.container);
float energyUsed = powerProvider.useEnergy(distance, contained.stackSize * distance, true);
@@ -290,7 +295,7 @@ public class PipeItemsObsidian extends Pipe implements IPowerReceptor {
}
@Override
- public int powerRequest() {
+ public int powerRequest(ForgeDirection from) {
return getPowerProvider().getMaxEnergyReceived();
}
}
diff --git a/common/buildcraft/transport/pipes/PipeItemsSandstone.java b/common/buildcraft/transport/pipes/PipeItemsSandstone.java
index 9069a39a..dd2a79e6 100644
--- a/common/buildcraft/transport/pipes/PipeItemsSandstone.java
+++ b/common/buildcraft/transport/pipes/PipeItemsSandstone.java
@@ -10,9 +10,13 @@
package buildcraft.transport.pipes;
import net.minecraftforge.common.ForgeDirection;
-import buildcraft.core.DefaultProps;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportItems;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeItemsSandstone extends Pipe {
public PipeItemsSandstone(int itemID) {
@@ -20,12 +24,13 @@ public class PipeItemsSandstone extends Pipe {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
- public int getTextureIndex(ForgeDirection direction) {
- return 8 * 16 + 15;
+ public int getIconIndex(ForgeDirection direction) {
+ return PipeIconProvider.PipeItemsSandstone;
}
}
diff --git a/common/buildcraft/transport/pipes/PipeItemsStone.java b/common/buildcraft/transport/pipes/PipeItemsStone.java
index 1f809a7d..0b07ac2d 100644
--- a/common/buildcraft/transport/pipes/PipeItemsStone.java
+++ b/common/buildcraft/transport/pipes/PipeItemsStone.java
@@ -11,13 +11,17 @@ package buildcraft.transport.pipes;
import java.util.LinkedList;
import net.minecraftforge.common.ForgeDirection;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.api.core.Position;
import buildcraft.api.transport.IPipedItem;
-import buildcraft.core.DefaultProps;
import buildcraft.core.utils.Utils;
import buildcraft.transport.IPipeTransportItemsHook;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportItems;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeItemsStone extends Pipe implements IPipeTransportItemsHook {
@@ -27,13 +31,14 @@ public class PipeItemsStone extends Pipe implements IPipeTransportItemsHook {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
- public int getTextureIndex(ForgeDirection direction) {
- return 1 * 16 + 13;
+ public int getIconIndex(ForgeDirection direction) {
+ return PipeIconProvider.PipeItemsStone;
}
@Override
diff --git a/common/buildcraft/transport/pipes/PipeItemsVoid.java b/common/buildcraft/transport/pipes/PipeItemsVoid.java
index 17666cca..225aa334 100644
--- a/common/buildcraft/transport/pipes/PipeItemsVoid.java
+++ b/common/buildcraft/transport/pipes/PipeItemsVoid.java
@@ -11,11 +11,15 @@ package buildcraft.transport.pipes;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
-import buildcraft.core.DefaultProps;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.transport.EntityData;
import buildcraft.transport.IItemTravelingHook;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportItems;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeItemsVoid extends Pipe implements IItemTravelingHook {
@@ -25,13 +29,14 @@ public class PipeItemsVoid extends Pipe implements IItemTravelingHook {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
- public int getTextureIndex(ForgeDirection direction) {
- return 8 * 16 + 14;
+ public int getIconIndex(ForgeDirection direction) {
+ return PipeIconProvider.PipeItemsVoid;
}
// This is called if the void pipe is only connected to one pipe
diff --git a/common/buildcraft/transport/pipes/PipeItemsWood.java b/common/buildcraft/transport/pipes/PipeItemsWood.java
index 7e922347..99139704 100644
--- a/common/buildcraft/transport/pipes/PipeItemsWood.java
+++ b/common/buildcraft/transport/pipes/PipeItemsWood.java
@@ -14,6 +14,8 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.ISidedInventory;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.api.core.Position;
import buildcraft.api.inventory.ISpecialInventory;
import buildcraft.api.power.IPowerProvider;
@@ -21,19 +23,21 @@ import buildcraft.api.power.IPowerReceptor;
import buildcraft.api.power.PowerFramework;
import buildcraft.api.transport.IPipedItem;
import buildcraft.api.transport.PipeManager;
-import buildcraft.core.DefaultProps;
import buildcraft.core.EntityPassiveItem;
import buildcraft.core.RedstonePowerFramework;
import buildcraft.core.utils.Utils;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportItems;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeItemsWood extends Pipe implements IPowerReceptor {
private IPowerProvider powerProvider;
-
- protected int baseTexture = 1 * 16 + 0;
- protected int plainTexture = 1 * 16 + 15;
+
+ protected int standardIconIndex = PipeIconProvider.PipeItemsWood_Standard;
+ protected int solidIconIndex = PipeIconProvider.PipeAllWood_Solid;
protected PipeItemsWood(PipeTransportItems transport, PipeLogic logic, int itemID) {
super(transport, logic, itemID);
@@ -52,21 +56,22 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
- public int getTextureIndex(ForgeDirection direction) {
+ public int getIconIndex(ForgeDirection direction) {
if (direction == ForgeDirection.UNKNOWN)
- return baseTexture;
+ return standardIconIndex;
else {
int metadata = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
if (metadata == direction.ordinal())
- return plainTexture;
+ return solidIconIndex;
else
- return baseTexture;
+ return standardIconIndex;
}
}
@@ -224,7 +229,7 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor {
}
@Override
- public int powerRequest() {
+ public int powerRequest(ForgeDirection from) {
return getPowerProvider().getMaxEnergyReceived();
}
diff --git a/common/buildcraft/transport/pipes/PipeLiquidsCobblestone.java b/common/buildcraft/transport/pipes/PipeLiquidsCobblestone.java
index de31a062..ff9fca16 100644
--- a/common/buildcraft/transport/pipes/PipeLiquidsCobblestone.java
+++ b/common/buildcraft/transport/pipes/PipeLiquidsCobblestone.java
@@ -9,9 +9,13 @@
package buildcraft.transport.pipes;
import net.minecraftforge.common.ForgeDirection;
-import buildcraft.core.DefaultProps;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportLiquids;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeLiquidsCobblestone extends Pipe {
@@ -20,12 +24,13 @@ public class PipeLiquidsCobblestone extends Pipe {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
- public int getTextureIndex(ForgeDirection direction) {
- return 7 * 16 + 1;
+ public int getIconIndex(ForgeDirection direction) {
+ return PipeIconProvider.PipeLiquidsCobblestone;
}
}
diff --git a/common/buildcraft/transport/pipes/PipeLiquidsEmerald.java b/common/buildcraft/transport/pipes/PipeLiquidsEmerald.java
index e2adf2b7..6b8e1726 100644
--- a/common/buildcraft/transport/pipes/PipeLiquidsEmerald.java
+++ b/common/buildcraft/transport/pipes/PipeLiquidsEmerald.java
@@ -8,6 +8,7 @@
*/
package buildcraft.transport.pipes;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportLiquids;
/**
@@ -19,8 +20,8 @@ public class PipeLiquidsEmerald extends PipeLiquidsWood {
public PipeLiquidsEmerald(int itemID) {
super(new PipeLogicEmerald(), itemID);
- baseTexture = 6 * 16 + 15;
- plainTexture = baseTexture - 1;
+ standardIconIndex = PipeIconProvider.PipeLiquidsEmerald_Standard;
+ solidIconIndex = PipeIconProvider.PipeAllEmerald_Solid;
((PipeTransportLiquids) transport).flowRate = 40;
((PipeTransportLiquids) transport).travelDelay = 4;
diff --git a/common/buildcraft/transport/pipes/PipeLiquidsGold.java b/common/buildcraft/transport/pipes/PipeLiquidsGold.java
index f44ae998..dfe2372f 100644
--- a/common/buildcraft/transport/pipes/PipeLiquidsGold.java
+++ b/common/buildcraft/transport/pipes/PipeLiquidsGold.java
@@ -9,9 +9,13 @@
package buildcraft.transport.pipes;
import net.minecraftforge.common.ForgeDirection;
-import buildcraft.core.DefaultProps;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportLiquids;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeLiquidsGold extends Pipe {
@@ -23,13 +27,14 @@ public class PipeLiquidsGold extends Pipe {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
- public int getTextureIndex(ForgeDirection direction) {
- return 7 * 16 + 4;
+ public int getIconIndex(ForgeDirection direction) {
+ return PipeIconProvider.PipeLiquidsGold;
}
}
diff --git a/common/buildcraft/transport/pipes/PipeLiquidsIron.java b/common/buildcraft/transport/pipes/PipeLiquidsIron.java
index 95bde61c..a7cf4990 100644
--- a/common/buildcraft/transport/pipes/PipeLiquidsIron.java
+++ b/common/buildcraft/transport/pipes/PipeLiquidsIron.java
@@ -9,35 +9,41 @@
package buildcraft.transport.pipes;
import net.minecraftforge.common.ForgeDirection;
-import buildcraft.core.DefaultProps;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportLiquids;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeLiquidsIron extends Pipe {
+
+ protected int standardIconIndex = PipeIconProvider.PipeLiquidsIron_Standard;
+ protected int solidIconIndex = PipeIconProvider.PipeAllIron_Solid;
- private int baseTexture = 7 * 16 + 3;
- private int plainTexture = 1 * 16 + 3;
public PipeLiquidsIron(int itemID) {
super(new PipeTransportLiquids(), new PipeLogicIron(), itemID);
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
- public int getTextureIndex(ForgeDirection direction) {
+ public int getIconIndex(ForgeDirection direction) {
if (direction == ForgeDirection.UNKNOWN)
- return baseTexture;
+ return standardIconIndex;
else {
int metadata = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
if (metadata == direction.ordinal())
- return baseTexture;
+ return solidIconIndex;
else
- return plainTexture;
+ return standardIconIndex;
}
}
diff --git a/common/buildcraft/transport/pipes/PipeLiquidsSandstone.java b/common/buildcraft/transport/pipes/PipeLiquidsSandstone.java
index 33c18a86..b787858c 100644
--- a/common/buildcraft/transport/pipes/PipeLiquidsSandstone.java
+++ b/common/buildcraft/transport/pipes/PipeLiquidsSandstone.java
@@ -11,11 +11,15 @@ package buildcraft.transport.pipes;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.LiquidStack;
-import buildcraft.core.DefaultProps;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.transport.IPipeTransportLiquidsHook;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportLiquids;
import buildcraft.transport.TileGenericPipe;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeLiquidsSandstone extends Pipe implements IPipeTransportLiquidsHook {
public PipeLiquidsSandstone(int itemID) {
@@ -23,13 +27,14 @@ public class PipeLiquidsSandstone extends Pipe implements IPipeTransportLiquidsH
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
- public int getTextureIndex(ForgeDirection direction) {
- return 9 * 16 + 15;
+ public int getIconIndex(ForgeDirection direction) {
+ return PipeIconProvider.PipeLiquidsSandstone;
}
@Override
diff --git a/common/buildcraft/transport/pipes/PipeLiquidsStone.java b/common/buildcraft/transport/pipes/PipeLiquidsStone.java
index fc5b9b55..51e8c37f 100644
--- a/common/buildcraft/transport/pipes/PipeLiquidsStone.java
+++ b/common/buildcraft/transport/pipes/PipeLiquidsStone.java
@@ -9,9 +9,13 @@
package buildcraft.transport.pipes;
import net.minecraftforge.common.ForgeDirection;
-import buildcraft.core.DefaultProps;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportLiquids;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeLiquidsStone extends Pipe {
@@ -20,15 +24,16 @@ public class PipeLiquidsStone extends Pipe {
// ((PipeTransportLiquids) transport).flowRate = 40;
}
-
+
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
- public int getTextureIndex(ForgeDirection direction) {
- return 7 * 16 + 2;
+ public int getIconIndex(ForgeDirection direction) {
+ return PipeIconProvider.PipeLiquidsStone;
}
}
diff --git a/common/buildcraft/transport/pipes/PipeLiquidsVoid.java b/common/buildcraft/transport/pipes/PipeLiquidsVoid.java
index 3a6aac22..56665e95 100644
--- a/common/buildcraft/transport/pipes/PipeLiquidsVoid.java
+++ b/common/buildcraft/transport/pipes/PipeLiquidsVoid.java
@@ -11,10 +11,14 @@ package buildcraft.transport.pipes;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.LiquidStack;
-import buildcraft.core.DefaultProps;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.transport.IPipeTransportLiquidsHook;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportLiquids;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeLiquidsVoid extends Pipe implements IPipeTransportLiquidsHook {
@@ -23,13 +27,14 @@ public class PipeLiquidsVoid extends Pipe implements IPipeTransportLiquidsHook {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
- public int getTextureIndex(ForgeDirection direction) {
- return 9 * 16 + 14;
+ public int getIconIndex(ForgeDirection direction) {
+ return PipeIconProvider.PipeLiquidsVoid;
}
@Override
diff --git a/common/buildcraft/transport/pipes/PipeLiquidsWood.java b/common/buildcraft/transport/pipes/PipeLiquidsWood.java
index 6ceb5ab9..c670f551 100644
--- a/common/buildcraft/transport/pipes/PipeLiquidsWood.java
+++ b/common/buildcraft/transport/pipes/PipeLiquidsWood.java
@@ -14,16 +14,20 @@ import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.ITankContainer;
import net.minecraftforge.liquids.LiquidContainerRegistry;
import net.minecraftforge.liquids.LiquidStack;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.api.core.Position;
import buildcraft.api.power.IPowerProvider;
import buildcraft.api.power.IPowerReceptor;
import buildcraft.api.power.PowerFramework;
import buildcraft.api.transport.PipeManager;
-import buildcraft.core.DefaultProps;
import buildcraft.core.RedstonePowerFramework;
import buildcraft.core.network.TileNetworkData;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportLiquids;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeLiquidsWood extends Pipe implements IPowerReceptor {
@@ -31,8 +35,9 @@ public class PipeLiquidsWood extends Pipe implements IPowerReceptor {
int liquidToExtract;
private IPowerProvider powerProvider;
- protected int baseTexture = 7 * 16 + 0;
- protected int plainTexture = 1 * 16 + 15;
+
+ protected int standardIconIndex = PipeIconProvider.PipeLiquidsWood_Standard;
+ protected int solidIconIndex = PipeIconProvider.PipeAllWood_Solid;
long lastMining = 0;
boolean lastPower = false;
@@ -120,26 +125,27 @@ public class PipeLiquidsWood extends Pipe implements IPowerReceptor {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
- public int getTextureIndex(ForgeDirection direction) {
+ public int getIconIndex(ForgeDirection direction) {
if (direction == ForgeDirection.UNKNOWN)
- return baseTexture;
+ return standardIconIndex;
else {
int metadata = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
if (metadata == direction.ordinal())
- return plainTexture;
+ return solidIconIndex;
else
- return baseTexture;
+ return standardIconIndex;
}
}
@Override
- public int powerRequest() {
+ public int powerRequest(ForgeDirection from) {
return getPowerProvider().getMaxEnergyReceived();
}
diff --git a/common/buildcraft/transport/pipes/PipeLogicDiamond.java b/common/buildcraft/transport/pipes/PipeLogicDiamond.java
index 8b8c64a9..765519ad 100644
--- a/common/buildcraft/transport/pipes/PipeLogicDiamond.java
+++ b/common/buildcraft/transport/pipes/PipeLogicDiamond.java
@@ -133,4 +133,18 @@ public class PipeLogicDiamond extends PipeLogic implements ISpecialInventory {
}
+ @Override
+ public boolean isInvNameLocalized()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isStackValidForSlot(int i, ItemStack itemstack)
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
}
diff --git a/common/buildcraft/transport/pipes/PipeLogicIron.java b/common/buildcraft/transport/pipes/PipeLogicIron.java
index 3713f732..fcb64274 100644
--- a/common/buildcraft/transport/pipes/PipeLogicIron.java
+++ b/common/buildcraft/transport/pipes/PipeLogicIron.java
@@ -57,7 +57,7 @@ public class PipeLogicIron extends PipeLogic {
if (tile instanceof IPipeEntry || tile instanceof IInventory || tile instanceof ITankContainer || tile instanceof TileGenericPipe) {
- worldObj.setBlockMetadata(xCoord, yCoord, zCoord, nextMetadata);
+ worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, nextMetadata,0);
container.scheduleRenderUpdate();
return;
}
@@ -75,7 +75,7 @@ public class PipeLogicIron extends PipeLogic {
public void onBlockPlaced() {
super.onBlockPlaced();
- worldObj.setBlockMetadata(xCoord, yCoord, zCoord, 1);
+ worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1,0);
switchPosition();
}
diff --git a/common/buildcraft/transport/pipes/PipeLogicWood.java b/common/buildcraft/transport/pipes/PipeLogicWood.java
index f21dd5eb..19bb1f16 100644
--- a/common/buildcraft/transport/pipes/PipeLogicWood.java
+++ b/common/buildcraft/transport/pipes/PipeLogicWood.java
@@ -43,7 +43,7 @@ public class PipeLogicWood extends PipeLogic {
}
if (newMeta != meta) {
- worldObj.setBlockMetadata(xCoord, yCoord, zCoord, newMeta);
+ worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, newMeta,0);
container.scheduleRenderUpdate();
// worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
}
diff --git a/common/buildcraft/transport/pipes/PipePowerGold.java b/common/buildcraft/transport/pipes/PipePowerGold.java
index 8e6c5481..3d673b1f 100644
--- a/common/buildcraft/transport/pipes/PipePowerGold.java
+++ b/common/buildcraft/transport/pipes/PipePowerGold.java
@@ -9,9 +9,13 @@
package buildcraft.transport.pipes;
import net.minecraftforge.common.ForgeDirection;
-import buildcraft.core.DefaultProps;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportPower;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipePowerGold extends Pipe {
@@ -22,13 +26,14 @@ public class PipePowerGold extends Pipe {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
- public int getTextureIndex(ForgeDirection direction) {
- return 7 * 16 + 10;
+ public int getIconIndex(ForgeDirection direction) {
+ return PipeIconProvider.PipePowerGold;
}
}
diff --git a/common/buildcraft/transport/pipes/PipePowerStone.java b/common/buildcraft/transport/pipes/PipePowerStone.java
index a32be911..082fdbab 100644
--- a/common/buildcraft/transport/pipes/PipePowerStone.java
+++ b/common/buildcraft/transport/pipes/PipePowerStone.java
@@ -9,9 +9,13 @@
package buildcraft.transport.pipes;
import net.minecraftforge.common.ForgeDirection;
-import buildcraft.core.DefaultProps;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportPower;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipePowerStone extends Pipe {
@@ -20,13 +24,14 @@ public class PipePowerStone extends Pipe {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
- public int getTextureIndex(ForgeDirection direction) {
- return 7 * 16 + 8;
+ public int getIconIndex(ForgeDirection direction) {
+ return PipeIconProvider.PipePowerStone;
}
}
diff --git a/common/buildcraft/transport/pipes/PipePowerWood.java b/common/buildcraft/transport/pipes/PipePowerWood.java
index cdb85df7..78a3b94a 100644
--- a/common/buildcraft/transport/pipes/PipePowerWood.java
+++ b/common/buildcraft/transport/pipes/PipePowerWood.java
@@ -10,23 +10,28 @@ package buildcraft.transport.pipes;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.api.power.IPowerProvider;
import buildcraft.api.power.IPowerReceptor;
import buildcraft.api.power.PowerFramework;
-import buildcraft.core.DefaultProps;
import buildcraft.core.utils.Utils;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportPower;
import buildcraft.transport.TileGenericPipe;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipePowerWood extends Pipe implements IPowerReceptor {
private static final int MAX_OVERHEAT_TICKS = 100;
private IPowerProvider powerProvider;
+
+ protected int standardIconIndex = PipeIconProvider.PipePowerWood_Standard;
+ protected int solidIconIndex = PipeIconProvider.PipeAllWood_Solid;
- private int baseTexture = 7 * 16 + 6;
- private int plainTexture = 1 * 16 + 15;
private int overheatTicks;
@@ -39,21 +44,22 @@ public class PipePowerWood extends Pipe implements IPowerReceptor {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
- public int getTextureIndex(ForgeDirection direction) {
+ public int getIconIndex(ForgeDirection direction) {
if (direction == ForgeDirection.UNKNOWN)
- return baseTexture;
+ return standardIconIndex;
else {
int metadata = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
if (metadata == direction.ordinal())
- return plainTexture;
+ return solidIconIndex;
else
- return baseTexture;
+ return standardIconIndex;
}
}
@@ -122,7 +128,7 @@ public class PipePowerWood extends Pipe implements IPowerReceptor {
}
@Override
- public int powerRequest() {
+ public int powerRequest(ForgeDirection from) {
return getPowerProvider().getMaxEnergyReceived();
}
diff --git a/common/buildcraft/transport/pipes/PipeStructureCobblestone.java b/common/buildcraft/transport/pipes/PipeStructureCobblestone.java
index 674fff88..450051ba 100644
--- a/common/buildcraft/transport/pipes/PipeStructureCobblestone.java
+++ b/common/buildcraft/transport/pipes/PipeStructureCobblestone.java
@@ -1,25 +1,28 @@
package buildcraft.transport.pipes;
import net.minecraftforge.common.ForgeDirection;
-import buildcraft.core.DefaultProps;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportStructure;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
public class PipeStructureCobblestone extends Pipe {
public PipeStructureCobblestone(int itemID) {
super(new PipeTransportStructure(), new PipeLogicCobblestone(), itemID);
-
}
-
+
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_BLOCKS;
+ @SideOnly(Side.CLIENT)
+ public IIconProvider getIconProvider() {
+ return BuildCraftTransport.instance.pipeIconProvider;
}
-
+
@Override
- public int getTextureIndex(ForgeDirection direction) {
- return 7 * 16 + 13;
+ public int getIconIndex(ForgeDirection direction) {
+ return PipeIconProvider.PipeStructureCobblestone;
}
-
}
diff --git a/common/buildcraft/transport/render/FacadeItemRenderer.java b/common/buildcraft/transport/render/FacadeItemRenderer.java
index 1c2820cb..2dc11617 100644
--- a/common/buildcraft/transport/render/FacadeItemRenderer.java
+++ b/common/buildcraft/transport/render/FacadeItemRenderer.java
@@ -4,15 +4,15 @@ import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.ItemStack;
-import net.minecraftforge.client.ForgeHooksClient;
+import net.minecraft.util.Icon;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import buildcraft.BuildCraftTransport;
-import buildcraft.core.DefaultProps;
import buildcraft.core.utils.Utils;
import buildcraft.transport.ItemFacade;
+import buildcraft.transport.PipeIconProvider;
public class FacadeItemRenderer implements IItemRenderer {
@@ -29,7 +29,6 @@ public class FacadeItemRenderer implements IItemRenderer {
// Render Facade
GL11.glPushMatrix();
- ForgeHooksClient.bindTexture(block.getTextureFile(), 0);
block.setBlockBounds(0F, 0F, 1F - 1F / 16F, 1F, 1F, 1F);
render.setRenderBoundsFromBlock(block);
GL11.glTranslatef(translateX, translateY, translateZ);
@@ -62,9 +61,9 @@ public class FacadeItemRenderer implements IItemRenderer {
GL11.glPopMatrix();
// Render StructurePipe
- ForgeHooksClient.bindTexture(DefaultProps.TEXTURE_BLOCKS, 0);
block = BuildCraftTransport.genericPipeBlock;
- int textureID = 7 * 16 + 13; // Structure pipe
+ Icon textureID = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.PipeStructureCobblestone); // Structure pipe
+
block.setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos - 1F / 16F);
block.setBlockBoundsForItemRender();
render.setRenderBoundsFromBlock(block);
diff --git a/common/buildcraft/transport/render/PipeItemRenderer.java b/common/buildcraft/transport/render/PipeItemRenderer.java
index 8c0735e0..29544dd0 100644
--- a/common/buildcraft/transport/render/PipeItemRenderer.java
+++ b/common/buildcraft/transport/render/PipeItemRenderer.java
@@ -5,6 +5,7 @@ import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
+import net.minecraft.util.Icon;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
@@ -21,10 +22,7 @@ public class PipeItemRenderer implements IItemRenderer {
Tessellator tessellator = Tessellator.instance;
Block block = BuildCraftTransport.genericPipeBlock;
- int textureID = ((ItemPipe) Item.itemsList[item.itemID]).getTextureIndex();
- if (textureID > 255) {
- textureID -= 256;
- }
+ Icon icon = ((ItemPipe) Item.itemsList[item.itemID]).getIconFromDamage(0);
block.setBlockBounds(Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos);
block.setBlockBoundsForItemRender();
@@ -33,27 +31,27 @@ public class PipeItemRenderer implements IItemRenderer {
GL11.glTranslatef(translateX, translateY, translateZ);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1F, 0.0F);
- render.renderBottomFace(block, 0.0D, 0.0D, 0.0D, textureID);
+ render.renderBottomFace(block, 0.0D, 0.0D, 0.0D, icon);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
- render.renderTopFace(block, 0.0D, 0.0D, 0.0D, textureID);
+ render.renderTopFace(block, 0.0D, 0.0D, 0.0D, icon);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
- render.renderEastFace(block, 0.0D, 0.0D, 0.0D, textureID);
+ render.renderEastFace(block, 0.0D, 0.0D, 0.0D, icon);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
- render.renderWestFace(block, 0.0D, 0.0D, 0.0D, textureID);
+ render.renderWestFace(block, 0.0D, 0.0D, 0.0D, icon);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
- render.renderNorthFace(block, 0.0D, 0.0D, 0.0D, textureID);
+ render.renderNorthFace(block, 0.0D, 0.0D, 0.0D, icon);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
- render.renderSouthFace(block, 0.0D, 0.0D, 0.0D, textureID);
+ render.renderSouthFace(block, 0.0D, 0.0D, 0.0D, icon);
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
diff --git a/common/buildcraft/transport/render/PipeWorldRenderer.java b/common/buildcraft/transport/render/PipeWorldRenderer.java
index 3ee581cc..0da895bd 100644
--- a/common/buildcraft/transport/render/PipeWorldRenderer.java
+++ b/common/buildcraft/transport/render/PipeWorldRenderer.java
@@ -4,13 +4,14 @@ import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
-import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.common.ForgeDirection;
+import buildcraft.BuildCraftTransport;
+import buildcraft.api.core.IIconProvider;
import buildcraft.api.transport.IPipe;
import buildcraft.api.transport.IPipe.WireColor;
-import buildcraft.core.DefaultProps;
import buildcraft.core.utils.Utils;
import buildcraft.transport.IPipeRenderState;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeRenderState;
import buildcraft.transport.TransportProxy;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
@@ -21,7 +22,7 @@ public class PipeWorldRenderer implements ISimpleBlockRenderingHandler {
/**
* Mirrors the array on the Y axis by calculating offsets from 0.5F
- *
+ *
* @param targetArray
*/
private void mirrorY(float[][] targetArray) {
@@ -33,7 +34,7 @@ public class PipeWorldRenderer implements ISimpleBlockRenderingHandler {
/**
* Shifts the coordinates around effectivly rotating something. Zero state is DOWN then -> NORTH -> WEST Note - To obtain Pos, do a mirrorY() before
* rotating
- *
+ *
* @param targetArray
* the array that should be rotated
*/
@@ -63,7 +64,7 @@ public class PipeWorldRenderer implements ISimpleBlockRenderingHandler {
/**
* Clones both dimensions of a float[][]
- *
+ *
* @param source
* the float[][] to deepClone
* @return
@@ -76,55 +77,58 @@ public class PipeWorldRenderer implements ISimpleBlockRenderingHandler {
return target;
}
- public void renderPipe(RenderBlocks renderblocks, IBlockAccess iblockaccess, Block block, PipeRenderState state, int x, int y, int z) {
+ public void renderPipe(RenderBlocks renderblocks, IBlockAccess iblockaccess, Block block, IPipeRenderState renderState, int x, int y, int z) {
float minSize = Utils.pipeMinPos;
float maxSize = Utils.pipeMaxPos;
+
+ PipeRenderState state = renderState.getRenderState();
+ IIconProvider icons = renderState.getPipeIcons();
+ if (icons == null) return;
+
- ForgeHooksClient.bindTexture(state.getTextureFile(), 0);
-
- state.currentTextureIndex = state.textureMatrix.getTextureIndex(ForgeDirection.UNKNOWN);
+ state.currentTexture = icons.getIcon(state.textureMatrix.getTextureIndex(ForgeDirection.UNKNOWN));
block.setBlockBounds(minSize, minSize, minSize, maxSize, maxSize, maxSize);
renderblocks.setRenderBoundsFromBlock(block);
renderblocks.renderStandardBlock(block, x, y, z);
if (state.pipeConnectionMatrix.isConnected(ForgeDirection.WEST)) {
- state.currentTextureIndex = state.textureMatrix.getTextureIndex(ForgeDirection.WEST);
+ state.currentTexture = icons.getIcon(state.textureMatrix.getTextureIndex(ForgeDirection.WEST));
block.setBlockBounds(0.0F, minSize, minSize, minSize, maxSize, maxSize);
renderblocks.setRenderBoundsFromBlock(block);
renderblocks.renderStandardBlock(block, x, y, z);
}
if (state.pipeConnectionMatrix.isConnected(ForgeDirection.EAST)) {
- state.currentTextureIndex = state.textureMatrix.getTextureIndex(ForgeDirection.EAST);
+ state.currentTexture = icons.getIcon(state.textureMatrix.getTextureIndex(ForgeDirection.EAST));
block.setBlockBounds(maxSize, minSize, minSize, 1.0F, maxSize, maxSize);
renderblocks.setRenderBoundsFromBlock(block);
renderblocks.renderStandardBlock(block, x, y, z);
}
if (state.pipeConnectionMatrix.isConnected(ForgeDirection.DOWN)) {
- state.currentTextureIndex = state.textureMatrix.getTextureIndex(ForgeDirection.DOWN);
+ state.currentTexture = icons.getIcon(state.textureMatrix.getTextureIndex(ForgeDirection.DOWN));
block.setBlockBounds(minSize, 0.0F, minSize, maxSize, minSize, maxSize);
renderblocks.setRenderBoundsFromBlock(block);
renderblocks.renderStandardBlock(block, x, y, z);
}
if (state.pipeConnectionMatrix.isConnected(ForgeDirection.UP)) {
- state.currentTextureIndex = state.textureMatrix.getTextureIndex(ForgeDirection.UP);
+ state.currentTexture = icons.getIcon(state.textureMatrix.getTextureIndex(ForgeDirection.UP));
block.setBlockBounds(minSize, maxSize, minSize, maxSize, 1.0F, maxSize);
renderblocks.setRenderBoundsFromBlock(block);
renderblocks.renderStandardBlock(block, x, y, z);
}
if (state.pipeConnectionMatrix.isConnected(ForgeDirection.NORTH)) {
- state.currentTextureIndex = state.textureMatrix.getTextureIndex(ForgeDirection.NORTH);
+ state.currentTexture = icons.getIcon(state.textureMatrix.getTextureIndex(ForgeDirection.NORTH));
block.setBlockBounds(minSize, minSize, 0.0F, maxSize, maxSize, minSize);
renderblocks.setRenderBoundsFromBlock(block);
renderblocks.renderStandardBlock(block, x, y, z);
}
if (state.pipeConnectionMatrix.isConnected(ForgeDirection.SOUTH)) {
- state.currentTextureIndex = state.textureMatrix.getTextureIndex(ForgeDirection.SOUTH);
+ state.currentTexture = icons.getIcon(state.textureMatrix.getTextureIndex(ForgeDirection.SOUTH));
block.setBlockBounds(minSize, minSize, maxSize, maxSize, maxSize, 1.0F);
renderblocks.setRenderBoundsFromBlock(block);
renderblocks.renderStandardBlock(block, x, y, z);
@@ -132,25 +136,24 @@ public class PipeWorldRenderer implements ISimpleBlockRenderingHandler {
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- ForgeHooksClient.bindTexture(DefaultProps.TEXTURE_BLOCKS, 0);
-
if (state.wireMatrix.hasWire(WireColor.Red)) {
- state.currentTextureIndex = state.wireMatrix.getTextureIndex(WireColor.Red);
+ state.currentTexture = BuildCraftTransport.instance.wireIconProvider.getIcon(state.wireMatrix.getWireIconIndex(WireColor.Red));
+
pipeWireRender(renderblocks, block, state, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMinPos, IPipe.WireColor.Red, x, y, z);
}
if (state.wireMatrix.hasWire(WireColor.Blue)) {
- state.currentTextureIndex = state.wireMatrix.getTextureIndex(WireColor.Blue);
+ state.currentTexture = BuildCraftTransport.instance.wireIconProvider.getIcon(state.wireMatrix.getWireIconIndex(WireColor.Blue));
pipeWireRender(renderblocks, block, state, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos, IPipe.WireColor.Blue, x, y, z);
}
if (state.wireMatrix.hasWire(WireColor.Green)) {
- state.currentTextureIndex = state.wireMatrix.getTextureIndex(WireColor.Green);
+ state.currentTexture = BuildCraftTransport.instance.wireIconProvider.getIcon(state.wireMatrix.getWireIconIndex(WireColor.Green));
pipeWireRender(renderblocks, block, state, Utils.pipeMaxPos, Utils.pipeMinPos, Utils.pipeMinPos, IPipe.WireColor.Green, x, y, z);
}
if (state.wireMatrix.hasWire(WireColor.Yellow)) {
- state.currentTextureIndex = state.wireMatrix.getTextureIndex(WireColor.Yellow);
+ state.currentTexture = BuildCraftTransport.instance.wireIconProvider.getIcon(state.wireMatrix.getWireIconIndex(WireColor.Yellow));
pipeWireRender(renderblocks, block, state, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, IPipe.WireColor.Yellow, x, y, z);
}
@@ -179,8 +182,7 @@ public class PipeWorldRenderer implements ISimpleBlockRenderingHandler {
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
if (state.facadeMatrix.isConnected(direction)) {
- ForgeHooksClient.bindTexture(state.facadeMatrix.getTextureFile(direction), 0);
- state.currentTextureIndex = state.facadeMatrix.getTextureIndex(direction);
+ state.currentTexture = Block.blocksList[state.facadeMatrix.getFacadeBlockId(direction)].getBlockTextureFromSideAndMetadata(direction.ordinal(), state.facadeMatrix.getFacadeMetaId(direction));
// Hollow facade
if (state.pipeConnectionMatrix.isConnected(direction)) {
@@ -238,8 +240,7 @@ public class PipeWorldRenderer implements ISimpleBlockRenderingHandler {
zeroState[2][0] = Utils.pipeMinPos;
zeroState[2][1] = Utils.pipeMaxPos;
- ForgeHooksClient.bindTexture(DefaultProps.TEXTURE_BLOCKS, 0);
- state.currentTextureIndex = 7 * 16 + 13; // Structure Pipe
+ state.currentTexture = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.PipeStructureCobblestone); // Structure Pipe
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
if (state.facadeMatrix.isConnected(direction) && !state.pipeConnectionMatrix.isConnected(direction)) {
@@ -474,7 +475,7 @@ public class PipeWorldRenderer implements ISimpleBlockRenderingHandler {
private void pipeGateRender(RenderBlocks renderblocks, Block block, PipeRenderState state, int x, int y, int z) {
- state.currentTextureIndex = state.getGateTextureIndex();
+ state.currentTexture = BuildCraftTransport.instance.gateIconProvider.getIcon(state.getGateIconIndex());
float min = Utils.pipeMinPos + 0.05F;
float max = Utils.pipeMaxPos - 0.05F;
@@ -528,7 +529,7 @@ public class PipeWorldRenderer implements ISimpleBlockRenderingHandler {
if (tile instanceof IPipeRenderState) {
IPipeRenderState pipeTile = (IPipeRenderState) tile;
- renderPipe(renderer, world, block, pipeTile.getRenderState(), x, y, z);
+ renderPipe(renderer, world, block, pipeTile, x, y, z);
}
return true;
}
diff --git a/common/buildcraft/transport/render/RenderPipe.java b/common/buildcraft/transport/render/RenderPipe.java
index a16a129f..7be4d556 100644
--- a/common/buildcraft/transport/render/RenderPipe.java
+++ b/common/buildcraft/transport/render/RenderPipe.java
@@ -12,6 +12,7 @@ package buildcraft.transport.render;
import java.util.HashMap;
import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager;
@@ -21,7 +22,6 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
-import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.LiquidStack;
@@ -29,13 +29,14 @@ import org.lwjgl.opengl.GL11;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftCore.RenderMode;
+import buildcraft.BuildCraftTransport;
import buildcraft.api.transport.IPipedItem;
-import buildcraft.core.DefaultProps;
import buildcraft.core.render.RenderEntityBlock;
import buildcraft.core.render.RenderEntityBlock.BlockInterface;
import buildcraft.core.utils.Utils;
import buildcraft.transport.EntityData;
import buildcraft.transport.Pipe;
+import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportItems;
import buildcraft.transport.PipeTransportLiquids;
import buildcraft.transport.PipeTransportPower;
@@ -59,7 +60,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
public int[] centerVertical = new int[LIQUID_STAGES];
}
- private HashMap> displayLiquidLists = new HashMap>();
+ private final HashMap> displayLiquidLists = new HashMap>();
private final int[] angleY = { 0, 0, 270, 90, 0, 180 };
private final int[] angleZ = { 90, 270, 0, 0, 0, 0 };
@@ -94,9 +95,13 @@ public class RenderPipe extends TileEntitySpecialRenderer {
displayLiquidLists.get(liquidId).put(meta, d);
BlockInterface block = new BlockInterface();
+ String spriteSet = "/gui/items.png";
+
if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) {
- block.texture = Block.blocksList[liquidId].getBlockTextureFromSideAndMetadata(0, meta);
+ block.baseBlock = Block.blocksList[liquidId];
+ spriteSet = "/terrain.png";
} else {
+ block.baseBlock = Block.waterStill;
block.texture = Item.itemsList[liquidId].getIconFromDamage(meta);
}
@@ -112,6 +117,8 @@ public class RenderPipe extends TileEntitySpecialRenderer {
d.sideHorizontal[s] = GLAllocation.generateDisplayLists(1);
GL11.glNewList(d.sideHorizontal[s], 4864 /* GL_COMPILE */);
+ Minecraft.getMinecraft().renderEngine.bindTexture(spriteSet);
+
block.minX = 0.0F;
block.minZ = Utils.pipeMinPos + 0.01F;
@@ -130,6 +137,8 @@ public class RenderPipe extends TileEntitySpecialRenderer {
d.sideVertical[s] = GLAllocation.generateDisplayLists(1);
GL11.glNewList(d.sideVertical[s], 4864 /* GL_COMPILE */);
+ Minecraft.getMinecraft().renderEngine.bindTexture(spriteSet);
+
block.minY = Utils.pipeMaxPos - 0.01;
block.maxY = 1;
@@ -148,6 +157,8 @@ public class RenderPipe extends TileEntitySpecialRenderer {
d.centerHorizontal[s] = GLAllocation.generateDisplayLists(1);
GL11.glNewList(d.centerHorizontal[s], 4864 /* GL_COMPILE */);
+ Minecraft.getMinecraft().renderEngine.bindTexture(spriteSet);
+
block.minX = Utils.pipeMinPos + 0.01;
block.minZ = Utils.pipeMinPos + 0.01;
@@ -166,6 +177,8 @@ public class RenderPipe extends TileEntitySpecialRenderer {
d.centerVertical[s] = GLAllocation.generateDisplayLists(1);
GL11.glNewList(d.centerVertical[s], 4864 /* GL_COMPILE */);
+ Minecraft.getMinecraft().renderEngine.bindTexture(spriteSet);
+
block.minY = Utils.pipeMinPos + 0.01;
block.maxY = Utils.pipeMaxPos - 0.01;
@@ -193,7 +206,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
initialized = true;
BlockInterface block = new BlockInterface();
- block.texture = 4;
+ block.texture = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.Power_Normal);
float size = Utils.pipeMaxPos - Utils.pipeMinPos;
@@ -201,6 +214,8 @@ public class RenderPipe extends TileEntitySpecialRenderer {
displayPowerList[s] = GLAllocation.generateDisplayLists(1);
GL11.glNewList(displayPowerList[s], 4864 /* GL_COMPILE */);
+ Minecraft.getMinecraft().renderEngine.bindTexture("/terrain.png");
+
float minSize = 0.005F;
float unit = (size - minSize) / 2F / POWER_STAGES;
@@ -219,7 +234,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
GL11.glEndList();
}
- block.texture = 6;
+ block.texture = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.Power_Overload);
size = Utils.pipeMaxPos - Utils.pipeMinPos;
@@ -275,17 +290,17 @@ public class RenderPipe extends TileEntitySpecialRenderer {
GL11.glPushMatrix();
GL11.glDisable(2896 /* GL_LIGHTING */);
- ForgeHooksClient.bindTexture(DefaultProps.TEXTURE_BLOCKS, 0);
-
- GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F);
+ GL11.glTranslatef((float) x, (float) y, (float) z);
int[] displayList = pow.overload ? displayPowerListOverload : displayPowerList;
for (int i = 0; i < 6; ++i) {
GL11.glPushMatrix();
+ GL11.glTranslatef(0.5F, 0.0F, 0.5F);
GL11.glRotatef(angleY[i], 0, 1, 0);
GL11.glRotatef(angleZ[i], 0, 0, 1);
+ GL11.glTranslatef(-0.5F, 0.0F, -0.5F);
if (pow.displayPower[i] >= 1.0) {
short stage = pow.displayPower[i];
@@ -310,7 +325,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
GL11.glPushMatrix();
GL11.glDisable(2896 /* GL_LIGHTING */);
- GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F);
+ GL11.glTranslatef((float) x, (float) y, (float) z);
// sides
@@ -349,8 +364,11 @@ public class RenderPipe extends TileEntitySpecialRenderer {
case SOUTH:
case NORTH:
sides = true;
+ // Yes, this is kind of ugly, but was easier than transform the coordinates above.
+ GL11.glTranslatef(0.5F, 0.0F, 0.5F);
GL11.glRotatef(angleY[i], 0, 1, 0);
GL11.glRotatef(angleZ[i], 0, 0, 1);
+ GL11.glTranslatef(-0.5F, 0.0F, -0.5F);
list = d.sideHorizontal[stage];
break;
default:
@@ -396,12 +414,6 @@ public class RenderPipe extends TileEntitySpecialRenderer {
if (liquidId == 0)
return null;
- if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) {
- ForgeHooksClient.bindTexture(Block.blocksList[liquidId].getTextureFile(), 0);
- } else if (Item.itemsList[liquidId] != null) {
- ForgeHooksClient.bindTexture(Item.itemsList[liquidId].getTextureFile(), 0);
- } else
- return null;
return getDisplayLiquidLists(liquidId, stack.itemMeta, world);
}
@@ -437,7 +449,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
GL11.glTranslatef((float) d, (float) d1, (float) d2);
GL11.glTranslatef(0, 0.25F, 0);
GL11.glScalef(renderScale, renderScale, renderScale);
- dummyEntityItem.func_92058_a(itemstack);
+ dummyEntityItem.setEntityItemStack(itemstack);
customRenderItem.doRenderItem(dummyEntityItem, 0, 0, 0, 0, 0);
GL11.glPopMatrix();
}
diff --git a/common/buildcraft/transport/render/TileEntityPickupFX.java b/common/buildcraft/transport/render/TileEntityPickupFX.java
index bacc8136..a891d059 100644
--- a/common/buildcraft/transport/render/TileEntityPickupFX.java
+++ b/common/buildcraft/transport/render/TileEntityPickupFX.java
@@ -11,19 +11,22 @@
*/
package buildcraft.transport.render;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
+import net.minecraft.client.particle.EntityFX;
+import net.minecraft.client.particle.EntityPickupFX;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
-import net.minecraft.world.World;
-import org.lwjgl.opengl.GL11;
-
-import net.minecraft.client.particle.EntityFX;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+
+import org.lwjgl.opengl.GL11;
+
import buildcraft.core.utils.Utils;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+//import net.minecraft.client.particle.EntityPickupFX;
@SideOnly(Side.CLIENT)
public class TileEntityPickupFX extends EntityFX
diff --git a/common/buildcraft/transport/triggers/ActionEnergyPulser.java b/common/buildcraft/transport/triggers/ActionEnergyPulser.java
index 380aea0a..cac78ac1 100644
--- a/common/buildcraft/transport/triggers/ActionEnergyPulser.java
+++ b/common/buildcraft/transport/triggers/ActionEnergyPulser.java
@@ -1,22 +1,21 @@
package buildcraft.transport.triggers;
-import buildcraft.api.gates.Action;
-import buildcraft.core.DefaultProps;
+import net.minecraft.util.Icon;
+import buildcraft.core.triggers.ActionTriggerIconProvider;
+import buildcraft.core.triggers.BCAction;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class ActionEnergyPulser extends Action {
+public class ActionEnergyPulser extends BCAction {
public ActionEnergyPulser(int id) {
super(id);
}
@Override
- public int getIndexInTexture() {
- return 4 * 16 + 0;
- }
-
- @Override
- public String getTexture() {
- return DefaultProps.TEXTURE_TRIGGERS;
+ @SideOnly(Side.CLIENT)
+ public Icon getTexture() {
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_Machine_Active);
}
@Override
diff --git a/common/buildcraft/transport/triggers/ActionSignalOutput.java b/common/buildcraft/transport/triggers/ActionSignalOutput.java
index d401d701..7aa68128 100644
--- a/common/buildcraft/transport/triggers/ActionSignalOutput.java
+++ b/common/buildcraft/transport/triggers/ActionSignalOutput.java
@@ -9,11 +9,14 @@
package buildcraft.transport.triggers;
-import buildcraft.api.gates.Action;
+import net.minecraft.util.Icon;
import buildcraft.api.transport.IPipe;
-import buildcraft.core.DefaultProps;
+import buildcraft.core.triggers.ActionTriggerIconProvider;
+import buildcraft.core.triggers.BCAction;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class ActionSignalOutput extends Action {
+public class ActionSignalOutput extends BCAction {
public IPipe.WireColor color;
@@ -23,22 +26,6 @@ public class ActionSignalOutput extends Action {
this.color = color;
}
- @Override
- public int getIndexInTexture() {
- switch (color) {
- case Red:
- return 0 * 16 + 3;
- case Blue:
- return 0 * 16 + 5;
- case Green:
- return 0 * 16 + 7;
- case Yellow:
- return 0 * 16 + 9;
- }
-
- return 0;
- }
-
@Override
public String getDescription() {
switch (color) {
@@ -56,7 +43,19 @@ public class ActionSignalOutput extends Action {
}
@Override
- public String getTexture() {
- return DefaultProps.TEXTURE_TRIGGERS;
+ @SideOnly(Side.CLIENT)
+ public Icon getTexture() {
+ switch (color) {
+ case Red:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_PipeSignal_Red_Active);
+ case Blue:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_PipeSignal_Blue_Active);
+ case Green:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_PipeSignal_Green_Active);
+ case Yellow:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_PipeSignal_Yellow_Active);
+ }
+
+ return null;
}
}
diff --git a/common/buildcraft/transport/triggers/ActionSingleEnergyPulse.java b/common/buildcraft/transport/triggers/ActionSingleEnergyPulse.java
index 5c89f692..062d6784 100644
--- a/common/buildcraft/transport/triggers/ActionSingleEnergyPulse.java
+++ b/common/buildcraft/transport/triggers/ActionSingleEnergyPulse.java
@@ -1,23 +1,22 @@
package buildcraft.transport.triggers;
-import buildcraft.api.gates.Action;
-import buildcraft.core.DefaultProps;
+import net.minecraft.util.Icon;
+import buildcraft.core.triggers.ActionTriggerIconProvider;
+import buildcraft.core.triggers.BCAction;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class ActionSingleEnergyPulse extends Action {
+public class ActionSingleEnergyPulse extends BCAction {
public ActionSingleEnergyPulse(int id) {
super(id);
}
- @Override
- public int getIndexInTexture() {
- return 4 * 16 + 0;
- }
-
- @Override
- public String getTexture() {
- return DefaultProps.TEXTURE_TRIGGERS;
- }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public Icon getTexture() {
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_Machine_Active);
+ }
@Override
public String getDescription() {
diff --git a/common/buildcraft/transport/triggers/TriggerPipeContents.java b/common/buildcraft/transport/triggers/TriggerPipeContents.java
index 85dda0ba..982e2c08 100644
--- a/common/buildcraft/transport/triggers/TriggerPipeContents.java
+++ b/common/buildcraft/transport/triggers/TriggerPipeContents.java
@@ -9,21 +9,24 @@
package buildcraft.transport.triggers;
+import net.minecraft.util.Icon;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.ILiquidTank;
import net.minecraftforge.liquids.LiquidContainerRegistry;
import net.minecraftforge.liquids.LiquidStack;
import buildcraft.api.gates.ITriggerParameter;
-import buildcraft.api.gates.Trigger;
-import buildcraft.core.DefaultProps;
+import buildcraft.core.triggers.ActionTriggerIconProvider;
+import buildcraft.core.triggers.BCTrigger;
import buildcraft.transport.EntityData;
import buildcraft.transport.ITriggerPipe;
import buildcraft.transport.Pipe;
import buildcraft.transport.PipeTransportItems;
import buildcraft.transport.PipeTransportLiquids;
import buildcraft.transport.PipeTransportPower;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class TriggerPipeContents extends Trigger implements ITriggerPipe {
+public class TriggerPipeContents extends BCTrigger implements ITriggerPipe {
public enum Kind {
Empty, ContainsItems, ContainsLiquids, ContainsEnergy
@@ -36,21 +39,6 @@ public class TriggerPipeContents extends Trigger implements ITriggerPipe {
this.kind = kind;
}
- @Override
- public int getIndexInTexture() {
- switch (kind) {
- case Empty:
- return 3 * 16 + 0;
- case ContainsItems:
- return 3 * 16 + 1;
- case ContainsLiquids:
- return 3 * 16 + 2;
- case ContainsEnergy:
- return 3 * 16 + 3;
- }
- return 3 * 16 + 0;
- }
-
@Override
public boolean hasParameter() {
switch (kind) {
@@ -139,8 +127,18 @@ public class TriggerPipeContents extends Trigger implements ITriggerPipe {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_TRIGGERS;
+ @SideOnly(Side.CLIENT)
+ public Icon getTextureIcon() {
+ switch (kind) {
+ case Empty:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_PipeContents_Empty);
+ case ContainsItems:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_PipeContents_ContainsItems);
+ case ContainsLiquids:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_PipeContents_ContainsLiquid);
+ case ContainsEnergy:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_PipeContents_ContainsEnergy);
+ }
+ return null;
}
-
}
diff --git a/common/buildcraft/transport/triggers/TriggerPipeSignal.java b/common/buildcraft/transport/triggers/TriggerPipeSignal.java
index 258fc2d2..d8187e7b 100644
--- a/common/buildcraft/transport/triggers/TriggerPipeSignal.java
+++ b/common/buildcraft/transport/triggers/TriggerPipeSignal.java
@@ -9,14 +9,17 @@
package buildcraft.transport.triggers;
+import net.minecraft.util.Icon;
import buildcraft.api.gates.ITriggerParameter;
-import buildcraft.api.gates.Trigger;
import buildcraft.api.transport.IPipe;
-import buildcraft.core.DefaultProps;
+import buildcraft.core.triggers.ActionTriggerIconProvider;
+import buildcraft.core.triggers.BCTrigger;
import buildcraft.transport.ITriggerPipe;
import buildcraft.transport.Pipe;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class TriggerPipeSignal extends Trigger implements ITriggerPipe {
+public class TriggerPipeSignal extends BCTrigger implements ITriggerPipe {
boolean active;
IPipe.WireColor color;
@@ -28,35 +31,6 @@ public class TriggerPipeSignal extends Trigger implements ITriggerPipe {
this.color = color;
}
- @Override
- public int getIndexInTexture() {
- if (active) {
- switch (color) {
- case Red:
- return 0 * 16 + 3;
- case Blue:
- return 0 * 16 + 5;
- case Green:
- return 0 * 16 + 7;
- case Yellow:
- return 0 * 16 + 9;
- }
- } else {
- switch (color) {
- case Red:
- return 0 * 16 + 2;
- case Blue:
- return 0 * 16 + 4;
- case Green:
- return 0 * 16 + 6;
- case Yellow:
- return 0 * 16 + 8;
- }
- }
-
- return 0;
- }
-
@Override
public boolean hasParameter() {
return false;
@@ -100,7 +74,32 @@ public class TriggerPipeSignal extends Trigger implements ITriggerPipe {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_TRIGGERS;
+ @SideOnly(Side.CLIENT)
+ public Icon getTextureIcon() {
+ if (active) {
+ switch (color) {
+ case Red:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_PipeSignal_Red_Active);
+ case Blue:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_PipeSignal_Blue_Active);
+ case Green:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_PipeSignal_Green_Active);
+ case Yellow:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_PipeSignal_Yellow_Active);
+ }
+ } else {
+ switch (color) {
+ case Red:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_PipeSignal_Red_Inactive);
+ case Blue:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_PipeSignal_Blue_Inactive);
+ case Green:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_PipeSignal_Green_Inactive);
+ case Yellow:
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_PipeSignal_Yellow_Inactive);
+ }
+ }
+
+ return null;
}
}
diff --git a/common/buildcraft/transport/triggers/TriggerRedstoneInput.java b/common/buildcraft/transport/triggers/TriggerRedstoneInput.java
index 7df9055f..897f502a 100644
--- a/common/buildcraft/transport/triggers/TriggerRedstoneInput.java
+++ b/common/buildcraft/transport/triggers/TriggerRedstoneInput.java
@@ -9,13 +9,16 @@
package buildcraft.transport.triggers;
+import net.minecraft.util.Icon;
import buildcraft.api.gates.ITriggerParameter;
-import buildcraft.api.gates.Trigger;
-import buildcraft.core.DefaultProps;
+import buildcraft.core.triggers.ActionTriggerIconProvider;
+import buildcraft.core.triggers.BCTrigger;
import buildcraft.transport.ITriggerPipe;
import buildcraft.transport.Pipe;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class TriggerRedstoneInput extends Trigger implements ITriggerPipe {
+public class TriggerRedstoneInput extends BCTrigger implements ITriggerPipe {
boolean active;
@@ -25,14 +28,6 @@ public class TriggerRedstoneInput extends Trigger implements ITriggerPipe {
this.active = active;
}
- @Override
- public int getIndexInTexture() {
- if (active)
- return 0 * 16 + 0;
- else
- return 0 * 16 + 1;
- }
-
@Override
public String getDescription() {
if (active)
@@ -50,7 +45,11 @@ public class TriggerRedstoneInput extends Trigger implements ITriggerPipe {
}
@Override
- public String getTextureFile() {
- return DefaultProps.TEXTURE_TRIGGERS;
+ @SideOnly(Side.CLIENT)
+ public Icon getTextureIcon() {
+ if (active)
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_RedstoneInput_Active);
+ else
+ return getIconProvider().getIcon(ActionTriggerIconProvider.Trigger_RedstoneInput_Inactive);
}
}
diff --git a/common/buildcraft/transport/utils/FacadeMatrix.java b/common/buildcraft/transport/utils/FacadeMatrix.java
index 5660dcf0..f94e5555 100644
--- a/common/buildcraft/transport/utils/FacadeMatrix.java
+++ b/common/buildcraft/transport/utils/FacadeMatrix.java
@@ -7,37 +7,28 @@ import java.io.IOException;
import net.minecraftforge.common.ForgeDirection;
public class FacadeMatrix extends ConnectionMatrix {
- private String[] _textureFiles = new String[ForgeDirection.VALID_DIRECTIONS.length];
- private int[] _textureIndex = new int[ForgeDirection.VALID_DIRECTIONS.length];
+ private final int[] _blockIds = new int[ForgeDirection.VALID_DIRECTIONS.length];
+ private final int[] _blockMetas = new int[ForgeDirection.VALID_DIRECTIONS.length];
private boolean dirty = false;
public FacadeMatrix() {
- for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
- _textureFiles[direction.ordinal()] = "";
- }
}
- public String getTextureFile(ForgeDirection direction) {
- return _textureFiles[direction.ordinal()];
- }
-
- public void setTextureFile(ForgeDirection direction, String filePath) {
- if (!_textureFiles[direction.ordinal()].equals(filePath)) {
- _textureFiles[direction.ordinal()] = filePath;
+ public void setFacade(ForgeDirection direction, int blockId, int blockMeta){
+ if (_blockIds[direction.ordinal()] != blockId || _blockMetas[direction.ordinal()] != blockMeta){
+ _blockIds[direction.ordinal()] = blockId;
+ _blockMetas[direction.ordinal()] = blockMeta;
dirty = true;
}
}
-
- public int getTextureIndex(ForgeDirection direction) {
- return _textureIndex[direction.ordinal()];
+
+ public int getFacadeBlockId(ForgeDirection direction){
+ return _blockIds[direction.ordinal()];
}
-
- public void setTextureIndex(ForgeDirection direction, int value) {
- if (_textureIndex[direction.ordinal()] != value) {
- _textureIndex[direction.ordinal()] = value;
- dirty = true;
- }
+
+ public int getFacadeMetaId(ForgeDirection direction){
+ return _blockMetas[direction.ordinal()];
}
@Override
@@ -55,8 +46,8 @@ public class FacadeMatrix extends ConnectionMatrix {
public void readData(DataInputStream data) throws IOException {
super.readData(data);
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
- _textureFiles[i] = data.readUTF();
- _textureIndex[i] = data.readInt();
+ _blockIds[i] = data.readInt();
+ _blockMetas[i] = data.readInt();
}
}
@@ -64,8 +55,8 @@ public class FacadeMatrix extends ConnectionMatrix {
public void writeData(DataOutputStream data) throws IOException {
super.writeData(data);
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
- data.writeUTF(_textureFiles[i]);
- data.writeInt(_textureIndex[i]);
+ data.writeInt(_blockIds[i]);
+ data.writeInt(_blockMetas[i]);
}
}
}
diff --git a/common/buildcraft/transport/utils/TextureMatrix.java b/common/buildcraft/transport/utils/TextureMatrix.java
index 9dd4d9dd..7f1b79d1 100644
--- a/common/buildcraft/transport/utils/TextureMatrix.java
+++ b/common/buildcraft/transport/utils/TextureMatrix.java
@@ -8,17 +8,17 @@ import net.minecraftforge.common.ForgeDirection;
public class TextureMatrix {
- private final int[] _textureIndexes = new int[ForgeDirection.values().length];
+ private final int[] _iconIndexes = new int[ForgeDirection.values().length];
private boolean dirty = false;
public int getTextureIndex(ForgeDirection direction) {
- return _textureIndexes[direction.ordinal()];
+ return _iconIndexes[direction.ordinal()];
}
- public void setTextureIndex(ForgeDirection direction, int value) {
- if (_textureIndexes[direction.ordinal()] != value) {
- _textureIndexes[direction.ordinal()] = value;
+ public void setIconIndex(ForgeDirection direction, int value) {
+ if (_iconIndexes[direction.ordinal()] != value) {
+ _iconIndexes[direction.ordinal()] = value;
dirty = true;
}
}
@@ -33,13 +33,13 @@ public class TextureMatrix {
public void writeData(DataOutputStream data) throws IOException {
for (int i = 0; i < ForgeDirection.values().length; i++) {
- data.writeInt(_textureIndexes[i]);
+ data.writeInt(_iconIndexes[i]);
}
}
public void readData(DataInputStream data) throws IOException {
for (int i = 0; i < ForgeDirection.values().length; i++) {
- _textureIndexes[i] = data.readInt();
+ _iconIndexes[i] = data.readInt();
}
}
}
diff --git a/common/buildcraft/transport/utils/WireMatrix.java b/common/buildcraft/transport/utils/WireMatrix.java
index 39a54519..9a634e66 100644
--- a/common/buildcraft/transport/utils/WireMatrix.java
+++ b/common/buildcraft/transport/utils/WireMatrix.java
@@ -11,7 +11,8 @@ public class WireMatrix {
private final boolean[] _hasWire = new boolean[IPipe.WireColor.values().length];
private final ConnectionMatrix _wires[] = new ConnectionMatrix[IPipe.WireColor.values().length];
- private int _wireTextureIndex[] = new int[IPipe.WireColor.values().length];
+ private final int[] _wireIconIndex = new int[IPipe.WireColor.values().length];
+
private boolean dirty = false;
public WireMatrix() {
@@ -38,14 +39,14 @@ public class WireMatrix {
public void setWireConnected(IPipe.WireColor color, ForgeDirection direction, boolean value) {
_wires[color.ordinal()].setConnected(direction, value);
}
-
- public int getTextureIndex(IPipe.WireColor color) {
- return _wireTextureIndex[color.ordinal()];
+
+ public int getWireIconIndex(IPipe.WireColor color){
+ return _wireIconIndex[color.ordinal()];
}
-
- public void setTextureIndex(IPipe.WireColor color, int value) {
- if (_wireTextureIndex[color.ordinal()] != value) {
- _wireTextureIndex[color.ordinal()] = value;
+
+ public void setWireIndex(IPipe.WireColor color, int value){
+ if (_wireIconIndex[color.ordinal()] != value){
+ _wireIconIndex[color.ordinal()] = value;
dirty = true;
}
}
@@ -72,7 +73,7 @@ public class WireMatrix {
for (int i = 0; i < IPipe.WireColor.values().length; i++) {
data.writeBoolean(_hasWire[i]);
_wires[i].writeData(data);
- data.writeInt(_wireTextureIndex[i]);
+ data.writeInt(_wireIconIndex[i]);
}
}
@@ -80,7 +81,7 @@ public class WireMatrix {
for (int i = 0; i < IPipe.WireColor.values().length; i++) {
_hasWire[i] = data.readBoolean();
_wires[i].readData(data);
- _wireTextureIndex[i] = data.readInt();
+ _wireIconIndex[i] = data.readInt();
}
}
}