diff --git a/api/buildcraft/api/filler/IFillerPattern.java b/api/buildcraft/api/filler/IFillerPattern.java index a732a474..fcb4f5ca 100644 --- a/api/buildcraft/api/filler/IFillerPattern.java +++ b/api/buildcraft/api/filler/IFillerPattern.java @@ -8,7 +8,9 @@ */ package buildcraft.api.filler; +import net.minecraft.util.IIcon; import buildcraft.api.statements.IStatement; public interface IFillerPattern extends IStatement { + IIcon getBlockOverlay(); } diff --git a/api/buildcraft/api/filler/package-info.java b/api/buildcraft/api/filler/package-info.java index f451c9af..cf48350c 100644 --- a/api/buildcraft/api/filler/package-info.java +++ b/api/buildcraft/api/filler/package-info.java @@ -6,7 +6,7 @@ * Please check the contents of the license, which should be located * as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "3.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|filler") +@API(apiVersion = "4.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|filler") package buildcraft.api.filler; import cpw.mods.fml.common.API; diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/back.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/back.png new file mode 100755 index 00000000..c8032e06 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/back.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/bottom.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/bottom.png new file mode 100755 index 00000000..0624f168 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/bottom.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/default.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/default.png deleted file mode 100755 index 4008864f..00000000 Binary files a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/default.png and /dev/null differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/front.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/front.png index b4d05ede..57f65779 100755 Binary files a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/front.png and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/front.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/led_green.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/led_green.png new file mode 100644 index 00000000..a615b101 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/led_green.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/led_red.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/led_red.png new file mode 100644 index 00000000..258b7b46 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/led_red.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/left.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/left.png new file mode 100755 index 00000000..68fc7e3a Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/left.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/right.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/right.png new file mode 100755 index 00000000..3e8cde2e Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/right.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/top.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/top.png index 634fceae..75705012 100755 Binary files a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/top.png and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/architectBlock/top.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/back.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/back.png new file mode 100755 index 00000000..66dae9fe Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/back.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/bottom.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/bottom.png new file mode 100755 index 00000000..0bbd84f8 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/bottom.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/default.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/default.png deleted file mode 100644 index 78962788..00000000 Binary files a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/default.png and /dev/null differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/front.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/front.png old mode 100644 new mode 100755 index fadac260..86e33ccd Binary files a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/front.png and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/front.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/side.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/side.png new file mode 100755 index 00000000..a7fed32f Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/side.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/top.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/top.png old mode 100644 new mode 100755 index 2ed3d26a..fb719c18 Binary files a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/top.png and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/top.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/top_on.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/top_on.png new file mode 100755 index 00000000..058fe06a Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/builderBlock/top_on.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/bottom.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/bottom.png new file mode 100755 index 00000000..e666e98b Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/bottom.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/default.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/default.png deleted file mode 100644 index 89cd1cb6..00000000 Binary files a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/default.png and /dev/null differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/front.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/front.png new file mode 100755 index 00000000..dd2e4b9a Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/front.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/item_hatch.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/item_hatch.png new file mode 100755 index 00000000..ea2ceea4 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/item_hatch.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/led_green.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/led_green.png new file mode 100644 index 00000000..6e8de714 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/led_green.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/led_red.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/led_red.png new file mode 100644 index 00000000..828d54b4 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/led_red.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/side.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/side.png new file mode 100755 index 00000000..836c5c41 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/side.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/top.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/top.png old mode 100644 new mode 100755 index 88f285da..493fef38 Binary files a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/top.png and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/top.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/top_off.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/top_off.png deleted file mode 100644 index 17bd903b..00000000 Binary files a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlock/top_off.png and /dev/null differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/box.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/box.png new file mode 100644 index 00000000..8afd3fb3 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/box.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/clear.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/clear.png new file mode 100644 index 00000000..085d73f0 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/clear.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/cylinder.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/cylinder.png new file mode 100644 index 00000000..09b78fa0 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/cylinder.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/fill.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/fill.png new file mode 100644 index 00000000..e50d9a5e Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/fill.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/flatten.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/flatten.png new file mode 100644 index 00000000..f3548edf Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/flatten.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/frame.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/frame.png new file mode 100644 index 00000000..d962b798 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/frame.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/horizon.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/horizon.png new file mode 100644 index 00000000..befe398a Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/horizon.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/pyramid.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/pyramid.png new file mode 100644 index 00000000..d1ab1ceb Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/pyramid.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/stairs.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/stairs.png new file mode 100644 index 00000000..40a7eca0 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/fillerBlockIcons/stairs.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/back.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/back.png new file mode 100755 index 00000000..a1edd35b Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/back.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/bottom.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/bottom.png new file mode 100755 index 00000000..bfb73915 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/bottom.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/front.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/front.png new file mode 100755 index 00000000..6753a5af Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/front.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/left.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/left.png new file mode 100755 index 00000000..e7b7908b Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/left.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/right.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/right.png new file mode 100755 index 00000000..88dbf980 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/right.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/side.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/side.png deleted file mode 100644 index eb894a0d..00000000 Binary files a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/side.png and /dev/null differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/top.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/top.png new file mode 100755 index 00000000..6dc4eb54 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/top.png differ diff --git a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/topbottom.png b/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/topbottom.png deleted file mode 100644 index 78962788..00000000 Binary files a/buildcraft_resources/assets/buildcraftbuilders/textures/blocks/libraryBlock/topbottom.png and /dev/null differ diff --git a/buildcraft_resources/assets/buildcraftcore/textures/blocks/engine/trunk_blue.png b/buildcraft_resources/assets/buildcraftcore/textures/blocks/engine/trunk_blue.png index 1981dbc1..d34a3c23 100644 Binary files a/buildcraft_resources/assets/buildcraftcore/textures/blocks/engine/trunk_blue.png and b/buildcraft_resources/assets/buildcraftcore/textures/blocks/engine/trunk_blue.png differ diff --git a/buildcraft_resources/assets/buildcraftcore/textures/blocks/engine/trunk_green.png b/buildcraft_resources/assets/buildcraftcore/textures/blocks/engine/trunk_green.png index aee72d1d..a4ef07a4 100644 Binary files a/buildcraft_resources/assets/buildcraftcore/textures/blocks/engine/trunk_green.png and b/buildcraft_resources/assets/buildcraftcore/textures/blocks/engine/trunk_green.png differ diff --git a/buildcraft_resources/assets/buildcraftcore/textures/blocks/engine/trunk_red.png b/buildcraft_resources/assets/buildcraftcore/textures/blocks/engine/trunk_red.png index 457cbf49..7443fc7d 100644 Binary files a/buildcraft_resources/assets/buildcraftcore/textures/blocks/engine/trunk_red.png and b/buildcraft_resources/assets/buildcraftcore/textures/blocks/engine/trunk_red.png differ diff --git a/buildcraft_resources/assets/buildcraftcore/textures/blocks/engine/trunk_yellow.png b/buildcraft_resources/assets/buildcraftcore/textures/blocks/engine/trunk_yellow.png index 40e2106b..a0e79d95 100644 Binary files a/buildcraft_resources/assets/buildcraftcore/textures/blocks/engine/trunk_yellow.png and b/buildcraft_resources/assets/buildcraftcore/textures/blocks/engine/trunk_yellow.png differ diff --git a/buildcraft_resources/assets/buildcraftcore/textures/blocks/engineWood/base.png b/buildcraft_resources/assets/buildcraftcore/textures/blocks/engineWood/base.png old mode 100644 new mode 100755 index 47d4c88b..b32e7d53 Binary files a/buildcraft_resources/assets/buildcraftcore/textures/blocks/engineWood/base.png and b/buildcraft_resources/assets/buildcraftcore/textures/blocks/engineWood/base.png differ diff --git a/buildcraft_resources/assets/buildcraftcore/textures/blocks/engineWood/chamber.png b/buildcraft_resources/assets/buildcraftcore/textures/blocks/engineWood/chamber.png old mode 100644 new mode 100755 index 616afbaf..b129460a Binary files a/buildcraft_resources/assets/buildcraftcore/textures/blocks/engineWood/chamber.png and b/buildcraft_resources/assets/buildcraftcore/textures/blocks/engineWood/chamber.png differ diff --git a/buildcraft_resources/assets/buildcraftcore/textures/blocks/laserBox/blockTransparentLaser.png b/buildcraft_resources/assets/buildcraftcore/textures/blocks/laserBox/blockTransparentLaser.png deleted file mode 100644 index 017d4f93..00000000 Binary files a/buildcraft_resources/assets/buildcraftcore/textures/blocks/laserBox/blockTransparentLaser.png and /dev/null differ diff --git a/buildcraft_resources/assets/buildcraftcore/textures/items/diamondGearItem.png b/buildcraft_resources/assets/buildcraftcore/textures/items/diamondGearItem.png index 29c6a981..8129f072 100644 Binary files a/buildcraft_resources/assets/buildcraftcore/textures/items/diamondGearItem.png and b/buildcraft_resources/assets/buildcraftcore/textures/items/diamondGearItem.png differ diff --git a/buildcraft_resources/assets/buildcraftcore/textures/items/goldGearItem.png b/buildcraft_resources/assets/buildcraftcore/textures/items/goldGearItem.png index e34f363c..b1b9d26d 100644 Binary files a/buildcraft_resources/assets/buildcraftcore/textures/items/goldGearItem.png and b/buildcraft_resources/assets/buildcraftcore/textures/items/goldGearItem.png differ diff --git a/buildcraft_resources/assets/buildcraftcore/textures/items/ironGearItem.png b/buildcraft_resources/assets/buildcraftcore/textures/items/ironGearItem.png index 3cad8a3b..1c292642 100644 Binary files a/buildcraft_resources/assets/buildcraftcore/textures/items/ironGearItem.png and b/buildcraft_resources/assets/buildcraftcore/textures/items/ironGearItem.png differ diff --git a/buildcraft_resources/assets/buildcraftcore/textures/items/stoneGearItem.png b/buildcraft_resources/assets/buildcraftcore/textures/items/stoneGearItem.png index bd672ce3..98ddbf71 100644 Binary files a/buildcraft_resources/assets/buildcraftcore/textures/items/stoneGearItem.png and b/buildcraft_resources/assets/buildcraftcore/textures/items/stoneGearItem.png differ diff --git a/buildcraft_resources/assets/buildcraftcore/textures/items/woodenGearItem.png b/buildcraft_resources/assets/buildcraftcore/textures/items/woodenGearItem.png index f1f1a49c..a1c59da5 100644 Binary files a/buildcraft_resources/assets/buildcraftcore/textures/items/woodenGearItem.png and b/buildcraft_resources/assets/buildcraftcore/textures/items/woodenGearItem.png differ diff --git a/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineCreative/base.png b/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineCreative/base.png old mode 100644 new mode 100755 index b5275749..fc9ca599 Binary files a/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineCreative/base.png and b/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineCreative/base.png differ diff --git a/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineCreative/chamber.png b/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineCreative/chamber.png old mode 100644 new mode 100755 index 1a077fdb..ced65595 Binary files a/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineCreative/chamber.png and b/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineCreative/chamber.png differ diff --git a/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineCreative/trunk.png b/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineCreative/trunk.png old mode 100644 new mode 100755 index e41bd073..fbf7fc7b Binary files a/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineCreative/trunk.png and b/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineCreative/trunk.png differ diff --git a/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineIron/base.png b/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineIron/base.png old mode 100644 new mode 100755 index 55a51b9f..b86082b5 Binary files a/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineIron/base.png and b/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineIron/base.png differ diff --git a/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineIron/chamber.png b/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineIron/chamber.png old mode 100644 new mode 100755 index 616afbaf..9f0d12b7 Binary files a/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineIron/chamber.png and b/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineIron/chamber.png differ diff --git a/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineStone/base.png b/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineStone/base.png old mode 100644 new mode 100755 index 7295a41e..0bb405db Binary files a/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineStone/base.png and b/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineStone/base.png differ diff --git a/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineStone/chamber.png b/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineStone/chamber.png old mode 100644 new mode 100755 index 616afbaf..9780c4d8 Binary files a/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineStone/chamber.png and b/buildcraft_resources/assets/buildcraftenergy/textures/blocks/engineStone/chamber.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/bottom.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/bottom.png old mode 100644 new mode 100755 index 7b8edf47..3597a694 Binary files a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/bottom.png and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/bottom.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/side.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/side.png old mode 100644 new mode 100755 index d2f6d9a5..b5425d7f Binary files a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/side.png and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/side.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/top.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/top.png old mode 100644 new mode 100755 index 4b82e460..342aa649 Binary files a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/top.png and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/top.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/valve.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/valve.png new file mode 100755 index 00000000..57fc8182 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/floodGateBlock/valve.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/back.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/back.png new file mode 100755 index 00000000..4197922f Binary files /dev/null and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/back.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/bottom.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/bottom.png new file mode 100755 index 00000000..47202a41 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/bottom.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/default.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/default.png deleted file mode 100644 index 7bf6e305..00000000 Binary files a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/default.png and /dev/null differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/display.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/display.png new file mode 100644 index 00000000..b7cc0096 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/display.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/drill.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/drill.png index 73bd64e9..d1c04c33 100644 Binary files a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/drill.png and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/drill.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/front.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/front.png old mode 100644 new mode 100755 index 140735da..0729cfb6 Binary files a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/front.png and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/front.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/item_hatch.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/item_hatch.png new file mode 100644 index 00000000..98f581e0 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/item_hatch.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/led_green.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/led_green.png new file mode 100644 index 00000000..0f082d47 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/led_green.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/led_red.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/led_red.png new file mode 100644 index 00000000..cc23682d Binary files /dev/null and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/led_red.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/side.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/side.png new file mode 100755 index 00000000..ff1572ce Binary files /dev/null and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/side.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/top.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/top.png index 66ae9f46..ed5b9f14 100644 Binary files a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/top.png and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/machineBlock/top.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/back.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/back.png old mode 100644 new mode 100755 index 6d240be0..e81b7974 Binary files a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/back.png and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/back.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/bottom.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/bottom.png old mode 100644 new mode 100755 index 6d240be0..bf06e1cc Binary files a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/bottom.png and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/bottom.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/front.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/front.png old mode 100644 new mode 100755 index 792d7954..929c79f9 Binary files a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/front.png and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/front.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/item_hatch.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/item_hatch.png new file mode 100644 index 00000000..98f581e0 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/item_hatch.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/led_green.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/led_green.png new file mode 100644 index 00000000..59e9e2c8 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/led_green.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/led_red.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/led_red.png new file mode 100644 index 00000000..07be6dfe Binary files /dev/null and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/led_red.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/side.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/side.png old mode 100644 new mode 100755 index 217770f9..08b0d59b Binary files a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/side.png and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/side.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/top.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/top.png old mode 100644 new mode 100755 index 874b116f..46d1efed Binary files a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/top.png and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/miningWellBlock/top.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/bottom.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/bottom.png old mode 100644 new mode 100755 index 8830fd33..c5418a97 Binary files a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/bottom.png and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/bottom.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/led_green.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/led_green.png new file mode 100644 index 00000000..22d2979a Binary files /dev/null and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/led_green.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/led_red.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/led_red.png new file mode 100644 index 00000000..afbf1782 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/led_red.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/side.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/side.png old mode 100644 new mode 100755 index 17c06ada..43b1fe8c Binary files a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/side.png and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/side.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/top.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/top.png old mode 100644 new mode 100755 index 874b116f..2267ab5a Binary files a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/top.png and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/top.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/top_alt.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/top_alt.png new file mode 100755 index 00000000..3e21e55a Binary files /dev/null and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/top_alt.png differ diff --git a/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/top_alt2.png b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/top_alt2.png new file mode 100755 index 00000000..41f27e23 Binary files /dev/null and b/buildcraft_resources/assets/buildcraftfactory/textures/blocks/pumpBlock/top_alt2.png differ diff --git a/common/buildcraft/BuildCraftCore.java b/common/buildcraft/BuildCraftCore.java index 91fa67db..f8acf044 100644 --- a/common/buildcraft/BuildCraftCore.java +++ b/common/buildcraft/BuildCraftCore.java @@ -172,6 +172,7 @@ public class BuildCraftCore extends BuildCraftMod { @SideOnly(Side.CLIENT) public static IIconProvider iconProvider; public static int blockByEntityModel; + public static int multipassModel; public static int legacyPipeModel; public static int markerModel; public static ITriggerExternal triggerMachineActive = new TriggerMachine(true); @@ -451,7 +452,7 @@ public class BuildCraftCore extends BuildCraftMod { BuildCraftCore.redLaserTexture = event.map.registerIcon("buildcraftcore:laserBox/blockRedLaser"); BuildCraftCore.blueLaserTexture = event.map.registerIcon("buildcraftcore:laserBox/blockBlueLaser"); BuildCraftCore.stripesLaserTexture = event.map.registerIcon("buildcraftcore:laserBox/blockStripesLaser"); - BuildCraftCore.transparentTexture = event.map.registerIcon("buildcraftcore:laserBox/blockTransparentLaser"); + BuildCraftCore.transparentTexture = event.map.registerIcon("buildcraftcore:misc/transparent"); } } diff --git a/common/buildcraft/builders/BlockArchitect.java b/common/buildcraft/builders/BlockArchitect.java index 837f1566..842cf934 100644 --- a/common/buildcraft/builders/BlockArchitect.java +++ b/common/buildcraft/builders/BlockArchitect.java @@ -8,23 +8,32 @@ */ package buildcraft.builders; +import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import buildcraft.BuildCraftBuilders; +import buildcraft.BuildCraftCore; +import buildcraft.core.BlockBuildCraftLED; import buildcraft.core.lib.block.BlockBuildCraft; import buildcraft.core.BCCreativeTab; import buildcraft.core.GuiIds; +import buildcraft.core.lib.utils.ResourceUtils; +import buildcraft.factory.TilePump; + +public class BlockArchitect extends BlockBuildCraftLED { + private IIcon[] led; -public class BlockArchitect extends BlockBuildCraft { public BlockArchitect() { - super(Material.iron, BCCreativeTab.get("main")); + super(Material.iron); setRotatable(true); } @@ -63,6 +72,16 @@ public class BlockArchitect extends BlockBuildCraft { return false; } + @Override + public int getIconGlowLevel(IBlockAccess access, int x, int y, int z) { + if (renderPass < 1) { + return -1; + } else { + TileArchitect tile = (TileArchitect) access.getTileEntity(x, y, z); + return tile.getIconGlowLevel(renderPass); + } + } + @Override public int getLightValue(IBlockAccess world, int x, int y, int z) { return 1; diff --git a/common/buildcraft/builders/BlockFiller.java b/common/buildcraft/builders/BlockFiller.java index f3219f00..e1f01b6a 100644 --- a/common/buildcraft/builders/BlockFiller.java +++ b/common/buildcraft/builders/BlockFiller.java @@ -26,19 +26,21 @@ import net.minecraftforge.common.util.ForgeDirection; import buildcraft.BuildCraftBuilders; import buildcraft.api.events.BlockInteractionEvent; import buildcraft.api.filler.IFillerPattern; +import buildcraft.core.BlockBuildCraftLED; import buildcraft.core.lib.block.BlockBuildCraft; import buildcraft.core.BCCreativeTab; import buildcraft.core.GuiIds; import buildcraft.core.lib.utils.Utils; +import buildcraft.factory.TileMiningWell; -public class BlockFiller extends BlockBuildCraft { - private IIcon textureTopOff; - +public class BlockFiller extends BlockBuildCraftLED { public BlockFiller() { super(Material.iron); setHardness(5F); setCreativeTab(BCCreativeTab.get("main")); + setRotatable(true); + setPassCount(4); } @Override @@ -59,23 +61,13 @@ public class BlockFiller extends BlockBuildCraft { } @Override - @SideOnly(Side.CLIENT) - public IIcon getIconAbsolute(IBlockAccess world, int x, int y, int z, int side, int metadata) { - TileEntity tile = world.getTileEntity(x, y, z); - if (tile != null && tile instanceof TileFiller) { - TileFiller filler = (TileFiller) tile; - if (side != 1) { - if (filler.currentPattern != null) { - return filler.currentPattern.getIcon(); - } - } else { - if (!filler.hasWork()) { - return textureTopOff; - } - } + public int getIconGlowLevel(IBlockAccess access, int x, int y, int z) { + if (renderPass == 0 || renderPass == 3) { + return -1; + } else { + TileFiller tile = (TileFiller) access.getTileEntity(x, y, z); + return tile.getIconGlowLevel(renderPass); } - - return super.getIconAbsolute(side, metadata); } @Override @@ -83,13 +75,6 @@ public class BlockFiller extends BlockBuildCraft { return new TileFiller(); } - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister register) { - super.registerBlockIcons(register); - textureTopOff = register.registerIcon("buildcraftbuilders:fillerBlock/top_off"); - } - @Override public boolean renderAsNormalBlock() { return false; @@ -104,4 +89,28 @@ public class BlockFiller extends BlockBuildCraft { public int getLightValue(IBlockAccess world, int x, int y, int z) { return 1; } + + @Override + public IIcon getIconAbsolute(IBlockAccess access, int x, int y, int z, int side, int meta) { + if (renderPass < 3) { + return super.getIconAbsolute(access, x, y, z, side, meta); + } else { + if (side == 2) { + TileEntity tile = access.getTileEntity(x, y, z); + if (tile instanceof TileFiller && ((TileFiller) tile).currentPattern != null) { + return ((TileFiller) tile).currentPattern.getBlockOverlay(); + } + } + return null; + } + } + + @Override + public IIcon getIconAbsolute(int side, int meta) { + if (renderPass < 3) { + return super.getIconAbsolute(side, meta); + } else { + return null; + } + } } diff --git a/common/buildcraft/builders/TileArchitect.java b/common/buildcraft/builders/TileArchitect.java index 8aecdf03..98c38ca7 100644 --- a/common/buildcraft/builders/TileArchitect.java +++ b/common/buildcraft/builders/TileArchitect.java @@ -59,6 +59,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro private SimpleInventory inv = new SimpleInventory(2, "Architect", 1); private RecursiveBlueprintReader reader; + private boolean isProcessing; public TileArchitect() { box.kind = Kind.BLUE_STRIPES; @@ -74,6 +75,8 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro if (reader.isDone()) { reader = null; + isProcessing = false; + sendNetworkUpdate(); } } } @@ -208,6 +211,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro box.writeData(stream); NetworkUtils.writeUTF(stream, name); readConfiguration.writeData(stream); + stream.writeBoolean(reader != null); stream.writeShort(subLasers.size()); for (LaserData ld: subLasers) { ld.writeData(stream); @@ -219,6 +223,12 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro box.readData(stream); name = NetworkUtils.readUTF(stream); readConfiguration.readData(stream); + boolean newIsProcessing = stream.readBoolean(); + if (newIsProcessing != isProcessing) { + isProcessing = newIsProcessing; + worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord); + } + int size = stream.readUnsignedShort(); subLasers.clear(); for (int i = 0; i < size; i++) { @@ -239,6 +249,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro } reader = new RecursiveBlueprintReader(this); + sendNetworkUpdate(); } public int getComputingProgressScaled(int scale) { @@ -336,4 +347,14 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro subLasers.add(laser); } + + public int getIconGlowLevel(int renderPass) { + if (renderPass == 1) { // Red LED + return isProcessing ? 15 : 0; + } else if (renderPass == 2) { // Green LED + return box != null && box.isInitialized() ? 15 : 0; + } else { + return -1; + } + } } \ No newline at end of file diff --git a/common/buildcraft/builders/TileFiller.java b/common/buildcraft/builders/TileFiller.java index e90fcc9b..b64cfda5 100644 --- a/common/buildcraft/builders/TileFiller.java +++ b/common/buildcraft/builders/TileFiller.java @@ -304,6 +304,7 @@ public class TileFiller extends TileAbstractBuilder implements IHasWork, IContro box.writeData(data); data.writeBoolean(done); NetworkUtils.writeUTF(data, currentPattern.getUniqueTag()); + NBTTagCompound parameterData = new NBTTagCompound(); writeParametersToNBT(parameterData); NetworkUtils.writeNBT(data, parameterData); @@ -400,4 +401,14 @@ public class TileFiller extends TileAbstractBuilder implements IHasWork, IContro } })); } + + public int getIconGlowLevel(int renderPass) { + if (renderPass == 1) { // Red LED + return done ? 15 : 0; + } else if (renderPass == 2) { // Green LED + return 0; + } else { + return -1; + } + } } diff --git a/common/buildcraft/core/BlockBuildCraftLED.java b/common/buildcraft/core/BlockBuildCraftLED.java new file mode 100644 index 00000000..515852d3 --- /dev/null +++ b/common/buildcraft/core/BlockBuildCraftLED.java @@ -0,0 +1,63 @@ +package buildcraft.core; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.util.ForgeDirection; +import buildcraft.BuildCraftCore; +import buildcraft.api.transport.IPipeTile; +import buildcraft.core.lib.block.BlockBuildCraft; +import buildcraft.core.lib.utils.ResourceUtils; +import buildcraft.core.lib.utils.Utils; + +public abstract class BlockBuildCraftLED extends BlockBuildCraft { + private IIcon[] led; + + protected BlockBuildCraftLED(Material material) { + super(material); + setPassCount(3); + } + + @Override + public void registerBlockIcons(IIconRegister register) { + super.registerBlockIcons(register); + String base = ResourceUtils.getObjectPrefix(Block.blockRegistry.getNameForObject(this)); + led = new IIcon[] { + register.registerIcon(base + "/led_red"), + register.registerIcon(base + "/led_green") + }; + } + + @Override + public IIcon getIconAbsolute(IBlockAccess access, int x, int y, int z, int side, int meta) { + if (renderPass == 0) { + return super.getIconAbsolute(access, x, y, z, side, meta); + } else { + if (isRotatable()) { + return side == 2 ? led[renderPass - 1] : null; + } else { + return side >= 2 ? led[renderPass - 1] : null; + } + } + } + + @Override + public IIcon getIconAbsolute(int side, int meta) { + if (renderPass == 0) { + return super.getIconAbsolute(side, meta); + } else { + if (isRotatable()) { + return side == 2 ? led[renderPass - 1] : null; + } else { + return side >= 2 ? led[renderPass - 1] : null; + } + } + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } +} diff --git a/common/buildcraft/core/builders/patterns/FillerPattern.java b/common/buildcraft/core/builders/patterns/FillerPattern.java index 01cc5de7..124deb32 100644 --- a/common/buildcraft/core/builders/patterns/FillerPattern.java +++ b/common/buildcraft/core/builders/patterns/FillerPattern.java @@ -16,6 +16,7 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import cpw.mods.fml.common.Loader; import buildcraft.api.blueprints.SchematicMask; import buildcraft.api.filler.IFillerPattern; import buildcraft.api.statements.IStatement; @@ -32,7 +33,7 @@ public abstract class FillerPattern implements IFillerPattern { public static final Map patterns = new TreeMap(); private final String tag; - private IIcon icon; + private IIcon icon, blockIcon; public FillerPattern(String tag) { this.tag = tag; @@ -62,6 +63,9 @@ public abstract class FillerPattern implements IFillerPattern { @Override public void registerIcons(IIconRegister iconRegister) { icon = iconRegister.registerIcon("buildcraftcore:fillerPatterns/" + tag); + if (Loader.isModLoaded("BuildCraft|Builders")) { + blockIcon = iconRegister.registerIcon("buildcraftbuilders:fillerBlockIcons/" + tag); + } } @Override @@ -69,6 +73,11 @@ public abstract class FillerPattern implements IFillerPattern { return icon; } + @Override + public IIcon getBlockOverlay() { + return blockIcon; + } + @Override public int maxParameters() { return 0; diff --git a/common/buildcraft/core/lib/block/BlockBuildCraft.java b/common/buildcraft/core/lib/block/BlockBuildCraft.java index 0454403f..dbca662a 100644 --- a/common/buildcraft/core/lib/block/BlockBuildCraft.java +++ b/common/buildcraft/core/lib/block/BlockBuildCraft.java @@ -13,7 +13,6 @@ import java.util.Random; 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.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; @@ -30,6 +29,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraftforge.common.util.ForgeDirection; +import buildcraft.BuildCraftCore; import buildcraft.api.events.BlockInteractionEvent; import buildcraft.api.events.BlockPlacedDownEvent; import buildcraft.api.tiles.IHasWork; @@ -44,6 +44,9 @@ public abstract class BlockBuildCraft extends BlockContainer { protected static boolean keepInventory = false; protected final Random rand = new Random(); + protected int renderPass; + + protected int maxPasses = 1; private static final int[][] SIDE_TEXTURING_LOCATIONS = new int[][] { {2, 3, 5, 4}, @@ -71,6 +74,10 @@ public abstract class BlockBuildCraft extends BlockContainer { this.rotatable = rotatable; } + public void setPassCount(int maxPasses) { + this.maxPasses = maxPasses; + } + @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { super.onBlockPlacedBy(world, x, y, z, entity, stack); @@ -93,7 +100,7 @@ public abstract class BlockBuildCraft extends BlockContainer { BlockInteractionEvent event = new BlockInteractionEvent(entityplayer, this); FMLCommonHandler.instance().bus().post(event); if (event.isCanceled()) { - return false; + return true; } if (isRotatable()) { @@ -182,17 +189,19 @@ public abstract class BlockBuildCraft extends BlockContainer { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(IBlockAccess access, int x, int y, int z, int side) { + IIcon icon; int metadata = access.getBlockMetadata(x, y, z); if (isRotatable()) { if (side < 2) { - return getIconAbsolute(access, x, y, z, side, metadata & 8); + icon = getIconAbsolute(access, x, y, z, side, metadata & 8); + } else { + int front = metadata >= 2 && metadata <= 5 ? metadata : 3; + icon = getIconAbsolute(access, x, y, z, SIDE_TEXTURING_LOCATIONS[(front - 2) % 4][(side - 2) % 4], metadata & 8); } - - int front = metadata >= 2 && metadata <= 5 ? metadata : 3; - return getIconAbsolute(access, x, y, z, SIDE_TEXTURING_LOCATIONS[(front - 2) % 4][(side - 2) % 4], metadata & 8); } else { - return getIconAbsolute(access, x, y, z, side, metadata); + icon = getIconAbsolute(access, x, y, z, side, metadata); } + return icon != null ? icon : BuildCraftCore.transparentTexture; } @Override @@ -247,4 +256,37 @@ public abstract class BlockBuildCraft extends BlockContainer { registerIconsForMeta(i, iconBlockNames[i], register); } } + + @Override + public boolean canRenderInPass(int pass) { + if (pass >= maxPasses) { + renderPass = 0; + return false; + } else { + renderPass = pass; + return true; + } + } + + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() { + return maxPasses > 1 ? 1 : 0; + } + + @Override + public int getRenderType() { + return maxPasses > 1 ? BuildCraftCore.multipassModel : 0; + } + + public int getCurrentRenderPass() { + return renderPass; + } + + public int getIconGlowLevel() { + return -1; + } + + public int getIconGlowLevel(IBlockAccess access, int x, int y, int z) { + return getIconGlowLevel(); + } } diff --git a/common/buildcraft/core/lib/block/TileBuildCraft.java b/common/buildcraft/core/lib/block/TileBuildCraft.java index db4ecbe9..2880a43d 100644 --- a/common/buildcraft/core/lib/block/TileBuildCraft.java +++ b/common/buildcraft/core/lib/block/TileBuildCraft.java @@ -49,6 +49,7 @@ public abstract class TileBuildCraft extends TileEntity implements IEnergyHandle private RFBattery battery; private int receivedTick, extractedTick; + private long worldTimeEnergyReceive; public String getOwner() { return owner; @@ -158,6 +159,10 @@ public abstract class TileBuildCraft extends TileEntity implements IEnergyHandle } } + protected int getTicksSinceEnergyReceived() { + return (int) (worldObj.getTotalWorldTime() - worldTimeEnergyReceive); + } + @Override public int hashCode() { @@ -181,6 +186,7 @@ public abstract class TileBuildCraft extends TileEntity implements IEnergyHandle int received = battery.receiveEnergy(maxReceive - receivedTick, simulate); if (!simulate) { receivedTick += received; + worldTimeEnergyReceive = worldObj.getTotalWorldTime(); } return received; } else { diff --git a/common/buildcraft/core/lib/render/RenderBlockMultipass.java b/common/buildcraft/core/lib/render/RenderBlockMultipass.java new file mode 100644 index 00000000..bcf6609b --- /dev/null +++ b/common/buildcraft/core/lib/render/RenderBlockMultipass.java @@ -0,0 +1,95 @@ +package buildcraft.core.lib.render; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import buildcraft.BuildCraftCore; +import buildcraft.core.lib.block.BlockBuildCraft; + +public class RenderBlockMultipass implements ISimpleBlockRenderingHandler { + @Override + public void renderInventoryBlock(Block block, int meta, int modelId, RenderBlocks renderer) { + BlockBuildCraft bcBlock = (BlockBuildCraft) block; + int pass = 0; + while (bcBlock.canRenderInPass(pass)) { + renderPassInventory(pass, bcBlock, meta, renderer); + pass++; + } + } + + private void renderPassInventory(int pass, BlockBuildCraft block, int meta, RenderBlocks renderer) { + if (block.getIconGlowLevel() >= 0) { + Tessellator.instance.setBrightness(block.getIconGlowLevel() << 4); + RenderUtils.drawBlockItem(renderer, Tessellator.instance, block, meta); + } else { + RenderUtils.drawBlockItem(renderer, Tessellator.instance, block, meta); + } + } + + private void renderPassWorld(int pass, BlockBuildCraft block, int meta, RenderBlocks renderer, IBlockAccess world, int x, int y, int z) { + if (block.getIconGlowLevel(world, x, y, z) >= 0) { + Tessellator.instance.setBrightness(block.getIconGlowLevel(world, x, y, z) << 4); + Tessellator.instance.setColorOpaque_F(1.0F, 1.0F, 1.0F); + IIcon icon; + + icon = block.getIcon(world, x, y, z, 0); + if (icon != null && (renderer.renderAllFaces || block.shouldSideBeRendered(world, x, y - 1, z, 0))) { + renderer.renderFaceYNeg(block, x, y, z, icon); + } + icon = block.getIcon(world, x, y, z, 1); + if (icon != null && (renderer.renderAllFaces || block.shouldSideBeRendered(world, x, y + 1, z, 1))) { + renderer.renderFaceYPos(block, x, y, z, icon); + } + icon = block.getIcon(world, x, y, z, 2); + if (icon != null && (renderer.renderAllFaces || block.shouldSideBeRendered(world, x, y, z - 1, 2))) { + renderer.renderFaceZNeg(block, x, y, z, icon); + } + icon = block.getIcon(world, x, y, z, 3); + if (icon != null && (renderer.renderAllFaces || block.shouldSideBeRendered(world, x, y, z + 1, 3))) { + renderer.renderFaceZPos(block, x, y, z, icon); + } + icon = block.getIcon(world, x, y, z, 4); + if (icon != null && (renderer.renderAllFaces || block.shouldSideBeRendered(world, x - 1, y, z, 4))) { + renderer.renderFaceXNeg(block, x, y, z, icon); + } + icon = block.getIcon(world, x, y, z, 5); + if (icon != null && (renderer.renderAllFaces || block.shouldSideBeRendered(world, x + 1, y, z, 5))) { + renderer.renderFaceXPos(block, x, y, z, icon); + } + } else { + renderer.renderStandardBlockWithColorMultiplier(block, x, y, z, 1.0f, 1.0f, 1.0f); + } + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + BlockBuildCraft bcBlock = (BlockBuildCraft) block; + int meta = world.getBlockMetadata(x, y, z); + + if (bcBlock.getCurrentRenderPass() > 0) { + int pass = bcBlock.getCurrentRenderPass(); + while (bcBlock.canRenderInPass(pass)) { + renderPassWorld(pass, bcBlock, meta, renderer, world, x, y, z); + pass++; + } + } else { + if (bcBlock.canRenderInPass(0)) { + renderPassWorld(0, bcBlock, meta, renderer, world, x, y, z); + } + } + return true; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return BuildCraftCore.multipassModel; + } +} diff --git a/common/buildcraft/core/lib/render/RenderUtils.java b/common/buildcraft/core/lib/render/RenderUtils.java index 213515eb..d2aa9575 100644 --- a/common/buildcraft/core/lib/render/RenderUtils.java +++ b/common/buildcraft/core/lib/render/RenderUtils.java @@ -9,6 +9,11 @@ package buildcraft.core.lib.render; import org.lwjgl.opengl.GL11; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; +import buildcraft.transport.PipeIconProvider; public final class RenderUtils { @@ -24,4 +29,74 @@ public final class RenderUtils { float blue = (color & 255) / 255.0F; GL11.glColor4f(red, green, blue, 1.0F); } + + public static void drawBlockItem(RenderBlocks render, Tessellator tessellator, Block block, IIcon icon) { + if (icon == null) { + return; + } + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1F, 0.0F); + render.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + render.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.setNormal(0.0F, 0.0F, -1F); + render.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + render.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.setNormal(-1F, 0.0F, 0.0F); + render.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + render.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + } + + public static void drawBlockItem(RenderBlocks render, Tessellator tessellator, Block block, int decodedMeta) { + tessellator.startDrawingQuads(); + IIcon icon = tryGetBlockIcon(block, 0, decodedMeta); + if (icon != null) { + tessellator.setNormal(0.0F, -1F, 0.0F); + render.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon); + } + icon = tryGetBlockIcon(block, 1, decodedMeta); + if (icon != null) { + tessellator.setNormal(0.0F, 1F, 0.0F); + render.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon); + } + icon = tryGetBlockIcon(block, 2, decodedMeta); + if (icon != null) { + tessellator.setNormal(0.0F, 0.0F, -1F); + render.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon); + } + icon = tryGetBlockIcon(block, 3, decodedMeta); + if (icon != null) { + tessellator.setNormal(0.0F, 0.0F, 1F); + render.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon); + } + icon = tryGetBlockIcon(block, 4, decodedMeta); + if (icon != null) { + tessellator.setNormal(-1F, 0.0F, 0.0F); + render.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon); + } + icon = tryGetBlockIcon(block, 5, decodedMeta); + if (icon != null) { + tessellator.setNormal(1F, 0.0F, 0.0F); + render.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon); + } + tessellator.draw(); + } + + public static IIcon tryGetBlockIcon(Block block, int side, int decodedMeta) { + IIcon icon = null; + + try { + icon = block.getIcon(side, decodedMeta); + } catch (Throwable t) { + try { + icon = block.getBlockTextureFromSide(side); + } catch (Throwable ignored) { + } + } + + return icon; + } } diff --git a/common/buildcraft/core/lib/utils/Utils.java b/common/buildcraft/core/lib/utils/Utils.java index f0cce6b7..962b87aa 100644 --- a/common/buildcraft/core/lib/utils/Utils.java +++ b/common/buildcraft/core/lib/utils/Utils.java @@ -26,6 +26,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; +import net.minecraft.world.IWorldAccess; import net.minecraft.world.World; import cpw.mods.fml.common.network.internal.FMLProxyPacket; @@ -386,6 +387,11 @@ public final class Utils { } + public static boolean isPipeConnected(IBlockAccess access, int x, int y, int z, ForgeDirection dir, IPipeTile.PipeType type) { + TileEntity tile = access.getTileEntity(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ); + return tile instanceof IPipeTile && ((IPipeTile) tile).getPipeType() == type && ((IPipeTile) tile).isPipeConnected(dir.getOpposite()); + } + public static int[] createSlotArray(int first, int count) { int[] slots = new int[count]; for (int k = first; k < first + count; k++) { diff --git a/common/buildcraft/core/proxy/CoreProxyClient.java b/common/buildcraft/core/proxy/CoreProxyClient.java index 3dc21952..9341b7f4 100644 --- a/common/buildcraft/core/proxy/CoreProxyClient.java +++ b/common/buildcraft/core/proxy/CoreProxyClient.java @@ -32,6 +32,7 @@ import buildcraft.core.lib.EntityBlock; import buildcraft.core.LaserKind; import buildcraft.core.lib.engines.RenderEngine; import buildcraft.core.lib.engines.TileEngineBase; +import buildcraft.core.lib.render.RenderBlockMultipass; import buildcraft.core.lib.render.RenderEntityBlock; import buildcraft.core.render.RenderingEntityBlocks; import buildcraft.core.render.RenderingMarkers; @@ -84,10 +85,12 @@ public class CoreProxyClient extends CoreProxy { BuildCraftCore.blockByEntityModel = RenderingRegistry.getNextAvailableRenderId(); BuildCraftCore.legacyPipeModel = RenderingRegistry.getNextAvailableRenderId(); BuildCraftCore.markerModel = RenderingRegistry.getNextAvailableRenderId(); + BuildCraftCore.multipassModel = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(new RenderingEntityBlocks()); RenderingRegistry.registerBlockHandler(BuildCraftCore.legacyPipeModel, new RenderingEntityBlocks()); RenderingRegistry.registerBlockHandler(new RenderingMarkers()); + RenderingRegistry.registerBlockHandler(BuildCraftCore.multipassModel, new RenderBlockMultipass()); //TODO Update me to grab differing trunk textures ClientRegistry.bindTileEntitySpecialRenderer(TileEngineBase.class, new RenderEngine()); diff --git a/common/buildcraft/factory/BlockFloodGate.java b/common/buildcraft/factory/BlockFloodGate.java index 8ad3a686..8a727c22 100644 --- a/common/buildcraft/factory/BlockFloodGate.java +++ b/common/buildcraft/factory/BlockFloodGate.java @@ -15,18 +15,23 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.common.util.ForgeDirection; import buildcraft.api.tools.IToolWrench; import buildcraft.core.lib.block.BlockBuildCraft; import buildcraft.core.lib.utils.Utils; public class BlockFloodGate extends BlockBuildCraft { + private IIcon valve, transparent; + public BlockFloodGate() { super(Material.iron); + setPassCount(2); } @Override @@ -35,26 +40,30 @@ public class BlockFloodGate extends BlockBuildCraft { } @Override - public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int par6, float par7, float par8, float par9) { - if (super.onBlockActivated(world, i, j, k, entityplayer, par6, par7, par8, par9)) { + public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int side, float par7, float par8, float par9) { + if (super.onBlockActivated(world, i, j, k, entityplayer, side, par7, par8, par9)) { return true; } + // Drop through if the player is sneaking + if (entityplayer.isSneaking()) { + return false; + } + TileEntity tile = world.getTileEntity(i, j, k); if (tile instanceof TileFloodGate) { TileFloodGate floodGate = (TileFloodGate) tile; - - // Drop through if the player is sneaking - if (entityplayer.isSneaking()) { - return false; - } - - // Restart the quarry if its a wrench + // Restart the flood gate if it's a wrench Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer.getCurrentEquippedItem().getItem() : null; if (equipped instanceof IToolWrench && ((IToolWrench) equipped).canWrench(entityplayer, i, j, k)) { + System.out.println("pre=" + side); + if (side == 1) { + floodGate.rebuildQueue(); + } else { + floodGate.switchSide(ForgeDirection.getOrientation(side)); + } - floodGate.rebuildQueue(); ((IToolWrench) equipped).wrenchUsed(entityplayer, i, j, k); return true; } @@ -71,4 +80,38 @@ public class BlockFloodGate extends BlockBuildCraft { ((TileFloodGate) tile).onNeighborBlockChange(block); } } + + @Override + public void registerBlockIcons(IIconRegister register) { + super.registerBlockIcons(register); + valve = register.registerIcon("buildcraftfactory:floodGateBlock/valve"); + transparent = register.registerIcon("buildcraftcore:misc/transparent"); + } + + @Override + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + if (renderPass == 1) { + if (side != 1) { + TileEntity tile = world.getTileEntity(x, y, z); + if (tile instanceof TileFloodGate) { + return ((TileFloodGate) tile).isSideBlocked(side) ? transparent : valve; + } + } + return transparent; + } else { + return super.getIcon(world, x, y, z, side); + } + } + + @Override + public IIcon getIcon(int side, int metadata) { + if (renderPass == 1) { + if (side == 1) { + return null; + } + return valve; + } else { + return super.getIcon(side, metadata); + } + } } diff --git a/common/buildcraft/factory/BlockLEDHatchBase.java b/common/buildcraft/factory/BlockLEDHatchBase.java new file mode 100644 index 00000000..8b3738de --- /dev/null +++ b/common/buildcraft/factory/BlockLEDHatchBase.java @@ -0,0 +1,79 @@ +package buildcraft.factory; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.util.ForgeDirection; +import buildcraft.BuildCraftCore; +import buildcraft.api.transport.IPipeTile; +import buildcraft.core.lib.block.BlockBuildCraft; +import buildcraft.core.lib.utils.ResourceUtils; +import buildcraft.core.lib.utils.Utils; + +public abstract class BlockLEDHatchBase extends BlockBuildCraft { + private IIcon[] led; + private IIcon itemHatch; + + protected BlockLEDHatchBase(Material material) { + super(material); + + setRotatable(true); + setPassCount(4); + } + + @Override + public int getLightValue(IBlockAccess world, int x, int y, int z) { + return 1; + } + + @Override + public void registerBlockIcons(IIconRegister register) { + super.registerBlockIcons(register); + String base = ResourceUtils.getObjectPrefix(Block.blockRegistry.getNameForObject(this)); + led = new IIcon[] { + register.registerIcon(base + "/led_red"), + register.registerIcon(base + "/led_green") + }; + itemHatch = register.registerIcon(base + "/item_hatch"); + } + + @Override + public IIcon getIcon(IBlockAccess access, int x, int y, int z, int side) { + // The quarry's pipe connection method has no idea about "sides". + if (renderPass == 1) { + return Utils.isPipeConnected(access, x, y, z, ForgeDirection.getOrientation(side), IPipeTile.PipeType.ITEM) ? itemHatch : BuildCraftCore.transparentTexture; + } else { + return super.getIcon(access, x, y, z, side); + } + } + + @Override + public IIcon getIconAbsolute(IBlockAccess access, int x, int y, int z, int side, int meta) { + if (renderPass == 0) { + return super.getIconAbsolute(access, x, y, z, side, meta); + } else if (renderPass == 1) { + return null; + } else { + return side == 2 ? led[renderPass - 2] : null; + } + } + + @Override + public IIcon getIconAbsolute(int side, int meta) { + if (renderPass == 0) { + return super.getIconAbsolute(side, meta); + } else if (renderPass == 1) { + return side == 1 ? itemHatch : null; + } else { + return side == 2 ? led[renderPass - 2] : null; + } + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } +} diff --git a/common/buildcraft/factory/BlockMiningWell.java b/common/buildcraft/factory/BlockMiningWell.java index 290fa17c..41790501 100644 --- a/common/buildcraft/factory/BlockMiningWell.java +++ b/common/buildcraft/factory/BlockMiningWell.java @@ -10,30 +10,19 @@ package buildcraft.factory; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import net.minecraftforge.common.util.ForgeDirection; - import buildcraft.BuildCraftFactory; -import buildcraft.core.lib.block.BlockBuildCraft; -import buildcraft.core.lib.utils.Utils; -public class BlockMiningWell extends BlockBuildCraft { +public class BlockMiningWell extends BlockLEDHatchBase { public BlockMiningWell() { super(Material.ground); setHardness(5F); setResistance(10F); setStepSound(soundTypeStone); - setRotatable(true); } @Override @@ -56,4 +45,14 @@ public class BlockMiningWell extends BlockBuildCraft { public TileEntity createNewTileEntity(World world, int metadata) { return new TileMiningWell(); } + + @Override + public int getIconGlowLevel(IBlockAccess access, int x, int y, int z) { + if (renderPass < 2) { + return -1; + } else { + TileMiningWell tile = (TileMiningWell) access.getTileEntity(x, y, z); + return tile.getIconGlowLevel(renderPass); + } + } } diff --git a/common/buildcraft/factory/BlockPump.java b/common/buildcraft/factory/BlockPump.java index 65abbdb7..5d095cf1 100644 --- a/common/buildcraft/factory/BlockPump.java +++ b/common/buildcraft/factory/BlockPump.java @@ -15,16 +15,24 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraftforge.common.util.ForgeDirection; +import buildcraft.BuildCraftCore; import buildcraft.api.tools.IToolWrench; +import buildcraft.api.transport.IPipeTile; +import buildcraft.core.BlockBuildCraftLED; import buildcraft.core.lib.block.BlockBuildCraft; +import buildcraft.core.lib.utils.ResourceUtils; import buildcraft.core.lib.utils.Utils; -public class BlockPump extends BlockBuildCraft { +public class BlockPump extends BlockBuildCraftLED { + private IIcon[] led; + public BlockPump() { super(Material.iron); } @@ -72,4 +80,19 @@ public class BlockPump extends BlockBuildCraft { ((TilePump) tile).onNeighborBlockChange(block); } } + + @Override + public int getIconGlowLevel(IBlockAccess access, int x, int y, int z) { + if (renderPass < 1) { + return -1; + } else { + TilePump tile = (TilePump) access.getTileEntity(x, y, z); + return tile.getIconGlowLevel(renderPass); + } + } + + @Override + public int getLightValue(IBlockAccess world, int x, int y, int z) { + return 1; + } } diff --git a/common/buildcraft/factory/BlockQuarry.java b/common/buildcraft/factory/BlockQuarry.java index e64619d1..7ddf3836 100644 --- a/common/buildcraft/factory/BlockQuarry.java +++ b/common/buildcraft/factory/BlockQuarry.java @@ -12,34 +12,26 @@ import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; 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.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - import net.minecraftforge.common.util.ForgeDirection; import buildcraft.BuildCraftFactory; import buildcraft.api.tools.IToolWrench; -import buildcraft.core.lib.block.BlockBuildCraft; -import buildcraft.core.lib.utils.Utils; -public class BlockQuarry extends BlockBuildCraft { +public class BlockQuarry extends BlockLEDHatchBase { public BlockQuarry() { super(Material.iron); setHardness(10F); setResistance(10F); setStepSound(soundTypeAnvil); - setRotatable(true); } @Override @@ -159,7 +151,12 @@ public class BlockQuarry extends BlockBuildCraft { } @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - return 1; + public int getIconGlowLevel(IBlockAccess access, int x, int y, int z) { + if (renderPass < 2) { + return -1; + } else { + TileQuarry tile = (TileQuarry) access.getTileEntity(x, y, z); + return tile.getIconGlowLevel(renderPass); + } } } diff --git a/common/buildcraft/factory/TileFloodGate.java b/common/buildcraft/factory/TileFloodGate.java index 1a7e3709..c8fefa44 100644 --- a/common/buildcraft/factory/TileFloodGate.java +++ b/common/buildcraft/factory/TileFloodGate.java @@ -14,6 +14,7 @@ import java.util.LinkedList; import java.util.Set; import java.util.TreeMap; +import io.netty.buffer.ByteBuf; import net.minecraft.block.Block; import net.minecraft.nbt.NBTTagCompound; @@ -28,6 +29,7 @@ import net.minecraftforge.fluids.IFluidHandler; import buildcraft.api.core.BlockIndex; import buildcraft.api.core.BuildCraftAPI; +import buildcraft.core.LaserData; import buildcraft.core.lib.block.TileBuildCraft; import buildcraft.core.lib.fluids.Tank; import buildcraft.core.lib.fluids.TankUtils; @@ -35,7 +37,6 @@ import buildcraft.core.lib.utils.BlockUtils; import buildcraft.core.lib.utils.Utils; public class TileFloodGate extends TileBuildCraft implements IFluidHandler { - public static final int[] REBUILD_DELAY = new int[8]; public static final int MAX_LIQUID = FluidContainerRegistry.BUCKET_VOLUME * 2; private final TreeMap> pumpLayerQueues = new TreeMap>(); @@ -45,6 +46,7 @@ public class TileFloodGate extends TileBuildCraft implements IFluidHandler { private int rebuildDelay; private int tick = Utils.RANDOM.nextInt(); private boolean powered = false; + private boolean[] blockedSides = new boolean[6]; static { REBUILD_DELAY[0] = 128; @@ -189,11 +191,12 @@ public class TileFloodGate extends TileBuildCraft implements IFluidHandler { if (tank.getFluidType() == null) { return; } - queueForFilling(x, y - 1, z); - queueForFilling(x + 1, y, z); - queueForFilling(x - 1, y, z); - queueForFilling(x, y, z + 1); - queueForFilling(x, y, z - 1); + for (int i = 0; i < 6; i++) { + if (i != 1 && !blockedSides[i]) { + ForgeDirection dir = ForgeDirection.getOrientation(i); + queueForFilling(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ); + } + } } public void queueForFilling(int x, int y, int z) { @@ -236,6 +239,9 @@ public class TileFloodGate extends TileBuildCraft implements IFluidHandler { tank.readFromNBT(data); rebuildDelay = data.getByte("rebuildDelay"); powered = data.getBoolean("powered"); + for (int i = 0; i < 6; i++) { + blockedSides[i] = data.getBoolean("blocked[" + i + "]"); + } } @Override @@ -244,6 +250,40 @@ public class TileFloodGate extends TileBuildCraft implements IFluidHandler { tank.writeToNBT(data); data.setByte("rebuildDelay", (byte) rebuildDelay); data.setBoolean("powered", powered); + for (int i = 0; i < 6; i++) { + if (blockedSides[i]) { + data.setBoolean("blocked[" + i + "]", true); + } + } + } + + // TODO: fit in single byte + @Override + public void readData(ByteBuf stream) { + for (int i = 0; i < 6; i++) { + blockedSides[i] = stream.readBoolean(); + System.out.println("Rsides=" + i + "=" + blockedSides[i]); + } + } + + @Override + public void writeData(ByteBuf stream) { + for (int i = 0; i < 6; i++) { + System.out.println("Wsides=" + i + "=" + blockedSides[i]); + stream.writeBoolean(blockedSides[i]); + } + } + + public void switchSide(ForgeDirection side) { + System.out.println("Csides=" + side.ordinal() + "=" + blockedSides[side.ordinal()]); + if (side.ordinal() != 1) { + blockedSides[side.ordinal()] = !blockedSides[side.ordinal()]; + System.out.println("Ssides=" + side.ordinal() + "=" + blockedSides[side.ordinal()]); + + rebuildQueue(); + sendNetworkUpdate(); + worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord); + } } @Override @@ -287,4 +327,8 @@ public class TileFloodGate extends TileBuildCraft implements IFluidHandler { public FluidTankInfo[] getTankInfo(ForgeDirection from) { return new FluidTankInfo[]{tank.getInfo()}; } + + public boolean isSideBlocked(int side) { + return blockedSides[side]; + } } diff --git a/common/buildcraft/factory/TileMiningWell.java b/common/buildcraft/factory/TileMiningWell.java index 968a369c..9a183dff 100644 --- a/common/buildcraft/factory/TileMiningWell.java +++ b/common/buildcraft/factory/TileMiningWell.java @@ -8,12 +8,15 @@ */ package buildcraft.factory; +import io.netty.buffer.ByteBuf; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import buildcraft.BuildCraftCore; import buildcraft.BuildCraftFactory; import buildcraft.api.blueprints.BuilderAPI; +import buildcraft.api.core.SafeTimeTracker; import buildcraft.api.tiles.IControllable; import buildcraft.api.tiles.IHasWork; import buildcraft.api.transport.IPipeConnection; @@ -24,8 +27,12 @@ import buildcraft.core.lib.utils.BlockMiner; import buildcraft.core.lib.utils.BlockUtils; public class TileMiningWell extends TileBuildCraft implements IHasWork, IPipeConnection, IControllable { - boolean isDigging = true; + private boolean isDigging = true; private BlockMiner miner; + private int ledState; + private int ticksSinceAction = 9001; + + private SafeTimeTracker updateTracker = new SafeTimeTracker(BuildCraftCore.updateFactor); public TileMiningWell() { super(); @@ -44,6 +51,12 @@ public class TileMiningWell extends TileBuildCraft implements IHasWork, IPipeCon return; } + if (updateTracker.markTimeIfDelay(worldObj)) { + sendNetworkUpdate(); + } + + ticksSinceAction++; + if (mode == Mode.Off) { if (miner != null) { miner.invalidate(); @@ -74,6 +87,7 @@ public class TileMiningWell extends TileBuildCraft implements IHasWork, IPipeCon } if (world.isAirBlock(xCoord, depth, zCoord) || world.getBlock(xCoord, depth, zCoord).isReplaceable(world, xCoord, depth, zCoord)) { + ticksSinceAction = 0; if (getBattery().getEnergyStored() >= BuilderAPI.BUILD_ENERGY) { getBattery().useEnergy(BuilderAPI.BUILD_ENERGY, BuilderAPI.BUILD_ENERGY, false); world.setBlock(xCoord, depth, zCoord, BuildCraftFactory.plainPipeBlock); @@ -85,6 +99,7 @@ public class TileMiningWell extends TileBuildCraft implements IHasWork, IPipeCon if (miner != null) { isDigging = true; + ticksSinceAction = 0; int usedEnergy = miner.acceptEnergy(getBattery().getEnergyStored()); getBattery().useEnergy(usedEnergy, usedEnergy, false); @@ -109,6 +124,35 @@ public class TileMiningWell extends TileBuildCraft implements IHasWork, IPipeCon } } + @Override + public void writeData(ByteBuf stream) { + super.writeData(stream); + + ledState = (ticksSinceAction < 2 ? 16 : 0) | (getBattery().getEnergyStored() * 15 / getBattery().getMaxEnergyStored()); + stream.writeByte(ledState); + } + + @Override + public void readData(ByteBuf stream) { + super.readData(stream); + + int newLedState = stream.readUnsignedByte(); + if (newLedState != ledState) { + ledState = newLedState; + worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord); + } + } + + public int getIconGlowLevel(int renderPass) { + if (renderPass == 2) { // Red LED + return ledState & 15; + } else if (renderPass == 3) { // Green LED + return (ledState >> 4) > 0 ? 15 : 0; + } else { + return -1; + } + } + @Override public boolean hasWork() { return isDigging; @@ -117,6 +161,9 @@ public class TileMiningWell extends TileBuildCraft implements IHasWork, IPipeCon @Override public ConnectOverride overridePipeConnection(IPipeTile.PipeType type, ForgeDirection with) { + if (with.ordinal() == worldObj.getBlockMetadata(xCoord, yCoord, zCoord)) { + return ConnectOverride.DISCONNECT; + } return type == IPipeTile.PipeType.ITEM ? ConnectOverride.CONNECT : ConnectOverride.DEFAULT; } diff --git a/common/buildcraft/factory/TilePump.java b/common/buildcraft/factory/TilePump.java index 134a9a95..7f837d3e 100644 --- a/common/buildcraft/factory/TilePump.java +++ b/common/buildcraft/factory/TilePump.java @@ -57,10 +57,15 @@ public class TilePump extends TileBuildCraft implements IHasWork, IFluidHandler, private int aimY = 0; private SafeTimeTracker timer = new SafeTimeTracker(REBUID_DELAY); - private int tick = Utils.RANDOM.nextInt(); + private int tick = Utils.RANDOM.nextInt(32); + private int tickPumped = tick - 20; private int numFluidBlocksFound = 0; private boolean powered = false; + private int ledState; + // tick % 16 => min. 16 ticks per network update + private SafeTimeTracker updateTracker = new SafeTimeTracker(Math.max(16, BuildCraftCore.updateFactor)); + public TilePump() { super(); this.setBattery(new RFBattery(1000, 150, 0)); @@ -81,6 +86,10 @@ public class TilePump extends TileBuildCraft implements IHasWork, IFluidHandler, return; } + if (updateTracker.markTimeIfDelay(worldObj)) { + sendNetworkUpdate(); + } + pushToConsumers(); if (powered) { @@ -116,6 +125,7 @@ public class TilePump extends TileBuildCraft implements IHasWork, IFluidHandler, } tank.fill(fluidToPump, true); + tickPumped = tick; } } } else { @@ -377,6 +387,8 @@ public class TilePump extends TileBuildCraft implements IHasWork, IFluidHandler, buf.writeShort(aimY); buf.writeFloat((float) tubeY); buf.writeBoolean(powered); + ledState = ((tick - tickPumped) < 48 ? 16 : 0) | (getBattery().getEnergyStored() * 15 / getBattery().getMaxEnergyStored()); + buf.writeByte(ledState); } @Override @@ -385,6 +397,12 @@ public class TilePump extends TileBuildCraft implements IHasWork, IFluidHandler, tubeY = data.readFloat(); powered = data.readBoolean(); + int newLedState = data.readUnsignedByte(); + if (newLedState != ledState) { + ledState = newLedState; + worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord); + } + setTubePosition(); } @@ -457,4 +475,14 @@ public class TilePump extends TileBuildCraft implements IHasWork, IFluidHandler, public boolean canConnectRedstoneEngine(ForgeDirection side) { return true; } + + public int getIconGlowLevel(int renderPass) { + if (renderPass == 1) { // Red LED + return ledState & 15; + } else if (renderPass == 2) { // Green LED + return (ledState >> 4) > 0 ? 15 : 0; + } else { + return -1; + } + } } diff --git a/common/buildcraft/factory/TileQuarry.java b/common/buildcraft/factory/TileQuarry.java index 639eddc1..43882cc0 100644 --- a/common/buildcraft/factory/TileQuarry.java +++ b/common/buildcraft/factory/TileQuarry.java @@ -23,6 +23,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatComponentText; import net.minecraft.world.ChunkCoordIntPair; @@ -33,6 +34,7 @@ import net.minecraftforge.common.ForgeChunkManager.Type; import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.ForgeDirection; +import buildcraft.BuildCraftCore; import buildcraft.BuildCraftFactory; import buildcraft.api.blueprints.BuilderAPI; import buildcraft.api.core.BuildCraftAPI; @@ -82,7 +84,7 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI private boolean movingVertically; private double headTrajectory; - private SafeTimeTracker updateTracker = new SafeTimeTracker(10); + private SafeTimeTracker updateTracker = new SafeTimeTracker(BuildCraftCore.updateFactor); private BptBuilderBase builder; @@ -97,6 +99,8 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI private BlockMiner miner; + private int ledState; + public TileQuarry () { box.kind = Kind.STRIPES; this.setBattery(new RFBattery((int) (2 * 64 * BuilderAPI.BREAK_ENERGY * BuildCraftFactory.miningMultiplier), (int) (1000 * BuildCraftFactory.miningMultiplier), 0)); @@ -512,7 +516,7 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI @Override public boolean hasWork() { - return mode != Mode.Off && stage != Stage.DONE; + return stage != Stage.DONE; } private void setBoundaries(boolean useDefaultI) { @@ -631,6 +635,9 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI flags |= movingHorizontally ? 0x10 : 0; flags |= movingVertically ? 0x20 : 0; stream.writeByte(flags); + + ledState = (hasWork() && mode != Mode.Off && getTicksSinceEnergyReceived() < 12 ? 16 : 0) | (getBattery().getEnergyStored() * 15 / getBattery().getMaxEnergyStored()); + stream.writeByte(ledState); } @Override @@ -649,6 +656,11 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI stage = Stage.values()[flags & 0x07]; movingHorizontally = (flags & 0x10) != 0; movingVertically = (flags & 0x20) != 0; + int newLedState = stream.readUnsignedByte(); + if (newLedState != ledState) { + ledState = newLedState; + worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord); + } createUtilsIfNeeded(); @@ -845,6 +857,16 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI } } + public int getIconGlowLevel(int renderPass) { + if (renderPass == 2) { // Red LED + return ledState & 15; + } else if (renderPass == 3) { // Green LED + return (ledState >> 4) > 0 ? 15 : 0; + } else { + return -1; + } + } + @Override public boolean hasCustomInventoryName() { return false; @@ -887,6 +909,9 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI @Override public ConnectOverride overridePipeConnection(IPipeTile.PipeType type, ForgeDirection with) { + if (with.ordinal() == worldObj.getBlockMetadata(xCoord, yCoord, zCoord)) { + return ConnectOverride.DISCONNECT; + } return type == IPipeTile.PipeType.ITEM ? ConnectOverride.CONNECT : ConnectOverride.DEFAULT; } } diff --git a/common/buildcraft/robotics/render/RenderRobot.java b/common/buildcraft/robotics/render/RenderRobot.java index c61097d3..e7ac8878 100644 --- a/common/buildcraft/robotics/render/RenderRobot.java +++ b/common/buildcraft/robotics/render/RenderRobot.java @@ -233,7 +233,6 @@ public class RenderRobot extends Render implements IItemRenderer { box.render(factor); GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glPopMatrix(); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lastBrightnessX, lastBrightnessY); diff --git a/common/buildcraft/transport/BlockGenericPipe.java b/common/buildcraft/transport/BlockGenericPipe.java index f89a3d24..ba076a55 100644 --- a/common/buildcraft/transport/BlockGenericPipe.java +++ b/common/buildcraft/transport/BlockGenericPipe.java @@ -578,10 +578,7 @@ public class BlockGenericPipe extends BlockBuildCraft { @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float xOffset, float yOffset, float zOffset) { - super.onBlockActivated(world, x, y, z, player, side, xOffset, yOffset, zOffset); - BlockInteractionEvent event = new BlockInteractionEvent(player, this); - FMLCommonHandler.instance().bus().post(event); - if (event.isCanceled()) { + if (super.onBlockActivated(world, x, y, z, player, side, xOffset, yOffset, zOffset)) { return true; } diff --git a/common/buildcraft/transport/render/FacadeItemRenderer.java b/common/buildcraft/transport/render/FacadeItemRenderer.java index 92bc8bf4..9aad21e0 100644 --- a/common/buildcraft/transport/render/FacadeItemRenderer.java +++ b/common/buildcraft/transport/render/FacadeItemRenderer.java @@ -35,31 +35,14 @@ public class FacadeItemRenderer implements IItemRenderer { private int renderState = 0; - private void drawCube(Tessellator tessellator, RenderBlocks render, Block block, int decodedMeta) { - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, -1F, 0.0F); - render.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, tryGetBlockIcon(block, 0, decodedMeta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 1.0F, 0.0F); - render.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, tryGetBlockIcon(block, 1, decodedMeta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 0.0F, -1F); - render.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, tryGetBlockIcon(block, 2, decodedMeta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 0.0F, 1.0F); - render.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, tryGetBlockIcon(block, 3, decodedMeta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(-1F, 0.0F, 0.0F); - render.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, tryGetBlockIcon(block, 4, decodedMeta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(1.0F, 0.0F, 0.0F); - render.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, tryGetBlockIcon(block, 5, decodedMeta)); - tessellator.draw(); + private IIcon tryGetBlockIcon(Block block, int side, int decodedMeta) { + IIcon icon = RenderUtils.tryGetBlockIcon(block, side, decodedMeta); + + if (icon == null) { + icon = PipeIconProvider.TYPE.TransparentFacade.getIcon(); + } + + return icon; } private void drawHollowCube(Tessellator tessellator, RenderBlocks render, Block block, int decodedMeta) { @@ -174,7 +157,7 @@ public class FacadeItemRenderer implements IItemRenderer { } else { render.setRenderBounds(0F, 0F, 1 - TransportConstants.FACADE_THICKNESS, 1F, 1F, 1F); GL11.glTranslatef(translateX, translateY, translateZ); - drawCube(tessellator, render, block, decodedMeta); + RenderUtils.drawBlockItem(render, tessellator, block, decodedMeta); } // Disable blending @@ -225,25 +208,6 @@ public class FacadeItemRenderer implements IItemRenderer { block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } - private IIcon tryGetBlockIcon(Block block, int side, int decodedMeta) { - IIcon icon = null; - - try { - icon = block.getIcon(side, decodedMeta); - } catch (Throwable t) { - try { - icon = block.getBlockTextureFromSide(side); - } catch (Throwable ignored) { - } - } finally { - if (icon == null) { - icon = PipeIconProvider.TYPE.TransparentFacade.getIcon(); - } - } - - return icon; - } - @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch (type) { diff --git a/common/buildcraft/transport/render/PipeItemRenderer.java b/common/buildcraft/transport/render/PipeItemRenderer.java index 81ca2ff3..452850da 100644 --- a/common/buildcraft/transport/render/PipeItemRenderer.java +++ b/common/buildcraft/transport/render/PipeItemRenderer.java @@ -22,6 +22,7 @@ import net.minecraftforge.client.IItemRenderer; import buildcraft.BuildCraftTransport; import buildcraft.core.CoreConstants; +import buildcraft.core.lib.render.RenderUtils; import buildcraft.core.lib.utils.ColorUtils; import buildcraft.transport.PipeIconProvider; @@ -49,7 +50,8 @@ public class PipeItemRenderer implements IItemRenderer { block.setBlockBoundsForItemRender(); render.setRenderBoundsFromBlock(block); - drawBlock(render, tessellator, block, icon, translateX, translateY, translateZ); + GL11.glTranslatef(translateX, translateY, translateZ); + RenderUtils.drawBlockItem(render, tessellator, block, icon); block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); GL11.glColor3ub((byte) 255, (byte) 255, (byte) 255); GL11.glPopMatrix(); @@ -66,40 +68,13 @@ public class PipeItemRenderer implements IItemRenderer { block.setBlockBoundsForItemRender(); render.setRenderBoundsFromBlock(block); - drawBlock(render, tessellator, block, icon, translateX, translateY, translateZ); + GL11.glTranslatef(translateX, translateY, translateZ); + RenderUtils.drawBlockItem(render, tessellator, block, icon); GL11.glTranslatef(0.5F, 0.5F, 0.5F); block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); GL11.glPopAttrib(); // nicely leave the rendering how it was } - - private void drawBlock(RenderBlocks render, Tessellator tessellator, Block block, IIcon icon, float translateX, float translateY, float translateZ) { - GL11.glTranslatef(translateX, translateY, translateZ); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, -1F, 0.0F); - render.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 1.0F, 0.0F); - render.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 0.0F, -1F); - render.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 0.0F, 1.0F); - render.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(-1F, 0.0F, 0.0F); - render.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(1.0F, 0.0F, 0.0F); - render.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon); - tessellator.draw(); - } /** * IItemRenderer implementation *