diff --git a/assets/tinker/lang/en_US.xml b/assets/tinker/lang/en_US.xml index a339446f..c8d6bfd7 100644 --- a/assets/tinker/lang/en_US.xml +++ b/assets/tinker/lang/en_US.xml @@ -21,7 +21,6 @@ Casting Table Tool Forge - Crafting Station Drying Rack Slimy Mud Grout @@ -42,7 +41,7 @@ Copper Oreberry Bush Tin Oreberry Bush Aluminum Oreberry Bush - Essence Oreberry Bush + Essence Berry Bush Iron Gravel Ore Gold Gravel Ore @@ -132,8 +131,10 @@ Copper Nugget Tin Nugget Aluminum Nugget - Essence Crystal + Fake Essence Crystal Aluminum Brass Nugget + Silky Cloth + Silky Jewel Obsidian Nugget Cobalt Nugget Ardite Nugget @@ -142,6 +143,8 @@ Alumite Nugget Steel Nugget + Essence Crystal + Smeltery Controller Smeltery Drain Seared Bricks @@ -166,6 +169,7 @@ Spruce Barricade Birch Barricade Jungle Barricade + Essence Extractor Block of Cobalt Block of Ardite @@ -177,8 +181,10 @@ Block of Aluminum Brass Block of Alumite Block of Steel + Block of Solid Ender Torch + Crafting Station Clear Glass Soul Glass @@ -239,6 +245,15 @@ Graveyard Soil Slab Consecrated Soil Slab + Blue Slimedirt + Slimy Leaves + Slimy Sapling + Slimy Grass + Slimy Grass + Slimy Grass + Congealed Blue Slime + Congealed Green Slime + Knapsack Blank Pattern Blank Cast @@ -271,33 +286,41 @@ Seared Stone Bucket Liquified Emerald Bucket Bucket o' Blood + Molten Nickel Bucket + Molten Lead Bucket + Molten Silver Bucket + Molten Shiny Bucket + Molten Invar Bucket + Molten Electrum Bucket + Liquified Ender Bucket Bowstring - Enchanted Bowstring + Enchanted Bowstring - Molten Iron - Molten Gold - Molten Copper - Molten Tin - Molten Aluminum - Molten Cobalt - Molten Ardite - Molten Bronze - Molten Aluminum Brass - Molten Manyullyn - Molten Alumite - Molten Obsidian - Molten Steel - Molten Glass - Seared Stone - Liquified Emerald - Blood - Molten Nickel - Molten Lead - Molten Silver - Molten Shiny - Molten Invar - Molten Electrum + Molten Iron + Molten Gold + Molten Copper + Liquid Tin + Molten Aluminum + Molten Cobalt + Molten Ardite + Molten Bronze + Molten Aluminum Brass + Molten Manyullyn + Molten Alumite + Molten Obsidian + Molten Steel + Molten Glass + Seared Stone + Liquified Emerald + Blood + Molten Nickel + Molten Silver + Molten Lead + Molten Shiny + Molten Invar + Molten Electrum + Liquified Ender Jeweled Apple Gelatinous Slime @@ -312,7 +335,7 @@ Blue Slime King Slime - Gardeslime + Gardeslime Armor Gui @@ -321,10 +344,6 @@ %1$s will be a stepping stone for our revolution! %1$s thought swimming in hot liquids was a good idea - %1$s watched their legs get blown off - %1$s was doomed to fall by Landmine - %1$s took a ride on a firework - Wooden Stone Iron @@ -366,5 +385,6 @@ Molten Platinum Molten Invar Molten Shiny + Liquid Ender \ No newline at end of file diff --git a/assets/tinker/sounds/frypan_hit.ogg b/assets/tinker/sound/frypan_hit.ogg similarity index 100% rename from assets/tinker/sounds/frypan_hit.ogg rename to assets/tinker/sound/frypan_hit.ogg diff --git a/assets/tinker/sounds/launcher_clank.ogg b/assets/tinker/sound/launcher_clank.ogg similarity index 100% rename from assets/tinker/sounds/launcher_clank.ogg rename to assets/tinker/sound/launcher_clank.ogg diff --git a/assets/tinker/sounds/little_saw.ogg b/assets/tinker/sound/little_saw.ogg similarity index 100% rename from assets/tinker/sounds/little_saw.ogg rename to assets/tinker/sound/little_saw.ogg diff --git a/assets/tinker/textures/blocks/coal_block.png b/assets/tinker/textures/blocks/coal_block.png new file mode 100644 index 00000000..024404bc Binary files /dev/null and b/assets/tinker/textures/blocks/coal_block.png differ diff --git a/assets/tinker/textures/blocks/compressed_ender.png b/assets/tinker/textures/blocks/compressed_ender.png new file mode 100644 index 00000000..b7e9bbbc Binary files /dev/null and b/assets/tinker/textures/blocks/compressed_ender.png differ diff --git a/assets/tinker/textures/blocks/extractor_bottom.png b/assets/tinker/textures/blocks/extractor_bottom.png new file mode 100644 index 00000000..a7755c87 Binary files /dev/null and b/assets/tinker/textures/blocks/extractor_bottom.png differ diff --git a/assets/tinker/textures/blocks/extractor_side.png b/assets/tinker/textures/blocks/extractor_side.png new file mode 100644 index 00000000..b9f52414 Binary files /dev/null and b/assets/tinker/textures/blocks/extractor_side.png differ diff --git a/assets/tinker/textures/blocks/extractor_top.png b/assets/tinker/textures/blocks/extractor_top.png new file mode 100644 index 00000000..1eaf2fa1 Binary files /dev/null and b/assets/tinker/textures/blocks/extractor_top.png differ diff --git a/assets/tinker/textures/blocks/liquid_alubrass.txt b/assets/tinker/textures/blocks/liquid_alubrass.txt deleted file mode 100644 index b0a7c084..00000000 --- a/assets/tinker/textures/blocks/liquid_alubrass.txt +++ /dev/null @@ -1,38 +0,0 @@ -0*2 -1*2 -2*2 -3*2 -4*2 -5*2 -6*2 -7*2 -8*2 -9*2 -10*2 -11*2 -12*2 -13*2 -14*2 -15*2 -16*2 -17*2 -18*2 -19*2 -18*2 -17*2 -16*2 -15*2 -14*2 -13*2 -12*2 -11*2 -10*2 -9*2 -8*2 -7*2 -6*2 -5*2 -4*2 -3*2 -2*2 -1*2 diff --git a/assets/tinker/textures/blocks/liquid_alubrass_flow.txt b/assets/tinker/textures/blocks/liquid_alubrass_flow.txt deleted file mode 100644 index 2e6ca4fc..00000000 --- a/assets/tinker/textures/blocks/liquid_alubrass_flow.txt +++ /dev/null @@ -1,16 +0,0 @@ -0*3 -1*3 -2*3 -3*3 -4*3 -5*3 -6*3 -7*3 -8*3 -9*3 -10*3 -11*3 -12*3 -13*3 -14*3 -15*3 diff --git a/assets/tinker/textures/blocks/liquid_aluminum.txt b/assets/tinker/textures/blocks/liquid_aluminum.txt deleted file mode 100644 index b0a7c084..00000000 --- a/assets/tinker/textures/blocks/liquid_aluminum.txt +++ /dev/null @@ -1,38 +0,0 @@ -0*2 -1*2 -2*2 -3*2 -4*2 -5*2 -6*2 -7*2 -8*2 -9*2 -10*2 -11*2 -12*2 -13*2 -14*2 -15*2 -16*2 -17*2 -18*2 -19*2 -18*2 -17*2 -16*2 -15*2 -14*2 -13*2 -12*2 -11*2 -10*2 -9*2 -8*2 -7*2 -6*2 -5*2 -4*2 -3*2 -2*2 -1*2 diff --git a/assets/tinker/textures/blocks/liquid_aluminum_flow.txt b/assets/tinker/textures/blocks/liquid_aluminum_flow.txt deleted file mode 100644 index 2e6ca4fc..00000000 --- a/assets/tinker/textures/blocks/liquid_aluminum_flow.txt +++ /dev/null @@ -1,16 +0,0 @@ -0*3 -1*3 -2*3 -3*3 -4*3 -5*3 -6*3 -7*3 -8*3 -9*3 -10*3 -11*3 -12*3 -13*3 -14*3 -15*3 diff --git a/assets/tinker/textures/blocks/liquid_alumite.txt b/assets/tinker/textures/blocks/liquid_alumite.txt deleted file mode 100644 index b0a7c084..00000000 --- a/assets/tinker/textures/blocks/liquid_alumite.txt +++ /dev/null @@ -1,38 +0,0 @@ -0*2 -1*2 -2*2 -3*2 -4*2 -5*2 -6*2 -7*2 -8*2 -9*2 -10*2 -11*2 -12*2 -13*2 -14*2 -15*2 -16*2 -17*2 -18*2 -19*2 -18*2 -17*2 -16*2 -15*2 -14*2 -13*2 -12*2 -11*2 -10*2 -9*2 -8*2 -7*2 -6*2 -5*2 -4*2 -3*2 -2*2 -1*2 diff --git a/assets/tinker/textures/blocks/liquid_alumite_flow.txt b/assets/tinker/textures/blocks/liquid_alumite_flow.txt deleted file mode 100644 index 2e6ca4fc..00000000 --- a/assets/tinker/textures/blocks/liquid_alumite_flow.txt +++ /dev/null @@ -1,16 +0,0 @@ -0*3 -1*3 -2*3 -3*3 -4*3 -5*3 -6*3 -7*3 -8*3 -9*3 -10*3 -11*3 -12*3 -13*3 -14*3 -15*3 diff --git a/assets/tinker/textures/blocks/liquid_ardite.txt b/assets/tinker/textures/blocks/liquid_ardite.txt deleted file mode 100644 index b0a7c084..00000000 --- a/assets/tinker/textures/blocks/liquid_ardite.txt +++ /dev/null @@ -1,38 +0,0 @@ -0*2 -1*2 -2*2 -3*2 -4*2 -5*2 -6*2 -7*2 -8*2 -9*2 -10*2 -11*2 -12*2 -13*2 -14*2 -15*2 -16*2 -17*2 -18*2 -19*2 -18*2 -17*2 -16*2 -15*2 -14*2 -13*2 -12*2 -11*2 -10*2 -9*2 -8*2 -7*2 -6*2 -5*2 -4*2 -3*2 -2*2 -1*2 diff --git a/assets/tinker/textures/blocks/liquid_ardite_flow.txt b/assets/tinker/textures/blocks/liquid_ardite_flow.txt deleted file mode 100644 index 2e6ca4fc..00000000 --- a/assets/tinker/textures/blocks/liquid_ardite_flow.txt +++ /dev/null @@ -1,16 +0,0 @@ -0*3 -1*3 -2*3 -3*3 -4*3 -5*3 -6*3 -7*3 -8*3 -9*3 -10*3 -11*3 -12*3 -13*3 -14*3 -15*3 diff --git a/assets/tinker/textures/blocks/liquid_bronze.txt b/assets/tinker/textures/blocks/liquid_bronze.txt deleted file mode 100644 index b0a7c084..00000000 --- a/assets/tinker/textures/blocks/liquid_bronze.txt +++ /dev/null @@ -1,38 +0,0 @@ -0*2 -1*2 -2*2 -3*2 -4*2 -5*2 -6*2 -7*2 -8*2 -9*2 -10*2 -11*2 -12*2 -13*2 -14*2 -15*2 -16*2 -17*2 -18*2 -19*2 -18*2 -17*2 -16*2 -15*2 -14*2 -13*2 -12*2 -11*2 -10*2 -9*2 -8*2 -7*2 -6*2 -5*2 -4*2 -3*2 -2*2 -1*2 diff --git a/assets/tinker/textures/blocks/liquid_bronze_flow.txt b/assets/tinker/textures/blocks/liquid_bronze_flow.txt deleted file mode 100644 index 2e6ca4fc..00000000 --- a/assets/tinker/textures/blocks/liquid_bronze_flow.txt +++ /dev/null @@ -1,16 +0,0 @@ -0*3 -1*3 -2*3 -3*3 -4*3 -5*3 -6*3 -7*3 -8*3 -9*3 -10*3 -11*3 -12*3 -13*3 -14*3 -15*3 diff --git a/assets/tinker/textures/blocks/liquid_cobalt.txt b/assets/tinker/textures/blocks/liquid_cobalt.txt deleted file mode 100644 index b0a7c084..00000000 --- a/assets/tinker/textures/blocks/liquid_cobalt.txt +++ /dev/null @@ -1,38 +0,0 @@ -0*2 -1*2 -2*2 -3*2 -4*2 -5*2 -6*2 -7*2 -8*2 -9*2 -10*2 -11*2 -12*2 -13*2 -14*2 -15*2 -16*2 -17*2 -18*2 -19*2 -18*2 -17*2 -16*2 -15*2 -14*2 -13*2 -12*2 -11*2 -10*2 -9*2 -8*2 -7*2 -6*2 -5*2 -4*2 -3*2 -2*2 -1*2 diff --git a/assets/tinker/textures/blocks/liquid_cobalt_flow.txt b/assets/tinker/textures/blocks/liquid_cobalt_flow.txt deleted file mode 100644 index 2e6ca4fc..00000000 --- a/assets/tinker/textures/blocks/liquid_cobalt_flow.txt +++ /dev/null @@ -1,16 +0,0 @@ -0*3 -1*3 -2*3 -3*3 -4*3 -5*3 -6*3 -7*3 -8*3 -9*3 -10*3 -11*3 -12*3 -13*3 -14*3 -15*3 diff --git a/assets/tinker/textures/blocks/liquid_copper.txt b/assets/tinker/textures/blocks/liquid_copper.txt deleted file mode 100644 index b0a7c084..00000000 --- a/assets/tinker/textures/blocks/liquid_copper.txt +++ /dev/null @@ -1,38 +0,0 @@ -0*2 -1*2 -2*2 -3*2 -4*2 -5*2 -6*2 -7*2 -8*2 -9*2 -10*2 -11*2 -12*2 -13*2 -14*2 -15*2 -16*2 -17*2 -18*2 -19*2 -18*2 -17*2 -16*2 -15*2 -14*2 -13*2 -12*2 -11*2 -10*2 -9*2 -8*2 -7*2 -6*2 -5*2 -4*2 -3*2 -2*2 -1*2 diff --git a/assets/tinker/textures/blocks/liquid_copper_flow.txt b/assets/tinker/textures/blocks/liquid_copper_flow.txt deleted file mode 100644 index 2e6ca4fc..00000000 --- a/assets/tinker/textures/blocks/liquid_copper_flow.txt +++ /dev/null @@ -1,16 +0,0 @@ -0*3 -1*3 -2*3 -3*3 -4*3 -5*3 -6*3 -7*3 -8*3 -9*3 -10*3 -11*3 -12*3 -13*3 -14*3 -15*3 diff --git a/assets/tinker/textures/blocks/liquid_cow.txt b/assets/tinker/textures/blocks/liquid_cow.txt deleted file mode 100644 index d8fe765a..00000000 --- a/assets/tinker/textures/blocks/liquid_cow.txt +++ /dev/null @@ -1,32 +0,0 @@ -0*2 -1*2 -2*2 -3*2 -4*2 -5*2 -6*2 -7*2 -8*2 -9*2 -10*2 -11*2 -12*2 -13*2 -14*2 -15*2 -16*2 -17*2 -18*2 -19*2 -20*2 -21*2 -22*2 -23*2 -24*2 -25*2 -26*2 -27*2 -28*2 -29*2 -30*2 -31*2 diff --git a/assets/tinker/textures/blocks/liquid_cow_flow.txt b/assets/tinker/textures/blocks/liquid_cow_flow.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/tinker/textures/blocks/liquid_electrum_flow.mcmeta b/assets/tinker/textures/blocks/liquid_electrum_flow.png.mcmeta similarity index 100% rename from assets/tinker/textures/blocks/liquid_electrum_flow.mcmeta rename to assets/tinker/textures/blocks/liquid_electrum_flow.png.mcmeta diff --git a/assets/tinker/textures/blocks/liquid_ender.png b/assets/tinker/textures/blocks/liquid_ender.png new file mode 100644 index 00000000..bbc90b39 Binary files /dev/null and b/assets/tinker/textures/blocks/liquid_ender.png differ diff --git a/assets/tinker/textures/blocks/liquid_ender.png.mcmeta b/assets/tinker/textures/blocks/liquid_ender.png.mcmeta new file mode 100644 index 00000000..4f0718ac --- /dev/null +++ b/assets/tinker/textures/blocks/liquid_ender.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/assets/tinker/textures/blocks/liquid_ender_flow.png b/assets/tinker/textures/blocks/liquid_ender_flow.png new file mode 100644 index 00000000..2612655c Binary files /dev/null and b/assets/tinker/textures/blocks/liquid_ender_flow.png differ diff --git a/assets/tinker/textures/blocks/liquid_ender_flow.png.mcmeta b/assets/tinker/textures/blocks/liquid_ender_flow.png.mcmeta new file mode 100644 index 00000000..0645f48c --- /dev/null +++ b/assets/tinker/textures/blocks/liquid_ender_flow.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/assets/tinker/textures/blocks/liquid_glass.txt b/assets/tinker/textures/blocks/liquid_glass.txt deleted file mode 100644 index d8fe765a..00000000 --- a/assets/tinker/textures/blocks/liquid_glass.txt +++ /dev/null @@ -1,32 +0,0 @@ -0*2 -1*2 -2*2 -3*2 -4*2 -5*2 -6*2 -7*2 -8*2 -9*2 -10*2 -11*2 -12*2 -13*2 -14*2 -15*2 -16*2 -17*2 -18*2 -19*2 -20*2 -21*2 -22*2 -23*2 -24*2 -25*2 -26*2 -27*2 -28*2 -29*2 -30*2 -31*2 diff --git a/assets/tinker/textures/blocks/liquid_glass_flow.txt b/assets/tinker/textures/blocks/liquid_glass_flow.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/tinker/textures/blocks/liquid_gold.txt b/assets/tinker/textures/blocks/liquid_gold.txt deleted file mode 100644 index b0a7c084..00000000 --- a/assets/tinker/textures/blocks/liquid_gold.txt +++ /dev/null @@ -1,38 +0,0 @@ -0*2 -1*2 -2*2 -3*2 -4*2 -5*2 -6*2 -7*2 -8*2 -9*2 -10*2 -11*2 -12*2 -13*2 -14*2 -15*2 -16*2 -17*2 -18*2 -19*2 -18*2 -17*2 -16*2 -15*2 -14*2 -13*2 -12*2 -11*2 -10*2 -9*2 -8*2 -7*2 -6*2 -5*2 -4*2 -3*2 -2*2 -1*2 diff --git a/assets/tinker/textures/blocks/liquid_gold_flow.txt b/assets/tinker/textures/blocks/liquid_gold_flow.txt deleted file mode 100644 index 2e6ca4fc..00000000 --- a/assets/tinker/textures/blocks/liquid_gold_flow.txt +++ /dev/null @@ -1,16 +0,0 @@ -0*3 -1*3 -2*3 -3*3 -4*3 -5*3 -6*3 -7*3 -8*3 -9*3 -10*3 -11*3 -12*3 -13*3 -14*3 -15*3 diff --git a/assets/tinker/textures/blocks/liquid_iron.txt b/assets/tinker/textures/blocks/liquid_iron.txt deleted file mode 100644 index b0a7c084..00000000 --- a/assets/tinker/textures/blocks/liquid_iron.txt +++ /dev/null @@ -1,38 +0,0 @@ -0*2 -1*2 -2*2 -3*2 -4*2 -5*2 -6*2 -7*2 -8*2 -9*2 -10*2 -11*2 -12*2 -13*2 -14*2 -15*2 -16*2 -17*2 -18*2 -19*2 -18*2 -17*2 -16*2 -15*2 -14*2 -13*2 -12*2 -11*2 -10*2 -9*2 -8*2 -7*2 -6*2 -5*2 -4*2 -3*2 -2*2 -1*2 diff --git a/assets/tinker/textures/blocks/liquid_iron_flow.txt b/assets/tinker/textures/blocks/liquid_iron_flow.txt deleted file mode 100644 index 2e6ca4fc..00000000 --- a/assets/tinker/textures/blocks/liquid_iron_flow.txt +++ /dev/null @@ -1,16 +0,0 @@ -0*3 -1*3 -2*3 -3*3 -4*3 -5*3 -6*3 -7*3 -8*3 -9*3 -10*3 -11*3 -12*3 -13*3 -14*3 -15*3 diff --git a/assets/tinker/textures/blocks/liquid_manyullyn.txt b/assets/tinker/textures/blocks/liquid_manyullyn.txt deleted file mode 100644 index b0a7c084..00000000 --- a/assets/tinker/textures/blocks/liquid_manyullyn.txt +++ /dev/null @@ -1,38 +0,0 @@ -0*2 -1*2 -2*2 -3*2 -4*2 -5*2 -6*2 -7*2 -8*2 -9*2 -10*2 -11*2 -12*2 -13*2 -14*2 -15*2 -16*2 -17*2 -18*2 -19*2 -18*2 -17*2 -16*2 -15*2 -14*2 -13*2 -12*2 -11*2 -10*2 -9*2 -8*2 -7*2 -6*2 -5*2 -4*2 -3*2 -2*2 -1*2 diff --git a/assets/tinker/textures/blocks/liquid_manyullyn_flow.txt b/assets/tinker/textures/blocks/liquid_manyullyn_flow.txt deleted file mode 100644 index 2e6ca4fc..00000000 --- a/assets/tinker/textures/blocks/liquid_manyullyn_flow.txt +++ /dev/null @@ -1,16 +0,0 @@ -0*3 -1*3 -2*3 -3*3 -4*3 -5*3 -6*3 -7*3 -8*3 -9*3 -10*3 -11*3 -12*3 -13*3 -14*3 -15*3 diff --git a/assets/tinker/textures/blocks/liquid_obsidian.txt b/assets/tinker/textures/blocks/liquid_obsidian.txt deleted file mode 100644 index b0a7c084..00000000 --- a/assets/tinker/textures/blocks/liquid_obsidian.txt +++ /dev/null @@ -1,38 +0,0 @@ -0*2 -1*2 -2*2 -3*2 -4*2 -5*2 -6*2 -7*2 -8*2 -9*2 -10*2 -11*2 -12*2 -13*2 -14*2 -15*2 -16*2 -17*2 -18*2 -19*2 -18*2 -17*2 -16*2 -15*2 -14*2 -13*2 -12*2 -11*2 -10*2 -9*2 -8*2 -7*2 -6*2 -5*2 -4*2 -3*2 -2*2 -1*2 diff --git a/assets/tinker/textures/blocks/liquid_obsidian_flow.txt b/assets/tinker/textures/blocks/liquid_obsidian_flow.txt deleted file mode 100644 index 2e6ca4fc..00000000 --- a/assets/tinker/textures/blocks/liquid_obsidian_flow.txt +++ /dev/null @@ -1,16 +0,0 @@ -0*3 -1*3 -2*3 -3*3 -4*3 -5*3 -6*3 -7*3 -8*3 -9*3 -10*3 -11*3 -12*3 -13*3 -14*3 -15*3 diff --git a/assets/tinker/textures/blocks/liquid_steel.txt b/assets/tinker/textures/blocks/liquid_steel.txt deleted file mode 100644 index b0a7c084..00000000 --- a/assets/tinker/textures/blocks/liquid_steel.txt +++ /dev/null @@ -1,38 +0,0 @@ -0*2 -1*2 -2*2 -3*2 -4*2 -5*2 -6*2 -7*2 -8*2 -9*2 -10*2 -11*2 -12*2 -13*2 -14*2 -15*2 -16*2 -17*2 -18*2 -19*2 -18*2 -17*2 -16*2 -15*2 -14*2 -13*2 -12*2 -11*2 -10*2 -9*2 -8*2 -7*2 -6*2 -5*2 -4*2 -3*2 -2*2 -1*2 diff --git a/assets/tinker/textures/blocks/liquid_steel_flow.txt b/assets/tinker/textures/blocks/liquid_steel_flow.txt deleted file mode 100644 index 2e6ca4fc..00000000 --- a/assets/tinker/textures/blocks/liquid_steel_flow.txt +++ /dev/null @@ -1,16 +0,0 @@ -0*3 -1*3 -2*3 -3*3 -4*3 -5*3 -6*3 -7*3 -8*3 -9*3 -10*3 -11*3 -12*3 -13*3 -14*3 -15*3 diff --git a/assets/tinker/textures/blocks/liquid_stone.txt b/assets/tinker/textures/blocks/liquid_stone.txt deleted file mode 100644 index d8fe765a..00000000 --- a/assets/tinker/textures/blocks/liquid_stone.txt +++ /dev/null @@ -1,32 +0,0 @@ -0*2 -1*2 -2*2 -3*2 -4*2 -5*2 -6*2 -7*2 -8*2 -9*2 -10*2 -11*2 -12*2 -13*2 -14*2 -15*2 -16*2 -17*2 -18*2 -19*2 -20*2 -21*2 -22*2 -23*2 -24*2 -25*2 -26*2 -27*2 -28*2 -29*2 -30*2 -31*2 diff --git a/assets/tinker/textures/blocks/liquid_stone_flow.txt b/assets/tinker/textures/blocks/liquid_stone_flow.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/tinker/textures/blocks/liquid_tin.txt b/assets/tinker/textures/blocks/liquid_tin.txt deleted file mode 100644 index b0a7c084..00000000 --- a/assets/tinker/textures/blocks/liquid_tin.txt +++ /dev/null @@ -1,38 +0,0 @@ -0*2 -1*2 -2*2 -3*2 -4*2 -5*2 -6*2 -7*2 -8*2 -9*2 -10*2 -11*2 -12*2 -13*2 -14*2 -15*2 -16*2 -17*2 -18*2 -19*2 -18*2 -17*2 -16*2 -15*2 -14*2 -13*2 -12*2 -11*2 -10*2 -9*2 -8*2 -7*2 -6*2 -5*2 -4*2 -3*2 -2*2 -1*2 diff --git a/assets/tinker/textures/blocks/liquid_tin_flow.txt b/assets/tinker/textures/blocks/liquid_tin_flow.txt deleted file mode 100644 index 2e6ca4fc..00000000 --- a/assets/tinker/textures/blocks/liquid_tin_flow.txt +++ /dev/null @@ -1,16 +0,0 @@ -0*3 -1*3 -2*3 -3*3 -4*3 -5*3 -6*3 -7*3 -8*3 -9*3 -10*3 -11*3 -12*3 -13*3 -14*3 -15*3 diff --git a/assets/tinker/textures/blocks/liquid_villager.txt b/assets/tinker/textures/blocks/liquid_villager.txt deleted file mode 100644 index d8fe765a..00000000 --- a/assets/tinker/textures/blocks/liquid_villager.txt +++ /dev/null @@ -1,32 +0,0 @@ -0*2 -1*2 -2*2 -3*2 -4*2 -5*2 -6*2 -7*2 -8*2 -9*2 -10*2 -11*2 -12*2 -13*2 -14*2 -15*2 -16*2 -17*2 -18*2 -19*2 -20*2 -21*2 -22*2 -23*2 -24*2 -25*2 -26*2 -27*2 -28*2 -29*2 -30*2 -31*2 diff --git a/assets/tinker/textures/blocks/liquid_villager_flow.txt b/assets/tinker/textures/blocks/liquid_villager_flow.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/assets/tinker/textures/blocks/slime_blue.png b/assets/tinker/textures/blocks/slime_blue.png new file mode 100644 index 00000000..4fc22c5d Binary files /dev/null and b/assets/tinker/textures/blocks/slime_blue.png differ diff --git a/assets/tinker/textures/blocks/slime_blue.png.mcmeta b/assets/tinker/textures/blocks/slime_blue.png.mcmeta new file mode 100644 index 00000000..4f0718ac --- /dev/null +++ b/assets/tinker/textures/blocks/slime_blue.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/assets/tinker/textures/blocks/slime_blue_flow.png b/assets/tinker/textures/blocks/slime_blue_flow.png new file mode 100644 index 00000000..929420e0 Binary files /dev/null and b/assets/tinker/textures/blocks/slime_blue_flow.png differ diff --git a/assets/tinker/textures/blocks/slime_blue_flow.png.mcmeta b/assets/tinker/textures/blocks/slime_blue_flow.png.mcmeta new file mode 100644 index 00000000..0645f48c --- /dev/null +++ b/assets/tinker/textures/blocks/slime_blue_flow.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/assets/tinker/textures/blocks/slimeblock_blue.png b/assets/tinker/textures/blocks/slimeblock_blue.png new file mode 100644 index 00000000..cc2a161b Binary files /dev/null and b/assets/tinker/textures/blocks/slimeblock_blue.png differ diff --git a/assets/tinker/textures/blocks/slimeblock_green.png b/assets/tinker/textures/blocks/slimeblock_green.png new file mode 100644 index 00000000..e0d9f10d Binary files /dev/null and b/assets/tinker/textures/blocks/slimeblock_green.png differ diff --git a/assets/tinker/textures/blocks/slimeblock_purple.png b/assets/tinker/textures/blocks/slimeblock_purple.png new file mode 100644 index 00000000..4c63c537 Binary files /dev/null and b/assets/tinker/textures/blocks/slimeblock_purple.png differ diff --git a/assets/tinker/textures/blocks/slimedirt_blue.png b/assets/tinker/textures/blocks/slimedirt_blue.png new file mode 100644 index 00000000..133b401b Binary files /dev/null and b/assets/tinker/textures/blocks/slimedirt_blue.png differ diff --git a/assets/tinker/textures/blocks/slimedirt_green.png b/assets/tinker/textures/blocks/slimedirt_green.png new file mode 100644 index 00000000..d4992452 Binary files /dev/null and b/assets/tinker/textures/blocks/slimedirt_green.png differ diff --git a/assets/tinker/textures/blocks/slimegrass_blue_fern.png b/assets/tinker/textures/blocks/slimegrass_blue_fern.png new file mode 100644 index 00000000..e50c38a7 Binary files /dev/null and b/assets/tinker/textures/blocks/slimegrass_blue_fern.png differ diff --git a/assets/tinker/textures/blocks/slimegrass_blue_side.png b/assets/tinker/textures/blocks/slimegrass_blue_side.png new file mode 100644 index 00000000..988c5281 Binary files /dev/null and b/assets/tinker/textures/blocks/slimegrass_blue_side.png differ diff --git a/assets/tinker/textures/blocks/slimegrass_blue_tall.png b/assets/tinker/textures/blocks/slimegrass_blue_tall.png new file mode 100644 index 00000000..bb10912e Binary files /dev/null and b/assets/tinker/textures/blocks/slimegrass_blue_tall.png differ diff --git a/assets/tinker/textures/blocks/slimegrass_blue_top.png b/assets/tinker/textures/blocks/slimegrass_blue_top.png new file mode 100644 index 00000000..5d9ad68e Binary files /dev/null and b/assets/tinker/textures/blocks/slimegrass_blue_top.png differ diff --git a/assets/tinker/textures/blocks/slimegrass_green_blue_side.png b/assets/tinker/textures/blocks/slimegrass_green_blue_side.png new file mode 100644 index 00000000..d8a186cb Binary files /dev/null and b/assets/tinker/textures/blocks/slimegrass_green_blue_side.png differ diff --git a/assets/tinker/textures/blocks/slimegrass_green_dirt_side.png b/assets/tinker/textures/blocks/slimegrass_green_dirt_side.png new file mode 100644 index 00000000..3d057239 Binary files /dev/null and b/assets/tinker/textures/blocks/slimegrass_green_dirt_side.png differ diff --git a/assets/tinker/textures/blocks/slimegrass_green_green_side.png b/assets/tinker/textures/blocks/slimegrass_green_green_side.png new file mode 100644 index 00000000..1b5b9b22 Binary files /dev/null and b/assets/tinker/textures/blocks/slimegrass_green_green_side.png differ diff --git a/assets/tinker/textures/blocks/slimegrass_green_top.png b/assets/tinker/textures/blocks/slimegrass_green_top.png new file mode 100644 index 00000000..cf7ff8b4 Binary files /dev/null and b/assets/tinker/textures/blocks/slimegrass_green_top.png differ diff --git a/assets/tinker/textures/blocks/slimeleaves_blue_fancy.png b/assets/tinker/textures/blocks/slimeleaves_blue_fancy.png new file mode 100644 index 00000000..deb17e7a Binary files /dev/null and b/assets/tinker/textures/blocks/slimeleaves_blue_fancy.png differ diff --git a/assets/tinker/textures/blocks/slimeleaves_blue_fast.png b/assets/tinker/textures/blocks/slimeleaves_blue_fast.png new file mode 100644 index 00000000..6c91818b Binary files /dev/null and b/assets/tinker/textures/blocks/slimeleaves_blue_fast.png differ diff --git a/assets/tinker/textures/blocks/slimesapling_blue.png b/assets/tinker/textures/blocks/slimesapling_blue.png new file mode 100644 index 00000000..c48bc13d Binary files /dev/null and b/assets/tinker/textures/blocks/slimesapling_blue.png differ diff --git a/assets/tinker/textures/blocks/slimesnow_blue.png b/assets/tinker/textures/blocks/slimesnow_blue.png new file mode 100644 index 00000000..9a81f243 Binary files /dev/null and b/assets/tinker/textures/blocks/slimesnow_blue.png differ diff --git a/assets/tinker/textures/items/arrow/thaumium_arrow_head.png b/assets/tinker/textures/items/arrow/thaumium_arrow_head.png new file mode 100644 index 00000000..b5effc73 Binary files /dev/null and b/assets/tinker/textures/items/arrow/thaumium_arrow_head.png differ diff --git a/assets/tinker/textures/items/arrow/thaumium_arrow_shaft.png b/assets/tinker/textures/items/arrow/thaumium_arrow_shaft.png new file mode 100644 index 00000000..50070b32 Binary files /dev/null and b/assets/tinker/textures/items/arrow/thaumium_arrow_shaft.png differ diff --git a/assets/tinker/textures/items/materials/bucket_electrum.png b/assets/tinker/textures/items/materials/bucket_electrum.png new file mode 100644 index 00000000..00d1819d Binary files /dev/null and b/assets/tinker/textures/items/materials/bucket_electrum.png differ diff --git a/assets/tinker/textures/items/materials/bucket_ender.png b/assets/tinker/textures/items/materials/bucket_ender.png new file mode 100644 index 00000000..d957a2c2 Binary files /dev/null and b/assets/tinker/textures/items/materials/bucket_ender.png differ diff --git a/assets/tinker/textures/items/materials/bucket_invar.png b/assets/tinker/textures/items/materials/bucket_invar.png new file mode 100644 index 00000000..c8e0f24b Binary files /dev/null and b/assets/tinker/textures/items/materials/bucket_invar.png differ diff --git a/assets/tinker/textures/items/materials/bucket_lead.png b/assets/tinker/textures/items/materials/bucket_lead.png new file mode 100644 index 00000000..164cc3ba Binary files /dev/null and b/assets/tinker/textures/items/materials/bucket_lead.png differ diff --git a/assets/tinker/textures/items/materials/bucket_nickel.png b/assets/tinker/textures/items/materials/bucket_nickel.png new file mode 100644 index 00000000..ff248756 Binary files /dev/null and b/assets/tinker/textures/items/materials/bucket_nickel.png differ diff --git a/assets/tinker/textures/items/materials/bucket_shiny.png b/assets/tinker/textures/items/materials/bucket_shiny.png new file mode 100644 index 00000000..b2082441 Binary files /dev/null and b/assets/tinker/textures/items/materials/bucket_shiny.png differ diff --git a/assets/tinker/textures/items/materials/bucket_silver.png b/assets/tinker/textures/items/materials/bucket_silver.png new file mode 100644 index 00000000..c8e81d96 Binary files /dev/null and b/assets/tinker/textures/items/materials/bucket_silver.png differ diff --git a/assets/tinker/textures/items/materials/cast_bowstring.png b/assets/tinker/textures/items/materials/cast_bowstring.png new file mode 100644 index 00000000..3b0fc0a9 Binary files /dev/null and b/assets/tinker/textures/items/materials/cast_bowstring.png differ diff --git a/assets/tinker/textures/items/materials/cast_fletching.png b/assets/tinker/textures/items/materials/cast_fletching.png new file mode 100644 index 00000000..3b0fc0a9 Binary files /dev/null and b/assets/tinker/textures/items/materials/cast_fletching.png differ diff --git a/assets/tinker/textures/items/parts/thaumium_arrowhead.png b/assets/tinker/textures/items/parts/thaumium_arrowhead.png new file mode 100644 index 00000000..06f155f5 Binary files /dev/null and b/assets/tinker/textures/items/parts/thaumium_arrowhead.png differ diff --git a/tconstruct/TConstruct.java b/tconstruct/TConstruct.java index 2e6abe59..b204eeb3 100644 --- a/tconstruct/TConstruct.java +++ b/tconstruct/TConstruct.java @@ -13,6 +13,7 @@ import tconstruct.util.PHConstruct; import tconstruct.util.TCraftingHandler; import tconstruct.util.TEventHandler; import tconstruct.util.player.TPlayerHandler; +import tconstruct.worldgen.SlimeIslandGen; import tconstruct.worldgen.TBaseWorldGenerator; import tconstruct.worldgen.TerrainGenEventHandler; import tconstruct.worldgen.village.TVillageTrades; @@ -37,7 +38,7 @@ import cpw.mods.fml.common.registry.VillagerRegistry; * @dependencies: IC2 API, MFR API */ -@Mod(modid = "TConstruct", name = "TConstruct", version = "1.6.2_1.4.dev.26", dependencies = "required-after:Forge@[7.7.1.687,)") +@Mod(modid = "TConstruct", name = "TConstruct", version = "1.6.2_1.4.dev.27", dependencies = "required-after:Forge@[7.7.1.687,)") @NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = tconstruct.util.network.TPacketHandler.class) public class TConstruct { @@ -116,6 +117,7 @@ public class TConstruct public void init (FMLInitializationEvent event) { content.intermodCommunication(); + GameRegistry.registerWorldGenerator(new SlimeIslandGen(TContent.slimePool.blockID, 0)); } @EventHandler diff --git a/tconstruct/blocks/EssenceExtractor.java b/tconstruct/blocks/EssenceExtractor.java new file mode 100644 index 00000000..a277bbf9 --- /dev/null +++ b/tconstruct/blocks/EssenceExtractor.java @@ -0,0 +1,182 @@ +package tconstruct.blocks; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import net.minecraftforge.common.FakePlayer; +import tconstruct.blocks.logic.EssenceExtractorLogic; +import tconstruct.common.TContent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class EssenceExtractor extends BlockContainer +{ + @SideOnly(Side.CLIENT) + private Icon field_94461_a; + @SideOnly(Side.CLIENT) + private Icon field_94460_b; + + public EssenceExtractor(int par1) + { + super(par1, Material.rock); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F); + this.setLightOpacity(0); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + @SideOnly(Side.CLIENT) + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + super.randomDisplayTick(par1World, par2, par3, par4, par5Random); + + for (int l = par2 - 2; l <= par2 + 2; ++l) + { + for (int i1 = par4 - 2; i1 <= par4 + 2; ++i1) + { + if (l > par2 - 2 && l < par2 + 2 && i1 == par4 - 1) + { + i1 = par4 + 2; + } + + if (par5Random.nextInt(16) == 0) + { + for (int j1 = par3; j1 <= par3 + 1; ++j1) + { + if (par1World.getBlockId(l, j1, i1) == Block.bookShelf.blockID) + { + if (!par1World.isAirBlock((l - par2) / 2 + par2, j1, (i1 - par4) / 2 + par4)) + { + break; + } + + par1World.spawnParticle("enchantmenttable", (double)par2 + 0.5D, (double)par3 + 2.0D, (double)par4 + 0.5D, (double)((float)(l - par2) + par5Random.nextFloat()) - 0.5D, (double)((float)(j1 - par3) - par5Random.nextFloat() - 1.0F), (double)((float)(i1 - par4) + par5Random.nextFloat()) - 0.5D); + } + } + } + } + } + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + @SideOnly(Side.CLIENT) + + /** + * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata + */ + public Icon getIcon(int par1, int par2) + { + return par1 == 0 ? this.field_94460_b : (par1 == 1 ? this.field_94461_a : this.blockIcon); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World par1World) + { + return new EssenceExtractorLogic(); + } + + /* Right-click to form a crystal */ + + @Override + public void onBlockClicked (World world, int x, int y, int z, EntityPlayer player) + { + if (world.isRemote) + { + return; + } + else + { + EssenceExtractorLogic logic = (EssenceExtractorLogic)world.getBlockTileEntity(x, y, z); + int amount = logic.removeEssence(); + if (amount > 0) + { + ItemStack crystal = new ItemStack(TContent.essenceCrystal, 1); + NBTTagCompound tags = new NBTTagCompound(); + tags.setInteger("Essence", amount); + crystal.setTagCompound(tags); + + EntityItem entityitem = new EntityItem(world, player.posX, player.posY - 1.0D, player.posZ, crystal); + world.spawnEntityInWorld(entityitem); + if (!(player instanceof FakePlayer)) + entityitem.onCollideWithPlayer(player); + } + } + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) + { + if (par1World.isRemote) + { + return true; + } + else + { + EssenceExtractorLogic logic = (EssenceExtractorLogic)par1World.getBlockTileEntity(x, y, z); + logic.addEssence(player); + logic.getEssenceMessage(player); + return true; + } + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving, ItemStack par6ItemStack) + { + super.onBlockPlacedBy(par1World, par2, par3, par4, par5EntityLiving, par6ItemStack); + + if (par6ItemStack.hasDisplayName()) + { + ((EssenceExtractorLogic)par1World.getBlockTileEntity(par2, par3, par4)).func_94134_a(par6ItemStack.getDisplayName()); + } + } + + @SideOnly(Side.CLIENT) + + /** + * When this method is called, your block should register all the icons it needs with the given IconRegister. This + * is the only chance you get to register icons. + */ + public void registerIcons(IconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon("tinker:extractor_side"); + this.field_94461_a = par1IconRegister.registerIcon("tinker:extractor_top"); + this.field_94460_b = par1IconRegister.registerIcon("tinker:extractor_bottom"); + } +} diff --git a/tconstruct/blocks/SoilBlock.java b/tconstruct/blocks/SoilBlock.java index 0504c999..2b38c8fa 100644 --- a/tconstruct/blocks/SoilBlock.java +++ b/tconstruct/blocks/SoilBlock.java @@ -9,7 +9,7 @@ import net.minecraft.world.World; public class SoilBlock extends TConstructBlock { - static String[] soilTypes = new String[] { "slimesand", "grout", "slimesandblue", "graveyardsoil", "consecratedsoil" }; + static String[] soilTypes = new String[] { "slimesand", "grout", "slimesandblue", "graveyardsoil", "consecratedsoil", "slimedirt_blue" }; public SoilBlock(int id) { diff --git a/tconstruct/blocks/TMetalBlock.java b/tconstruct/blocks/TMetalBlock.java index 95d5c332..33c5443b 100644 --- a/tconstruct/blocks/TMetalBlock.java +++ b/tconstruct/blocks/TMetalBlock.java @@ -8,7 +8,7 @@ public class TMetalBlock extends TConstructBlock { static String[] metalTypes = new String[] { "compressed_cobalt", "compressed_ardite", "compressed_manyullyn", "compressed_copper", "compressed_bronze", "compressed_tin", "compressed_aluminum", - "compressed_alubrass", "compressed_alumite", "compressed_steel" }; + "compressed_alubrass", "compressed_alumite", "compressed_steel", "compressed_ender" }; public TMetalBlock(int id, Material material, float hardness) { diff --git a/tconstruct/blocks/logic/EssenceExtractorLogic.java b/tconstruct/blocks/logic/EssenceExtractorLogic.java new file mode 100644 index 00000000..7a95a406 --- /dev/null +++ b/tconstruct/blocks/logic/EssenceExtractorLogic.java @@ -0,0 +1,245 @@ +package tconstruct.blocks.logic; + +import java.text.DecimalFormat; +import java.util.Random; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntityEnchantmentTable; + +public class EssenceExtractorLogic extends TileEntityEnchantmentTable +{ + /** Used by the render to make the book 'bounce' */ + public int tickCount; + + /** Value used for determining how the page flip should look. */ + public float pageFlip; + + /** The last tick's pageFlip value. */ + public float pageFlipPrev; + public float field_70373_d; + public float field_70374_e; + + /** The amount that the book is open. */ + public float bookSpread; + + /** The amount that the book is open. */ + public float bookSpreadPrev; + public float bookRotation2; + public float bookRotationPrev; + public float bookRotation; + private static Random rand = new Random(); + private String field_94136_s; + + private int essenceAmount; + static DecimalFormat df = new DecimalFormat("##.##"); + + /*public EssenceExtractorLogic() + { + df.setRoundingMode(RoundingMode.DOWN); + }*/ + + /** + * Writes a tile entity to NBT. + */ + public void writeToNBT (NBTTagCompound tags) + { + super.writeToNBT(tags); + + if (this.func_94135_b()) + { + tags.setString("CustomName", this.field_94136_s); + } + tags.setInteger("Essence", essenceAmount); + } + + /** + * Reads a tile entity from NBT. + */ + public void readFromNBT (NBTTagCompound tags) + { + super.readFromNBT(tags); + + if (tags.hasKey("CustomName")) + { + this.field_94136_s = tags.getString("CustomName"); + } + + essenceAmount = tags.getInteger("Essence"); + } + + /** + * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count + * ticks and creates a new spawn inside its implementation. + */ + public void updateEntity () + { + super.updateEntity(); + this.bookSpreadPrev = this.bookSpread; + this.bookRotationPrev = this.bookRotation2; + EntityPlayer entityplayer = this.worldObj.getClosestPlayer((double) ((float) this.xCoord + 0.5F), (double) ((float) this.yCoord + 0.5F), (double) ((float) this.zCoord + 0.5F), 3.0D); + + if (entityplayer != null) + { + double d0 = entityplayer.posX - (double) ((float) this.xCoord + 0.5F); + double d1 = entityplayer.posZ - (double) ((float) this.zCoord + 0.5F); + this.bookRotation = (float) Math.atan2(d1, d0); + this.bookSpread += 0.1F; + + if (this.bookSpread < 0.5F || rand.nextInt(40) == 0) + { + float f = this.field_70373_d; + + do + { + this.field_70373_d += (float) (rand.nextInt(4) - rand.nextInt(4)); + } while (f == this.field_70373_d); + } + } + else + { + this.bookRotation += 0.02F; + this.bookSpread -= 0.1F; + } + + while (this.bookRotation2 >= (float) Math.PI) + { + this.bookRotation2 -= ((float) Math.PI * 2F); + } + + while (this.bookRotation2 < -(float) Math.PI) + { + this.bookRotation2 += ((float) Math.PI * 2F); + } + + while (this.bookRotation >= (float) Math.PI) + { + this.bookRotation -= ((float) Math.PI * 2F); + } + + while (this.bookRotation < -(float) Math.PI) + { + this.bookRotation += ((float) Math.PI * 2F); + } + + float f1; + + for (f1 = this.bookRotation - this.bookRotation2; f1 >= (float) Math.PI; f1 -= ((float) Math.PI * 2F)) + { + ; + } + + while (f1 < -(float) Math.PI) + { + f1 += ((float) Math.PI * 2F); + } + + this.bookRotation2 += f1 * 0.4F; + + if (this.bookSpread < 0.0F) + { + this.bookSpread = 0.0F; + } + + if (this.bookSpread > 1.0F) + { + this.bookSpread = 1.0F; + } + + ++this.tickCount; + this.pageFlipPrev = this.pageFlip; + float f2 = (this.field_70373_d - this.pageFlip) * 0.4F; + float f3 = 0.2F; + + if (f2 < -f3) + { + f2 = -f3; + } + + if (f2 > f3) + { + f2 = f3; + } + + this.field_70374_e += (f2 - this.field_70374_e) * 0.9F; + this.pageFlip += this.field_70374_e; + } + + public String func_94133_a () + { + return this.func_94135_b() ? this.field_94136_s : "container.enchant"; + } + + public boolean func_94135_b () + { + return this.field_94136_s != null && this.field_94136_s.length() > 0; + } + + public void func_94134_a (String par1Str) + { + this.field_94136_s = par1Str; + } + + public void addEssence (EntityPlayer player) + { + int amount = player.experienceTotal; + essenceAmount += amount; + player.addExperienceLevel(-player.experienceLevel - 1); + } + + public int removeEssence() + { + int amount = this.essenceAmount; + this.essenceAmount = 0; + return amount; + } + + public void getEssenceMessage (EntityPlayer player) + { + player.addChatMessage("Total Essence: " + this.essenceAmount); + player.addChatMessage("Stored Levels: " + getEssencelevels(this.essenceAmount)); + } + + public static String getEssencelevels (int essence) + { + if (essence < 255) //0-14 + { + float ret = essence / 17f; + return String.valueOf(df.format(ret)); + } + else if (essence < 825) + { + int amount = essence - 255; + int levels = 15; + int offset = 3; + + int sub = 17 + offset; + while (amount - sub >= 0) + { + amount -= sub; + sub += offset; + levels++; + } + + float ret = levels + amount / (float) sub; + return String.valueOf(df.format(ret)); + } + else + { + int amount = essence - 825; + int levels = 30; + int offset = 7; + + int sub = 62 + offset; + while (amount - sub >= 0) + { + amount -= sub; + sub += offset; + levels++; + } + + float ret = levels + amount / (float) sub; + return String.valueOf(df.format(ret)); + } + } +} diff --git a/tconstruct/blocks/slime/SlimeFluid.java b/tconstruct/blocks/slime/SlimeFluid.java new file mode 100644 index 00000000..831e75ab --- /dev/null +++ b/tconstruct/blocks/slime/SlimeFluid.java @@ -0,0 +1,59 @@ +package tconstruct.blocks.slime; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import net.minecraftforge.fluids.BlockFluidClassic; +import net.minecraftforge.fluids.Fluid; +import tconstruct.entity.BlueSlime; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SlimeFluid extends BlockFluidClassic +{ + Icon stillIcon; + Icon flowIcon; + public SlimeFluid(int id, Fluid fluid, Material material) + { + super(id, fluid, material); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons (IconRegister iconRegister) + { + stillIcon = iconRegister.registerIcon("tinker:slime_blue"); + flowIcon = iconRegister.registerIcon("tinker:slime_blue_flow"); + } + + @Override + @SideOnly(Side.CLIENT) + public Icon getIcon (int side, int meta) + { + if (side == 0 || side == 1) + return stillIcon; + return flowIcon; + } + + public void updateTick(World world, int x, int y, int z, Random rand) + { + super.updateTick(world, x, y, z, rand); + if (rand.nextInt(100) == 0 && world.checkNoEntityCollision(AxisAlignedBB.getBoundingBox(x - 1, y - 1, z - 1, x + 2, y + 2, z + 2)) ) + { + BlueSlime entityslime = new BlueSlime(world); + entityslime.setPosition((double)x + 0.5D, (double)y + 1.5D, (double)z + 0.5D); + world.spawnEntityInWorld(entityslime); + } + } + + public void getSubBlocks (int par1, CreativeTabs par2CreativeTabs, List par3List) + { + + } +} diff --git a/tconstruct/blocks/slime/SlimeGel.java b/tconstruct/blocks/slime/SlimeGel.java new file mode 100644 index 00000000..25fa7dd4 --- /dev/null +++ b/tconstruct/blocks/slime/SlimeGel.java @@ -0,0 +1,76 @@ +package tconstruct.blocks.slime; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import tconstruct.blocks.TConstructBlock; +import tconstruct.library.TConstructRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SlimeGel extends TConstructBlock +{ + public SlimeGel(int id) + { + super(id, Material.sponge, 0.5f, new String[] { "slimeblock_blue", "slimeblock_green", "slimeblock_purple" }); + setCreativeTab(TConstructRegistry.blockTab); + } + + public boolean getEnableStats () + { + return false; + } + + public int getMobilityFlag () + { + return 0; + } + + public int damageDropped (int meta) + { + return meta; + } + + @Override + public void onEntityCollidedWithBlock (World world, int x, int y, int z, Entity entity) + { + if (entity.motionY < 0) + { + if (entity.motionY < -0.08F) + { + Block var9 = Block.blocksList[this.blockID]; + world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, var9.stepSound.getStepSound(), (var9.stepSound.getVolume()) / 2.0F, var9.stepSound.getPitch() * 0.65F); + } + entity.motionY *= -1.2F; + } + entity.fallDistance = 0; + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool (World world, int x, int y, int z) + { + return AxisAlignedBB.getBoundingBox(x, y, z, (double) x + 1.0D, (double) y + 0.625D, (double) z + 1.0D); + } + + @SideOnly(Side.CLIENT) + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + public void getSubBlocks (int par1, CreativeTabs par2CreativeTabs, List par3List) + { + par3List.add(new ItemStack(par1, 1, 0)); + par3List.add(new ItemStack(par1, 1, 1)); + //par3List.add(new ItemStack(par1, 1, 2)); + } + + public boolean canSustainLeaves (World world, int x, int y, int z) + { + return true; + } +} diff --git a/tconstruct/blocks/slime/SlimeGrass.java b/tconstruct/blocks/slime/SlimeGrass.java new file mode 100644 index 00000000..f491b031 --- /dev/null +++ b/tconstruct/blocks/slime/SlimeGrass.java @@ -0,0 +1,127 @@ +package tconstruct.blocks.slime; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import net.minecraftforge.common.EnumPlantType; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.common.IPlantable; +import tconstruct.common.TContent; +import tconstruct.library.TConstructRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SlimeGrass extends Block +{ + public String[] textureNames = { "slimegrass_green_top", "slimedirt_blue", "slimegrass_green_blue_side", "slimegrass_green_dirt_side" };//green, purple + public Icon[] icons; + + public SlimeGrass(int id) + { + super(id, Material.grass); + setHardness(0.6f); + this.setTickRandomly(true); + this.setCreativeTab(TConstructRegistry.blockTab); + } + + @Override + public int damageDropped (int meta) + { + return meta; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons (IconRegister iconRegister) + { + this.icons = new Icon[textureNames.length]; + + for (int i = 0; i < this.icons.length; ++i) + { + this.icons[i] = iconRegister.registerIcon("tinker:" + textureNames[i]); + } + } + + @Override + @SideOnly(Side.CLIENT) + public Icon getIcon (int side, int meta) + { + if (side == 0) + { + return meta % 2 == 1 ? Block.dirt.getIcon(0, 0) : icons[1]; + } + else if (side == 1) + { + return icons[0]; + } + else + { + return icons[meta + 2]; + } + } + + @Override + public void getSubBlocks (int id, CreativeTabs tab, List list) + { + for (int iter = 0; iter < 1; iter++) + { + list.add(new ItemStack(id, 1, iter)); + } + } + + @Override + public boolean canSustainPlant (World world, int x, int y, int z, ForgeDirection direction, IPlantable plant) + { + EnumPlantType plantType = plant.getPlantType(world, x, y + 1, z); + return plantType == EnumPlantType.Plains && plant.getPlantID(world, x, y+1, z) != Block.tallGrass.blockID; + } + + public void onPlantGrow(World world, int x, int y, int z, int sourceX, int sourceY, int sourceZ) + { + world.setBlock(x, y, z, TContent.craftedSoil.blockID, 5, 3); + } + + public void updateTick (World par1World, int par2, int par3, int par4, Random par5Random) + { + if (!par1World.isRemote) + { + if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && par1World.getBlockLightOpacity(par2, par3 + 1, par4) > 2) + { + par1World.setBlock(par2, par3, par4, TContent.craftedSoil.blockID, 5, 3); + } + else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) + { + for (int l = 0; l < 4; ++l) + { + int posX = par2 + par5Random.nextInt(3) - 1; + int posY = par3 + par5Random.nextInt(5) - 3; + int posZ = par4 + par5Random.nextInt(3) - 1; + int l1 = par1World.getBlockId(posX, posY + 1, posZ); + + if (par1World.getBlockLightValue(posX, posY + 1, posZ) >= 4 && par1World.getBlockLightOpacity(posX, posY + 1, posZ) <= 2) + { + int blockID = par1World.getBlockId(posX, posY, posZ); + if (blockID == Block.dirt.blockID) + { + par1World.setBlock(posX, posY, posZ, this.blockID, 1, 3); + return; + } + int blockMeta = par1World.getBlockMetadata(posX, posY, posZ); + if (blockID == TContent.craftedSoil.blockID) + { + if (blockMeta == 5) + par1World.setBlock(posX, posY, posZ, this.blockID, 0, 3); + } + } + } + } + } + } +} diff --git a/tconstruct/blocks/slime/SlimeLeaves.java b/tconstruct/blocks/slime/SlimeLeaves.java new file mode 100644 index 00000000..4ad70295 --- /dev/null +++ b/tconstruct/blocks/slime/SlimeLeaves.java @@ -0,0 +1,144 @@ +package tconstruct.blocks.slime; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.BlockLeaves; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import tconstruct.common.TContent; +import tconstruct.library.TConstructRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SlimeLeaves extends BlockLeaves +{ + private static final String[] fastLeaves = new String[] { "slimeleaves_blue_fast" }; + private static final String[] fancyLeaves = new String[] { "slimeleaves_blue_fancy" }; + @SideOnly(Side.CLIENT) + private Icon[] fastIcons; + @SideOnly(Side.CLIENT) + private Icon[] fancyIcons; + + public SlimeLeaves(int id) + { + super(id); + setCreativeTab(TConstructRegistry.blockTab); + setLightOpacity(1); + } + + @SideOnly(Side.CLIENT) + public int getBlockColor () + { + return 0xffffff; + } + + @SideOnly(Side.CLIENT) + public int getRenderColor (int par1) + { + return 0xffffff; + } + + @SideOnly(Side.CLIENT) + public int colorMultiplier (IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + { + return 0xffffff; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerIcons (IconRegister iconRegister) + { + this.fastIcons = new Icon[fastLeaves.length]; + this.fancyIcons = new Icon[fancyLeaves.length]; + + for (int i = 0; i < this.fastIcons.length; i++) + { + this.fastIcons[i] = iconRegister.registerIcon("tinker:" + fastLeaves[i] ); + this.fancyIcons[i] = iconRegister.registerIcon("tinker:" + fancyLeaves[i]); + } + } + + public Icon getIcon (int side, int meta) + { + int tex = meta % 4; + + if (this.graphicsLevel) + return fancyIcons[tex]; + else + return fastIcons[tex]; + } + + @Override + public void getSubBlocks (int id, CreativeTabs tab, List list) + { + for (int iter = 0; iter < fastIcons.length; iter++) + { + list.add(new ItemStack(id, 1, iter)); + } + } + + /* Drops */ + + + /** + * Returns the ID of the items to drop on destruction. + */ + public int idDropped(int par1, Random par2Random, int par3) + { + return TContent.slimeSapling.blockID; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int fortune) + { + if (!world.isRemote) + { + int dropChance = 35; + + /*if ((meta & 3) == 3) + { + j1 = 40; + }*/ + + if (fortune > 0) + { + dropChance -= 2 << fortune; + + if (dropChance < 15) + { + dropChance = 15; + } + } + + if (world.rand.nextInt(dropChance) == 0) + { + int k1 = this.idDropped(meta, world.rand, fortune); + this.dropBlockAsItem_do(world, x, y, z, new ItemStack(k1, 1, this.damageDropped(meta))); + } + + dropChance = 80; + + if (fortune > 0) + { + dropChance -= 10 << fortune; + + if (dropChance < 20) + { + dropChance = 20; + } + } + + if ((meta & 3) == 0 && world.rand.nextInt(dropChance) == 0) + { + this.dropBlockAsItem_do(world, x, y, z, new ItemStack(TContent.strangeFood, 1, 0)); + } + } + } +} diff --git a/tconstruct/blocks/slime/SlimeSapling.java b/tconstruct/blocks/slime/SlimeSapling.java new file mode 100644 index 00000000..8cb0b859 --- /dev/null +++ b/tconstruct/blocks/slime/SlimeSapling.java @@ -0,0 +1,127 @@ +package tconstruct.blocks.slime; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockSapling; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; +import tconstruct.common.TContent; +import tconstruct.library.TConstructRegistry; +import tconstruct.worldgen.SlimeTreeGen; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SlimeSapling extends BlockSapling +{ + public Icon[] icons; + public String[] textureNames = new String[] { "blue" }; + + public SlimeSapling(int id) + { + super(id); + float f = 0.4F; + setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f); + this.setHardness(0.0F); + this.setStepSound(Block.soundGrassFootstep); + this.setCreativeTab(TConstructRegistry.blockTab); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons (IconRegister iconRegister) + { + this.icons = new Icon[textureNames.length]; + + for (int i = 0; i < this.icons.length; ++i) + { + this.icons[i] = iconRegister.registerIcon("tinker:slimesapling_" + textureNames[i]); + } + } + + public boolean canThisPlantGrowOnThisBlockID (int id) + { + return id == Block.grass.blockID || id == Block.dirt.blockID || id == TContent.slimeGrass.blockID || id == TContent.craftedSoil.blockID; + } + + public void updateTick (World world, int x, int y, int z, Random random) + { + if (world.isRemote) + { + return; + } + super.updateTick(world, x, y, z, random); + int md = world.getBlockMetadata(x, y, z); + if (random.nextInt(10) == 0 && world.getBlockLightValue(x, y + 1, z) >= 9) + { + if ((md & 8) == 0) + world.setBlockMetadataWithNotify(x, y, z, md | 8, 4); + + else + growTree(world, x, y, z, random); + } + } + + @Override + @SideOnly(Side.CLIENT) + public Icon getIcon (int side, int meta) + { + return icons[meta % 8]; + } + + @Override + public void markOrGrowMarked (World world, int x, int y, int z, Random random) + { + boneFertilize(world, x, y, z, random, null); + } + + public boolean boneFertilize (World world, int x, int y, int z, Random random, EntityPlayer player) + { + int meta = world.getBlockMetadata(x, y, z); + + if (meta % 8 == 0 && (player == null || !player.capabilities.isCreativeMode)) + return false; + + if ((meta & 8) == 0) + { + world.setBlockMetadataWithNotify(x, y, z, meta | 8, 4); + } + else + { + this.growTree(world, x, y, z, random); + } + + return true; + } + + public void growTree (World world, int x, int y, int z, Random random) + { + int md = world.getBlockMetadata(x, y, z) % 8; + world.setBlock(x, y, z, 0); + WorldGenerator obj = null; + + obj = new SlimeTreeGen(true, 5, 4, 1, 0); + + if (!(obj.generate(world, random, x, y, z))) + world.setBlock(x, y, z, blockID, md + 8, 3); + } + + public int damageDropped (int i) + { + return i % 8; + } + + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks (int par1, CreativeTabs par2CreativeTabs, List par3List) + { + for (int i = 0; i < 1; i++) + par3List.add(new ItemStack(par1, 1, i)); + } +} diff --git a/tconstruct/blocks/slime/SlimeTallGrass.java b/tconstruct/blocks/slime/SlimeTallGrass.java new file mode 100644 index 00000000..f76a7bb2 --- /dev/null +++ b/tconstruct/blocks/slime/SlimeTallGrass.java @@ -0,0 +1,131 @@ +package tconstruct.blocks.slime; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import net.minecraft.block.BlockFlower; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.IShearable; +import tconstruct.library.TConstructRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SlimeTallGrass extends BlockFlower implements IShearable +{ + private static final String[] grassTypes = new String[] {"slimegrass_blue_tall"}; + @SideOnly(Side.CLIENT) + private Icon[] iconArray; + + public SlimeTallGrass(int par1) + { + super(par1, Material.vine); + float f = 0.4F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f); + setCreativeTab(TConstructRegistry.blockTab); + } + + @SideOnly(Side.CLIENT) + + /** + * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata + */ + public Icon getIcon(int side, int meta) + { + /*if (meta >= this.iconArray.length) + { + meta = 0; + }*/ + + return this.iconArray[meta]; + } + + /** + * Returns the ID of the items to drop on destruction. + */ + public int idDropped(int par1, Random par2Random, int par3) + { + return -1; + } + + /** + * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). + */ + public int quantityDroppedWithBonus(int par1, Random par2Random) + { + return 1 + par2Random.nextInt(par1 * 2 + 1); + } + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World par1World, int par2, int par3, int par4) + { + return par1World.getBlockMetadata(par2, par3, par4); + } + + @SideOnly(Side.CLIENT) + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) + { + for (int j = 0; j < 1; ++j) + { + par3List.add(new ItemStack(par1, 1, j)); + } + } + + @SideOnly(Side.CLIENT) + + /** + * When this method is called, your block should register all the icons it needs with the given IconRegister. This + * is the only chance you get to register icons. + */ + public void registerIcons(IconRegister par1IconRegister) + { + this.iconArray = new Icon[grassTypes.length]; + + for (int i = 0; i < this.iconArray.length; ++i) + { + this.iconArray[i] = par1IconRegister.registerIcon("tinker:"+grassTypes[i]); + } + } + + @Override + public ArrayList getBlockDropped(World world, int x, int y, int z, int meta, int fortune) + { + ArrayList ret = new ArrayList(); + if (world.rand.nextInt(8) != 0) + { + return ret; + } + + ItemStack item = ForgeHooks.getGrassSeed(world); + if (item != null) + { + ret.add(item); + } + return ret; + } + + @Override + public boolean isShearable(ItemStack item, World world, int x, int y, int z) + { + return true; + } + + @Override + public ArrayList onSheared(ItemStack item, World world, int x, int y, int z, int fortune) + { + ArrayList ret = new ArrayList(); + ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z))); + return ret; + } +} diff --git a/tconstruct/client/StepSoundSlime.java b/tconstruct/client/StepSoundSlime.java new file mode 100644 index 00000000..54d83c45 --- /dev/null +++ b/tconstruct/client/StepSoundSlime.java @@ -0,0 +1,30 @@ +package tconstruct.client; + +import net.minecraft.block.StepSound; + +public class StepSoundSlime extends StepSound +{ + + public StepSoundSlime(String par1Str, float par2, float par3) + { + super(par1Str, par2, par3); + // TODO Auto-generated constructor stub + } + + /** + * Used when a block breaks, EXA: Player break, Shep eating grass, etc.. + */ + public String getBreakSound() + { + return this.stepSoundName + ".big"; + } + + /** + * Used when a entity walks over, or otherwise interacts with the block. + */ + public String getStepSound() + { + return this.stepSoundName + ".small"; + } + +} diff --git a/tconstruct/client/TClientEvents.java b/tconstruct/client/TClientEvents.java index fbb03516..294d0861 100644 --- a/tconstruct/client/TClientEvents.java +++ b/tconstruct/client/TClientEvents.java @@ -40,7 +40,7 @@ public class TClientEvents boolean initSounds; - /*@ForgeSubscribe + @ForgeSubscribe public void onSound (SoundLoadEvent event) { if (!initSounds) @@ -59,7 +59,7 @@ public class TClientEvents System.err.println("[TConstruct] Failed to register one or more sounds"); } } - }*/ + } /* Liquids */ @ForgeSubscribe diff --git a/tconstruct/client/TProxyClient.java b/tconstruct/client/TProxyClient.java index 189c1ee7..384f5cad 100644 --- a/tconstruct/client/TProxyClient.java +++ b/tconstruct/client/TProxyClient.java @@ -2,1082 +2,859 @@ package tconstruct.client; import java.io.InputStream; import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; +import java.util.*; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.gui.inventory.GuiInventory; -import net.minecraft.client.model.ModelSlime; -import net.minecraft.client.particle.EntityAuraFX; -import net.minecraft.client.particle.EntityBreakingFX; -import net.minecraft.client.particle.EntityBubbleFX; -import net.minecraft.client.particle.EntityCloudFX; -import net.minecraft.client.particle.EntityCritFX; -import net.minecraft.client.particle.EntityDropParticleFX; -import net.minecraft.client.particle.EntityEnchantmentTableParticleFX; -import net.minecraft.client.particle.EntityExplodeFX; -import net.minecraft.client.particle.EntityFX; -import net.minecraft.client.particle.EntityFireworkSparkFX; -import net.minecraft.client.particle.EntityFlameFX; -import net.minecraft.client.particle.EntityFootStepFX; -import net.minecraft.client.particle.EntityHeartFX; -import net.minecraft.client.particle.EntityHugeExplodeFX; -import net.minecraft.client.particle.EntityLargeExplodeFX; -import net.minecraft.client.particle.EntityLavaFX; -import net.minecraft.client.particle.EntityNoteFX; -import net.minecraft.client.particle.EntityPortalFX; -import net.minecraft.client.particle.EntityReddustFX; -import net.minecraft.client.particle.EntitySmokeFX; -import net.minecraft.client.particle.EntitySnowShovelFX; -import net.minecraft.client.particle.EntitySpellParticleFX; -import net.minecraft.client.particle.EntitySplashFX; -import net.minecraft.client.particle.EntitySuspendFX; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.settings.GameSettings; -import net.minecraft.client.settings.KeyBinding; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import net.minecraftforge.client.MinecraftForgeClient; -import net.minecraftforge.common.MinecraftForge; +import javax.xml.parsers.*; import org.lwjgl.opengl.GL11; import org.w3c.dom.Document; +import com.google.common.collect.Lists; + +import cpw.mods.fml.client.registry.*; +import cpw.mods.fml.common.registry.*; +import cpw.mods.fml.relauncher.Side; + import tconstruct.TConstruct; -import tconstruct.blocks.logic.CastingBasinLogic; -import tconstruct.blocks.logic.CastingTableLogic; -import tconstruct.blocks.logic.CraftingStationLogic; -import tconstruct.blocks.logic.DrawbridgeLogic; -import tconstruct.blocks.logic.DryingRackLogic; -import tconstruct.blocks.logic.FrypanLogic; -import tconstruct.blocks.logic.GlowstoneAggregator; -import tconstruct.blocks.logic.PartCrafterLogic; -import tconstruct.blocks.logic.PatternChestLogic; -import tconstruct.blocks.logic.SmelteryLogic; -import tconstruct.blocks.logic.StencilTableLogic; -import tconstruct.blocks.logic.ToolForgeLogic; -import tconstruct.blocks.logic.ToolStationLogic; -import tconstruct.client.block.BarricadeRender; -import tconstruct.client.block.CastingBasinSpecialRender; -import tconstruct.client.block.CastingTableSpecialRenderer; -import tconstruct.client.block.CrystalBlockRender; -import tconstruct.client.block.DryingRackRender; -import tconstruct.client.block.DryingRackSpecialRender; -import tconstruct.client.block.FrypanRender; -import tconstruct.client.block.MachineRender; -import tconstruct.client.block.OreberryRender; -import tconstruct.client.block.PaneConnectedRender; -import tconstruct.client.block.PaneRender; -import tconstruct.client.block.PunjiRender; -import tconstruct.client.block.SearedRender; -import tconstruct.client.block.SmallFontRenderer; -import tconstruct.client.block.SmelteryRender; -import tconstruct.client.block.TableForgeRender; -import tconstruct.client.block.TableRender; -import tconstruct.client.block.TankRender; -import tconstruct.client.entity.CartRender; -import tconstruct.client.entity.CloneHeadModel; -import tconstruct.client.entity.CrystalGuardianRender; -import tconstruct.client.entity.CrystalRender; -import tconstruct.client.entity.FancyItemRender; -import tconstruct.client.entity.MiniGardyRender; -import tconstruct.client.entity.SlimeCloneRender; -import tconstruct.client.entity.SlimeRender; -import tconstruct.client.entity.projectile.ArrowRender; -import tconstruct.client.entity.projectile.DaggerRender; -import tconstruct.client.entity.projectile.LaunchedItemRender; -import tconstruct.client.gui.ArmorExtendedGui; -import tconstruct.client.gui.CraftingStationGui; -import tconstruct.client.gui.DrawbridgeGui; -import tconstruct.client.gui.FrypanGui; -import tconstruct.client.gui.GlowstoneAggregatorGui; -import tconstruct.client.gui.GuiManual; -import tconstruct.client.gui.InventoryTab; -import tconstruct.client.gui.KnapsackGui; -import tconstruct.client.gui.MiniGardyGui; -import tconstruct.client.gui.PartCrafterGui; -import tconstruct.client.gui.PatternChestGui; -import tconstruct.client.gui.SmelteryGui; -import tconstruct.client.gui.StencilTableGui; -import tconstruct.client.gui.ToolForgeGui; -import tconstruct.client.gui.ToolStationGui; -import tconstruct.client.pages.BlankPage; -import tconstruct.client.pages.BlockCastPage; -import tconstruct.client.pages.BookPage; -import tconstruct.client.pages.ContentsTablePage; -import tconstruct.client.pages.CraftingPage; -import tconstruct.client.pages.FurnacePage; -import tconstruct.client.pages.MaterialPage; -import tconstruct.client.pages.ModifierPage; -import tconstruct.client.pages.PicturePage; -import tconstruct.client.pages.SectionPage; -import tconstruct.client.pages.SidebarPage; -import tconstruct.client.pages.TextPage; -import tconstruct.client.pages.TitlePage; -import tconstruct.client.pages.ToolPage; -import tconstruct.common.TContent; -import tconstruct.common.TProxyCommon; -import tconstruct.entity.Automaton; -import tconstruct.entity.BlueSlime; -import tconstruct.entity.CartEntity; -import tconstruct.entity.Crystal; -import tconstruct.entity.FancyEntityItem; -import tconstruct.entity.MiniGardy; -import tconstruct.entity.SlimeClone; -import tconstruct.entity.projectile.ArrowEntity; -import tconstruct.entity.projectile.DaggerEntity; -import tconstruct.entity.projectile.LaunchedPotion; +import tconstruct.blocks.logic.*; +import tconstruct.client.block.*; +import tconstruct.client.entity.*; +import tconstruct.client.entity.projectile.*; +import tconstruct.client.gui.*; +import tconstruct.client.pages.*; +import tconstruct.common.*; +import tconstruct.entity.*; +import tconstruct.entity.projectile.*; import tconstruct.landmine.client.gui.GuiLandmine; import tconstruct.landmine.client.render.RenderLandmine; import tconstruct.landmine.inventory.ContainerLandmine; import tconstruct.landmine.tileentity.TileEntityLandmine; import tconstruct.library.TConstructRegistry; -import tconstruct.library.client.TConstructClientRegistry; -import tconstruct.library.client.ToolGuiElement; +import tconstruct.library.client.*; import tconstruct.library.crafting.ToolBuilder; import tconstruct.library.tools.ToolCore; -import tconstruct.util.player.ArmorExtended; -import tconstruct.util.player.KnapsackInventory; - -import com.google.common.collect.Lists; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.TickRegistry; -import cpw.mods.fml.common.registry.VillagerRegistry; -import cpw.mods.fml.relauncher.Side; - -public class TProxyClient extends TProxyCommon -{ - public static SmallFontRenderer smallFontRenderer; - public static Icon metalBall; - public static Minecraft mc; - public static RenderItem itemRenderer = new RenderItem(); - - public static ArmorExtended armorExtended = new ArmorExtended(); - public static KnapsackInventory knapsack = new KnapsackInventory(); - - @Override - public Object getClientGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z) - { - if (ID == stationGuiID) - return new ToolStationGui(player.inventory, (ToolStationLogic) world.getBlockTileEntity(x, y, z), world, x, y, z); - if (ID == partGuiID) - return new PartCrafterGui(player.inventory, (PartCrafterLogic) world.getBlockTileEntity(x, y, z), world, x, y, z); - if (ID == pchestGuiID) - return new PatternChestGui(player.inventory, (PatternChestLogic) world.getBlockTileEntity(x, y, z), world, x, y, z); - if (ID == frypanGuiID) - return new FrypanGui(player.inventory, (FrypanLogic) world.getBlockTileEntity(x, y, z), world, x, y, z); - if (ID == smelteryGuiID) - return new SmelteryGui(player.inventory, (SmelteryLogic) world.getBlockTileEntity(x, y, z), world, x, y, z); - if (ID == pshaperGuiID) - return new StencilTableGui(player.inventory, (StencilTableLogic) world.getBlockTileEntity(x, y, z), world, x, y, z); - if (ID == toolForge) - return new ToolForgeGui(player.inventory, (ToolForgeLogic) world.getBlockTileEntity(x, y, z), world, x, y, z); - if (ID == glowstoneAggregatorGui) - return new GlowstoneAggregatorGui(player.inventory, (GlowstoneAggregator) world.getBlockTileEntity(x, y, z), world, x, y, z); - if (ID == drawbridgeGui) - return new DrawbridgeGui(player.inventory, (DrawbridgeLogic) world.getBlockTileEntity(x, y, z), world, x, y, z); - if (ID == landmineGui) - return new GuiLandmine(new ContainerLandmine(player, (TileEntityLandmine) world.getBlockTileEntity(x, y, z))); - if (ID == craftingStationID) - return new CraftingStationGui(player.inventory, (CraftingStationLogic) world.getBlockTileEntity(x, y, z), x, y, z); - - if (ID == manualGuiID) - { - ItemStack stack = player.getCurrentEquippedItem(); - return new GuiManual(stack, TProxyClient.getManualFromStack(stack)); - } - if (ID == inventoryGui) - { - GuiInventory inventory = new GuiInventory(player); - addTabsToInventory(inventory); - return inventory; - } - if (ID == armorGuiID) - { - TProxyClient.armorExtended.init(Minecraft.getMinecraft().thePlayer); - return new ArmorExtendedGui(player.inventory, TProxyClient.armorExtended); - } - if (ID == knapsackGuiID) - { - TProxyClient.knapsack.init(Minecraft.getMinecraft().thePlayer); - return new KnapsackGui(player.inventory, TProxyClient.knapsack); - } - if (ID == miniGardyGui) - { - for (Object o : world.loadedEntityList) - { - Entity entity = (Entity) o; - if (entity.entityId == x) - { - return new MiniGardyGui(player.inventory, (MiniGardy) entity); - } - } - return null; - } - return null; - } - - public static void renderStandardInvBlock (RenderBlocks renderblocks, Block block, int meta) - { - Tessellator tessellator = Tessellator.instance; - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, -1F, 0.0F); - renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 1.0F, 0.0F); - renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 0.0F, -1F); - renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 0.0F, 1.0F); - renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(-1F, 0.0F, 0.0F); - renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(1.0F, 0.0F, 0.0F); - renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta)); - tessellator.draw(); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - } - - public static void renderInvBlockFace (RenderBlocks renderblocks, Block block, int meta) - { - Tessellator tessellator = Tessellator.instance; - GL11.glScalef(2f, 2f, 2f); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - GL11.glRotatef(45, 0, 1, 0); - GL11.glRotatef(60, 1, 0, 0); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, -1F, 0.0F); - renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 1.0F, 0.0F); - renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 0.0F, -1F); - renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 0.0F, 1.0F); - renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(-1F, 0.0F, 0.0F); - renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(1.0F, 0.0F, 0.0F); - renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta)); - tessellator.draw(); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - } - - public static void openInventoryGui () - { - //controlInstance.openInventoryGui(); - if (mc == null) - mc = Minecraft.getMinecraft(); - GuiInventory inventory = new GuiInventory(mc.thePlayer); - mc.displayGuiScreen(inventory); - addTabsToInventory(inventory); - } - - public static void addTabsToInventory (GuiContainer gui) - { - /*if (mc == null) - mc = Minecraft.getMinecraft();*/ - if (gui.getClass() == GuiInventory.class || classMatches(gui, "micdoodle8.mods.galacticraft.core.client.gui.GCCoreGuiInventory")) - { - try{ - Field guiLeft = GuiContainer.class.getDeclaredField("guiLeft"); - guiLeft.setAccessible(true); - int cornerX = (Integer)guiLeft.get(gui); - Field ySize = GuiContainer.class.getDeclaredField("ySize"); - ySize.setAccessible(true); - int cornerY = (gui.height - (Integer)ySize.get(gui)) / 2; - Field buttonList = GuiScreen.class.getDeclaredField("buttonList"); - buttonList.setAccessible(true); - ArrayList listOfButtons = (ArrayList)buttonList.get(gui); - listOfButtons.clear(); - - InventoryTab tab = new InventoryTab(2, cornerX, cornerY - 28, new ItemStack(Block.workbench), 0); - tab.enabled = false; - listOfButtons.add(tab); - tab = new InventoryTab(3, cornerX + 28, cornerY - 28, new ItemStack(Item.plateDiamond), 1); - listOfButtons.add(tab); - if (armorExtended.inventory[2] != null && armorExtended.inventory[2].getItem() == TContent.knapsack) - { - if (listOfButtons.size() < 3) - { - tab = new InventoryTab(4, cornerX + 56, cornerY - 28, new ItemStack(TContent.knapsack), 1); - listOfButtons.add(tab); - } - } - }catch(Exception e){ - e.printStackTrace(); - } - } - } - - public static boolean classMatches (Object paramObject, String paramString) - { - try - { - return paramObject.getClass().getName().equals(paramString); - } - catch (Exception localException) - { - return false; - } - } - - public void registerTickHandler () - { - TickRegistry.registerTickHandler(new TClientTickHandler(), Side.CLIENT); - //TickRegistry.registerTickHandler(new TimeTicker(), Side.CLIENT); - //TickRegistry.registerTickHandler(new TCommonTickHandler(), Side.CLIENT); - } - - /* Registers any rendering code. */ - public void registerRenderer () - { - Minecraft mc = Minecraft.getMinecraft(); - MinecraftForge.EVENT_BUS.register(new TClientEvents()); - smallFontRenderer = new SmallFontRenderer(mc.gameSettings, new ResourceLocation("font/default.png"), mc.renderEngine, false); - RenderingRegistry.registerBlockHandler(new TableRender()); - RenderingRegistry.registerBlockHandler(new TableForgeRender()); - RenderingRegistry.registerBlockHandler(new FrypanRender()); - RenderingRegistry.registerBlockHandler(new SmelteryRender()); - RenderingRegistry.registerBlockHandler(new TankRender()); - RenderingRegistry.registerBlockHandler(new SearedRender()); - //RenderingRegistry.registerBlockHandler(new GolemCoreRender()); - RenderingRegistry.registerBlockHandler(new OreberryRender()); - RenderingRegistry.registerBlockHandler(new BarricadeRender()); - RenderingRegistry.registerBlockHandler(new CrystalBlockRender()); - RenderingRegistry.registerBlockHandler(new MachineRender()); - RenderingRegistry.registerBlockHandler(new DryingRackRender()); - RenderingRegistry.registerBlockHandler(new PaneRender()); - RenderingRegistry.registerBlockHandler(new PaneConnectedRender()); - RenderingRegistry.registerBlockHandler(new RenderLandmine()); - RenderingRegistry.registerBlockHandler(new PunjiRender()); - //RenderingRegistry.registerBlockHandler(new BrickRender()); - - //Special Renderers - ClientRegistry.bindTileEntitySpecialRenderer(CastingTableLogic.class, new CastingTableSpecialRenderer()); - ClientRegistry.bindTileEntitySpecialRenderer(CastingBasinLogic.class, new CastingBasinSpecialRender()); - ClientRegistry.bindTileEntitySpecialRenderer(DryingRackLogic.class, new DryingRackSpecialRender()); - //ClientRegistry.bindTileEntitySpecialRenderer(GolemCoreLogic.class, new GolemCoreSpecialRender()); - - //Entities - RenderingRegistry.registerEntityRenderingHandler(FancyEntityItem.class, new FancyItemRender()); - RenderingRegistry.registerEntityRenderingHandler(BlueSlime.class, new SlimeRender(new ModelSlime(16), new ModelSlime(0), 0.25F)); - RenderingRegistry.registerEntityRenderingHandler(SlimeClone.class, new SlimeCloneRender(new CloneHeadModel(0), new CloneHeadModel(1f), 0.25F)); - - RenderingRegistry.registerEntityRenderingHandler(CartEntity.class, new CartRender()); - RenderingRegistry.registerEntityRenderingHandler(DaggerEntity.class, new DaggerRender()); - RenderingRegistry.registerEntityRenderingHandler(Crystal.class, new CrystalRender()); - // RenderingRegistry.registerEntityRenderingHandler(Skyla.class, new SkylaRender()); - RenderingRegistry.registerEntityRenderingHandler(MiniGardy.class, new MiniGardyRender()); - RenderingRegistry.registerEntityRenderingHandler(Automaton.class, new CrystalGuardianRender()); - RenderingRegistry.registerEntityRenderingHandler(LaunchedPotion.class, new LaunchedItemRender(Item.potion, 16384)); - RenderingRegistry.registerEntityRenderingHandler(ArrowEntity.class, new ArrowRender()); - //RenderingRegistry.registerEntityRenderingHandler(net.minecraft.entity.player.EntityPlayer.class, new PlayerArmorRender()); // <-- Works, woo! - - MinecraftForgeClient.registerItemRenderer(TContent.shortbow.itemID, new CustomBowRenderer()); - VillagerRegistry.instance().registerVillagerSkin(78943, new ResourceLocation("tinker", "textures/mob/villagertools.png")); - - addRenderMappings(); - addToolButtons(); - } - - public static Document diary; - public static Document volume1; - public static Document volume2; - public static Document smelter; - - public void readManuals () - { - DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); - diary = readManual("/assets/tinker/manuals/diary.xml", dbFactory); - volume1 = readManual("/assets/tinker/manuals/firstday.xml", dbFactory); - volume2 = readManual("/assets/tinker/manuals/materials.xml", dbFactory); - smelter = readManual("/assets/tinker/manuals/smeltery.xml", dbFactory); - initManualIcons(); - initManualRecipes(); - initManualPages(); - } - - Document readManual (String location, DocumentBuilderFactory dbFactory) - { - try - { - InputStream stream = TConstruct.class.getResourceAsStream(location); - DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); - Document doc = dBuilder.parse(stream); - doc.getDocumentElement().normalize(); - return doc; - } - catch (Exception e) - { - e.printStackTrace(); - return null; - } - } - - public void initManualIcons () - { - TConstructClientRegistry.registerManualIcon("smelterybook", new ItemStack(TContent.manualBook, 1, 2)); - TConstructClientRegistry.registerManualIcon("smeltery", new ItemStack(TContent.smeltery)); - TConstructClientRegistry.registerManualIcon("blankcast", new ItemStack(TContent.blankPattern, 1, 1)); - TConstructClientRegistry.registerManualIcon("castingtable", new ItemStack(TContent.searedBlock)); - //TConstructClientRegistry.registerManualIcon("liquidiron", new ItemStack(TContent.liquidMetalStill)); - TConstructClientRegistry.registerManualIcon("lavatank", new ItemStack(TContent.lavaTank)); - TConstructClientRegistry.registerManualIcon("searedbrick", new ItemStack(TContent.smeltery, 1, 2)); - TConstructClientRegistry.registerManualIcon("drain", new ItemStack(TContent.smeltery, 1, 1)); - TConstructClientRegistry.registerManualIcon("faucet", new ItemStack(TContent.searedBlock, 1, 1)); - TConstructClientRegistry.registerManualIcon("bronzeingot", new ItemStack(TContent.materials, 1, 13)); - TConstructClientRegistry.registerManualIcon("alubrassingot", new ItemStack(TContent.materials, 1, 14)); - TConstructClientRegistry.registerManualIcon("manyullyningot", new ItemStack(TContent.materials, 1, 5)); - TConstructClientRegistry.registerManualIcon("alumiteingot", new ItemStack(TContent.materials, 1, 15)); - TConstructClientRegistry.registerManualIcon("blankpattern", new ItemStack(TContent.blankPattern, 1, 0)); - TConstructClientRegistry.registerManualIcon("toolstation", new ItemStack(TContent.toolStationWood, 1, 0)); - TConstructClientRegistry.registerManualIcon("partcrafter", new ItemStack(TContent.toolStationWood, 1, 1)); - TConstructClientRegistry.registerManualIcon("patternchest", new ItemStack(TContent.toolStationWood, 1, 5)); - TConstructClientRegistry.registerManualIcon("stenciltable", new ItemStack(TContent.toolStationWood, 1, 10)); - TConstructClientRegistry.registerManualIcon("torch", new ItemStack(Block.torchWood)); - TConstructClientRegistry.registerManualIcon("sapling", new ItemStack(Block.sapling)); - TConstructClientRegistry.registerManualIcon("workbench", new ItemStack(Block.workbench)); - TConstructClientRegistry.registerManualIcon("coal", new ItemStack(Item.coal)); - - TConstructClientRegistry.registerManualIcon("obsidianingot", new ItemStack(TContent.materials, 1, 18)); - TConstructClientRegistry.registerManualIcon("lavacrystal", new ItemStack(TContent.materials, 1, 7)); - - //Tool Materials - TConstructClientRegistry.registerManualIcon("woodplanks", new ItemStack(Block.planks)); - TConstructClientRegistry.registerManualIcon("stoneblock", new ItemStack(Block.stone)); - TConstructClientRegistry.registerManualIcon("ironingot", new ItemStack(Item.ingotIron)); - TConstructClientRegistry.registerManualIcon("flint", new ItemStack(Item.flint)); - TConstructClientRegistry.registerManualIcon("cactus", new ItemStack(Block.cactus)); - TConstructClientRegistry.registerManualIcon("bone", new ItemStack(Item.bone)); - TConstructClientRegistry.registerManualIcon("obsidian", new ItemStack(Block.obsidian)); - TConstructClientRegistry.registerManualIcon("netherrack", new ItemStack(Block.netherrack)); - TConstructClientRegistry.registerManualIcon("blueslimecrystal", new ItemStack(TContent.materials, 1, 17)); - TConstructClientRegistry.registerManualIcon("slimecrystal", new ItemStack(TContent.materials, 1, 1)); - TConstructClientRegistry.registerManualIcon("paperstack", new ItemStack(TContent.materials, 1, 0)); - TConstructClientRegistry.registerManualIcon("cobaltingot", new ItemStack(TContent.materials, 1, 3)); - TConstructClientRegistry.registerManualIcon("arditeingot", new ItemStack(TContent.materials, 1, 4)); - TConstructClientRegistry.registerManualIcon("copperingot", new ItemStack(TContent.materials, 1, 9)); - TConstructClientRegistry.registerManualIcon("steelingot", new ItemStack(TContent.materials, 1, 16)); - - //Tool parts - TConstructClientRegistry.registerManualIcon("pickhead", new ItemStack(TContent.pickaxeHead, 1, 2)); - TConstructClientRegistry.registerManualIcon("shovelhead", new ItemStack(TContent.shovelHead, 1, 2)); - TConstructClientRegistry.registerManualIcon("axehead", new ItemStack(TContent.hatchetHead, 1, 2)); - TConstructClientRegistry.registerManualIcon("swordblade", new ItemStack(TContent.swordBlade, 1, 2)); - TConstructClientRegistry.registerManualIcon("pan", new ItemStack(TContent.frypanHead, 1, 2)); - TConstructClientRegistry.registerManualIcon("board", new ItemStack(TContent.signHead, 1, 2)); - TConstructClientRegistry.registerManualIcon("knifeblade", new ItemStack(TContent.knifeBlade, 1, 2)); - TConstructClientRegistry.registerManualIcon("chiselhead", new ItemStack(TContent.chiselHead, 1, 2)); - - TConstructClientRegistry.registerManualIcon("hammerhead", new ItemStack(TContent.hammerHead, 1, 2)); - TConstructClientRegistry.registerManualIcon("excavatorhead", new ItemStack(TContent.excavatorHead, 1, 2)); - TConstructClientRegistry.registerManualIcon("scythehead", new ItemStack(TContent.scytheBlade, 1, 2)); - TConstructClientRegistry.registerManualIcon("broadaxehead", new ItemStack(TContent.broadAxeHead, 1, 2)); - TConstructClientRegistry.registerManualIcon("largeswordblade", new ItemStack(TContent.largeSwordBlade, 1, 2)); - - TConstructClientRegistry.registerManualIcon("toolrod", new ItemStack(Item.stick)); - - TConstructClientRegistry.registerManualIcon("binding", new ItemStack(TContent.binding, 1, 4)); - TConstructClientRegistry.registerManualIcon("wideguard", new ItemStack(TContent.wideGuard, 1, 4)); - TConstructClientRegistry.registerManualIcon("handguard", new ItemStack(TContent.handGuard, 1, 4)); - TConstructClientRegistry.registerManualIcon("crossbar", new ItemStack(TContent.crossbar, 1, 4)); - - TConstructClientRegistry.registerManualIcon("toughrod", new ItemStack(TContent.toughRod, 1, 0)); - TConstructClientRegistry.registerManualIcon("toughbinding", new ItemStack(TContent.toughBinding, 1, 17)); - TConstructClientRegistry.registerManualIcon("largeplate", new ItemStack(TContent.heavyPlate, 1, 17)); - - //ToolIcons - TConstructClientRegistry.registerManualIcon("pickicon", - ToolBuilder.instance.buildTool(new ItemStack(TContent.pickaxeHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.binding, 1, 12), "")); - TConstructClientRegistry.registerManualIcon("shovelicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.shovelHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, "")); - TConstructClientRegistry.registerManualIcon("axeicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.hatchetHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, "")); - TConstructClientRegistry.registerManualIcon("mattockicon", - ToolBuilder.instance.buildTool(new ItemStack(TContent.hatchetHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.shovelHead, 1, 12), "")); - TConstructClientRegistry.registerManualIcon("swordicon", - ToolBuilder.instance.buildTool(new ItemStack(TContent.swordBlade, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.wideGuard, 1, 12), "")); - TConstructClientRegistry.registerManualIcon("longswordicon", - ToolBuilder.instance.buildTool(new ItemStack(TContent.swordBlade, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.handGuard, 1, 12), "")); - TConstructClientRegistry.registerManualIcon("rapiericon", - ToolBuilder.instance.buildTool(new ItemStack(TContent.swordBlade, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.crossbar, 1, 12), "")); - TConstructClientRegistry.registerManualIcon("daggerIcon", - ToolBuilder.instance.buildTool(new ItemStack(TContent.knifeBlade, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.crossbar, 1, 12), "")); - TConstructClientRegistry.registerManualIcon("frypanicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.frypanHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, "")); - TConstructClientRegistry.registerManualIcon("battlesignicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.signHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, "")); - TConstructClientRegistry.registerManualIcon("chiselicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.chiselHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, "")); - - TConstructClientRegistry.registerManualIcon("hammericon", ToolBuilder.instance.buildTool(new ItemStack(TContent.hammerHead, 1, 10), new ItemStack(TContent.toughRod, 1, 11), new ItemStack( - TContent.heavyPlate, 1, 12), new ItemStack(TContent.heavyPlate, 8), "")); - TConstructClientRegistry.registerManualIcon("lumbericon", ToolBuilder.instance.buildTool(new ItemStack(TContent.broadAxeHead, 1, 10), new ItemStack(TContent.toughRod, 1, 11), new ItemStack( - TContent.heavyPlate, 1, 12), new ItemStack(TContent.toughBinding, 8), "")); - TConstructClientRegistry.registerManualIcon("excavatoricon", ToolBuilder.instance.buildTool(new ItemStack(TContent.excavatorHead, 1, 10), new ItemStack(TContent.toughRod, 1, 11), - new ItemStack(TContent.heavyPlate, 1, 12), new ItemStack(TContent.toughBinding, 8), "")); - TConstructClientRegistry.registerManualIcon("scytheicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.scytheBlade, 1, 10), new ItemStack(TContent.toughRod, 1, 11), new ItemStack( - TContent.toughBinding, 1, 12), new ItemStack(TContent.toughRod, 8), "")); - TConstructClientRegistry.registerManualIcon("cleavericon", ToolBuilder.instance.buildTool(new ItemStack(TContent.largeSwordBlade, 1, 10), new ItemStack(TContent.toughRod, 1, 11), - new ItemStack(TContent.heavyPlate, 1, 12), new ItemStack(TContent.toughRod, 8), "")); - TConstructClientRegistry.registerManualIcon("battleaxeicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.broadAxeHead, 1, 10), new ItemStack(TContent.toughRod, 1, 11), - new ItemStack(TContent.broadAxeHead, 1, 12), new ItemStack(TContent.toughBinding, 8), "")); - } - - public void initManualRecipes () - { - ItemStack pattern = new ItemStack(TContent.blankPattern, 1, 0); - - ItemStack stick = new ItemStack(Item.stick, 1, 0); - ItemStack plank = new ItemStack(Block.planks, 1, 0); - ItemStack workbench = new ItemStack(Block.workbench, 1, 0); - ItemStack chest = new ItemStack(Block.chest, 1, 0); - ItemStack log = new ItemStack(Block.wood, 1, 0); - ItemStack mossycobble = new ItemStack(Block.cobblestoneMossy); - ItemStack netherrack = new ItemStack(Block.netherrack); - - ItemStack dirt = new ItemStack(Block.dirt, 1, 0); - ItemStack sand = new ItemStack(Block.sand, 1, 0); - ItemStack gravel = new ItemStack(Block.gravel, 1, 0); - ItemStack clay = new ItemStack(Item.clay, 1, 0); - ItemStack glass = new ItemStack(Block.glass, 1, 0); - ItemStack ironblock = new ItemStack(Block.blockIron, 1, 0); - - ItemStack grout = new ItemStack(TContent.craftedSoil, 2, 1); - ItemStack searedbrick = new ItemStack(TContent.materials, 1, 2); - ItemStack searedbrickBlock = new ItemStack(TContent.smeltery, 1, 2); - - ItemStack coal = new ItemStack(Item.coal); - ItemStack paper = new ItemStack(Item.paper); - ItemStack slimeball = new ItemStack(Item.slimeBall); - ItemStack slimyMud = new ItemStack(TContent.craftedSoil); - ItemStack blazerod = new ItemStack(Item.blazeRod); - ItemStack firecharge = new ItemStack(Item.fireballCharge); - ItemStack string = new ItemStack(Item.silk); - - ItemStack silkyCloth = new ItemStack(TContent.materials, 1, 25); - - ItemStack graveyardsoil = new ItemStack(TContent.craftedSoil, 1, 3); - ItemStack consecratedsoil = new ItemStack(TContent.craftedSoil, 1, 4); - - //TConstruct recipes - TConstructClientRegistry.registerManualSmallRecipe("patternbook1", new ItemStack(TContent.manualBook, 1, 0), new ItemStack(Item.paper), pattern, null, null); - TConstructClientRegistry.registerManualSmallRecipe("patternbook2", new ItemStack(TContent.manualBook, 1, 1), new ItemStack(TContent.manualBook, 1, 0), null, null, null); - TConstructClientRegistry.registerManualSmallRecipe("patternbook3", new ItemStack(TContent.manualBook, 1, 2), new ItemStack(TContent.manualBook, 1, 1), null, null, null); - TConstructClientRegistry.registerManualSmallRecipe("blankpattern", pattern, plank, stick, stick, plank); - TConstructClientRegistry.registerManualSmallRecipe("toolstation", new ItemStack(TContent.toolStationWood, 1, 0), null, pattern, null, workbench); - TConstructClientRegistry.registerManualSmallRecipe("partcrafter", new ItemStack(TContent.toolStationWood, 1, 1), null, pattern, null, log); - TConstructClientRegistry.registerManualSmallRecipe("patternchest", new ItemStack(TContent.toolStationWood, 1, 5), null, pattern, null, chest); - TConstructClientRegistry.registerManualSmallRecipe("stenciltable", new ItemStack(TContent.toolStationWood, 1, 10), null, pattern, null, plank); - TConstructClientRegistry.registerManualLargeRecipe("toolforge", new ItemStack(TContent.toolForge, 1, 0), searedbrickBlock, searedbrickBlock, searedbrickBlock, ironblock, new ItemStack( - TContent.toolStationWood, 1, 0), ironblock, ironblock, null, ironblock); - - TConstructClientRegistry.registerManualLargeRecipe("slimymud", slimyMud, null, slimeball, slimeball, null, slimeball, slimeball, null, dirt, sand); - TConstructClientRegistry.registerManualFurnaceRecipe("slimecrystal", new ItemStack(TContent.materials, 1, 1), slimyMud); - TConstructClientRegistry.registerManualSmallRecipe("paperstack", new ItemStack(TContent.materials, 1, 0), paper, paper, paper, paper); - TConstructClientRegistry.registerManualLargeRecipe("mossball", new ItemStack(TContent.materials, 1, 6), mossycobble, mossycobble, mossycobble, mossycobble, mossycobble, mossycobble, - mossycobble, mossycobble, mossycobble); - TConstructClientRegistry.registerManualLargeRecipe("lavacrystal", new ItemStack(TContent.materials, 1, 7), blazerod, firecharge, blazerod, firecharge, new ItemStack(Item.bucketLava), - firecharge, blazerod, firecharge, blazerod); - TConstructClientRegistry.registerManualLargeRecipe("silkycloth", silkyCloth, string, string, string, string, new ItemStack(TContent.materials, 1, 24), string, string, string, string); - TConstructClientRegistry.registerManualLargeRecipe("silkyjewel", new ItemStack(TContent.materials, 1, 26), null, silkyCloth, null, silkyCloth, new ItemStack(Item.emerald), silkyCloth, null, - silkyCloth, null); - - TConstructClientRegistry.registerManualSmallRecipe("graveyardsoil", graveyardsoil, new ItemStack(Block.dirt), new ItemStack(Item.rottenFlesh), new ItemStack(Item.dyePowder, 1, 15), null); - TConstructClientRegistry.registerManualFurnaceRecipe("consecratedsoil", consecratedsoil, graveyardsoil); - - TConstructClientRegistry.registerManualSmallRecipe("grout", grout, sand, gravel, null, clay); - TConstructClientRegistry.registerManualFurnaceRecipe("searedbrick", searedbrick, grout); - TConstructClientRegistry.registerManualSmallRecipe("searedbricks", new ItemStack(TContent.smeltery, 1, 2), searedbrick, searedbrick, searedbrick, searedbrick); - TConstructClientRegistry.registerManualLargeRecipe("smelterycontroller", new ItemStack(TContent.smeltery, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, null, searedbrick, - searedbrick, searedbrick, searedbrick); - TConstructClientRegistry.registerManualLargeRecipe("smelterydrain", new ItemStack(TContent.smeltery, 1, 1), searedbrick, null, searedbrick, searedbrick, null, searedbrick, searedbrick, null, - searedbrick); - - TConstructClientRegistry.registerManualLargeRecipe("smelterytank1", new ItemStack(TContent.lavaTank, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, glass, searedbrick, - searedbrick, searedbrick, searedbrick); - TConstructClientRegistry.registerManualLargeRecipe("smelterytank2", new ItemStack(TContent.lavaTank, 1, 1), searedbrick, glass, searedbrick, glass, glass, glass, searedbrick, glass, - searedbrick); - TConstructClientRegistry.registerManualLargeRecipe("smelterytank3", new ItemStack(TContent.lavaTank, 1, 2), searedbrick, glass, searedbrick, searedbrick, glass, searedbrick, searedbrick, - glass, searedbrick); - - TConstructClientRegistry.registerManualLargeRecipe("smelterytable", new ItemStack(TContent.searedBlock, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, null, searedbrick, - searedbrick, null, searedbrick); - TConstructClientRegistry.registerManualLargeRecipe("smelteryfaucet", new ItemStack(TContent.searedBlock, 1, 1), searedbrick, null, searedbrick, null, searedbrick, null, null, null, null); - TConstructClientRegistry.registerManualLargeRecipe("smelterybasin", new ItemStack(TContent.searedBlock, 1, 2), searedbrick, null, searedbrick, searedbrick, null, searedbrick, searedbrick, - searedbrick, searedbrick); - - //Modifier recipes - ItemStack ironpick = ToolBuilder.instance.buildTool(new ItemStack(TContent.pickaxeHead, 1, 6), new ItemStack(TContent.toolRod, 1, 2), new ItemStack(TContent.binding, 1, 6), ""); - TConstructClientRegistry.registerManualIcon("ironpick", ironpick); - ItemStack ironlongsword = ToolBuilder.instance.buildTool(new ItemStack(TContent.swordBlade, 1, 6), new ItemStack(TContent.toolRod, 1, 2), new ItemStack(TContent.handGuard, 1, 10), ""); - TConstructClientRegistry.registerManualIcon("ironlongsword", ironlongsword); - - TConstructClientRegistry.registerManualModifier("diamondmod", ironpick.copy(), new ItemStack(Item.diamond)); - TConstructClientRegistry.registerManualModifier("emeraldmod", ironpick.copy(), new ItemStack(Item.emerald)); - TConstructClientRegistry.registerManualModifier("redstonemod", ironpick.copy(), new ItemStack(Item.redstone), new ItemStack(Block.blockRedstone)); - TConstructClientRegistry.registerManualModifier("lavacrystalmod", ironpick.copy(), new ItemStack(TContent.materials, 1, 7)); - TConstructClientRegistry.registerManualModifier("lapismod", ironpick.copy(), new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Block.blockLapis)); - TConstructClientRegistry.registerManualModifier("mossmod", ironpick.copy(), new ItemStack(TContent.materials, 1, 6)); - TConstructClientRegistry.registerManualModifier("quartzmod", ironlongsword.copy(), new ItemStack(Item.netherQuartz), new ItemStack(Block.blockNetherQuartz)); - TConstructClientRegistry.registerManualModifier("blazemod", ironlongsword.copy(), new ItemStack(Item.blazePowder)); - TConstructClientRegistry.registerManualModifier("necroticmod", ironlongsword.copy(), new ItemStack(TContent.materials, 1, 8)); - TConstructClientRegistry.registerManualModifier("silkymod", ironpick.copy(), new ItemStack(TContent.materials, 1, 26)); - TConstructClientRegistry.registerManualModifier("reinforcedmod", ironpick.copy(), new ItemStack(TContent.heavyPlate, 1, 6)); - - TConstructClientRegistry.registerManualModifier("pistonmod", ironlongsword.copy(), new ItemStack(Block.pistonBase)); - TConstructClientRegistry.registerManualModifier("beheadingmod", ironlongsword.copy(), new ItemStack(Item.enderPearl), new ItemStack(Block.obsidian)); - TConstructClientRegistry.registerManualModifier("spidermod", ironlongsword.copy(), new ItemStack(Item.fermentedSpiderEye)); - TConstructClientRegistry.registerManualModifier("smitemod", ironlongsword.copy(), new ItemStack(TContent.craftedSoil, 1, 4)); - - TConstructClientRegistry.registerManualModifier("electricmod", ironpick.copy(), new ItemStack(Block.dirt), new ItemStack(Block.dirt)); - TConstructClientRegistry.registerManualModifier("tier1free", ironpick.copy(), new ItemStack(Item.diamond), new ItemStack(Block.blockGold)); - TConstructClientRegistry.registerManualModifier("tier2free", ironpick.copy(), new ItemStack(Item.netherStar)); - - TConstructClientRegistry.registerManualSmeltery("brownstone", new ItemStack(TContent.speedBlock), new ItemStack(TContent.moltenTin, 1), new ItemStack(Block.gravel)); - TConstructClientRegistry.registerManualSmeltery("clearglass", new ItemStack(TContent.glass), new ItemStack(TContent.moltenGlass, 1), null); - TConstructClientRegistry.registerManualSmeltery("searedstone", new ItemStack(TContent.smeltery, 1, 4), new ItemStack(TContent.moltenStone, 1), null); - - } - - public static Map> pageClasses = new HashMap>(); - - public static void registerManualPage (String type, Class clazz) - { - pageClasses.put(type, clazz); - } - - public static Class getPageClass (String type) - { - return pageClasses.get(type); - } - - void initManualPages () - { - TProxyClient.registerManualPage("crafting", CraftingPage.class); - TProxyClient.registerManualPage("picture", PicturePage.class); - TProxyClient.registerManualPage("text", TextPage.class); - TProxyClient.registerManualPage("intro", TextPage.class); - TProxyClient.registerManualPage("sectionpage", SectionPage.class); - TProxyClient.registerManualPage("intro", TitlePage.class); - TProxyClient.registerManualPage("contents", ContentsTablePage.class); - TProxyClient.registerManualPage("furnace", FurnacePage.class); - TProxyClient.registerManualPage("sidebar", SidebarPage.class); - TProxyClient.registerManualPage("materialstats", MaterialPage.class); - TProxyClient.registerManualPage("toolpage", ToolPage.class); - TProxyClient.registerManualPage("modifier", ModifierPage.class); - TProxyClient.registerManualPage("blockcast", BlockCastPage.class); - - TProxyClient.registerManualPage("blank", BlankPage.class); - } - - public static Document getManualFromStack (ItemStack stack) - { - switch (stack.getItemDamage()) - { - case 0: - return volume1; - case 1: - return volume2; - case 2: - return smelter; - case 3: - return diary; - } - - return null; - } - - static int[][] itemIcons = { new int[] { 0, 3, 0 }, //Repair - new int[] { 1, 4, 0 }, //Pickaxe - new int[] { 2, 5, 0 }, //Shovel - new int[] { 2, 6, 0 }, //Axe - //new int[] {2, 9, 0}, //Lumber Axe - //new int[] {1, 7, 0}, //Ice Axe - new int[] { 3, 8, 0 }, //Mattock - new int[] { 1, 0, 1 }, //Broadsword - new int[] { 1, 1, 1 }, //Longsword - new int[] { 1, 2, 1 }, //Rapier - new int[] { 1, 5, 1 }, //Dagger - new int[] { 2, 3, 1 }, //Frying pan - new int[] { 2, 4, 1 }, //Battlesign - new int[] { 2, 6, 1 } //Chisel - }; - - static int[][] iconCoords = { new int[] { 0, 1, 2, 13 }, new int[] { 13, 13, 13, 13 }, //Repair - new int[] { 0, 0, 1, 13 }, new int[] { 2, 3, 3, 13 }, //Pickaxe - new int[] { 3, 0, 13, 13 }, new int[] { 2, 3, 13, 13 }, //Shovel - new int[] { 2, 0, 13, 13 }, new int[] { 2, 3, 13, 13 }, //Axe - //new int[] { 6, 0, 13, 13 }, new int[] { 2, 3, 13, 13 }, //Lumber Axe - //new int[] { 0, 0, 5, 13 }, new int[] { 2, 3, 3, 13 }, //Ice Axe - new int[] { 2, 0, 3, 13 }, new int[] { 2, 3, 2, 13 }, //Mattock - new int[] { 1, 0, 2, 13 }, new int[] { 2, 3, 3, 13 }, //Broadsword - new int[] { 1, 0, 3, 13 }, new int[] { 2, 3, 3, 13 }, //Longsword - new int[] { 1, 0, 4, 13 }, new int[] { 2, 3, 3, 13 }, //Rapier - new int[] { 7, 0, 4, 13 }, new int[] { 2, 3, 3, 13 }, //Dagger - new int[] { 4, 0, 13, 13 }, new int[] { 2, 3, 13, 13 }, //Frying Pan - new int[] { 5, 0, 13, 13 }, new int[] { 2, 3, 13, 13 }, //Battlesign - new int[] { 7, 0, 13, 13 }, new int[] { 3, 3, 13, 13 } //Chisel - }; - - static String[] toolNames = { "Repair and Modification", "Pickaxe", "Shovel", "Hatchet", - //"Lumber Axe", - //"Ice Axe", - "Mattock", "Broadsword", "Longsword", "Rapier", "Dagger", "Frying Pan", "Battlesign", "Chisel" }; - - static String[] toolDescriptions = { - "The main way to repair or change your tools. Place a tool and a material on the left to get started.", - "The Pickaxe is a precise mining tool. It is effective on stone and ores.\n\nRequired parts:\n- Pickaxe Head\n- Tool Binding\n- Handle", - "The Shovel is a precise digging tool. It is effective on dirt, sand, and snow.\n\nRequired parts:\n- Shovel Head\n- Handle", - "The Hatchet is a basic chopping tool. It is effective on wood and leaves.\n\nRequired parts:\n- Axe Head\n- Handle", - //"The Lumber Axe is a broad chopping tool. It harvests wood in a wide range and can fell entire trees.\n\nRequired parts:\n- Broad Axe Head\n- Handle", - //"The Ice Axe is a tool for harvesting ice, mining, and attacking foes.\n\nSpecial Ability:\n- Wall Climb\nNatural Ability:\n- Ice Harvest\nDamage: Moderate\n\nRequired parts:\n- Pickaxe Head\n- Spike\n- Handle", - "The Cutter Mattock is a versatile farming tool. It is effective on wood, dirt, and plants.\n\nSpecial Ability: Hoe\n\nRequired parts:\n- Axe Head\n- Shovel Head\n- Handle", - "The Broadsword is a defensive weapon. Blocking cuts damage in half.\n\nSpecial Ability: Block\nDamage: Moderate\nDurability: High\n\nRequired parts:\n- Sword Blade\n- Wide Guard\n- Handle", - "The Longsword is an offensive weapon. It is often used for charging into battle at full speed.\n\nNatural Ability:\n- Charge Boost\nSpecial Ability: Lunge\n\nDamage: Moderate\nDurability: Moderate", - "The Rapier is a special weapon that relies on quick strikes to defeat foes.\n\nNatural Abilities:\n- Armor Pierce\n- Quick Strike\n- Charge Boost\nSpecial Ability:\n- Backpedal\n\nDamage: Low\nDurability: Low", - "The Dagger is a short blade that can be thrown.\n\nSpecial Ability:\n- Throw Item\n\nDamage: Low\nDurability: Moderate\n\nRequired parts:\n- Knife Blade\n- Crossbar\n- Handle", - "The Frying is a heavy weapon that uses sheer weight to stun foes.\n\nSpecial Ability: Block\nNatural Ability: Heavy\nShift+rClick: Place Frying Pan\nDamage: Low\nDurability: High\n\nRequired parts:\n- Pan\n- Handle", - //"The Battlesign is an advance in weapon technology worthy of Zombie Pigmen everywhere.\n\nSpecial Ability: Block\nShift-rClick: Place sign\nDamage: Low\nDurability: Average\n\nRequired parts:\n- Board\n- Handle" - "The Battlesign is an advance in weapon technology worthy of Zombie Pigmen everywhere.\n\nSpecial Ability: Block\nDamage: Low\nDurability: Average\n\nRequired parts:\n- Sign Board\n- Handle", - "The Chisel is a utility tool that carves shapes into blocks.\n\nCrafting Grid:\n- Shape Items\nSpecial Ability: Chisel\nDurability: Average\n\nRequired parts:\n- Chisel Head\n- Handle" }; - - void addToolButtons () - { - for (int i = 0; i < toolNames.length; i++) - { - addToolButton(itemIcons[i][0], itemIcons[i][1], itemIcons[i][2], iconCoords[i * 2], iconCoords[i * 2 + 1], toolNames[i], toolDescriptions[i]); - } - - addToolButton(3, 9, 1, new int[] { 0, 10, 0, 13 }, new int[] { 3, 3, 3, 13 }, "Shortbow", - "The Shortbow is a ranged weapon. It fires arrows quickly and precisely at its foes.\n\nDraw Speed: Quick\n\nRequired parts:\n- Tool Rod\n- Bowstring\n- Tool Rod"); - addToolButton(7, 10, 1, new int[] { 11, 0, 12, 13 }, new int[] { 3, 3, 3, 13 }, "Arrow", - "Arrows are projectiles usually fired from bows.\n\nRequired parts:\n- Arrowhead\n- Tool Rod\n- Fletching"); - addTierTwoButton(6, 13, 0, new int[] { 11, 8, 9, 9 }, new int[] { 2, 3, 2, 2 }, "Hammer", - "The Hammer is a broad mining tool. It harvests blocks in a wide range and is effective against undead.\n\nNatural Abilities:\nArea of Effect\n- (3x3)\n- Smite\n\nDurability: High"); - addTierTwoButton(5, 11, 0, new int[] { 6, 8, 9, 9 }, new int[] { 2, 3, 2, 3 }, "Lumber Axe", - "The Lumber Axe is a broad chopping tool. It can fell entire trees or gather wood in a wide range.\n\nNatural Abilities:\nArea of Effect\n- Fell Trees\n- (3x3x3)\n\nDurability: Average"); - addTierTwoButton(5, 12, 0, new int[] { 10, 8, 9, 9 }, new int[] { 2, 3, 2, 3 }, "Excavator", - "The Excavator is a broad digging tool. It harvests soil and snow in a wide range.\n\nNatural Ability:\n- Area of Effect\n- (3x3)\n\nDurability: Average"); - addTierTwoButton(4, 10, 0, new int[] { 8, 8, 9, 8 }, new int[] { 2, 3, 3, 3 }, "Scythe", - "The Scythe is a broad reaping tool. It is effective on plants and attacks enemies in a wide range.\n\nNatural Ability:\nArea of Effect\n- (3x3x3)\n\nDurability: Average\nDamage: Low, AoE"); - addTierTwoButton(5, 7, 1, new int[] { 6, 8, 9, 8 }, new int[] { 3, 3, 2, 3 }, "Cleaver", - "The Cleaver is a heavy defensive weapon. It has powerful strikes, but is difficult to wield.\n\nSpecial Ability: Block\nNatural Ability:\n- Beheading\n\nDamage: High\nDurability: Average"); - addTierTwoButton(5, 8, 1, new int[] { 6, 8, 6, 9 }, new int[] { 2, 3, 2, 3 }, "Battleaxe", - "The Battleaxe is a heavy offensive weapon. It is capable of bringing down small trees and can send foes flying.\n\nSpecial Ability: Block\nNatural Abilities:" - + "\n- Knockback\n- Area of Effect\n- (1x9)\n\nDamage: Average\nDurability: Average"); - } - - void addToolButton (int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body) - { - TConstructClientRegistry.addToolButton(new ToolGuiElement(slotType, xButton, yButton, xIcons, yIcons, "tinker", title, "tinker", "textures/gui/icons.png")); - } - - void addTierTwoButton (int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body) - { - TConstructClientRegistry.addTierTwoButton(new ToolGuiElement(slotType, xButton, yButton, xIcons, yIcons, "tinker", title, "tinker", "textures/gui/icons.png")); - } - - void addRenderMappings () - { - String[] partTypes = { "wood", "stone", "iron", "flint", "cactus", "bone", "obsidian", "netherrack", "slime", "paper", "cobalt", "ardite", "manyullyn", "copper", "bronze", "alumite", "steel", - "blueslime" }; - //String[] modPartTypes = { "thaumium" }; - String[] effectTypes = { "diamond", "emerald", "redstone", "piston", "moss", "ice", "lava", "blaze", "necrotic", "electric", "lapis", "quartz", "silk", "beheading", "smite", "spider", - "reinforced" }; - int[] universalEffects = { 0, 1, 4, 9, 16 }; - int[] weaponEffects = { 3, 5, 7, 13, 14, 15 }; - int[] harvestEffects = { 2 }; - int[] nonUtility = { 6, 8, 10, 11, 12 }; - - for (int partIter = 0; partIter < partTypes.length; partIter++) - { - TConstructClientRegistry.addMaterialRenderMapping(partIter, "tinker", partTypes[partIter], true); - } - - /*for (int iter = 0; iter < modPartTypes.length; iter++) - { - TConstructClientRegistry.addMaterialRenderMapping(31 + iter, "tinker", modPartTypes[iter], true); - }*/ - - for (ToolCore tool : TConstructRegistry.getToolMapping()) - { - for (int i = 0; i < effectTypes.length; i++) - { - TConstructClientRegistry.addEffectRenderMapping(tool, i, "tinker", effectTypes[i], true); - } - } - - String[] bowstringTypes = { "string", "magicfabric" }; - for (int bowIter = 0; bowIter < bowstringTypes.length; bowIter++) - { - TConstructClientRegistry.addAlternateMaterialRenderMapping(TContent.shortbow, bowIter, "tinker", bowstringTypes[bowIter], true); - } - - String[] fletching = { "feather", "leaf", "slime", "blueslime" }; - for (int arrowIter = 0; arrowIter < fletching.length; arrowIter++) - { - TConstructClientRegistry.addAlternateMaterialRenderMapping(TContent.arrow, arrowIter, "tinker", fletching[arrowIter], true); - } - } - - /* Keybindings */ - public static TControls controlInstance; - - public void registerKeys () - { - controlInstance = new TControls(); - TickRegistry.registerTickHandler(controlInstance, Side.CLIENT); - uploadKeyBindingsToGame(Minecraft.getMinecraft().gameSettings, controlInstance); - } - - public void uploadKeyBindingsToGame (GameSettings settings, TKeyHandler keyhandler) - { - ArrayList harvestedBindings = Lists.newArrayList(); - for (KeyBinding kb : keyhandler.keyBindings) - { - harvestedBindings.add(kb); - } - - KeyBinding[] modKeyBindings = harvestedBindings.toArray(new KeyBinding[harvestedBindings.size()]); - KeyBinding[] allKeys = new KeyBinding[settings.keyBindings.length + modKeyBindings.length]; - System.arraycopy(settings.keyBindings, 0, allKeys, 0, settings.keyBindings.length); - System.arraycopy(modKeyBindings, 0, allKeys, settings.keyBindings.length, modKeyBindings.length); - settings.keyBindings = allKeys; - settings.loadOptions(); - } - - public void spawnParticle (String particle, double xPos, double yPos, double zPos, double velX, double velY, double velZ) - { - this.doSpawnParticle(particle, xPos, yPos, zPos, velX, velY, velZ); - } - - public EntityFX doSpawnParticle (String par1Str, double par2, double par4, double par6, double par8, double par10, double par12) - { - if (this.mc == null) - this.mc = Minecraft.getMinecraft(); - - if (this.mc.renderViewEntity != null && this.mc.effectRenderer != null) - { - int i = this.mc.gameSettings.particleSetting; - - if (i == 1 && mc.theWorld.rand.nextInt(3) == 0) - { - i = 2; - } - - double d6 = this.mc.renderViewEntity.posX - par2; - double d7 = this.mc.renderViewEntity.posY - par4; - double d8 = this.mc.renderViewEntity.posZ - par6; - EntityFX entityfx = null; - - if (par1Str.equals("hugeexplosion")) - { - this.mc.effectRenderer.addEffect(entityfx = new EntityHugeExplodeFX(mc.theWorld, par2, par4, par6, par8, par10, par12)); - } - else if (par1Str.equals("largeexplode")) - { - this.mc.effectRenderer.addEffect(entityfx = new EntityLargeExplodeFX(mc.renderEngine, mc.theWorld, par2, par4, par6, par8, par10, par12)); - } - else if (par1Str.equals("fireworksSpark")) - { - this.mc.effectRenderer.addEffect(entityfx = new EntityFireworkSparkFX(mc.theWorld, par2, par4, par6, par8, par10, par12, this.mc.effectRenderer)); - } - - if (entityfx != null) - { - return (EntityFX) entityfx; - } - else - { - double d9 = 16.0D; - - if (d6 * d6 + d7 * d7 + d8 * d8 > d9 * d9) - { - return null; - } - else if (i > 1) - { - return null; - } - else - { - if (par1Str.equals("bubble")) - { - entityfx = new EntityBubbleFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - } - else if (par1Str.equals("suspended")) - { - entityfx = new EntitySuspendFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - } - else if (par1Str.equals("depthsuspend")) - { - entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - } - else if (par1Str.equals("townaura")) - { - entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - } - else if (par1Str.equals("crit")) - { - entityfx = new EntityCritFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - } - else if (par1Str.equals("smoke")) - { - entityfx = new EntitySmokeFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - } - else if (par1Str.equals("mobSpell")) - { - entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D); - ((EntityFX) entityfx).setRBGColorF((float) par8, (float) par10, (float) par12); - } - else if (par1Str.equals("mobSpellAmbient")) - { - entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D); - ((EntityFX) entityfx).setAlphaF(0.15F); - ((EntityFX) entityfx).setRBGColorF((float) par8, (float) par10, (float) par12); - } - else if (par1Str.equals("spell")) - { - entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - } - else if (par1Str.equals("instantSpell")) - { - entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - ((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144); - } - else if (par1Str.equals("witchMagic")) - { - entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - ((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144); - float f = mc.theWorld.rand.nextFloat() * 0.5F + 0.35F; - ((EntityFX) entityfx).setRBGColorF(1.0F * f, 0.0F * f, 1.0F * f); - } - else if (par1Str.equals("note")) - { - entityfx = new EntityNoteFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - } - else if (par1Str.equals("portal")) - { - entityfx = new EntityPortalFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - } - else if (par1Str.equals("enchantmenttable")) - { - entityfx = new EntityEnchantmentTableParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - } - else if (par1Str.equals("explode")) - { - entityfx = new EntityExplodeFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - } - else if (par1Str.equals("flame")) - { - entityfx = new EntityFlameFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - } - else if (par1Str.equals("lava")) - { - entityfx = new EntityLavaFX(mc.theWorld, par2, par4, par6); - } - else if (par1Str.equals("footstep")) - { - entityfx = new EntityFootStepFX(mc.renderEngine, mc.theWorld, par2, par4, par6); - } - else if (par1Str.equals("splash")) - { - entityfx = new EntitySplashFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - } - else if (par1Str.equals("largesmoke")) - { - entityfx = new EntitySmokeFX(mc.theWorld, par2, par4, par6, par8, par10, par12, 2.5F); - } - else if (par1Str.equals("cloud")) - { - entityfx = new EntityCloudFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - } - else if (par1Str.equals("reddust")) - { - entityfx = new EntityReddustFX(mc.theWorld, par2, par4, par6, (float) par8, (float) par10, (float) par12); - } - else if (par1Str.equals("snowballpoof")) - { - entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, Item.snowball); - } - else if (par1Str.equals("dripWater")) - { - entityfx = new EntityDropParticleFX(mc.theWorld, par2, par4, par6, Material.water); - } - else if (par1Str.equals("dripLava")) - { - entityfx = new EntityDropParticleFX(mc.theWorld, par2, par4, par6, Material.lava); - } - else if (par1Str.equals("snowshovel")) - { - entityfx = new EntitySnowShovelFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - } - else if (par1Str.equals("blueslime")) - { - entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, TContent.strangeFood); - } - else if (par1Str.equals("heart")) - { - entityfx = new EntityHeartFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - } - else if (par1Str.equals("angryVillager")) - { - entityfx = new EntityHeartFX(mc.theWorld, par2, par4 + 0.5D, par6, par8, par10, par12); - ((EntityFX) entityfx).setParticleTextureIndex(81); - ((EntityFX) entityfx).setRBGColorF(1.0F, 1.0F, 1.0F); - } - else if (par1Str.equals("happyVillager")) - { - entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - ((EntityFX) entityfx).setParticleTextureIndex(82); - ((EntityFX) entityfx).setRBGColorF(1.0F, 1.0F, 1.0F); - } - - if (entityfx != null) - { - this.mc.effectRenderer.addEffect((EntityFX) entityfx); - } - - return (EntityFX) entityfx; - } - } - } - else - { - return null; - } - } +import tconstruct.util.player.*; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.inventory.*; +import net.minecraft.client.model.ModelSlime; +import net.minecraft.client.particle.*; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.settings.*; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.*; +import net.minecraft.util.*; +import net.minecraft.world.World; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.common.MinecraftForge; + +public class TProxyClient extends TProxyCommon { + public static SmallFontRenderer smallFontRenderer; + public static Icon metalBall; + public static Minecraft mc; + public static RenderItem itemRenderer = new RenderItem(); + + public static ArmorExtended armorExtended = new ArmorExtended(); + public static KnapsackInventory knapsack = new KnapsackInventory(); + + @Override + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { + if (ID == stationGuiID) + return new ToolStationGui(player.inventory, (ToolStationLogic) world.getBlockTileEntity(x, y, z), world, x, y, z); + if (ID == partGuiID) + return new PartCrafterGui(player.inventory, (PartCrafterLogic) world.getBlockTileEntity(x, y, z), world, x, y, z); + if (ID == pchestGuiID) + return new PatternChestGui(player.inventory, (PatternChestLogic) world.getBlockTileEntity(x, y, z), world, x, y, z); + if (ID == frypanGuiID) + return new FrypanGui(player.inventory, (FrypanLogic) world.getBlockTileEntity(x, y, z), world, x, y, z); + if (ID == smelteryGuiID) + return new SmelteryGui(player.inventory, (SmelteryLogic) world.getBlockTileEntity(x, y, z), world, x, y, z); + if (ID == pshaperGuiID) + return new StencilTableGui(player.inventory, (StencilTableLogic) world.getBlockTileEntity(x, y, z), world, x, y, z); + if (ID == toolForge) + return new ToolForgeGui(player.inventory, (ToolForgeLogic) world.getBlockTileEntity(x, y, z), world, x, y, z); + if (ID == glowstoneAggregatorGui) + return new GlowstoneAggregatorGui(player.inventory, (GlowstoneAggregator) world.getBlockTileEntity(x, y, z), world, x, y, z); + if (ID == drawbridgeGui) + return new DrawbridgeGui(player.inventory, (DrawbridgeLogic) world.getBlockTileEntity(x, y, z), world, x, y, z); + if (ID == landmineGui) + return new GuiLandmine(new ContainerLandmine(player, (TileEntityLandmine) world.getBlockTileEntity(x, y, z))); + if (ID == craftingStationID) + return new CraftingStationGui(player.inventory, (CraftingStationLogic) world.getBlockTileEntity(x, y, z), x, y, z); + + if (ID == manualGuiID) { + ItemStack stack = player.getCurrentEquippedItem(); + return new GuiManual(stack, TProxyClient.getManualFromStack(stack)); + } + if (ID == inventoryGui) { + GuiInventory inventory = new GuiInventory(player); + addTabsToInventory(inventory); + return inventory; + } + if (ID == armorGuiID) { + TProxyClient.armorExtended.init(Minecraft.getMinecraft().thePlayer); + return new ArmorExtendedGui(player.inventory, TProxyClient.armorExtended); + } + if (ID == knapsackGuiID) { + TProxyClient.knapsack.init(Minecraft.getMinecraft().thePlayer); + return new KnapsackGui(player.inventory, TProxyClient.knapsack); + } + if (ID == miniGardyGui) { + for (Object o : world.loadedEntityList) { + Entity entity = (Entity) o; + if (entity.entityId == x) { + return new MiniGardyGui(player.inventory, (MiniGardy) entity); + } + } + return null; + } + return null; + } + + public static void renderStandardInvBlock(RenderBlocks renderblocks, Block block, int meta) { + Tessellator tessellator = Tessellator.instance; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1F, 0.0F); + renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1F); + renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1F, 0.0F, 0.0F); + renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + public static void renderInvBlockFace(RenderBlocks renderblocks, Block block, int meta) { + Tessellator tessellator = Tessellator.instance; + GL11.glScalef(2f, 2f, 2f); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + GL11.glRotatef(45, 0, 1, 0); + GL11.glRotatef(60, 1, 0, 0); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1F, 0.0F); + renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1F); + renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1F, 0.0F, 0.0F); + renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + public static void openInventoryGui() { + // controlInstance.openInventoryGui(); + if (mc == null) + mc = Minecraft.getMinecraft(); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + addTabsToInventory(inventory); + } + + public static void addTabsToInventory(GuiContainer gui) { + /* + * if (mc == null) mc = Minecraft.getMinecraft(); + */ + if (gui.getClass() == GuiInventory.class || classMatches(gui, "micdoodle8.mods.galacticraft.core.client.gui.GCCoreGuiInventory")) { + try { + Field guiLeft = GuiContainer.class.getDeclaredField("p"); + guiLeft.setAccessible(true); + int cornerX = (Integer) guiLeft.get(gui); + Field ySize = GuiContainer.class.getDeclaredField("d"); + ySize.setAccessible(true); + int cornerY = (gui.height - (Integer) ySize.get(gui)) / 2; + Field buttonList = GuiScreen.class.getDeclaredField("i"); + buttonList.setAccessible(true); + ArrayList listOfButtons = (ArrayList) buttonList.get(gui); + listOfButtons.clear(); + + InventoryTab tab = new InventoryTab(2, cornerX, cornerY - 28, new ItemStack(Block.workbench), 0); + tab.enabled = false; + listOfButtons.add(tab); + tab = new InventoryTab(3, cornerX + 28, cornerY - 28, new ItemStack(Item.plateDiamond), 1); + listOfButtons.add(tab); + if (armorExtended.inventory[2] != null && armorExtended.inventory[2].getItem() == TContent.knapsack) { + if (listOfButtons.size() < 3) { + tab = new InventoryTab(4, cornerX + 56, cornerY - 28, new ItemStack(TContent.knapsack), 1); + listOfButtons.add(tab); + } + } + } catch (Exception e) { + try { + Field guiLeft = GuiContainer.class.getDeclaredField("guiLeft"); + guiLeft.setAccessible(true); + int cornerX = (Integer) guiLeft.get(gui); + Field ySize = GuiContainer.class.getDeclaredField("ySize"); + ySize.setAccessible(true); + int cornerY = (gui.height - (Integer) ySize.get(gui)) / 2; + Field buttonList = GuiScreen.class.getDeclaredField("buttonList"); + buttonList.setAccessible(true); + ArrayList listOfButtons = (ArrayList) buttonList.get(gui); + listOfButtons.clear(); + + InventoryTab tab = new InventoryTab(2, cornerX, cornerY - 28, new ItemStack(Block.workbench), 0); + tab.enabled = false; + listOfButtons.add(tab); + tab = new InventoryTab(3, cornerX + 28, cornerY - 28, new ItemStack(Item.plateDiamond), 1); + listOfButtons.add(tab); + if (armorExtended.inventory[2] != null && armorExtended.inventory[2].getItem() == TContent.knapsack) { + if (listOfButtons.size() < 3) { + tab = new InventoryTab(4, cornerX + 56, cornerY - 28, new ItemStack(TContent.knapsack), 1); + listOfButtons.add(tab); + } + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + } + } + + public static boolean classMatches(Object paramObject, String paramString) { + try { + return paramObject.getClass().getName().equals(paramString); + } catch (Exception localException) { + return false; + } + } + + public void registerTickHandler() { + TickRegistry.registerTickHandler(new TClientTickHandler(), Side.CLIENT); + // TickRegistry.registerTickHandler(new TimeTicker(), Side.CLIENT); + // TickRegistry.registerTickHandler(new TCommonTickHandler(), + // Side.CLIENT); + } + + /* Registers any rendering code. */ + public void registerRenderer() { + Minecraft mc = Minecraft.getMinecraft(); + MinecraftForge.EVENT_BUS.register(new TClientEvents()); + smallFontRenderer = new SmallFontRenderer(mc.gameSettings, new ResourceLocation("font/default.png"), mc.renderEngine, false); + RenderingRegistry.registerBlockHandler(new TableRender()); + RenderingRegistry.registerBlockHandler(new TableForgeRender()); + RenderingRegistry.registerBlockHandler(new FrypanRender()); + RenderingRegistry.registerBlockHandler(new SmelteryRender()); + RenderingRegistry.registerBlockHandler(new TankRender()); + RenderingRegistry.registerBlockHandler(new SearedRender()); + // RenderingRegistry.registerBlockHandler(new GolemCoreRender()); + RenderingRegistry.registerBlockHandler(new OreberryRender()); + RenderingRegistry.registerBlockHandler(new BarricadeRender()); + RenderingRegistry.registerBlockHandler(new CrystalBlockRender()); + RenderingRegistry.registerBlockHandler(new MachineRender()); + RenderingRegistry.registerBlockHandler(new DryingRackRender()); + RenderingRegistry.registerBlockHandler(new PaneRender()); + RenderingRegistry.registerBlockHandler(new PaneConnectedRender()); + RenderingRegistry.registerBlockHandler(new RenderLandmine()); + RenderingRegistry.registerBlockHandler(new PunjiRender()); + // RenderingRegistry.registerBlockHandler(new BrickRender()); + + // Special Renderers + ClientRegistry.bindTileEntitySpecialRenderer(CastingTableLogic.class, new CastingTableSpecialRenderer()); + ClientRegistry.bindTileEntitySpecialRenderer(CastingBasinLogic.class, new CastingBasinSpecialRender()); + ClientRegistry.bindTileEntitySpecialRenderer(DryingRackLogic.class, new DryingRackSpecialRender()); + // ClientRegistry.bindTileEntitySpecialRenderer(GolemCoreLogic.class, + // new GolemCoreSpecialRender()); + + // Entities + RenderingRegistry.registerEntityRenderingHandler(FancyEntityItem.class, new FancyItemRender()); + RenderingRegistry.registerEntityRenderingHandler(BlueSlime.class, new SlimeRender(new ModelSlime(16), new ModelSlime(0), 0.25F)); + RenderingRegistry.registerEntityRenderingHandler(SlimeClone.class, new SlimeCloneRender(new CloneHeadModel(0), new CloneHeadModel(1f), 0.25F)); + + RenderingRegistry.registerEntityRenderingHandler(CartEntity.class, new CartRender()); + RenderingRegistry.registerEntityRenderingHandler(DaggerEntity.class, new DaggerRender()); + RenderingRegistry.registerEntityRenderingHandler(Crystal.class, new CrystalRender()); + // RenderingRegistry.registerEntityRenderingHandler(Skyla.class, new + // SkylaRender()); + RenderingRegistry.registerEntityRenderingHandler(MiniGardy.class, new MiniGardyRender()); + RenderingRegistry.registerEntityRenderingHandler(Automaton.class, new CrystalGuardianRender()); + RenderingRegistry.registerEntityRenderingHandler(LaunchedPotion.class, new LaunchedItemRender(Item.potion, 16384)); + RenderingRegistry.registerEntityRenderingHandler(ArrowEntity.class, new ArrowRender()); + // RenderingRegistry.registerEntityRenderingHandler(net.minecraft.entity.player.EntityPlayer.class, + // new PlayerArmorRender()); // <-- Works, woo! + + MinecraftForgeClient.registerItemRenderer(TContent.shortbow.itemID, new CustomBowRenderer()); + VillagerRegistry.instance().registerVillagerSkin(78943, new ResourceLocation("tinker", "textures/mob/villagertools.png")); + + ToolCoreRenderer renderer = new ToolCoreRenderer(); + MinecraftForgeClient.registerItemRenderer(TContent.arrow.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.battleaxe.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.battlesign.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.broadsword.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.chisel.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.cleaver.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.cutlass.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.dagger.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.excavator.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.frypan.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.hammer.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.hatchet.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.longsword.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.lumberaxe.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.mattock.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.pickaxe.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.rapier.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.scythe.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.shortbow.itemID, renderer); + MinecraftForgeClient.registerItemRenderer(TContent.shovel.itemID, renderer); + + addRenderMappings(); + addToolButtons(); + } + + public static Document diary; + public static Document volume1; + public static Document volume2; + public static Document smelter; + + public void readManuals() { + DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); + diary = readManual("/assets/tinker/manuals/diary.xml", dbFactory); + volume1 = readManual("/assets/tinker/manuals/firstday.xml", dbFactory); + volume2 = readManual("/assets/tinker/manuals/materials.xml", dbFactory); + smelter = readManual("/assets/tinker/manuals/smeltery.xml", dbFactory); + initManualIcons(); + initManualRecipes(); + initManualPages(); + } + + Document readManual(String location, DocumentBuilderFactory dbFactory) { + try { + InputStream stream = TConstruct.class.getResourceAsStream(location); + DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); + Document doc = dBuilder.parse(stream); + doc.getDocumentElement().normalize(); + return doc; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + public void initManualIcons() { + TConstructClientRegistry.registerManualIcon("smelterybook", new ItemStack(TContent.manualBook, 1, 2)); + TConstructClientRegistry.registerManualIcon("smeltery", new ItemStack(TContent.smeltery)); + TConstructClientRegistry.registerManualIcon("blankcast", new ItemStack(TContent.blankPattern, 1, 1)); + TConstructClientRegistry.registerManualIcon("castingtable", new ItemStack(TContent.searedBlock)); + // TConstructClientRegistry.registerManualIcon("liquidiron", new + // ItemStack(TContent.liquidMetalStill)); + TConstructClientRegistry.registerManualIcon("lavatank", new ItemStack(TContent.lavaTank)); + TConstructClientRegistry.registerManualIcon("searedbrick", new ItemStack(TContent.smeltery, 1, 2)); + TConstructClientRegistry.registerManualIcon("drain", new ItemStack(TContent.smeltery, 1, 1)); + TConstructClientRegistry.registerManualIcon("faucet", new ItemStack(TContent.searedBlock, 1, 1)); + TConstructClientRegistry.registerManualIcon("bronzeingot", new ItemStack(TContent.materials, 1, 13)); + TConstructClientRegistry.registerManualIcon("alubrassingot", new ItemStack(TContent.materials, 1, 14)); + TConstructClientRegistry.registerManualIcon("manyullyningot", new ItemStack(TContent.materials, 1, 5)); + TConstructClientRegistry.registerManualIcon("alumiteingot", new ItemStack(TContent.materials, 1, 15)); + TConstructClientRegistry.registerManualIcon("blankpattern", new ItemStack(TContent.blankPattern, 1, 0)); + TConstructClientRegistry.registerManualIcon("toolstation", new ItemStack(TContent.toolStationWood, 1, 0)); + TConstructClientRegistry.registerManualIcon("partcrafter", new ItemStack(TContent.toolStationWood, 1, 1)); + TConstructClientRegistry.registerManualIcon("patternchest", new ItemStack(TContent.toolStationWood, 1, 5)); + TConstructClientRegistry.registerManualIcon("stenciltable", new ItemStack(TContent.toolStationWood, 1, 10)); + TConstructClientRegistry.registerManualIcon("torch", new ItemStack(Block.torchWood)); + TConstructClientRegistry.registerManualIcon("sapling", new ItemStack(Block.sapling)); + TConstructClientRegistry.registerManualIcon("workbench", new ItemStack(Block.workbench)); + TConstructClientRegistry.registerManualIcon("coal", new ItemStack(Item.coal)); + + TConstructClientRegistry.registerManualIcon("obsidianingot", new ItemStack(TContent.materials, 1, 18)); + TConstructClientRegistry.registerManualIcon("lavacrystal", new ItemStack(TContent.materials, 1, 7)); + + // Tool Materials + TConstructClientRegistry.registerManualIcon("woodplanks", new ItemStack(Block.planks)); + TConstructClientRegistry.registerManualIcon("stoneblock", new ItemStack(Block.stone)); + TConstructClientRegistry.registerManualIcon("ironingot", new ItemStack(Item.ingotIron)); + TConstructClientRegistry.registerManualIcon("flint", new ItemStack(Item.flint)); + TConstructClientRegistry.registerManualIcon("cactus", new ItemStack(Block.cactus)); + TConstructClientRegistry.registerManualIcon("bone", new ItemStack(Item.bone)); + TConstructClientRegistry.registerManualIcon("obsidian", new ItemStack(Block.obsidian)); + TConstructClientRegistry.registerManualIcon("netherrack", new ItemStack(Block.netherrack)); + TConstructClientRegistry.registerManualIcon("blueslimecrystal", new ItemStack(TContent.materials, 1, 17)); + TConstructClientRegistry.registerManualIcon("slimecrystal", new ItemStack(TContent.materials, 1, 1)); + TConstructClientRegistry.registerManualIcon("paperstack", new ItemStack(TContent.materials, 1, 0)); + TConstructClientRegistry.registerManualIcon("cobaltingot", new ItemStack(TContent.materials, 1, 3)); + TConstructClientRegistry.registerManualIcon("arditeingot", new ItemStack(TContent.materials, 1, 4)); + TConstructClientRegistry.registerManualIcon("copperingot", new ItemStack(TContent.materials, 1, 9)); + TConstructClientRegistry.registerManualIcon("steelingot", new ItemStack(TContent.materials, 1, 16)); + + // Tool parts + TConstructClientRegistry.registerManualIcon("pickhead", new ItemStack(TContent.pickaxeHead, 1, 2)); + TConstructClientRegistry.registerManualIcon("shovelhead", new ItemStack(TContent.shovelHead, 1, 2)); + TConstructClientRegistry.registerManualIcon("axehead", new ItemStack(TContent.hatchetHead, 1, 2)); + TConstructClientRegistry.registerManualIcon("swordblade", new ItemStack(TContent.swordBlade, 1, 2)); + TConstructClientRegistry.registerManualIcon("pan", new ItemStack(TContent.frypanHead, 1, 2)); + TConstructClientRegistry.registerManualIcon("board", new ItemStack(TContent.signHead, 1, 2)); + TConstructClientRegistry.registerManualIcon("knifeblade", new ItemStack(TContent.knifeBlade, 1, 2)); + TConstructClientRegistry.registerManualIcon("chiselhead", new ItemStack(TContent.chiselHead, 1, 2)); + + TConstructClientRegistry.registerManualIcon("hammerhead", new ItemStack(TContent.hammerHead, 1, 2)); + TConstructClientRegistry.registerManualIcon("excavatorhead", new ItemStack(TContent.excavatorHead, 1, 2)); + TConstructClientRegistry.registerManualIcon("scythehead", new ItemStack(TContent.scytheBlade, 1, 2)); + TConstructClientRegistry.registerManualIcon("broadaxehead", new ItemStack(TContent.broadAxeHead, 1, 2)); + TConstructClientRegistry.registerManualIcon("largeswordblade", new ItemStack(TContent.largeSwordBlade, 1, 2)); + + TConstructClientRegistry.registerManualIcon("toolrod", new ItemStack(Item.stick)); + + TConstructClientRegistry.registerManualIcon("binding", new ItemStack(TContent.binding, 1, 4)); + TConstructClientRegistry.registerManualIcon("wideguard", new ItemStack(TContent.wideGuard, 1, 4)); + TConstructClientRegistry.registerManualIcon("handguard", new ItemStack(TContent.handGuard, 1, 4)); + TConstructClientRegistry.registerManualIcon("crossbar", new ItemStack(TContent.crossbar, 1, 4)); + + TConstructClientRegistry.registerManualIcon("toughrod", new ItemStack(TContent.toughRod, 1, 0)); + TConstructClientRegistry.registerManualIcon("toughbinding", new ItemStack(TContent.toughBinding, 1, 17)); + TConstructClientRegistry.registerManualIcon("largeplate", new ItemStack(TContent.heavyPlate, 1, 17)); + + // ToolIcons + TConstructClientRegistry.registerManualIcon("pickicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.pickaxeHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.binding, 1, 12), "")); + TConstructClientRegistry.registerManualIcon("shovelicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.shovelHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, "")); + TConstructClientRegistry.registerManualIcon("axeicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.hatchetHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, "")); + TConstructClientRegistry.registerManualIcon("mattockicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.hatchetHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.shovelHead, 1, 12), "")); + TConstructClientRegistry.registerManualIcon("swordicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.swordBlade, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.wideGuard, 1, 12), "")); + TConstructClientRegistry.registerManualIcon("longswordicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.swordBlade, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.handGuard, 1, 12), "")); + TConstructClientRegistry.registerManualIcon("rapiericon", ToolBuilder.instance.buildTool(new ItemStack(TContent.swordBlade, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.crossbar, 1, 12), "")); + TConstructClientRegistry.registerManualIcon("daggerIcon", ToolBuilder.instance.buildTool(new ItemStack(TContent.knifeBlade, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.crossbar, 1, 12), "")); + TConstructClientRegistry.registerManualIcon("frypanicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.frypanHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, "")); + TConstructClientRegistry.registerManualIcon("battlesignicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.signHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, "")); + TConstructClientRegistry.registerManualIcon("chiselicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.chiselHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, "")); + + TConstructClientRegistry.registerManualIcon("hammericon", ToolBuilder.instance.buildTool(new ItemStack(TContent.hammerHead, 1, 10), new ItemStack(TContent.toughRod, 1, 11), new ItemStack(TContent.heavyPlate, 1, 12), new ItemStack(TContent.heavyPlate, 8), "")); + TConstructClientRegistry.registerManualIcon("lumbericon", ToolBuilder.instance.buildTool(new ItemStack(TContent.broadAxeHead, 1, 10), new ItemStack(TContent.toughRod, 1, 11), new ItemStack(TContent.heavyPlate, 1, 12), new ItemStack(TContent.toughBinding, 8), "")); + TConstructClientRegistry.registerManualIcon("excavatoricon", ToolBuilder.instance.buildTool(new ItemStack(TContent.excavatorHead, 1, 10), new ItemStack(TContent.toughRod, 1, 11), new ItemStack(TContent.heavyPlate, 1, 12), new ItemStack(TContent.toughBinding, 8), "")); + TConstructClientRegistry.registerManualIcon("scytheicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.scytheBlade, 1, 10), new ItemStack(TContent.toughRod, 1, 11), new ItemStack(TContent.toughBinding, 1, 12), new ItemStack(TContent.toughRod, 8), "")); + TConstructClientRegistry.registerManualIcon("cleavericon", ToolBuilder.instance.buildTool(new ItemStack(TContent.largeSwordBlade, 1, 10), new ItemStack(TContent.toughRod, 1, 11), new ItemStack(TContent.heavyPlate, 1, 12), new ItemStack(TContent.toughRod, 8), "")); + TConstructClientRegistry.registerManualIcon("battleaxeicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.broadAxeHead, 1, 10), new ItemStack(TContent.toughRod, 1, 11), new ItemStack(TContent.broadAxeHead, 1, 12), new ItemStack(TContent.toughBinding, 8), "")); + } + + public void initManualRecipes() { + ItemStack pattern = new ItemStack(TContent.blankPattern, 1, 0); + + ItemStack stick = new ItemStack(Item.stick, 1, 0); + ItemStack plank = new ItemStack(Block.planks, 1, 0); + ItemStack workbench = new ItemStack(Block.workbench, 1, 0); + ItemStack chest = new ItemStack(Block.chest, 1, 0); + ItemStack log = new ItemStack(Block.wood, 1, 0); + ItemStack mossycobble = new ItemStack(Block.cobblestoneMossy); + ItemStack netherrack = new ItemStack(Block.netherrack); + + ItemStack dirt = new ItemStack(Block.dirt, 1, 0); + ItemStack sand = new ItemStack(Block.sand, 1, 0); + ItemStack gravel = new ItemStack(Block.gravel, 1, 0); + ItemStack clay = new ItemStack(Item.clay, 1, 0); + ItemStack glass = new ItemStack(Block.glass, 1, 0); + ItemStack ironblock = new ItemStack(Block.blockIron, 1, 0); + + ItemStack grout = new ItemStack(TContent.craftedSoil, 2, 1); + ItemStack searedbrick = new ItemStack(TContent.materials, 1, 2); + ItemStack searedbrickBlock = new ItemStack(TContent.smeltery, 1, 2); + + ItemStack coal = new ItemStack(Item.coal); + ItemStack paper = new ItemStack(Item.paper); + ItemStack slimeball = new ItemStack(Item.slimeBall); + ItemStack slimyMud = new ItemStack(TContent.craftedSoil); + ItemStack blazerod = new ItemStack(Item.blazeRod); + ItemStack firecharge = new ItemStack(Item.fireballCharge); + ItemStack string = new ItemStack(Item.silk); + + ItemStack silkyCloth = new ItemStack(TContent.materials, 1, 25); + + ItemStack graveyardsoil = new ItemStack(TContent.craftedSoil, 1, 3); + ItemStack consecratedsoil = new ItemStack(TContent.craftedSoil, 1, 4); + + // TConstruct recipes + TConstructClientRegistry.registerManualSmallRecipe("patternbook1", new ItemStack(TContent.manualBook, 1, 0), new ItemStack(Item.paper), pattern, null, null); + TConstructClientRegistry.registerManualSmallRecipe("patternbook2", new ItemStack(TContent.manualBook, 1, 1), new ItemStack(TContent.manualBook, 1, 0), null, null, null); + TConstructClientRegistry.registerManualSmallRecipe("patternbook3", new ItemStack(TContent.manualBook, 1, 2), new ItemStack(TContent.manualBook, 1, 1), null, null, null); + TConstructClientRegistry.registerManualSmallRecipe("blankpattern", pattern, plank, stick, stick, plank); + TConstructClientRegistry.registerManualSmallRecipe("toolstation", new ItemStack(TContent.toolStationWood, 1, 0), null, pattern, null, workbench); + TConstructClientRegistry.registerManualSmallRecipe("partcrafter", new ItemStack(TContent.toolStationWood, 1, 1), null, pattern, null, log); + TConstructClientRegistry.registerManualSmallRecipe("patternchest", new ItemStack(TContent.toolStationWood, 1, 5), null, pattern, null, chest); + TConstructClientRegistry.registerManualSmallRecipe("stenciltable", new ItemStack(TContent.toolStationWood, 1, 10), null, pattern, null, plank); + TConstructClientRegistry.registerManualLargeRecipe("toolforge", new ItemStack(TContent.toolForge, 1, 0), searedbrickBlock, searedbrickBlock, searedbrickBlock, ironblock, new ItemStack(TContent.toolStationWood, 1, 0), ironblock, ironblock, null, ironblock); + + TConstructClientRegistry.registerManualLargeRecipe("slimymud", slimyMud, null, slimeball, slimeball, null, slimeball, slimeball, null, dirt, sand); + TConstructClientRegistry.registerManualFurnaceRecipe("slimecrystal", new ItemStack(TContent.materials, 1, 1), slimyMud); + TConstructClientRegistry.registerManualSmallRecipe("paperstack", new ItemStack(TContent.materials, 1, 0), paper, paper, paper, paper); + TConstructClientRegistry.registerManualLargeRecipe("mossball", new ItemStack(TContent.materials, 1, 6), mossycobble, mossycobble, mossycobble, mossycobble, mossycobble, mossycobble, mossycobble, mossycobble, mossycobble); + TConstructClientRegistry.registerManualLargeRecipe("lavacrystal", new ItemStack(TContent.materials, 1, 7), blazerod, firecharge, blazerod, firecharge, new ItemStack(Item.bucketLava), firecharge, blazerod, firecharge, blazerod); + TConstructClientRegistry.registerManualLargeRecipe("silkycloth", silkyCloth, string, string, string, string, new ItemStack(TContent.materials, 1, 24), string, string, string, string); + TConstructClientRegistry.registerManualLargeRecipe("silkyjewel", new ItemStack(TContent.materials, 1, 26), null, silkyCloth, null, silkyCloth, new ItemStack(Item.emerald), silkyCloth, null, silkyCloth, null); + + TConstructClientRegistry.registerManualSmallRecipe("graveyardsoil", graveyardsoil, new ItemStack(Block.dirt), new ItemStack(Item.rottenFlesh), new ItemStack(Item.dyePowder, 1, 15), null); + TConstructClientRegistry.registerManualFurnaceRecipe("consecratedsoil", consecratedsoil, graveyardsoil); + + TConstructClientRegistry.registerManualSmallRecipe("grout", grout, sand, gravel, null, clay); + TConstructClientRegistry.registerManualFurnaceRecipe("searedbrick", searedbrick, grout); + TConstructClientRegistry.registerManualSmallRecipe("searedbricks", new ItemStack(TContent.smeltery, 1, 2), searedbrick, searedbrick, searedbrick, searedbrick); + TConstructClientRegistry.registerManualLargeRecipe("smelterycontroller", new ItemStack(TContent.smeltery, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, null, searedbrick, searedbrick, searedbrick, searedbrick); + TConstructClientRegistry.registerManualLargeRecipe("smelterydrain", new ItemStack(TContent.smeltery, 1, 1), searedbrick, null, searedbrick, searedbrick, null, searedbrick, searedbrick, null, searedbrick); + + TConstructClientRegistry.registerManualLargeRecipe("smelterytank1", new ItemStack(TContent.lavaTank, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, glass, searedbrick, searedbrick, searedbrick, searedbrick); + TConstructClientRegistry.registerManualLargeRecipe("smelterytank2", new ItemStack(TContent.lavaTank, 1, 1), searedbrick, glass, searedbrick, glass, glass, glass, searedbrick, glass, searedbrick); + TConstructClientRegistry.registerManualLargeRecipe("smelterytank3", new ItemStack(TContent.lavaTank, 1, 2), searedbrick, glass, searedbrick, searedbrick, glass, searedbrick, searedbrick, glass, searedbrick); + + TConstructClientRegistry.registerManualLargeRecipe("smelterytable", new ItemStack(TContent.searedBlock, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, null, searedbrick, searedbrick, null, searedbrick); + TConstructClientRegistry.registerManualLargeRecipe("smelteryfaucet", new ItemStack(TContent.searedBlock, 1, 1), searedbrick, null, searedbrick, null, searedbrick, null, null, null, null); + TConstructClientRegistry.registerManualLargeRecipe("smelterybasin", new ItemStack(TContent.searedBlock, 1, 2), searedbrick, null, searedbrick, searedbrick, null, searedbrick, searedbrick, searedbrick, searedbrick); + + // Modifier recipes + ItemStack ironpick = ToolBuilder.instance.buildTool(new ItemStack(TContent.pickaxeHead, 1, 6), new ItemStack(TContent.toolRod, 1, 2), new ItemStack(TContent.binding, 1, 6), ""); + TConstructClientRegistry.registerManualIcon("ironpick", ironpick); + ItemStack ironlongsword = ToolBuilder.instance.buildTool(new ItemStack(TContent.swordBlade, 1, 6), new ItemStack(TContent.toolRod, 1, 2), new ItemStack(TContent.handGuard, 1, 10), ""); + TConstructClientRegistry.registerManualIcon("ironlongsword", ironlongsword); + + TConstructClientRegistry.registerManualModifier("diamondmod", ironpick.copy(), new ItemStack(Item.diamond)); + TConstructClientRegistry.registerManualModifier("emeraldmod", ironpick.copy(), new ItemStack(Item.emerald)); + TConstructClientRegistry.registerManualModifier("redstonemod", ironpick.copy(), new ItemStack(Item.redstone), new ItemStack(Block.blockRedstone)); + TConstructClientRegistry.registerManualModifier("lavacrystalmod", ironpick.copy(), new ItemStack(TContent.materials, 1, 7)); + TConstructClientRegistry.registerManualModifier("lapismod", ironpick.copy(), new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Block.blockLapis)); + TConstructClientRegistry.registerManualModifier("mossmod", ironpick.copy(), new ItemStack(TContent.materials, 1, 6)); + TConstructClientRegistry.registerManualModifier("quartzmod", ironlongsword.copy(), new ItemStack(Item.netherQuartz), new ItemStack(Block.blockNetherQuartz)); + TConstructClientRegistry.registerManualModifier("blazemod", ironlongsword.copy(), new ItemStack(Item.blazePowder)); + TConstructClientRegistry.registerManualModifier("necroticmod", ironlongsword.copy(), new ItemStack(TContent.materials, 1, 8)); + TConstructClientRegistry.registerManualModifier("silkymod", ironpick.copy(), new ItemStack(TContent.materials, 1, 26)); + TConstructClientRegistry.registerManualModifier("reinforcedmod", ironpick.copy(), new ItemStack(TContent.heavyPlate, 1, 6)); + + TConstructClientRegistry.registerManualModifier("pistonmod", ironlongsword.copy(), new ItemStack(Block.pistonBase)); + TConstructClientRegistry.registerManualModifier("beheadingmod", ironlongsword.copy(), new ItemStack(Item.enderPearl), new ItemStack(Block.obsidian)); + TConstructClientRegistry.registerManualModifier("spidermod", ironlongsword.copy(), new ItemStack(Item.fermentedSpiderEye)); + TConstructClientRegistry.registerManualModifier("smitemod", ironlongsword.copy(), new ItemStack(TContent.craftedSoil, 1, 4)); + + TConstructClientRegistry.registerManualModifier("electricmod", ironpick.copy(), new ItemStack(Block.dirt), new ItemStack(Block.dirt)); + TConstructClientRegistry.registerManualModifier("tier1free", ironpick.copy(), new ItemStack(Item.diamond), new ItemStack(Block.blockGold)); + TConstructClientRegistry.registerManualModifier("tier2free", ironpick.copy(), new ItemStack(Item.netherStar)); + + TConstructClientRegistry.registerManualSmeltery("brownstone", new ItemStack(TContent.speedBlock), new ItemStack(TContent.moltenTin, 1), new ItemStack(Block.gravel)); + TConstructClientRegistry.registerManualSmeltery("clearglass", new ItemStack(TContent.glass), new ItemStack(TContent.moltenGlass, 1), null); + TConstructClientRegistry.registerManualSmeltery("searedstone", new ItemStack(TContent.smeltery, 1, 4), new ItemStack(TContent.moltenStone, 1), null); + + } + + public static Map> pageClasses = new HashMap>(); + + public static void registerManualPage(String type, Class clazz) { + pageClasses.put(type, clazz); + } + + public static Class getPageClass(String type) { + return pageClasses.get(type); + } + + void initManualPages() { + TProxyClient.registerManualPage("crafting", CraftingPage.class); + TProxyClient.registerManualPage("picture", PicturePage.class); + TProxyClient.registerManualPage("text", TextPage.class); + TProxyClient.registerManualPage("intro", TextPage.class); + TProxyClient.registerManualPage("sectionpage", SectionPage.class); + TProxyClient.registerManualPage("intro", TitlePage.class); + TProxyClient.registerManualPage("contents", ContentsTablePage.class); + TProxyClient.registerManualPage("furnace", FurnacePage.class); + TProxyClient.registerManualPage("sidebar", SidebarPage.class); + TProxyClient.registerManualPage("materialstats", MaterialPage.class); + TProxyClient.registerManualPage("toolpage", ToolPage.class); + TProxyClient.registerManualPage("modifier", ModifierPage.class); + TProxyClient.registerManualPage("blockcast", BlockCastPage.class); + + TProxyClient.registerManualPage("blank", BlankPage.class); + } + + public static Document getManualFromStack(ItemStack stack) { + switch (stack.getItemDamage()) { + case 0: + return volume1; + case 1: + return volume2; + case 2: + return smelter; + case 3: + return diary; + } + + return null; + } + + static int[][] itemIcons = { new int[] { 0, 3, 0 }, // Repair + new int[] { 1, 4, 0 }, // Pickaxe + new int[] { 2, 5, 0 }, // Shovel + new int[] { 2, 6, 0 }, // Axe + // new int[] {2, 9, 0}, //Lumber Axe + // new int[] {1, 7, 0}, //Ice Axe + new int[] { 3, 8, 0 }, // Mattock + new int[] { 1, 0, 1 }, // Broadsword + new int[] { 1, 1, 1 }, // Longsword + new int[] { 1, 2, 1 }, // Rapier + new int[] { 1, 5, 1 }, // Dagger + new int[] { 2, 3, 1 }, // Frying pan + new int[] { 2, 4, 1 }, // Battlesign + new int[] { 2, 6, 1 } // Chisel + }; + + static int[][] iconCoords = { new int[] { 0, 1, 2, 13 }, new int[] { 13, 13, 13, 13 }, // Repair + new int[] { 0, 0, 1, 13 }, new int[] { 2, 3, 3, 13 }, // Pickaxe + new int[] { 3, 0, 13, 13 }, new int[] { 2, 3, 13, 13 }, // Shovel + new int[] { 2, 0, 13, 13 }, new int[] { 2, 3, 13, 13 }, // Axe + // new int[] { 6, 0, 13, 13 }, new int[] { 2, 3, 13, 13 }, //Lumber + // Axe + // new int[] { 0, 0, 5, 13 }, new int[] { 2, 3, 3, 13 }, //Ice Axe + new int[] { 2, 0, 3, 13 }, new int[] { 2, 3, 2, 13 }, // Mattock + new int[] { 1, 0, 2, 13 }, new int[] { 2, 3, 3, 13 }, // Broadsword + new int[] { 1, 0, 3, 13 }, new int[] { 2, 3, 3, 13 }, // Longsword + new int[] { 1, 0, 4, 13 }, new int[] { 2, 3, 3, 13 }, // Rapier + new int[] { 7, 0, 4, 13 }, new int[] { 2, 3, 3, 13 }, // Dagger + new int[] { 4, 0, 13, 13 }, new int[] { 2, 3, 13, 13 }, // Frying + // Pan + new int[] { 5, 0, 13, 13 }, new int[] { 2, 3, 13, 13 }, // Battlesign + new int[] { 7, 0, 13, 13 }, new int[] { 3, 3, 13, 13 } // Chisel + }; + + static String[] toolNames = { "Repair and Modification", "Pickaxe", "Shovel", "Hatchet", + // "Lumber Axe", + // "Ice Axe", + "Mattock", "Broadsword", "Longsword", "Rapier", "Dagger", "Frying Pan", "Battlesign", "Chisel" }; + + static String[] toolDescriptions = { "The main way to repair or change your tools. Place a tool and a material on the left to get started.", "The Pickaxe is a precise mining tool. It is effective on stone and ores.\n\nRequired parts:\n- Pickaxe Head\n- Tool Binding\n- Handle", "The Shovel is a precise digging tool. It is effective on dirt, sand, and snow.\n\nRequired parts:\n- Shovel Head\n- Handle", "The Hatchet is a basic chopping tool. It is effective on wood and leaves.\n\nRequired parts:\n- Axe Head\n- Handle", + // "The Lumber Axe is a broad chopping tool. It harvests wood in a wide range and can fell entire trees.\n\nRequired parts:\n- Broad Axe Head\n- Handle", + // "The Ice Axe is a tool for harvesting ice, mining, and attacking foes.\n\nSpecial Ability:\n- Wall Climb\nNatural Ability:\n- Ice Harvest\nDamage: Moderate\n\nRequired parts:\n- Pickaxe Head\n- Spike\n- Handle", + "The Cutter Mattock is a versatile farming tool. It is effective on wood, dirt, and plants.\n\nSpecial Ability: Hoe\n\nRequired parts:\n- Axe Head\n- Shovel Head\n- Handle", "The Broadsword is a defensive weapon. Blocking cuts damage in half.\n\nSpecial Ability: Block\nDamage: Moderate\nDurability: High\n\nRequired parts:\n- Sword Blade\n- Wide Guard\n- Handle", "The Longsword is an offensive weapon. It is often used for charging into battle at full speed.\n\nNatural Ability:\n- Charge Boost\nSpecial Ability: Lunge\n\nDamage: Moderate\nDurability: Moderate", "The Rapier is a special weapon that relies on quick strikes to defeat foes.\n\nNatural Abilities:\n- Armor Pierce\n- Quick Strike\n- Charge Boost\nSpecial Ability:\n- Backpedal\n\nDamage: Low\nDurability: Low", "The Dagger is a short blade that can be thrown.\n\nSpecial Ability:\n- Throw Item\n\nDamage: Low\nDurability: Moderate\n\nRequired parts:\n- Knife Blade\n- Crossbar\n- Handle", "The Frying is a heavy weapon that uses sheer weight to stun foes.\n\nSpecial Ability: Block\nNatural Ability: Heavy\nShift+rClick: Place Frying Pan\nDamage: Low\nDurability: High\n\nRequired parts:\n- Pan\n- Handle", + // "The Battlesign is an advance in weapon technology worthy of Zombie Pigmen everywhere.\n\nSpecial Ability: Block\nShift-rClick: Place sign\nDamage: Low\nDurability: Average\n\nRequired parts:\n- Board\n- Handle" + "The Battlesign is an advance in weapon technology worthy of Zombie Pigmen everywhere.\n\nSpecial Ability: Block\nDamage: Low\nDurability: Average\n\nRequired parts:\n- Sign Board\n- Handle", "The Chisel is a utility tool that carves shapes into blocks.\n\nCrafting Grid:\n- Shape Items\nSpecial Ability: Chisel\nDurability: Average\n\nRequired parts:\n- Chisel Head\n- Handle" }; + + void addToolButtons() { + for (int i = 0; i < toolNames.length; i++) { + addToolButton(itemIcons[i][0], itemIcons[i][1], itemIcons[i][2], iconCoords[i * 2], iconCoords[i * 2 + 1], toolNames[i], toolDescriptions[i]); + } + + addToolButton(3, 9, 1, new int[] { 0, 10, 0, 13 }, new int[] { 3, 3, 3, 13 }, "Shortbow", "The Shortbow is a ranged weapon. It fires arrows quickly and precisely at its foes.\n\nDraw Speed: Quick\n\nRequired parts:\n- Tool Rod\n- Bowstring\n- Tool Rod"); + addToolButton(7, 10, 1, new int[] { 11, 0, 12, 13 }, new int[] { 3, 3, 3, 13 }, "Arrow", "Arrows are projectiles usually fired from bows.\n\nRequired parts:\n- Arrowhead\n- Tool Rod\n- Fletching"); + addTierTwoButton(6, 13, 0, new int[] { 11, 8, 9, 9 }, new int[] { 2, 3, 2, 2 }, "Hammer", "The Hammer is a broad mining tool. It harvests blocks in a wide range and is effective against undead.\n\nNatural Abilities:\nArea of Effect\n- (3x3)\n- Smite\n\nDurability: High"); + addTierTwoButton(5, 11, 0, new int[] { 6, 8, 9, 9 }, new int[] { 2, 3, 2, 3 }, "Lumber Axe", "The Lumber Axe is a broad chopping tool. It can fell entire trees or gather wood in a wide range.\n\nNatural Abilities:\nArea of Effect\n- Fell Trees\n- (3x3x3)\n\nDurability: Average"); + addTierTwoButton(5, 12, 0, new int[] { 10, 8, 9, 9 }, new int[] { 2, 3, 2, 3 }, "Excavator", "The Excavator is a broad digging tool. It harvests soil and snow in a wide range.\n\nNatural Ability:\n- Area of Effect\n- (3x3)\n\nDurability: Average"); + addTierTwoButton(4, 10, 0, new int[] { 8, 8, 9, 8 }, new int[] { 2, 3, 3, 3 }, "Scythe", "The Scythe is a broad reaping tool. It is effective on plants and attacks enemies in a wide range.\n\nNatural Ability:\nArea of Effect\n- (3x3x3)\n\nDurability: Average\nDamage: Low, AoE"); + addTierTwoButton(5, 7, 1, new int[] { 6, 8, 9, 8 }, new int[] { 3, 3, 2, 3 }, "Cleaver", "The Cleaver is a heavy defensive weapon. It has powerful strikes, but is difficult to wield.\n\nSpecial Ability: Block\nNatural Ability:\n- Beheading\n\nDamage: High\nDurability: Average"); + addTierTwoButton(5, 8, 1, new int[] { 6, 8, 6, 9 }, new int[] { 2, 3, 2, 3 }, "Battleaxe", "The Battleaxe is a heavy offensive weapon. It is capable of bringing down small trees and can send foes flying.\n\nSpecial Ability: Block\nNatural Abilities:" + "\n- Knockback\n- Area of Effect\n- (1x9)\n\nDamage: Average\nDurability: Average"); + } + + void addToolButton(int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body) { + TConstructClientRegistry.addToolButton(new ToolGuiElement(slotType, xButton, yButton, xIcons, yIcons, "tinker", title, "tinker", "textures/gui/icons.png")); + } + + void addTierTwoButton(int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body) { + TConstructClientRegistry.addTierTwoButton(new ToolGuiElement(slotType, xButton, yButton, xIcons, yIcons, "tinker", title, "tinker", "textures/gui/icons.png")); + } + + void addRenderMappings() { + String[] partTypes = { "wood", "stone", "iron", "flint", "cactus", "bone", "obsidian", "netherrack", "slime", "paper", "cobalt", "ardite", "manyullyn", "copper", "bronze", "alumite", "steel", "blueslime" }; + // String[] modPartTypes = { "thaumium" }; + String[] effectTypes = { "diamond", "emerald", "redstone", "piston", "moss", "ice", "lava", "blaze", "necrotic", "electric", "lapis", "quartz", "silk", "beheading", "smite", "spider", "reinforced" }; + int[] universalEffects = { 0, 1, 4, 9, 16 }; + int[] weaponEffects = { 3, 5, 7, 13, 14, 15 }; + int[] harvestEffects = { 2 }; + int[] nonUtility = { 6, 8, 10, 11, 12 }; + + for (int partIter = 0; partIter < partTypes.length; partIter++) { + TConstructClientRegistry.addMaterialRenderMapping(partIter, "tinker", partTypes[partIter], true); + } + + /* + * for (int iter = 0; iter < modPartTypes.length; iter++) { + * TConstructClientRegistry.addMaterialRenderMapping(31 + iter, + * "tinker", modPartTypes[iter], true); } + */ + + for (ToolCore tool : TConstructRegistry.getToolMapping()) { + for (int i = 0; i < effectTypes.length; i++) { + TConstructClientRegistry.addEffectRenderMapping(tool, i, "tinker", effectTypes[i], true); + } + } + + String[] bowstringTypes = { "string", "magicfabric" }; + for (int bowIter = 0; bowIter < bowstringTypes.length; bowIter++) { + TConstructClientRegistry.addAlternateMaterialRenderMapping(TContent.shortbow, bowIter, "tinker", bowstringTypes[bowIter], true); + } + + String[] fletching = { "feather", "leaf", "slime", "blueslime" }; + for (int arrowIter = 0; arrowIter < fletching.length; arrowIter++) { + TConstructClientRegistry.addAlternateMaterialRenderMapping(TContent.arrow, arrowIter, "tinker", fletching[arrowIter], true); + } + } + + /* Keybindings */ + public static TControls controlInstance; + + public void registerKeys() { + controlInstance = new TControls(); + TickRegistry.registerTickHandler(controlInstance, Side.CLIENT); + uploadKeyBindingsToGame(Minecraft.getMinecraft().gameSettings, controlInstance); + } + + public void uploadKeyBindingsToGame(GameSettings settings, TKeyHandler keyhandler) { + ArrayList harvestedBindings = Lists.newArrayList(); + for (KeyBinding kb : keyhandler.keyBindings) { + harvestedBindings.add(kb); + } + + KeyBinding[] modKeyBindings = harvestedBindings.toArray(new KeyBinding[harvestedBindings.size()]); + KeyBinding[] allKeys = new KeyBinding[settings.keyBindings.length + modKeyBindings.length]; + System.arraycopy(settings.keyBindings, 0, allKeys, 0, settings.keyBindings.length); + System.arraycopy(modKeyBindings, 0, allKeys, settings.keyBindings.length, modKeyBindings.length); + settings.keyBindings = allKeys; + settings.loadOptions(); + } + + public void spawnParticle(String particle, double xPos, double yPos, double zPos, double velX, double velY, double velZ) { + this.doSpawnParticle(particle, xPos, yPos, zPos, velX, velY, velZ); + } + + public EntityFX doSpawnParticle(String par1Str, double par2, double par4, double par6, double par8, double par10, double par12) { + if (this.mc == null) + this.mc = Minecraft.getMinecraft(); + + if (this.mc.renderViewEntity != null && this.mc.effectRenderer != null) { + int i = this.mc.gameSettings.particleSetting; + + if (i == 1 && mc.theWorld.rand.nextInt(3) == 0) { + i = 2; + } + + double d6 = this.mc.renderViewEntity.posX - par2; + double d7 = this.mc.renderViewEntity.posY - par4; + double d8 = this.mc.renderViewEntity.posZ - par6; + EntityFX entityfx = null; + + if (par1Str.equals("hugeexplosion")) { + this.mc.effectRenderer.addEffect(entityfx = new EntityHugeExplodeFX(mc.theWorld, par2, par4, par6, par8, par10, par12)); + } else if (par1Str.equals("largeexplode")) { + this.mc.effectRenderer.addEffect(entityfx = new EntityLargeExplodeFX(mc.renderEngine, mc.theWorld, par2, par4, par6, par8, par10, par12)); + } else if (par1Str.equals("fireworksSpark")) { + this.mc.effectRenderer.addEffect(entityfx = new EntityFireworkSparkFX(mc.theWorld, par2, par4, par6, par8, par10, par12, this.mc.effectRenderer)); + } + + if (entityfx != null) { + return (EntityFX) entityfx; + } else { + double d9 = 16.0D; + + if (d6 * d6 + d7 * d7 + d8 * d8 > d9 * d9) { + return null; + } else if (i > 1) { + return null; + } else { + if (par1Str.equals("bubble")) { + entityfx = new EntityBubbleFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("suspended")) { + entityfx = new EntitySuspendFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("depthsuspend")) { + entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("townaura")) { + entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("crit")) { + entityfx = new EntityCritFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("smoke")) { + entityfx = new EntitySmokeFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("mobSpell")) { + entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D); + ((EntityFX) entityfx).setRBGColorF((float) par8, (float) par10, (float) par12); + } else if (par1Str.equals("mobSpellAmbient")) { + entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D); + ((EntityFX) entityfx).setAlphaF(0.15F); + ((EntityFX) entityfx).setRBGColorF((float) par8, (float) par10, (float) par12); + } else if (par1Str.equals("spell")) { + entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("instantSpell")) { + entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + ((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144); + } else if (par1Str.equals("witchMagic")) { + entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + ((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144); + float f = mc.theWorld.rand.nextFloat() * 0.5F + 0.35F; + ((EntityFX) entityfx).setRBGColorF(1.0F * f, 0.0F * f, 1.0F * f); + } else if (par1Str.equals("note")) { + entityfx = new EntityNoteFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("portal")) { + entityfx = new EntityPortalFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("enchantmenttable")) { + entityfx = new EntityEnchantmentTableParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("explode")) { + entityfx = new EntityExplodeFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("flame")) { + entityfx = new EntityFlameFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("lava")) { + entityfx = new EntityLavaFX(mc.theWorld, par2, par4, par6); + } else if (par1Str.equals("footstep")) { + entityfx = new EntityFootStepFX(mc.renderEngine, mc.theWorld, par2, par4, par6); + } else if (par1Str.equals("splash")) { + entityfx = new EntitySplashFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("largesmoke")) { + entityfx = new EntitySmokeFX(mc.theWorld, par2, par4, par6, par8, par10, par12, 2.5F); + } else if (par1Str.equals("cloud")) { + entityfx = new EntityCloudFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("reddust")) { + entityfx = new EntityReddustFX(mc.theWorld, par2, par4, par6, (float) par8, (float) par10, (float) par12); + } else if (par1Str.equals("snowballpoof")) { + entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, Item.snowball); + } else if (par1Str.equals("dripWater")) { + entityfx = new EntityDropParticleFX(mc.theWorld, par2, par4, par6, Material.water); + } else if (par1Str.equals("dripLava")) { + entityfx = new EntityDropParticleFX(mc.theWorld, par2, par4, par6, Material.lava); + } else if (par1Str.equals("snowshovel")) { + entityfx = new EntitySnowShovelFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("blueslime")) { + entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, TContent.strangeFood); + } else if (par1Str.equals("heart")) { + entityfx = new EntityHeartFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("angryVillager")) { + entityfx = new EntityHeartFX(mc.theWorld, par2, par4 + 0.5D, par6, par8, par10, par12); + ((EntityFX) entityfx).setParticleTextureIndex(81); + ((EntityFX) entityfx).setRBGColorF(1.0F, 1.0F, 1.0F); + } else if (par1Str.equals("happyVillager")) { + entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12); + ((EntityFX) entityfx).setParticleTextureIndex(82); + ((EntityFX) entityfx).setRBGColorF(1.0F, 1.0F, 1.0F); + } + + if (entityfx != null) { + this.mc.effectRenderer.addEffect((EntityFX) entityfx); + } + + return (EntityFX) entityfx; + } + } + } else { + return null; + } + } } diff --git a/tconstruct/client/ToolCoreRenderer.java b/tconstruct/client/ToolCoreRenderer.java new file mode 100644 index 00000000..9bc12ee7 --- /dev/null +++ b/tconstruct/client/ToolCoreRenderer.java @@ -0,0 +1,251 @@ +package tconstruct.client; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraftforge.client.IItemRenderer; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import tconstruct.library.tools.ToolCore; + +public class ToolCoreRenderer implements IItemRenderer +{ + @Override + public boolean handleRenderType (ItemStack item, ItemRenderType type) + { + switch (type) + { + case ENTITY: + case EQUIPPED: + case EQUIPPED_FIRST_PERSON: + case INVENTORY: + return true; + default: + System.out.println("[TCon] Unhandled render case!"); + case FIRST_PERSON_MAP: + return false; + } + } + + @Override + public boolean shouldUseRenderHelper (ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return handleRenderType(item, type) & helper.ordinal() < ItemRendererHelper.EQUIPPED_BLOCK.ordinal(); + } + + private static final int toolIcons = 10; + + @Override + public void renderItem (ItemRenderType type, ItemStack item, Object... data) + { + ToolCore tool = (ToolCore) item.getItem(); + + boolean isInventory = type == ItemRenderType.INVENTORY; + Entity ent = null; + if (data.length > 1) + ent = (Entity) data[1]; + + int iconParts = toolIcons;//tool.getRenderPasses(item.getItemDamage()); + + Icon[] tempParts = new Icon[iconParts]; + label: + { + if (!isInventory && ent instanceof EntityPlayer) + { + EntityPlayer player = (EntityPlayer) ent; + ItemStack itemInUse = player.getItemInUse(); + if (itemInUse != null) + { + int useCount = player.getItemInUseCount(); + for (int i = iconParts; i-- > 0;) + tempParts[i] = tool.getIcon(item, i, player, itemInUse, useCount); + break label; + } + } + for (int i = iconParts; i-- > 0;) + tempParts[i] = tool.getIcon(item, i); + } + + int count = 0; + Icon[] parts = new Icon[iconParts]; + for (int i = 0; i < iconParts; ++i) + { + Icon part = tempParts[i]; + if (part == null || part == ToolCore.blankSprite | part == ToolCore.emptyIcon) + ++count; + else + parts[i - count] = part; + } + iconParts -= count; + + if (iconParts <= 0) + { + iconParts = 1; + // TODO: assign default sprite + // parts = new Icon[]{ defaultSprite }; + } + + Tessellator tess = Tessellator.instance; + float[] xMax = new float[iconParts]; + float[] yMin = new float[iconParts]; + float[] xMin = new float[iconParts]; + float[] yMax = new float[iconParts]; + int[] sheetWidth = new int[iconParts]; + int[] sheetHeight = new int[iconParts]; + float depth = 1f / 16f; + + float[] width = new float[iconParts]; + float[] height = new float[iconParts]; + float[] xDiff = new float[iconParts]; + float[] yDiff = new float[iconParts]; + for (int i = 0; i < iconParts; ++i) + { + Icon icon = parts[i]; + xMin[i] = icon.getMinU(); + xMax[i] = icon.getMaxU(); + yMin[i] = icon.getMinV(); + yMax[i] = icon.getMaxV(); + sheetWidth[i] = icon.getOriginX(); + sheetHeight[i] = icon.getOriginY(); + width[i] = sheetWidth[i] * (xMax[i] - xMin[i]); + height[i] = sheetHeight[i] * (yMax[i] - yMin[i]); + xDiff[i] = xMin[i] - xMax[i]; + yDiff[i] = yMin[i] - yMax[i]; + } + GL11.glPushMatrix(); + + if (type == ItemRenderType.INVENTORY) + { + GL11.glDisable(GL11.GL_LIGHTING); + tess.startDrawingQuads(); + for (int i = 0; i < iconParts; ++i) + { + tess.addVertexWithUV(0, 16, 0, xMin[i], yMax[i]); + tess.addVertexWithUV(16, 16, 0, xMax[i], yMax[i]); + tess.addVertexWithUV(16, 0, 0, xMax[i], yMin[i]); + tess.addVertexWithUV(0, 0, 0, xMin[i], yMin[i]); + } + tess.draw(); + GL11.glEnable(GL11.GL_LIGHTING); + } + else + { + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + + switch (type) + { + case EQUIPPED_FIRST_PERSON: + break; + case EQUIPPED: + GL11.glTranslatef(0, -4 / 16f, 0); + break; + case ENTITY: + GL11.glTranslatef(0, 4 / 16f, 0); + break; + default: + } + + tess.startDrawingQuads(); + tess.setNormal(0, 0, 1); + for (int i = 0; i < iconParts; ++i) + { + tess.addVertexWithUV(0, 0, 0, xMax[i], yMax[i]); + tess.addVertexWithUV(1, 0, 0, xMin[i], yMax[i]); + tess.addVertexWithUV(1, 1, 0, xMin[i], yMin[i]); + tess.addVertexWithUV(0, 1, 0, xMax[i], yMin[i]); + } + tess.draw(); + tess.startDrawingQuads(); + tess.setNormal(0, 0, -1); + for (int i = 0; i < iconParts; ++i) + { + tess.addVertexWithUV(0, 1, -depth, xMax[i], yMin[i]); + tess.addVertexWithUV(1, 1, -depth, xMin[i], yMin[i]); + tess.addVertexWithUV(1, 0, -depth, xMin[i], yMax[i]); + tess.addVertexWithUV(0, 0, -depth, xMax[i], yMax[i]); + } + tess.draw(); + tess.startDrawingQuads(); + tess.setNormal(-1, 0, 0); + int k; + float pos; + float iconPos; + + for (int i = 0; i < iconParts; ++i) + { + for (k = 0; k < width[i]; ++k) + { + pos = k / width[i]; + iconPos = xMax[i] + xDiff[i] * pos - 0.5F / sheetWidth[i]; + tess.addVertexWithUV(pos, 0, -depth, iconPos, yMax[i]); + tess.addVertexWithUV(pos, 0, 0, iconPos, yMax[i]); + tess.addVertexWithUV(pos, 1, 0, iconPos, yMin[i]); + tess.addVertexWithUV(pos, 1, -depth, iconPos, yMin[i]); + } + } + + tess.draw(); + tess.startDrawingQuads(); + tess.setNormal(1, 0, 0); + float posEnd; + + for (int i = 0; i < iconParts; ++i) + { + for (k = 0; k < width[i]; ++k) + { + pos = k / width[i]; + iconPos = xMax[i] + xDiff[i] * pos - 0.5F / sheetWidth[i]; + posEnd = pos + 1 / width[i]; + tess.addVertexWithUV(posEnd, 1, -depth, iconPos, yMin[i]); + tess.addVertexWithUV(posEnd, 1, 0, iconPos, yMin[i]); + tess.addVertexWithUV(posEnd, 0, 0, iconPos, yMax[i]); + tess.addVertexWithUV(posEnd, 0, -depth, iconPos, yMax[i]); + } + } + + tess.draw(); + tess.startDrawingQuads(); + tess.setNormal(0, 1, 0); + + for (int i = 0; i < iconParts; ++i) + { + for (k = 0; k < height[i]; ++k) + { + pos = k / height[i]; + iconPos = yMax[i] + yDiff[i] * pos - 0.5F / sheetHeight[i]; + posEnd = pos + 1 / height[i]; + tess.addVertexWithUV(0, posEnd, 0, xMax[i], iconPos); + tess.addVertexWithUV(1, posEnd, 0, xMin[i], iconPos); + tess.addVertexWithUV(1, posEnd, -depth, xMin[i], iconPos); + tess.addVertexWithUV(0, posEnd, -depth, xMax[i], iconPos); + } + } + + tess.draw(); + tess.startDrawingQuads(); + tess.setNormal(0, -1, 0); + + for (int i = 0; i < iconParts; ++i) + { + for (k = 0; k < height[i]; ++k) + { + pos = k / height[i]; + iconPos = yMax[i] + yDiff[i] * pos - 0.5F / sheetHeight[i]; + tess.addVertexWithUV(1, pos, 0, xMin[i], iconPos); + tess.addVertexWithUV(0, pos, 0, xMax[i], iconPos); + tess.addVertexWithUV(0, pos, -depth, xMax[i], iconPos); + tess.addVertexWithUV(1, pos, -depth, xMin[i], iconPos); + } + } + + tess.draw(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } + + GL11.glPopMatrix(); + } +} diff --git a/tconstruct/client/entity/projectile/ArrowRender.java b/tconstruct/client/entity/projectile/ArrowRender.java index d26f0e68..a36bbe09 100644 --- a/tconstruct/client/entity/projectile/ArrowRender.java +++ b/tconstruct/client/entity/projectile/ArrowRender.java @@ -2,19 +2,12 @@ package tconstruct.client.entity.projectile; import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.ForgeHooksClient; @@ -23,612 +16,86 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; import tconstruct.entity.projectile.ArrowEntity; - import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class ArrowRender extends Render { - private static final ResourceLocation field_110798_h = new ResourceLocation("textures/misc/enchanted_item_glint.png"); - private RenderBlocks itemRenderBlocks = new RenderBlocks(); + private static RenderItem renderer = new RenderItem(); + private Random random = new Random(); - /** The RNG used in RenderItem (for bobbing itemstacks on the ground) */ - private Random random = new Random(); - public boolean renderWithColor = true; + public ArrowRender() {} - /** Defines the zLevel of rendering of item on GUI. */ - public float zLevel; - public static boolean renderInFrame; + /** + * Renders the item + */ + public void doRenderItem(ArrowEntity arrow, double par2, double par4, double par6, float par8, float par9) + { + random.setSeed(187L); + ItemStack item = arrow.getEntityItem(); + GL11.glPushMatrix(); + GL11.glTranslatef((float)par2, (float)par4, (float)par6); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glRotatef(arrow.prevRotationYaw + (arrow.rotationYaw - arrow.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(arrow.prevRotationPitch + (arrow.rotationPitch - arrow.prevRotationPitch) * par9 - 45.0F, 0.0F, 0.0F, 1.0F); + float shake = arrow.arrowShake - par9; + if (shake > 0.0F) + GL11.glRotatef(-MathHelper.sin(shake * 3) * shake, 0, 0, 1); + GL11.glTranslatef(-7 / 16f, -8 / 16f, -1 / 32f); + float scale = 1.35f; + GL11.glScalef(scale, scale, scale); + ForgeHooksClient.renderEntityItem(null, item, 0, 0, random, renderManager.renderEngine, renderBlocks); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } - public ArrowRender() - { - this.shadowSize = 0.15F; - this.shadowOpaque = 0.75F; - } + /** + * Renders the item's icon or block into the UI at the specified position. + */ + public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) + { + renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5); + } - /** - * Renders the item - */ - public void doRenderItem (ArrowEntity par1ArrowEntity, double par2, double par4, double par6, float par8, float par9) - { - this.func_110777_b(par1ArrowEntity); - this.random.setSeed(187L); - ItemStack itemstack = par1ArrowEntity.getEntityItem(); + /** + * Render the item's icon or block into the GUI, including the glint effect. + */ + public void renderItemAndEffectIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) + { + renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5); + } - if (itemstack.getItem() != null) - { - GL11.glPushMatrix(); - float f2 = shouldBob() ? MathHelper.sin(((float) 0 + par9) / 10.0F + 0) * 0.1F + 0.1F : 0F; - float f3 = (((float) 0 + par9) / 20.0F + 0) * (180F / (float) Math.PI); - byte b0 = getMiniBlockCount(itemstack); + /** + * Renders the item's overlay information. Examples being stack count or + * damage on top of the item's image at the specified position. + */ + public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) + { + renderer.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5); + } - GL11.glTranslatef((float) par2, (float) par4 + f2, (float) par6); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - float f4; - float f5; - float f6; - int i; - - Block block = null; - if (itemstack.itemID < Block.blocksList.length) - { - block = Block.blocksList[itemstack.itemID]; - } - - if (itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())) - { - GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F); - - if (renderInFrame) - { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glTranslatef(0.0F, 0.05F, 0.0F); - GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); - } - - float f7 = 0.25F; - int j = block.getRenderType(); - - if (j == 1 || j == 19 || j == 12 || j == 2) - { - f7 = 0.5F; - } - - GL11.glScalef(f7, f7, f7); - - for (i = 0; i < b0; ++i) - { - GL11.glPushMatrix(); - - if (i > 0) - { - f5 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7; - f4 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7; - f6 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7; - GL11.glTranslatef(f5, f4, f6); - } - - f5 = 1.0F; - this.itemRenderBlocks.renderBlockAsItem(block, itemstack.getItemDamage(), f5); - GL11.glPopMatrix(); - } - } - else - { - float f8; - - if (itemstack.getItemSpriteNumber() == 1 && itemstack.getItem().requiresMultipleRenderPasses()) - { - if (renderInFrame) - { - GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F); - GL11.glTranslatef(0.0F, -0.05F, 0.0F); - } - else - { - GL11.glScalef(0.5F, 0.5F, 0.5F); - } - - for (int k = 0; k < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++k) - { - this.random.setSeed(187L); - Icon icon = itemstack.getItem().getIcon(itemstack, k); - f8 = 1.0F; - - if (this.renderWithColor) - { - i = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, k); - f5 = (float) (i >> 16 & 255) / 255.0F; - f4 = (float) (i >> 8 & 255) / 255.0F; - f6 = (float) (i & 255) / 255.0F; - GL11.glColor4f(f5 * f8, f4 * f8, f6 * f8, 1.0F); - this.renderDroppedItem(par1ArrowEntity, icon, b0, par9, f5 * f8, f4 * f8, f6 * f8, k); - } - else - { - this.renderDroppedItem(par1ArrowEntity, icon, b0, par9, 1.0F, 1.0F, 1.0F, k); - } - } - } - else - { - if (renderInFrame) - { - GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F); - GL11.glTranslatef(0.0F, -0.05F, 0.0F); - } - else - { - GL11.glScalef(0.5F, 0.5F, 0.5F); - } - - Icon icon1 = itemstack.getIconIndex(); - - if (this.renderWithColor) - { - int l = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 0); - f8 = (float) (l >> 16 & 255) / 255.0F; - float f9 = (float) (l >> 8 & 255) / 255.0F; - f5 = (float) (l & 255) / 255.0F; - f4 = 1.0F; - this.renderDroppedItem(par1ArrowEntity, icon1, b0, par9, f8 * f4, f9 * f4, f5 * f4); - } - else - { - this.renderDroppedItem(par1ArrowEntity, icon1, b0, par9, 1.0F, 1.0F, 1.0F); - } - } - } - - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - } - } - - protected ResourceLocation func_110796_a (ArrowEntity par1ArrowEntity) - { - return this.renderManager.renderEngine.func_130087_a(par1ArrowEntity.getEntityItem().getItemSpriteNumber()); - } - - /** - * Renders a dropped item - */ - private void renderDroppedItem (ArrowEntity par1ArrowEntity, Icon par2Icon, int par3, float par4, float par5, float par6, float par7) - { - renderDroppedItem(par1ArrowEntity, par2Icon, par3, par4, par5, par6, par7, 0); - } - - private void renderDroppedItem (ArrowEntity arrow, Icon par2Icon, int par3, float par4, float par5, float par6, float par7, int pass) - { - Tessellator tessellator = Tessellator.instance; - - if (par2Icon == null) - { - TextureManager texturemanager = Minecraft.getMinecraft().func_110434_K(); - ResourceLocation resourcelocation = texturemanager.func_130087_a(arrow.getEntityItem().getItemSpriteNumber()); - par2Icon = ((TextureMap) texturemanager.func_110581_b(resourcelocation)).func_110572_b("missingno"); - } - - float f4 = ((Icon) par2Icon).getMinU(); - float f5 = ((Icon) par2Icon).getMaxU(); - float f6 = ((Icon) par2Icon).getMinV(); - float f7 = ((Icon) par2Icon).getMaxV(); - float f8 = 1.0F; - float f9 = 0.5F; - float f10 = 0.25F; - float f11; - GL11.glRotatef(arrow.prevRotationYaw + (arrow.rotationYaw - arrow.prevRotationYaw) * par4 - 90.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(arrow.prevRotationPitch + (arrow.rotationPitch - arrow.prevRotationPitch) * par4 - 45.0F, 0.0F, 0.0F, 1.0F); - - GL11.glPushMatrix(); - - if (renderInFrame) - { - GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); - } - else - { - GL11.glRotatef((((float) 0 + par4) / 20.0F + 0) * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F); - } - - float f12 = 0.0625F; - f11 = 0.021875F; - ItemStack itemstack = arrow.getEntityItem(); - int j = itemstack.stackSize; - byte b0 = getMiniItemCount(itemstack); - - GL11.glTranslatef(-f9, -f10, -((f12 + f11) * (float) b0 / 2.0F)); - - for (int k = 0; k < b0; ++k) - { - // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug... - if (k > 0 && shouldSpreadItems()) - { - float x = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; - float y = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; - float z = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; - GL11.glTranslatef(x, y, f12 + f11); - } - else - { - GL11.glTranslatef(0f, 0f, f12 + f11); - } - - if (itemstack.getItemSpriteNumber() == 0) - { - this.func_110776_a(TextureMap.field_110575_b); - } - else - { - this.func_110776_a(TextureMap.field_110576_c); - } - - GL11.glColor4f(par5, par6, par7, 1.0F); - ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7, ((Icon) par2Icon).getOriginX(), ((Icon) par2Icon).getOriginY(), f12); - - if (itemstack.hasEffect(pass)) - { - GL11.glDepthFunc(GL11.GL_EQUAL); - GL11.glDisable(GL11.GL_LIGHTING); - this.renderManager.renderEngine.func_110577_a(field_110798_h); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); - float f13 = 0.76F; - GL11.glColor4f(0.5F * f13, 0.25F * f13, 0.8F * f13, 1.0F); - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glPushMatrix(); - float f14 = 0.125F; - GL11.glScalef(f14, f14, f14); - float f15 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; - GL11.glTranslatef(f15, 0.0F, 0.0F); - GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); - ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(f14, f14, f14); - f15 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; - GL11.glTranslatef(-f15, 0.0F, 0.0F); - GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); - ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12); - GL11.glPopMatrix(); - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDepthFunc(GL11.GL_LEQUAL); - } - } - - GL11.glPopMatrix(); - } - - /** - * Renders the item's icon or block into the UI at the specified position. - */ - public void renderItemIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) - { - renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, false); - } - - public void renderItemIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, boolean renderEffect) - { - int k = par3ItemStack.itemID; - int l = par3ItemStack.getItemDamage(); - Object object = par3ItemStack.getIconIndex(); - float f; - int i1; - float f1; - float f2; - - Block block = (k < Block.blocksList.length ? Block.blocksList[k] : null); - if (par3ItemStack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[k].getRenderType())) - { - par2TextureManager.func_110577_a(TextureMap.field_110575_b); - GL11.glPushMatrix(); - GL11.glTranslatef((float) (par4 - 2), (float) (par5 + 3), -3.0F + this.zLevel); - GL11.glScalef(10.0F, 10.0F, 10.0F); - GL11.glTranslatef(1.0F, 0.5F, 1.0F); - GL11.glScalef(1.0F, 1.0F, -1.0F); - GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0); - f = (float) (i1 >> 16 & 255) / 255.0F; - f1 = (float) (i1 >> 8 & 255) / 255.0F; - f2 = (float) (i1 & 255) / 255.0F; - - if (this.renderWithColor) - { - GL11.glColor4f(f, f1, f2, 1.0F); - } - - GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); - this.itemRenderBlocks.useInventoryTint = this.renderWithColor; - this.itemRenderBlocks.renderBlockAsItem(block, l, 1.0F); - this.itemRenderBlocks.useInventoryTint = true; - GL11.glPopMatrix(); - } - else if (Item.itemsList[k].requiresMultipleRenderPasses()) - { - GL11.glDisable(GL11.GL_LIGHTING); - - for (int j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1) - { - par2TextureManager.func_110577_a(par3ItemStack.getItemSpriteNumber() == 0 ? TextureMap.field_110575_b : TextureMap.field_110576_c); - Icon icon = Item.itemsList[k].getIcon(par3ItemStack, j1); - int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1); - f1 = (float) (k1 >> 16 & 255) / 255.0F; - f2 = (float) (k1 >> 8 & 255) / 255.0F; - float f3 = (float) (k1 & 255) / 255.0F; - - if (this.renderWithColor) - { - GL11.glColor4f(f1, f2, f3, 1.0F); - } - - this.renderIcon(par4, par5, icon, 16, 16); - - if (par3ItemStack.hasEffect(j1)) - { - renderEffect(par2TextureManager, par4, par5); - } - } - - GL11.glEnable(GL11.GL_LIGHTING); - } - else - { - GL11.glDisable(GL11.GL_LIGHTING); - ResourceLocation resourcelocation = par2TextureManager.func_130087_a(par3ItemStack.getItemSpriteNumber()); - par2TextureManager.func_110577_a(resourcelocation); - - if (object == null) - { - object = ((TextureMap) Minecraft.getMinecraft().func_110434_K().func_110581_b(resourcelocation)).func_110572_b("missingno"); - } - - i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0); - f = (float) (i1 >> 16 & 255) / 255.0F; - f1 = (float) (i1 >> 8 & 255) / 255.0F; - f2 = (float) (i1 & 255) / 255.0F; - - if (this.renderWithColor) - { - GL11.glColor4f(f, f1, f2, 1.0F); - } - - this.renderIcon(par4, par5, (Icon) object, 16, 16); - GL11.glEnable(GL11.GL_LIGHTING); - - if (par3ItemStack.hasEffect(0)) - { - renderEffect(par2TextureManager, par4, par5); - } - } - - GL11.glEnable(GL11.GL_CULL_FACE); - } - - private void renderEffect (TextureManager manager, int x, int y) - { - GL11.glDepthFunc(GL11.GL_GREATER); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDepthMask(false); - manager.func_110577_a(field_110798_h); - this.zLevel -= 50.0F; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR); - GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F); - this.renderGlint(x * 431278612 + y * 32178161, x - 2, y - 2, 20, 20); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDepthMask(true); - this.zLevel += 50.0F; - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDepthFunc(GL11.GL_LEQUAL); - } - - /** - * Render the item's icon or block into the GUI, including the glint effect. - */ - public void renderItemAndEffectIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) - { - if (par3ItemStack != null) - { - if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2TextureManager, par3ItemStack, renderWithColor, zLevel, (float) par4, (float) par5)) - { - this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, true); - } - - /* Modders must handle this themselves if they use custom renderers! - if (par3ItemStack.hasEffect()) - { - GL11.glDepthFunc(GL11.GL_GREATER); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDepthMask(false); - par2TextureManager.func_110577_a(field_110798_h); - this.zLevel -= 50.0F; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR); - GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F); - this.renderGlint(par4 * 431278612 + par5 * 32178161, par4 - 2, par5 - 2, 20, 20); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDepthMask(true); - this.zLevel += 50.0F; - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDepthFunc(GL11.GL_LEQUAL); - } - */ - } - } - - private void renderGlint (int par1, int par2, int par3, int par4, int par5) - { - for (int j1 = 0; j1 < 2; ++j1) - { - if (j1 == 0) - { - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); - } - - if (j1 == 1) - { - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); - } - - float f = 0.00390625F; - float f1 = 0.00390625F; - float f2 = (float) (Minecraft.getSystemTime() % (long) (3000 + j1 * 1873)) / (3000.0F + (float) (j1 * 1873)) * 256.0F; - float f3 = 0.0F; - Tessellator tessellator = Tessellator.instance; - float f4 = 4.0F; - - if (j1 == 1) - { - f4 = -1.0F; - } - - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par5 * f4) * f), (double) ((f3 + (float) par5) * f1)); - tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par4 + (float) par5 * f4) * f), - (double) ((f3 + (float) par5) * f1)); - tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + (float) par4) * f), (double) ((f3 + 0.0F) * f1)); - tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + 0.0F) * f), (double) ((f3 + 0.0F) * f1)); - tessellator.draw(); - } - } - - /** - * Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the - * specified position. - */ - public void renderItemOverlayIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) - { - this.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, (String) null); - } - - public void renderItemOverlayIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, String par6Str) - { - if (par3ItemStack != null) - { - if (par3ItemStack.stackSize > 1 || par6Str != null) - { - String s1 = par6Str == null ? String.valueOf(par3ItemStack.stackSize) : par6Str; - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); - par1FontRenderer.drawStringWithShadow(s1, par4 + 19 - 2 - par1FontRenderer.getStringWidth(s1), par5 + 6 + 3, 16777215); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_DEPTH_TEST); - } - - if (par3ItemStack.isItemDamaged()) - { - int k = (int) Math.round(13.0D - (double) par3ItemStack.getItemDamageForDisplay() * 13.0D / (double) par3ItemStack.getMaxDamage()); - int l = (int) Math.round(255.0D - (double) par3ItemStack.getItemDamageForDisplay() * 255.0D / (double) par3ItemStack.getMaxDamage()); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); - GL11.glDisable(GL11.GL_TEXTURE_2D); - Tessellator tessellator = Tessellator.instance; - int i1 = 255 - l << 16 | l << 8; - int j1 = (255 - l) / 4 << 16 | 16128; - this.renderQuad(tessellator, par4 + 2, par5 + 13, 13, 2, 0); - this.renderQuad(tessellator, par4 + 2, par5 + 13, 12, 1, j1); - this.renderQuad(tessellator, par4 + 2, par5 + 13, k, 1, i1); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - } - } - - /** - * Adds a quad to the tesselator at the specified position with the set width and height and color. Args: - * tessellator, x, y, width, height, color - */ - private void renderQuad (Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6) - { - par1Tessellator.startDrawingQuads(); - par1Tessellator.setColorOpaque_I(par6); - par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + 0), 0.0D); - par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + par5), 0.0D); - par1Tessellator.addVertex((double) (par2 + par4), (double) (par3 + par5), 0.0D); - par1Tessellator.addVertex((double) (par2 + par4), (double) (par3 + 0), 0.0D); - par1Tessellator.draw(); - } - - public void renderIcon (int par1, int par2, Icon par3Icon, int par4, int par5) - { - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + par5), (double) this.zLevel, (double) par3Icon.getMinU(), (double) par3Icon.getMaxV()); - tessellator.addVertexWithUV((double) (par1 + par4), (double) (par2 + par5), (double) this.zLevel, (double) par3Icon.getMaxU(), (double) par3Icon.getMaxV()); - tessellator.addVertexWithUV((double) (par1 + par4), (double) (par2 + 0), (double) this.zLevel, (double) par3Icon.getMaxU(), (double) par3Icon.getMinV()); - tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + 0), (double) this.zLevel, (double) par3Icon.getMinU(), (double) par3Icon.getMinV()); - tessellator.draw(); - } - - protected ResourceLocation func_110775_a (Entity par1Entity) + /** + * Actually renders the given argument. This is a synthetic bridge method, + * always casting down its argument and then handing it off to a worker + * function which does the actual work. In all probabilty, the class Render + * is generic (Render 1) - ret = 2; - if (stack.stackSize > 5) - ret = 3; - if (stack.stackSize > 20) - ret = 4; - if (stack.stackSize > 40) - ret = 5; - return ret; - } - - /** - * Allows for a subclass to override how many rendered items appear in a - * "mini item 3d stack" - * @param stack - * @return - */ - public byte getMiniItemCount (ItemStack stack) - { - byte ret = 1; - if (stack.stackSize > 1) - ret = 2; - if (stack.stackSize > 15) - ret = 3; - if (stack.stackSize > 31) - ret = 4; - return ret; + return this.renderManager.renderEngine.func_130087_a(par1ArrowEntity.getEntityItem().getItemSpriteNumber()); } } diff --git a/tconstruct/client/entity/projectile/DaggerRender.java b/tconstruct/client/entity/projectile/DaggerRender.java index 6a12bd21..fd710ee7 100644 --- a/tconstruct/client/entity/projectile/DaggerRender.java +++ b/tconstruct/client/entity/projectile/DaggerRender.java @@ -2,19 +2,12 @@ package tconstruct.client.entity.projectile; import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.ForgeHooksClient; @@ -23,23 +16,14 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; import tconstruct.entity.projectile.DaggerEntity; - import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class DaggerRender extends Render { - private static final ResourceLocation field_110798_h = new ResourceLocation("textures/misc/enchanted_item_glint.png"); - private RenderBlocks itemRenderBlocks = new RenderBlocks(); - - /** The RNG used in RenderItem (for bobbing itemstacks on the ground) */ + private static RenderItem renderer = new RenderItem(); private Random random = new Random(); - public boolean renderWithColor = true; - - /** Defines the zLevel of rendering of item on GUI. */ - public float zLevel; - public static boolean renderInFrame; public DaggerRender() { @@ -50,584 +34,77 @@ public class DaggerRender extends Render /** * Renders the item */ - public void doRenderItem (DaggerEntity par1ArrowEntity, double par2, double par4, double par6, float par8, float par9) + public void doRenderItem(DaggerEntity dagger, double par2, double par4, double par6, float par8, float par9) { - this.func_110777_b(par1ArrowEntity); - this.random.setSeed(187L); - ItemStack itemstack = par1ArrowEntity.getEntityItem(); - - if (itemstack.getItem() != null) - { - GL11.glPushMatrix(); - float f2 = shouldBob() ? MathHelper.sin(((float) 0 + par9) / 10.0F + 0) * 0.1F + 0.1F : 0F; - float f3 = (((float) 0 + par9) / 20.0F + 0) * (180F / (float) Math.PI); - byte b0 = getMiniBlockCount(itemstack); - - GL11.glTranslatef((float) par2, (float) par4 + f2, (float) par6); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - float f4; - float f5; - float f6; - int i; - - Block block = null; - if (itemstack.itemID < Block.blocksList.length) - { - block = Block.blocksList[itemstack.itemID]; - } - - if (itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())) - { - GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F); - - if (renderInFrame) - { - GL11.glScalef(1.25F, 1.25F, 1.25F); - GL11.glTranslatef(0.0F, 0.05F, 0.0F); - GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); - } - - float f7 = 0.25F; - int j = block.getRenderType(); - - if (j == 1 || j == 19 || j == 12 || j == 2) - { - f7 = 0.5F; - } - - GL11.glScalef(f7, f7, f7); - - for (i = 0; i < b0; ++i) - { - GL11.glPushMatrix(); - - if (i > 0) - { - f5 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7; - f4 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7; - f6 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7; - GL11.glTranslatef(f5, f4, f6); - } - - f5 = 1.0F; - this.itemRenderBlocks.renderBlockAsItem(block, itemstack.getItemDamage(), f5); - GL11.glPopMatrix(); - } - } - else - { - float f8; - - if (itemstack.getItemSpriteNumber() == 1 && itemstack.getItem().requiresMultipleRenderPasses()) - { - if (renderInFrame) - { - GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F); - GL11.glTranslatef(0.0F, -0.05F, 0.0F); - } - else - { - GL11.glScalef(0.5F, 0.5F, 0.5F); - } - - for (int k = 0; k < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++k) - { - this.random.setSeed(187L); - Icon icon = itemstack.getItem().getIcon(itemstack, k); - f8 = 1.0F; - - if (this.renderWithColor) - { - i = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, k); - f5 = (float) (i >> 16 & 255) / 255.0F; - f4 = (float) (i >> 8 & 255) / 255.0F; - f6 = (float) (i & 255) / 255.0F; - GL11.glColor4f(f5 * f8, f4 * f8, f6 * f8, 1.0F); - this.renderDroppedItem(par1ArrowEntity, icon, b0, par9, f5 * f8, f4 * f8, f6 * f8, k); - } - else - { - this.renderDroppedItem(par1ArrowEntity, icon, b0, par9, 1.0F, 1.0F, 1.0F, k); - } - } - } - else - { - if (renderInFrame) - { - GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F); - GL11.glTranslatef(0.0F, -0.05F, 0.0F); - } - else - { - GL11.glScalef(0.5F, 0.5F, 0.5F); - } - - Icon icon1 = itemstack.getIconIndex(); - - if (this.renderWithColor) - { - int l = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 0); - f8 = (float) (l >> 16 & 255) / 255.0F; - float f9 = (float) (l >> 8 & 255) / 255.0F; - f5 = (float) (l & 255) / 255.0F; - f4 = 1.0F; - this.renderDroppedItem(par1ArrowEntity, icon1, b0, par9, f8 * f4, f9 * f4, f5 * f4); - } - else - { - this.renderDroppedItem(par1ArrowEntity, icon1, b0, par9, 1.0F, 1.0F, 1.0F); - } - } - } - - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - } - } - - protected ResourceLocation func_110796_a (DaggerEntity par1ArrowEntity) - { - return this.renderManager.renderEngine.func_130087_a(par1ArrowEntity.getEntityItem().getItemSpriteNumber()); - } - - /** - * Renders a dropped item - */ - private void renderDroppedItem (DaggerEntity par1ArrowEntity, Icon par2Icon, int par3, float par4, float par5, float par6, float par7) - { - renderDroppedItem(par1ArrowEntity, par2Icon, par3, par4, par5, par6, par7, 0); - } - - private void renderDroppedItem (DaggerEntity dagger, Icon par2Icon, int par3, float par4, float par5, float par6, float par7, int pass) - { - Tessellator tessellator = Tessellator.instance; - - if (par2Icon == null) - { - TextureManager texturemanager = Minecraft.getMinecraft().func_110434_K(); - ResourceLocation resourcelocation = texturemanager.func_130087_a(dagger.getEntityItem().getItemSpriteNumber()); - par2Icon = ((TextureMap) texturemanager.func_110581_b(resourcelocation)).func_110572_b("missingno"); - } - - float f4 = ((Icon) par2Icon).getMinU(); - float f5 = ((Icon) par2Icon).getMaxU(); - float f6 = ((Icon) par2Icon).getMinV(); - float f7 = ((Icon) par2Icon).getMaxV(); - float f8 = 1.0F; - float f9 = 0.5F; - float f10 = 0.25F; - float f11; - float rotation = dagger.prevRotationPitch + (dagger.rotationPitch - dagger.prevRotationPitch) * par7; - + random.setSeed(187L); + ItemStack item = dagger.getEntityItem(); GL11.glPushMatrix(); - - if (renderInFrame) - { - GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); - } - else - { - GL11.glRotatef((((float) 0 + par4) / 20.0F + 0) * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F); - } - - float f12 = 0.0625F; - f11 = 0.021875F; - ItemStack itemstack = dagger.getEntityItem(); - int j = itemstack.stackSize; - byte b0 = getMiniItemCount(itemstack); - - GL11.glTranslatef(-f9, -f10, -((f12 + f11) * (float) b0 / 2.0F)); - - for (int k = 0; k < b0; ++k) - { - // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug... - if (k > 0 && shouldSpreadItems()) - { - float x = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; - float y = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; - float z = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; - GL11.glTranslatef(x, y, f12 + f11); - } - else - { - GL11.glTranslatef(0f, 0f, f12 + f11); - } - - if (itemstack.getItemSpriteNumber() == 0) - { - this.func_110776_a(TextureMap.field_110575_b); - } - else - { - this.func_110776_a(TextureMap.field_110576_c); - } - - GL11.glColor4f(par5, par6, par7, 1.0F); - ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7, ((Icon) par2Icon).getOriginX(), ((Icon) par2Icon).getOriginY(), f12); - - if (itemstack.hasEffect(pass)) - { - GL11.glDepthFunc(GL11.GL_EQUAL); - GL11.glDisable(GL11.GL_LIGHTING); - this.renderManager.renderEngine.func_110577_a(field_110798_h); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); - float f13 = 0.76F; - GL11.glColor4f(0.5F * f13, 0.25F * f13, 0.8F * f13, 1.0F); - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glPushMatrix(); - float f14 = 0.125F; - GL11.glScalef(f14, f14, f14); - float f15 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; - GL11.glTranslatef(f15, 0.0F, 0.0F); - GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); - ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(f14, f14, f14); - f15 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; - GL11.glTranslatef(-f15, 0.0F, 0.0F); - GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); - ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12); - GL11.glPopMatrix(); - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDepthFunc(GL11.GL_LEQUAL); - } - } - + GL11.glTranslatef((float)par2, (float)par4, (float)par6); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glRotatef(dagger.prevRotationYaw + (dagger.rotationYaw - dagger.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(dagger.prevRotationPitch + (dagger.rotationPitch - dagger.prevRotationPitch) * par9 - 45.0F, 0.0F, 0.0F, 1.0F); + + float rotation = dagger.prevRotationPitch + (dagger.rotationPitch - dagger.prevRotationPitch) * par9; + GL11.glRotatef(dagger.rotationYaw + 90, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(rotation * 15, 0.0F, 0.0F, 1.0F); + + float shake = dagger.arrowShake - par9; + if (shake > 0.0F) + GL11.glRotatef(-MathHelper.sin(shake * 3) * shake, 0, 0, 1); + GL11.glTranslatef(-7 / 16f, -8 / 16f, -1 / 32f); + float scale = 1.35f; + GL11.glScalef(scale, scale, scale); + ForgeHooksClient.renderEntityItem(null, item, 0, 0, random, renderManager.renderEngine, renderBlocks); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); } /** * Renders the item's icon or block into the UI at the specified position. */ - public void renderItemIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) + public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) { - renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, false); - } - - public void renderItemIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, boolean renderEffect) - { - int k = par3ItemStack.itemID; - int l = par3ItemStack.getItemDamage(); - Object object = par3ItemStack.getIconIndex(); - float f; - int i1; - float f1; - float f2; - - Block block = (k < Block.blocksList.length ? Block.blocksList[k] : null); - if (par3ItemStack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[k].getRenderType())) - { - par2TextureManager.func_110577_a(TextureMap.field_110575_b); - GL11.glPushMatrix(); - GL11.glTranslatef((float) (par4 - 2), (float) (par5 + 3), -3.0F + this.zLevel); - GL11.glScalef(10.0F, 10.0F, 10.0F); - GL11.glTranslatef(1.0F, 0.5F, 1.0F); - GL11.glScalef(1.0F, 1.0F, -1.0F); - GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0); - f = (float) (i1 >> 16 & 255) / 255.0F; - f1 = (float) (i1 >> 8 & 255) / 255.0F; - f2 = (float) (i1 & 255) / 255.0F; - - if (this.renderWithColor) - { - GL11.glColor4f(f, f1, f2, 1.0F); - } - - GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); - this.itemRenderBlocks.useInventoryTint = this.renderWithColor; - this.itemRenderBlocks.renderBlockAsItem(block, l, 1.0F); - this.itemRenderBlocks.useInventoryTint = true; - GL11.glPopMatrix(); - } - else if (Item.itemsList[k].requiresMultipleRenderPasses()) - { - GL11.glDisable(GL11.GL_LIGHTING); - - for (int j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1) - { - par2TextureManager.func_110577_a(par3ItemStack.getItemSpriteNumber() == 0 ? TextureMap.field_110575_b : TextureMap.field_110576_c); - Icon icon = Item.itemsList[k].getIcon(par3ItemStack, j1); - int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1); - f1 = (float) (k1 >> 16 & 255) / 255.0F; - f2 = (float) (k1 >> 8 & 255) / 255.0F; - float f3 = (float) (k1 & 255) / 255.0F; - - if (this.renderWithColor) - { - GL11.glColor4f(f1, f2, f3, 1.0F); - } - - this.renderIcon(par4, par5, icon, 16, 16); - - if (par3ItemStack.hasEffect(j1)) - { - renderEffect(par2TextureManager, par4, par5); - } - } - - GL11.glEnable(GL11.GL_LIGHTING); - } - else - { - GL11.glDisable(GL11.GL_LIGHTING); - ResourceLocation resourcelocation = par2TextureManager.func_130087_a(par3ItemStack.getItemSpriteNumber()); - par2TextureManager.func_110577_a(resourcelocation); - - if (object == null) - { - object = ((TextureMap) Minecraft.getMinecraft().func_110434_K().func_110581_b(resourcelocation)).func_110572_b("missingno"); - } - - i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0); - f = (float) (i1 >> 16 & 255) / 255.0F; - f1 = (float) (i1 >> 8 & 255) / 255.0F; - f2 = (float) (i1 & 255) / 255.0F; - - if (this.renderWithColor) - { - GL11.glColor4f(f, f1, f2, 1.0F); - } - - this.renderIcon(par4, par5, (Icon) object, 16, 16); - GL11.glEnable(GL11.GL_LIGHTING); - - if (par3ItemStack.hasEffect(0)) - { - renderEffect(par2TextureManager, par4, par5); - } - } - - GL11.glEnable(GL11.GL_CULL_FACE); - } - - private void renderEffect (TextureManager manager, int x, int y) - { - GL11.glDepthFunc(GL11.GL_GREATER); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDepthMask(false); - manager.func_110577_a(field_110798_h); - this.zLevel -= 50.0F; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR); - GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F); - this.renderGlint(x * 431278612 + y * 32178161, x - 2, y - 2, 20, 20); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDepthMask(true); - this.zLevel += 50.0F; - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDepthFunc(GL11.GL_LEQUAL); + renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5); } /** * Render the item's icon or block into the GUI, including the glint effect. */ - public void renderItemAndEffectIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) + public void renderItemAndEffectIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) { - if (par3ItemStack != null) - { - if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2TextureManager, par3ItemStack, renderWithColor, zLevel, (float) par4, (float) par5)) - { - this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, true); - } - - /* Modders must handle this themselves if they use custom renderers! - if (par3ItemStack.hasEffect()) - { - GL11.glDepthFunc(GL11.GL_GREATER); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDepthMask(false); - par2TextureManager.func_110577_a(field_110798_h); - this.zLevel -= 50.0F; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR); - GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F); - this.renderGlint(par4 * 431278612 + par5 * 32178161, par4 - 2, par5 - 2, 20, 20); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDepthMask(true); - this.zLevel += 50.0F; - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDepthFunc(GL11.GL_LEQUAL); - } - */ - } - } - - private void renderGlint (int par1, int par2, int par3, int par4, int par5) - { - for (int j1 = 0; j1 < 2; ++j1) - { - if (j1 == 0) - { - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); - } - - if (j1 == 1) - { - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); - } - - float f = 0.00390625F; - float f1 = 0.00390625F; - float f2 = (float) (Minecraft.getSystemTime() % (long) (3000 + j1 * 1873)) / (3000.0F + (float) (j1 * 1873)) * 256.0F; - float f3 = 0.0F; - Tessellator tessellator = Tessellator.instance; - float f4 = 4.0F; - - if (j1 == 1) - { - f4 = -1.0F; - } - - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par5 * f4) * f), (double) ((f3 + (float) par5) * f1)); - tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par4 + (float) par5 * f4) * f), - (double) ((f3 + (float) par5) * f1)); - tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + (float) par4) * f), (double) ((f3 + 0.0F) * f1)); - tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + 0.0F) * f), (double) ((f3 + 0.0F) * f1)); - tessellator.draw(); - } + renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5); } /** - * Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the - * specified position. + * Renders the item's overlay information. Examples being stack count or + * damage on top of the item's image at the specified position. */ - public void renderItemOverlayIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) + public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) { - this.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, (String) null); - } - - public void renderItemOverlayIntoGUI (FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, String par6Str) - { - if (par3ItemStack != null) - { - if (par3ItemStack.stackSize > 1 || par6Str != null) - { - String s1 = par6Str == null ? String.valueOf(par3ItemStack.stackSize) : par6Str; - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); - par1FontRenderer.drawStringWithShadow(s1, par4 + 19 - 2 - par1FontRenderer.getStringWidth(s1), par5 + 6 + 3, 16777215); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_DEPTH_TEST); - } - - if (par3ItemStack.isItemDamaged()) - { - int k = (int) Math.round(13.0D - (double) par3ItemStack.getItemDamageForDisplay() * 13.0D / (double) par3ItemStack.getMaxDamage()); - int l = (int) Math.round(255.0D - (double) par3ItemStack.getItemDamageForDisplay() * 255.0D / (double) par3ItemStack.getMaxDamage()); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); - GL11.glDisable(GL11.GL_TEXTURE_2D); - Tessellator tessellator = Tessellator.instance; - int i1 = 255 - l << 16 | l << 8; - int j1 = (255 - l) / 4 << 16 | 16128; - this.renderQuad(tessellator, par4 + 2, par5 + 13, 13, 2, 0); - this.renderQuad(tessellator, par4 + 2, par5 + 13, 12, 1, j1); - this.renderQuad(tessellator, par4 + 2, par5 + 13, k, 1, i1); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - } + renderer.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5); } /** - * Adds a quad to the tesselator at the specified position with the set width and height and color. Args: - * tessellator, x, y, width, height, color + * Actually renders the given argument. This is a synthetic bridge method, + * always casting down its argument and then handing it off to a worker + * function which does the actual work. In all probabilty, the class Render + * is generic (Render 1) - ret = 2; - if (stack.stackSize > 5) - ret = 3; - if (stack.stackSize > 20) - ret = 4; - if (stack.stackSize > 40) - ret = 5; - return ret; - } - - /** - * Allows for a subclass to override how many rendered items appear in a - * "mini item 3d stack" - * @param stack - * @return - */ - public byte getMiniItemCount (ItemStack stack) - { - byte ret = 1; - if (stack.stackSize > 1) - ret = 2; - if (stack.stackSize > 15) - ret = 3; - if (stack.stackSize > 31) - ret = 4; - return ret; + return this.renderManager.renderEngine.func_130087_a(par1ArrowEntity.getEntityItem().getItemSpriteNumber()); } } diff --git a/tconstruct/common/TContent.java b/tconstruct/common/TContent.java index 38b6f0ea..28579640 100644 --- a/tconstruct/common/TContent.java +++ b/tconstruct/common/TContent.java @@ -8,6 +8,7 @@ import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.BlockDispenser; +import net.minecraft.block.StepSound; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.block.material.MaterialLiquid; @@ -15,10 +16,7 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EnumCreatureType; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.FurnaceRecipes; -import net.minecraft.item.crafting.RecipesTools; -import net.minecraft.item.crafting.RecipesWeapons; import net.minecraft.item.crafting.ShapedRecipes; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; @@ -40,6 +38,7 @@ import tconstruct.blocks.Aggregator; import tconstruct.blocks.CraftingStationBlock; import tconstruct.blocks.DryingRack; import tconstruct.blocks.EquipBlock; +import tconstruct.blocks.EssenceExtractor; import tconstruct.blocks.GlassBlockConnected; import tconstruct.blocks.GlassBlockConnectedMeta; import tconstruct.blocks.GlassPane; @@ -69,6 +68,7 @@ import tconstruct.blocks.logic.CastingTableLogic; import tconstruct.blocks.logic.CraftingStationLogic; import tconstruct.blocks.logic.DrawbridgeLogic; import tconstruct.blocks.logic.DryingRackLogic; +import tconstruct.blocks.logic.EssenceExtractorLogic; import tconstruct.blocks.logic.FaucetLogic; import tconstruct.blocks.logic.FirestarterLogic; import tconstruct.blocks.logic.FrypanLogic; @@ -82,8 +82,15 @@ import tconstruct.blocks.logic.SmelteryLogic; import tconstruct.blocks.logic.StencilTableLogic; import tconstruct.blocks.logic.ToolForgeLogic; import tconstruct.blocks.logic.ToolStationLogic; +import tconstruct.blocks.slime.SlimeFluid; +import tconstruct.blocks.slime.SlimeGel; +import tconstruct.blocks.slime.SlimeGrass; +import tconstruct.blocks.slime.SlimeLeaves; +import tconstruct.blocks.slime.SlimeSapling; +import tconstruct.blocks.slime.SlimeTallGrass; import tconstruct.blocks.traps.BarricadeBlock; import tconstruct.blocks.traps.Punji; +import tconstruct.client.StepSoundSlime; import tconstruct.entity.Automaton; import tconstruct.entity.BlueSlime; import tconstruct.entity.Crystal; @@ -96,6 +103,7 @@ import tconstruct.entity.projectile.LaunchedPotion; import tconstruct.items.Bowstring; import tconstruct.items.CraftingItem; import tconstruct.items.DiamondApple; +import tconstruct.items.EssenceCrystal; import tconstruct.items.FilledBucket; import tconstruct.items.Fletching; import tconstruct.items.GoldenHead; @@ -129,6 +137,11 @@ import tconstruct.items.blocks.OreberryBushSecondItem; import tconstruct.items.blocks.RedstoneMachineItem; import tconstruct.items.blocks.SearedSlabItem; import tconstruct.items.blocks.SearedTableItemBlock; +import tconstruct.items.blocks.SlimeGelItemBlock; +import tconstruct.items.blocks.SlimeGrassItemBlock; +import tconstruct.items.blocks.SlimeLeavesItemBlock; +import tconstruct.items.blocks.SlimeSaplingItemBlock; +import tconstruct.items.blocks.SlimeTallGrassItem; import tconstruct.items.blocks.SmelteryItemBlock; import tconstruct.items.blocks.SpeedBlockItem; import tconstruct.items.blocks.SpeedSlabItem; @@ -319,6 +332,8 @@ public class TContent implements IFuelHandler //Crystalline public static Block aggregator; public static Block lightCrystalBase; + public static Block essenceExtractor; + public static Item essenceCrystal; //Liquids public static Material liquidMetal; @@ -346,6 +361,8 @@ public class TContent implements IFuelHandler public static Fluid moltenShinyFluid; public static Fluid moltenInvarFluid; public static Fluid moltenElectrumFluid; + public static Fluid moltenEnderFluid; + public static Fluid blueSlimeFluid; public static Block moltenIron; public static Block moltenGold; @@ -370,6 +387,16 @@ public class TContent implements IFuelHandler public static Block moltenShiny; public static Block moltenInvar; public static Block moltenElectrum; + public static Block moltenEnder; + + //Slime + public static StepSound slimeStep; + public static Block slimePool; + public static Block slimeGel; + public static Block slimeGrass; + public static Block slimeTallGrass; + public static SlimeLeaves slimeLeaves; + public static SlimeSapling slimeSapling; //Ores public static Block oreSlag; @@ -448,7 +475,7 @@ public class TContent implements IFuelHandler BiomeGenBase[] nether = BiomeDictionary.getBiomesForType(BiomeDictionary.Type.NETHER); - if (PHConstruct.blueSlime) + /*if (PHConstruct.blueSlime) { EntityRegistry.addSpawn(BlueSlime.class, PHConstruct.blueSlimeWeight, 4, 4, EnumCreatureType.monster, plains); EntityRegistry.addSpawn(BlueSlime.class, PHConstruct.blueSlimeWeight, 4, 4, EnumCreatureType.monster, mountain); @@ -470,11 +497,11 @@ public class TContent implements IFuelHandler catch (Exception e) { - } + }*/ } - public static Fluid[] fluids = new Fluid[23]; - public static Block[] fluidBlocks = new Block[23]; + public static Fluid[] fluids = new Fluid[25]; + public static Block[] fluidBlocks = new Block[25]; void registerBlocks () { @@ -537,6 +564,10 @@ public class TContent implements IFuelHandler GameRegistry.registerBlock(redstoneMachine, RedstoneMachineItem.class, "Redstone.Machine"); GameRegistry.registerTileEntity(DrawbridgeLogic.class, "Drawbridge"); GameRegistry.registerTileEntity(FirestarterLogic.class, "Firestarter"); + + essenceExtractor = new EssenceExtractor(PHConstruct.essenceExtractor).setHardness(12f).setUnlocalizedName("extractor.essence"); + GameRegistry.registerBlock(essenceExtractor, "extractor.essence"); + GameRegistry.registerTileEntity(EssenceExtractorLogic.class, "extractor.essence"); //Traps landmine = new BlockLandmine(PHConstruct.landmine).setHardness(0.5F).setResistance(0F).setStepSound(Block.soundMetalFootstep).setCreativeTab(CreativeTabs.tabRedstone) @@ -567,211 +598,247 @@ public class TContent implements IFuelHandler liquidMetal = new MaterialLiquid(MapColor.tntColor); moltenIronFluid = new Fluid("Molten Iron"); + FluidRegistry.registerFluid(moltenIronFluid); moltenIron = new LiquidMetalFinite(PHConstruct.moltenIron, moltenIronFluid, "liquid_iron").setUnlocalizedName("metal.molten.iron"); GameRegistry.registerBlock(moltenIron, "metal.molten.iron"); moltenIronFluid.setBlockID(moltenIron).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[0] = moltenIronFluid; fluidBlocks[0] = moltenIron; - FluidRegistry.registerFluid(moltenIronFluid); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenIronFluid, 1), new ItemStack(buckets, 1, 0), new ItemStack(Item.bucketEmpty))); moltenGoldFluid = new Fluid("Molten Gold"); + FluidRegistry.registerFluid(moltenGoldFluid); moltenGold = new LiquidMetalFinite(PHConstruct.moltenGold, moltenGoldFluid, "liquid_gold").setUnlocalizedName("metal.molten.gold"); GameRegistry.registerBlock(moltenGold, "metal.molten.gold"); moltenGoldFluid.setBlockID(moltenGold).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[1] = moltenGoldFluid; fluidBlocks[1] = moltenGold; - FluidRegistry.registerFluid(moltenGoldFluid); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenGoldFluid, 1), new ItemStack(buckets, 1, 1), new ItemStack(Item.bucketEmpty))); moltenCopperFluid = new Fluid("Molten Copper"); + FluidRegistry.registerFluid(moltenCopperFluid); moltenCopper = new LiquidMetalFinite(PHConstruct.moltenCopper, moltenCopperFluid, "liquid_copper").setUnlocalizedName("metal.molten.copper"); GameRegistry.registerBlock(moltenCopper, "metal.molten.copper"); moltenCopperFluid.setBlockID(moltenCopper).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[2] = moltenCopperFluid; fluidBlocks[2] = moltenCopper; - FluidRegistry.registerFluid(moltenCopperFluid); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenCopperFluid, 1), new ItemStack(buckets, 1, 2), new ItemStack(Item.bucketEmpty))); moltenTinFluid = new Fluid("Molten Tin"); + FluidRegistry.registerFluid(moltenTinFluid); moltenTin = new LiquidMetalFinite(PHConstruct.moltenTin, moltenTinFluid, "liquid_tin").setUnlocalizedName("metal.molten.tin"); GameRegistry.registerBlock(moltenTin, "metal.molten.tin"); moltenTinFluid.setBlockID(moltenTin).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[3] = moltenTinFluid; fluidBlocks[3] = moltenTin; - FluidRegistry.registerFluid(moltenTinFluid); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenTinFluid, 1), new ItemStack(buckets, 1, 3), new ItemStack(Item.bucketEmpty))); moltenAluminumFluid = new Fluid("Molten Aluminum"); + FluidRegistry.registerFluid(moltenAluminumFluid); moltenAluminum = new LiquidMetalFinite(PHConstruct.moltenAluminum, moltenAluminumFluid, "liquid_aluminum").setUnlocalizedName("metal.molten.aluminum"); GameRegistry.registerBlock(moltenAluminum, "metal.molten.aluminum"); moltenAluminumFluid.setBlockID(moltenAluminum).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[4] = moltenAluminumFluid; fluidBlocks[4] = moltenAluminum; - FluidRegistry.registerFluid(moltenAluminumFluid); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenAluminumFluid, 1), new ItemStack(buckets, 1, 4), new ItemStack(Item.bucketEmpty))); moltenCobaltFluid = new Fluid("Molten Cobalt"); + FluidRegistry.registerFluid(moltenCobaltFluid); moltenCobalt = new LiquidMetalFinite(PHConstruct.moltenCobalt, moltenCobaltFluid, "liquid_cobalt").setUnlocalizedName("metal.molten.cobalt"); GameRegistry.registerBlock(moltenCobalt, "metal.molten.cobalt"); moltenCobaltFluid.setBlockID(moltenCobalt).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[5] = moltenCobaltFluid; fluidBlocks[5] = moltenCobalt; - FluidRegistry.registerFluid(moltenCobaltFluid); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenCobaltFluid, 1), new ItemStack(buckets, 1, 5), new ItemStack(Item.bucketEmpty))); moltenArditeFluid = new Fluid("Molten Ardite"); + FluidRegistry.registerFluid(moltenArditeFluid); moltenArdite = new LiquidMetalFinite(PHConstruct.moltenArdite, moltenArditeFluid, "liquid_ardite").setUnlocalizedName("metal.molten.ardite"); GameRegistry.registerBlock(moltenArdite, "metal.molten.ardite"); moltenArditeFluid.setBlockID(moltenArdite).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[6] = moltenArditeFluid; fluidBlocks[6] = moltenArdite; - FluidRegistry.registerFluid(moltenArditeFluid); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenArditeFluid, 1), new ItemStack(buckets, 1, 6), new ItemStack(Item.bucketEmpty))); moltenBronzeFluid = new Fluid("Molten Bronze"); + FluidRegistry.registerFluid(moltenBronzeFluid); moltenBronze = new LiquidMetalFinite(PHConstruct.moltenBronze, moltenBronzeFluid, "liquid_bronze").setUnlocalizedName("metal.molten.bronze"); GameRegistry.registerBlock(moltenBronze, "metal.molten.bronze"); moltenBronzeFluid.setBlockID(moltenBronze).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[7] = moltenBronzeFluid; fluidBlocks[7] = moltenBronze; - FluidRegistry.registerFluid(moltenBronzeFluid); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenBronzeFluid, 1), new ItemStack(buckets, 1, 7), new ItemStack(Item.bucketEmpty))); moltenAlubrassFluid = new Fluid("Molten Aluminum Brass"); + FluidRegistry.registerFluid(moltenAlubrassFluid); moltenAlubrass = new LiquidMetalFinite(PHConstruct.moltenAlubrass, moltenAlubrassFluid, "liquid_alubrass").setUnlocalizedName("metal.molten.alubrass"); GameRegistry.registerBlock(moltenAlubrass, "metal.molten.alubrass"); moltenAlubrassFluid.setBlockID(moltenAlubrass).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[8] = moltenAlubrassFluid; fluidBlocks[8] = moltenAlubrass; - FluidRegistry.registerFluid(moltenAlubrassFluid); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenAlubrassFluid, 1), new ItemStack(buckets, 1, 8), new ItemStack(Item.bucketEmpty))); moltenManyullynFluid = new Fluid("Molten Manyullyn"); + FluidRegistry.registerFluid(moltenManyullynFluid); moltenManyullyn = new LiquidMetalFinite(PHConstruct.moltenManyullyn, moltenManyullynFluid, "liquid_manyullyn").setUnlocalizedName("metal.molten.manyullyn"); GameRegistry.registerBlock(moltenManyullyn, "metal.molten.manyullyn"); moltenManyullynFluid.setBlockID(moltenManyullyn).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[9] = moltenManyullynFluid; fluidBlocks[9] = moltenManyullyn; - FluidRegistry.registerFluid(moltenManyullynFluid); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenManyullynFluid, 1), new ItemStack(buckets, 1, 9), new ItemStack(Item.bucketEmpty))); moltenAlumiteFluid = new Fluid("Molten Alumite"); + FluidRegistry.registerFluid(moltenAlumiteFluid); moltenAlumite = new LiquidMetalFinite(PHConstruct.moltenAlumite, moltenAlumiteFluid, "liquid_alumite").setUnlocalizedName("metal.molten.alumite"); GameRegistry.registerBlock(moltenAlumite, "metal.molten.alumite"); moltenAlumiteFluid.setBlockID(moltenAlumite).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[10] = moltenAlumiteFluid; fluidBlocks[10] = moltenAlumite; - FluidRegistry.registerFluid(moltenAlumiteFluid); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenAlumiteFluid, 1), new ItemStack(buckets, 1, 10), new ItemStack(Item.bucketEmpty))); moltenObsidianFluid = new Fluid("Molten Obsidian"); + FluidRegistry.registerFluid(moltenObsidianFluid); moltenObsidian = new LiquidMetalFinite(PHConstruct.moltenObsidian, moltenObsidianFluid, "liquid_obsidian").setUnlocalizedName("metal.molten.obsidian"); GameRegistry.registerBlock(moltenObsidian, "metal.molten.obsidian"); moltenObsidianFluid.setBlockID(moltenObsidian).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[11] = moltenObsidianFluid; fluidBlocks[11] = moltenObsidian; - FluidRegistry.registerFluid(moltenObsidianFluid); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenObsidianFluid, 1), new ItemStack(buckets, 1, 11), new ItemStack(Item.bucketEmpty))); moltenSteelFluid = new Fluid("Molten Steel"); + FluidRegistry.registerFluid(moltenSteelFluid); moltenSteel = new LiquidMetalFinite(PHConstruct.moltenSteel, moltenSteelFluid, "liquid_steel").setUnlocalizedName("metal.molten.steel"); GameRegistry.registerBlock(moltenSteel, "metal.molten.steel"); moltenSteelFluid.setBlockID(moltenSteel).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[12] = moltenSteelFluid; fluidBlocks[12] = moltenSteel; - FluidRegistry.registerFluid(moltenSteelFluid); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenSteelFluid, 1), new ItemStack(buckets, 1, 12), new ItemStack(Item.bucketEmpty))); moltenGlassFluid = new Fluid("Molten Glass"); + FluidRegistry.registerFluid(moltenGlassFluid); moltenGlass = new LiquidMetalFinite(PHConstruct.moltenGlass, moltenGlassFluid, "liquid_glass").setUnlocalizedName("metal.molten.glass"); GameRegistry.registerBlock(moltenGlass, "metal.molten.glass"); moltenGlassFluid.setBlockID(moltenGlass).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[13] = moltenGlassFluid; fluidBlocks[13] = moltenGlass; - FluidRegistry.registerFluid(moltenGlassFluid); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenGlassFluid, 1), new ItemStack(buckets, 1, 13), new ItemStack(Item.bucketEmpty))); moltenStoneFluid = new Fluid("Seared Stone"); + FluidRegistry.registerFluid(moltenStoneFluid); moltenStone = new LiquidMetalFinite(PHConstruct.moltenStone, moltenStoneFluid, "liquid_stone").setUnlocalizedName("molten.stone"); GameRegistry.registerBlock(moltenStone, "molten.stone"); moltenStoneFluid.setBlockID(moltenStone).setLuminosity(12).setDensity(3000).setViscosity(6000); fluids[14] = moltenStoneFluid; fluidBlocks[14] = moltenStone; - FluidRegistry.registerFluid(moltenStoneFluid); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenStoneFluid, 1), new ItemStack(buckets, 1, 14), new ItemStack(Item.bucketEmpty))); moltenEmeraldFluid = new Fluid("Liquified Emerald"); + FluidRegistry.registerFluid(moltenEmeraldFluid); moltenEmerald = new LiquidMetalFinite(PHConstruct.moltenEmerald, moltenEmeraldFluid, "liquid_villager").setUnlocalizedName("molten.emerald"); GameRegistry.registerBlock(moltenEmerald, "molten.emerald"); moltenEmeraldFluid.setBlockID(moltenEmerald).setDensity(3000).setViscosity(6000); fluids[15] = moltenEmeraldFluid; fluidBlocks[15] = moltenEmerald; - FluidRegistry.registerFluid(moltenEmeraldFluid); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenEmeraldFluid, 1), new ItemStack(buckets, 1, 15), new ItemStack(Item.bucketEmpty))); bloodFluid = new Fluid("Blood"); + FluidRegistry.registerFluid(bloodFluid); blood = new LiquidMetalFinite(PHConstruct.blood, bloodFluid, "liquid_cow").setUnlocalizedName("liquid.blood"); GameRegistry.registerBlock(blood, "liquid.blood"); bloodFluid.setBlockID(blood).setDensity(3000).setViscosity(6000); fluids[16] = bloodFluid; fluidBlocks[16] = blood; - FluidRegistry.registerFluid(bloodFluid); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(bloodFluid, 1), new ItemStack(buckets, 1, 16), new ItemStack(Item.bucketEmpty))); - moltenNickelFluid = new Fluid("Molten Nickel"); + moltenNickelFluid = new Fluid("nickel.molten"); + FluidRegistry.registerFluid(moltenNickelFluid); moltenNickel = new LiquidMetalFinite(PHConstruct.moltenNickel, moltenNickelFluid, "liquid_ferrous").setUnlocalizedName("metal.molten.nickel"); GameRegistry.registerBlock(moltenNickel, "metal.molten.nickel"); moltenNickelFluid.setBlockID(moltenNickel).setDensity(3000).setViscosity(6000); fluids[17] = moltenNickelFluid; fluidBlocks[17] = moltenNickel; - FluidRegistry.registerFluid(moltenNickelFluid); - //FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenNickelFluid, 1), new ItemStack(buckets, 1, 17), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenNickelFluid, 1), new ItemStack(buckets, 1, 17), new ItemStack(Item.bucketEmpty))); - moltenLeadFluid = new Fluid("Molten Lead"); + moltenLeadFluid = new Fluid("lead.molten"); + FluidRegistry.registerFluid(moltenLeadFluid); moltenLead = new LiquidMetalFinite(PHConstruct.moltenLead, moltenLeadFluid, "liquid_lead").setUnlocalizedName("metal.molten.lead"); GameRegistry.registerBlock(moltenLead, "metal.molten.lead"); moltenLeadFluid.setBlockID(moltenLead).setDensity(3000).setViscosity(6000); fluids[18] = moltenLeadFluid; fluidBlocks[18] = moltenLead; - FluidRegistry.registerFluid(moltenLeadFluid); - //FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenLeadFluid, 1), new ItemStack(buckets, 1, 18), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenLeadFluid, 1), new ItemStack(buckets, 1, 18), new ItemStack(Item.bucketEmpty))); - moltenSilverFluid = new Fluid("Molten Silver"); + moltenSilverFluid = new Fluid("silver.molten"); + FluidRegistry.registerFluid(moltenSilverFluid); moltenSilver = new LiquidMetalFinite(PHConstruct.moltenSilver, moltenSilverFluid, "liquid_silver").setUnlocalizedName("metal.molten.silver"); GameRegistry.registerBlock(moltenSilver, "metal.molten.silver"); moltenSilverFluid.setBlockID(moltenSilver).setDensity(3000).setViscosity(6000); fluids[19] = moltenSilverFluid; fluidBlocks[19] = moltenSilver; - FluidRegistry.registerFluid(moltenSilverFluid); - //FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenSilverFluid, 1), new ItemStack(buckets, 1, 19), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenSilverFluid, 1), new ItemStack(buckets, 1, 19), new ItemStack(Item.bucketEmpty))); - moltenShinyFluid = new Fluid("Molten Platinum"); + moltenShinyFluid = new Fluid("platinum.molten"); + FluidRegistry.registerFluid(moltenShinyFluid); moltenShiny = new LiquidMetalFinite(PHConstruct.moltenShiny, moltenShinyFluid, "liquid_shiny").setUnlocalizedName("metal.molten.shiny"); GameRegistry.registerBlock(moltenShiny, "metal.molten.shiny"); moltenShinyFluid.setBlockID(moltenShiny).setDensity(3000).setViscosity(6000); fluids[20] = moltenLeadFluid; fluidBlocks[20] = moltenShiny; - FluidRegistry.registerFluid(moltenShinyFluid); - //FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenShinyFluid, 1), new ItemStack(buckets, 1, 20), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenShinyFluid, 1), new ItemStack(buckets, 1, 20), new ItemStack(Item.bucketEmpty))); - moltenInvarFluid = new Fluid("Molten Invar"); + moltenInvarFluid = new Fluid("invar.molten"); + FluidRegistry.registerFluid(moltenInvarFluid); moltenInvar = new LiquidMetalFinite(PHConstruct.moltenInvar, moltenInvarFluid, "liquid_invar").setUnlocalizedName("metal.molten.invar"); GameRegistry.registerBlock(moltenInvar, "metal.molten.invar"); moltenInvarFluid.setBlockID(moltenInvar).setDensity(3000).setViscosity(6000); fluids[21] = moltenInvarFluid; fluidBlocks[21] = moltenInvar; - FluidRegistry.registerFluid(moltenInvarFluid); - //FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenInvarFluid, 1), new ItemStack(buckets, 1, 21), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenInvarFluid, 1), new ItemStack(buckets, 1, 21), new ItemStack(Item.bucketEmpty))); - moltenElectrumFluid = new Fluid("Molten Electrum"); + moltenElectrumFluid = new Fluid("electrum.molten"); + FluidRegistry.registerFluid(moltenElectrumFluid); moltenElectrum = new LiquidMetalFinite(PHConstruct.moltenElectrum, moltenElectrumFluid, "liquid_electrum").setUnlocalizedName("metal.molten.electrum"); GameRegistry.registerBlock(moltenElectrum, "metal.molten.electrum"); moltenElectrumFluid.setBlockID(moltenElectrum).setDensity(3000).setViscosity(6000); fluids[22] = moltenElectrumFluid; fluidBlocks[22] = moltenElectrum; - FluidRegistry.registerFluid(moltenElectrumFluid); - //FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenElectrumFluid, 1), new ItemStack(buckets, 1, 22), new ItemStack(Item.bucketEmpty))); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenElectrumFluid, 1), new ItemStack(buckets, 1, 22), new ItemStack(Item.bucketEmpty))); + + moltenEnderFluid = new Fluid("ender"); + FluidRegistry.registerFluid(moltenEnderFluid); + moltenEnder = new LiquidMetalFinite(PHConstruct.moltenEnder, moltenEnderFluid, "liquid_ender").setUnlocalizedName("liquid.ender"); + GameRegistry.registerBlock(moltenEnder, "liquid.ender"); + moltenEnderFluid.setBlockID(moltenEnder).setDensity(3000).setViscosity(6000); + fluids[23] = moltenEnderFluid; + fluidBlocks[23] = moltenEnder; + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(moltenEnderFluid, 1), new ItemStack(buckets, 1, 23), new ItemStack(Item.bucketEmpty))); + + //Slime + slimeStep = new StepSoundSlime("mob.slime", 1.0f, 1.0f); + + blueSlimeFluid = new Fluid("slime.blue"); + FluidRegistry.registerFluid(blueSlimeFluid); + slimePool = new SlimeFluid(PHConstruct.slimePoolBlue, blueSlimeFluid, Material.water).setCreativeTab(TConstructRegistry.blockTab).setStepSound(slimeStep).setUnlocalizedName("liquid.slime"); + GameRegistry.registerBlock(slimePool, "liquid.slime"); + blueSlimeFluid.setBlockID(slimePool); + fluids[24] = blueSlimeFluid; + fluidBlocks[24] = slimePool; + //FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(blueSlimeFluid, 1), new ItemStack(buckets, 1, 24), new ItemStack(Item.bucketEmpty))); + + slimeGel = new SlimeGel(PHConstruct.slimeGel).setStepSound(slimeStep).setUnlocalizedName("slime.gel"); + GameRegistry.registerBlock(slimeGel, SlimeGelItemBlock.class, "slime.gel"); + + slimeGrass = new SlimeGrass(PHConstruct.slimeGrass).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("slime.grass"); + GameRegistry.registerBlock(slimeGrass, SlimeGrassItemBlock.class, "slime.grass"); + + slimeTallGrass = new SlimeTallGrass(PHConstruct.slimeTallGrass).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("slime.grass.tall"); + GameRegistry.registerBlock(slimeTallGrass, SlimeTallGrassItem.class, "slime.grass.tall"); + + slimeLeaves = (SlimeLeaves) new SlimeLeaves(PHConstruct.slimeLeaves).setStepSound(slimeStep).setUnlocalizedName("slime.leaves"); + GameRegistry.registerBlock(slimeLeaves, SlimeLeavesItemBlock.class, "slime.leaves"); + + slimeSapling = (SlimeSapling) new SlimeSapling(PHConstruct.slimeSapling).setStepSound(slimeStep).setUnlocalizedName("slime.sapling"); + GameRegistry.registerBlock(slimeSapling, SlimeSaplingItemBlock.class, "slime.sapling"); //Decoration stoneTorch = new StoneTorch(PHConstruct.stoneTorch).setUnlocalizedName("decoration.stonetorch"); @@ -955,6 +1022,8 @@ public class TContent implements IFuelHandler glove = new Glove(PHConstruct.glove).setUnlocalizedName("tconstruct.Glove"); knapsack = new Knapsack(PHConstruct.knapsack).setUnlocalizedName("tconstruct.storage"); goldHead = new GoldenHead(PHConstruct.goldHead, 4, 1.2F, false).setAlwaysEdible().setPotionEffect(Potion.regeneration.id, 10, 0, 1.0F).setUnlocalizedName("goldenhead"); + + essenceCrystal = new EssenceCrystal(PHConstruct.essenceCrystal).setUnlocalizedName("tconstruct.crystal.essence"); String[] materialStrings = { "paperStack", "greenSlimeCrystal", "searedBrick", "ingotCobalt", "ingotArdite", "ingotManyullyn", "mossBall", "lavaCrystal", "necroticBone", "ingotCopper", "ingotTin", "ingotAluminum", "rawAluminum", "ingotBronze", "ingotAluminumBrass", "ingotAlumite", "ingotSteel", "blueSlimeCrystal", "ingotObsidian", "nuggetIron", "nuggetCopper", @@ -1332,6 +1401,8 @@ public class TContent implements IFuelHandler basinCasting.addCastingRecipe(new ItemStack(smeltery, 1, 4), new FluidStack(moltenStoneFluid, TConstruct.ingotLiquidValue), null, true, 100); //seared stone basinCasting.addCastingRecipe(new ItemStack(speedBlock, 1, 0), new FluidStack(moltenTinFluid, TConstruct.ingotLiquidValue / 9), new ItemStack(Block.gravel), true, 100); //brownstone + basinCasting.addCastingRecipe(new ItemStack(Block.whiteStone), new FluidStack(moltenEnderFluid, 25), new ItemStack(Block.obsidian), true, 100); //endstone + basinCasting.addCastingRecipe(new ItemStack(metalBlock.blockID, 1, 10), new FluidStack(moltenEnderFluid, 1000), null, true, 100); //ender //Ore Smeltery.addMelting(Block.oreIron, 0, 600, new FluidStack(moltenIronFluid, TConstruct.ingotLiquidValue * 2)); @@ -1348,6 +1419,8 @@ public class TContent implements IFuelHandler Smeltery.addMelting(new ItemStack(blankPattern, 4, 1), metalBlock.blockID, 7, 150, new FluidStack(moltenAlubrassFluid, TConstruct.ingotLiquidValue)); Smeltery.addMelting(new ItemStack(blankPattern, 4, 2), metalBlock.blockID, 7, 150, new FluidStack(moltenGoldFluid, TConstruct.ingotLiquidValue * 2)); + + Smeltery.addMelting(new ItemStack(Item.enderPearl, 4), metalBlock.blockID, 10, 500, new FluidStack(moltenEnderFluid, 250)); //Blocks Smeltery.addMelting(Block.blockIron, 0, 600, new FluidStack(moltenIronFluid, TConstruct.ingotLiquidValue * 9)); diff --git a/tconstruct/dimension/TinkerChunkProvider.java b/tconstruct/dimension/TinkerChunkProvider.java index 09dfcfbd..f8eb36a7 100644 --- a/tconstruct/dimension/TinkerChunkProvider.java +++ b/tconstruct/dimension/TinkerChunkProvider.java @@ -6,7 +6,6 @@ import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.NETH import java.util.List; import java.util.Random; -import mods.natura.dimension.NetheriteChunk; import net.minecraft.block.Block; import net.minecraft.block.BlockSand; import net.minecraft.entity.EnumCreatureType; @@ -303,7 +302,8 @@ public class TinkerChunkProvider implements IChunkProvider this.replaceBlocksForBiome(chunkX, chunkZ, lowerArray); this.netherCaveGenerator.generate(this, this.worldObj, chunkX, chunkZ, lowerArray); this.genNetherBridge.generate(this, this.worldObj, chunkX, chunkZ, lowerArray); - Chunk chunk = new NetheriteChunk(this.worldObj, lowerArray, chunkX, chunkZ); + Chunk chunk = new Chunk(this.worldObj, lowerArray, chunkX, chunkZ); + //Chunk chunk = new NetheriteChunk(this.worldObj, lowerArray, chunkX, chunkZ); BiomeGenBase[] abiomegenbase = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[]) null, chunkX * 16, chunkZ * 16, 16, 16); byte[] abyte1 = chunk.getBiomeArray(); diff --git a/tconstruct/items/EssenceCrystal.java b/tconstruct/items/EssenceCrystal.java new file mode 100644 index 00000000..c34ae4fd --- /dev/null +++ b/tconstruct/items/EssenceCrystal.java @@ -0,0 +1,102 @@ +package tconstruct.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import tconstruct.blocks.logic.EssenceExtractorLogic; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class EssenceCrystal extends Item +{ + public EssenceCrystal(int id) + { + super(id); + this.setCreativeTab(CreativeTabs.tabMisc); + } + + @Override + public int getMaxItemUseDuration (ItemStack par1ItemStack) + { + return 32; + } + + @Override + public EnumAction getItemUseAction (ItemStack par1ItemStack) + { + return EnumAction.eat; + } + + @Override + public ItemStack onItemRightClick (ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); + return par1ItemStack; + } + + @Override + public ItemStack onEaten (ItemStack stack, World world, EntityPlayer player) + { + if (stack.hasTagCompound()) + { + EntityXPOrb entity = new EntityXPOrb(world, player.posX, player.posY + 1, player.posZ, stack.getTagCompound().getInteger("Essence")); + spawnEntity(player.posX, player.posY + 1, player.posZ, entity, world, player); + if (!player.capabilities.isCreativeMode) + stack.stackSize--; + } + return stack; + } + + public static void spawnEntity (double x, double y, double z, Entity entity, World world, EntityPlayer player) + { + if (!world.isRemote) + { + world.spawnEntityInWorld(entity); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons (IconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("tinker:materials/material_essencecrystal"); + } + + @Override + @SideOnly(Side.CLIENT) + public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) + { + if (stack.hasTagCompound()) + { + int amount = stack.getTagCompound().getInteger("Essence"); + list.add("Stored Levels: " + EssenceExtractorLogic.getEssencelevels(amount)); + } + else + { + list.add("Stored Levels: 0"); + } + } + + @Override + public void getSubItems (int id, CreativeTabs tab, List list) + { + int[] amount = new int[] { 17, 85, 170, 255, 385, 590, 825 }; + for (int i = 0; i < amount.length; i++) + { + ItemStack crystal = new ItemStack(id, 1, 0); + NBTTagCompound tags = new NBTTagCompound(); + tags.setInteger("Essence", amount[i]); + crystal.setTagCompound(tags); + list.add(crystal); + } + } +} diff --git a/tconstruct/items/FilledBucket.java b/tconstruct/items/FilledBucket.java index 66f971db..5454790b 100644 --- a/tconstruct/items/FilledBucket.java +++ b/tconstruct/items/FilledBucket.java @@ -177,8 +177,8 @@ public class FilledBucket extends ItemBucket } public static final String[] materialNames = new String[] { "Iron", "Gold", "Copper", "Tin", "Aluminum", "Cobalt", "Ardite", "Bronze", "AluBrass", "Manyullyn", "Alumite", "Obsidian", "Steel", - "Glass", "Stone", "Villager", "Cow" }; + "Glass", "Stone", "Villager", "Cow", "Nickel", "Lead", "Silver", "Shiny", "Invar", "Electrum", "Ender" }; public static final String[] textureNames = new String[] { "iron", "gold", "copper", "tin", "aluminum", "cobalt", "ardite", "bronze", "alubrass", "manyullyn", "alumite", "obsidian", "steel", - "glass", "stone", "emerald", "blood" }; + "glass", "stone", "emerald", "blood", "nickel", "lead", "silver", "shiny", "invar", "electrum", "ender" }; } diff --git a/tconstruct/items/blocks/CraftedSoilItemBlock.java b/tconstruct/items/blocks/CraftedSoilItemBlock.java index eec72a9d..72bc83b0 100644 --- a/tconstruct/items/blocks/CraftedSoilItemBlock.java +++ b/tconstruct/items/blocks/CraftedSoilItemBlock.java @@ -2,16 +2,16 @@ package tconstruct.items.blocks; import java.util.List; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class CraftedSoilItemBlock extends ItemBlock { - public static final String blockType[] = { "Slime", "Grout", "BlueSlime", "GraveyardSoil", "ConsecratedSoil" }; + public static final String blockType[] = { "Slime", "Grout", "BlueSlime", "GraveyardSoil", "ConsecratedSoil", "blue", "dirt" }; public CraftedSoilItemBlock(int id) { @@ -28,7 +28,9 @@ public class CraftedSoilItemBlock extends ItemBlock public String getUnlocalizedName (ItemStack itemstack) { int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); - return (new StringBuilder()).append("CraftedSoil.").append(blockType[pos]).toString(); + if (pos <= 4) + return (new StringBuilder()).append("CraftedSoil.").append(blockType[pos]).toString(); + return (new StringBuilder()).append("block.slime.soil.").append(blockType[pos]).toString(); } @Override diff --git a/tconstruct/items/blocks/SlimeGelItemBlock.java b/tconstruct/items/blocks/SlimeGelItemBlock.java new file mode 100644 index 00000000..9434b93f --- /dev/null +++ b/tconstruct/items/blocks/SlimeGelItemBlock.java @@ -0,0 +1,33 @@ +package tconstruct.items.blocks; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; + +public class SlimeGelItemBlock extends ItemBlock +{ + public static final String blockType[] = { "blue", "green", "purple", "magma", "yellow", "red", "metal" }; + + public SlimeGelItemBlock(int id) + { + super(id); + setMaxDamage(0); + setHasSubtypes(true); + } + + public int getMetadata (int meta) + { + return meta; + } + + public String getUnlocalizedName (ItemStack itemstack) + { + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); + return (new StringBuilder()).append("block.slime.congealed.").append(blockType[pos]).toString(); + } +} diff --git a/tconstruct/items/blocks/SlimeGrassItemBlock.java b/tconstruct/items/blocks/SlimeGrassItemBlock.java new file mode 100644 index 00000000..79285889 --- /dev/null +++ b/tconstruct/items/blocks/SlimeGrassItemBlock.java @@ -0,0 +1,33 @@ +package tconstruct.items.blocks; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; + +public class SlimeGrassItemBlock extends ItemBlock +{ + public static final String blockType[] = { "blue", "dirt" }; + + public SlimeGrassItemBlock(int id) + { + super(id); + setMaxDamage(0); + setHasSubtypes(true); + } + + public int getMetadata (int meta) + { + return meta; + } + + public String getUnlocalizedName (ItemStack itemstack) + { + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); + return (new StringBuilder()).append("block.slime.grass.").append(blockType[pos]).toString(); + } +} diff --git a/tconstruct/items/blocks/SlimeLeavesItemBlock.java b/tconstruct/items/blocks/SlimeLeavesItemBlock.java new file mode 100644 index 00000000..296124c0 --- /dev/null +++ b/tconstruct/items/blocks/SlimeLeavesItemBlock.java @@ -0,0 +1,33 @@ +package tconstruct.items.blocks; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; + +public class SlimeLeavesItemBlock extends ItemBlock +{ + public static final String blockType[] = { "blue" }; + + public SlimeLeavesItemBlock(int id) + { + super(id); + setMaxDamage(0); + setHasSubtypes(true); + } + + public int getMetadata (int meta) + { + return meta; + } + + public String getUnlocalizedName (ItemStack itemstack) + { + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); + return (new StringBuilder()).append("block.slime.leaves.").append(blockType[pos]).toString(); + } +} diff --git a/tconstruct/items/blocks/SlimeSaplingItemBlock.java b/tconstruct/items/blocks/SlimeSaplingItemBlock.java new file mode 100644 index 00000000..484b0c09 --- /dev/null +++ b/tconstruct/items/blocks/SlimeSaplingItemBlock.java @@ -0,0 +1,33 @@ +package tconstruct.items.blocks; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; + +public class SlimeSaplingItemBlock extends ItemBlock +{ + public static final String blockType[] = { "bluegreen" }; + + public SlimeSaplingItemBlock(int id) + { + super(id); + setMaxDamage(0); + setHasSubtypes(true); + } + + public int getMetadata (int meta) + { + return meta; + } + + public String getUnlocalizedName (ItemStack itemstack) + { + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); + return (new StringBuilder()).append("block.slime.sapling.").append(blockType[pos]).toString(); + } +} diff --git a/tconstruct/items/blocks/SlimeTallGrassItem.java b/tconstruct/items/blocks/SlimeTallGrassItem.java new file mode 100644 index 00000000..f0c36293 --- /dev/null +++ b/tconstruct/items/blocks/SlimeTallGrassItem.java @@ -0,0 +1,39 @@ +package tconstruct.items.blocks; + +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.util.MathHelper; +import tconstruct.common.TContent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SlimeTallGrassItem extends ItemBlock +{ + public static final String blockType[] = { "tallgrass", "tallgrass.fern" }; + + public SlimeTallGrassItem(int id) + { + super(id); + setMaxDamage(0); + setHasSubtypes(true); + } + + public int getMetadata (int meta) + { + return meta; + } + + @SideOnly(Side.CLIENT) + public Icon getIconFromDamage (int meta) + { + int arr = MathHelper.clamp_int(meta, 0, blockType.length); + return TContent.slimeTallGrass.getIcon(0, arr); + } + + public String getUnlocalizedName (ItemStack itemstack) + { + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); + return (new StringBuilder()).append("block.slime.").append(blockType[pos]).toString(); + } +} diff --git a/tconstruct/util/PHConstruct.java b/tconstruct/util/PHConstruct.java index a5aaa2e1..50033006 100644 --- a/tconstruct/util/PHConstruct.java +++ b/tconstruct/util/PHConstruct.java @@ -68,7 +68,6 @@ public class PHConstruct vanillaMetalBlocks = config.get("Difficulty Changes", "Craft vanilla metal blocks", true).getBoolean(true); lavaFortuneInteraction = config.get("Difficulty Changes", "Enable Auto-Smelt and Fortune interaction", true).getBoolean(true); removeVanillaToolRecipes = config.get("Difficulty Changes", "Remove Vanilla Tool Recipes", false).getBoolean(false); - deGreg = config.get("Difficulty Changes", "Remove Vanilla GregTech Nerfs", true).getBoolean(true); harderBronze = config.get("Difficulty Changes", "Lower bronze output to 2 ingots", false).getBoolean(false); stencilTableCrafting = config.get("Difficulty Changes", "Craft Stencil Tables", true).getBoolean(true); miningLevelIncrease = config.get("Difficulty Changes", "Modifiers increase Mining Level", true).getBoolean(true); @@ -130,6 +129,7 @@ public class PHConstruct moltenStone = config.getBlock("Molten Stone", 3215).getInt(3215); moltenEmerald = config.getBlock("Molten Emerald", 3216).getInt(3216); blood = config.getBlock("Liquid Cow", 3217).getInt(3217); + moltenEnder = config.getBlock("Molten Ender", 3218).getInt(3218); aggregator = config.getBlock("Aggregator", 3221).getInt(3221); lightCrystalBase = config.getBlock("Light Crystal", 3222).getInt(3222); @@ -147,6 +147,14 @@ public class PHConstruct punji = config.getBlock("Punji", 3232).getInt(3232); woodCrafter = config.getBlock("Crafting Station", 3233).getInt(3233); + essenceExtractor = config.getBlock("Essence Extractor", 3234).getInt(3234); + + slimePoolBlue = config.getBlock("Liquid Blue Slime", 3235).getInt(3235); + slimeGel = config.getBlock("Congealed Slime", 3237).getInt(3237); + slimeGrass = config.getBlock("Slime Grass", 3238).getInt(3238); + slimeTallGrass = config.getBlock("Slime Tall Grass", 3239).getInt(3239); + slimeLeaves = config.getBlock("Slime Grass Leaves", 3240).getInt(3240); + slimeSapling = config.getBlock("Slime Tree Sapling", 3241).getInt(3241); /*golemCore = config.getBlock("Golem Core", 1481).getInt(1481); golemHead = config.getBlock("Golem Head", 1482).getInt(1482);*/ @@ -233,6 +241,7 @@ public class PHConstruct glove = config.getItem("Equipables", "Gloves", 14111).getInt(14111); knapsack = config.getItem("Equipables", "Knapsack", 14112).getInt(14112); goldHead = config.getItem("Patterns and Misc", "Golden Head", 14113).getInt(14113); + essenceCrystal = config.getItem("Patterns and Misc", "Essence Crystal", 14114).getInt(14114); boolean ic2 = true; boolean xycraft = true; @@ -321,6 +330,9 @@ public class PHConstruct worldBorder = config.get("Ultra Hardcore Changes", "Add World Border", false).getBoolean(false); worldBorderSize = config.get("Ultra Hardcore Changes", "World Border Radius", 1000).getInt(1000); freePatterns = config.get("Ultra Hardcore Changes", "Add Patterns to Pattern Chests", false).getBoolean(false); //Check + + //Slime pools + islandRarity = config.get("Worldgen", "Slime Island Rarity", 450).getInt(450); /* Save the configuration file */ config.save(); @@ -381,6 +393,8 @@ public class PHConstruct //Crystalline public static int aggregator; public static int lightCrystalBase; + public static int essenceExtractor; + public static int essenceCrystal; //Liquids public static int metalFlowing; @@ -403,12 +417,21 @@ public class PHConstruct public static int moltenStone; public static int moltenEmerald; public static int blood; + public static int moltenEnder; public static int moltenSilver; //Thermal Expansion public static int moltenLead; public static int moltenNickel; public static int moltenShiny; public static int moltenInvar; public static int moltenElectrum; + + //Slime + public static int slimePoolBlue; + public static int slimeGel; + public static int slimeGrass; + public static int slimeTallGrass; + public static int slimeLeaves; + public static int slimeSapling; //Decoration public static int stoneTorch; @@ -620,5 +643,6 @@ public class PHConstruct public static boolean gregtech; public static boolean lavaFortuneInteraction; - public static boolean deGreg; + + public static int islandRarity; } diff --git a/tconstruct/worldgen/PlantGen.java b/tconstruct/worldgen/PlantGen.java new file mode 100644 index 00000000..b4d4359d --- /dev/null +++ b/tconstruct/worldgen/PlantGen.java @@ -0,0 +1,53 @@ +package tconstruct.worldgen; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class PlantGen extends WorldGenerator +{ + /** The ID of the plant block used in this plant generator. */ + public final int plantID; + public final int metadata; + public int chances = 64; + int xSize = 8; + int ySize = 4; + int zSize = 8; + boolean clumped = true; + + public PlantGen(int id, int meta) + { + this.plantID = id; + this.metadata = meta; + } + + public PlantGen(int id, int meta, int count, int range, int height, int width, boolean clumped) + { + this.plantID = id; + this.metadata = meta; + this.chances = count; + this.xSize = range; + this.ySize = height; + this.zSize = width; + this.clumped = clumped; + } + + public boolean generate (World world, Random random, int x, int y, int z) + { + for (int iter = 0; iter < chances; ++iter) + { + int posX = clumped ? x + random.nextInt(xSize) - random.nextInt(xSize) : x + random.nextInt(xSize); + int posY = clumped ? y + random.nextInt(ySize) - random.nextInt(ySize) : y + random.nextInt(ySize); + int posZ = clumped ? z + random.nextInt(zSize) - random.nextInt(zSize) : z + random.nextInt(zSize); + + if (world.isAirBlock(posX, posY, posZ) && (!world.provider.hasNoSky || posY < 127) && Block.blocksList[this.plantID].canBlockStay(world, posX, posY, posZ)) + { + world.setBlock(posX, posY, posZ, this.plantID, this.metadata, 2); + } + } + + return true; + } +} \ No newline at end of file diff --git a/tconstruct/worldgen/SlimeIslandGen.java b/tconstruct/worldgen/SlimeIslandGen.java new file mode 100644 index 00000000..36c65183 --- /dev/null +++ b/tconstruct/worldgen/SlimeIslandGen.java @@ -0,0 +1,288 @@ +package tconstruct.worldgen; + +import java.awt.geom.Ellipse2D; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.feature.WorldGenerator; +import tconstruct.common.TContent; +import tconstruct.util.PHConstruct; +import cpw.mods.fml.common.IWorldGenerator; + +public class SlimeIslandGen extends WorldGenerator implements IWorldGenerator +{ + private int liquidBlock; + private int gelMeta; + int randomness = 2; + Random random = new Random(); + int baseID = TContent.craftedSoil.blockID;//Block.dirt.blockID; + int topID = TContent.slimeGrass.blockID; + SlimeTreeGen trees = new SlimeTreeGen(false, 5, 4, 1, 0); + + public SlimeIslandGen(int id, int meta) + { + this.liquidBlock = id; + this.gelMeta = meta; + } + + @Override + public void generate (Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) //IWorldGenerator version + { + if (world.provider.dimensionId == 0 || world.provider.dimensionId >= 2) + { + if (random.nextInt(PHConstruct.islandRarity) == 0) + generateIsland(world, random, chunkX * 16, chunkZ * 16); + } + } + + //Island is biased towards one direction. Quadrants would be more useful + public void generateIsland (World world, Random rand, int xChunk, int zChunk) + { + int xRange = random.nextInt(13) + 20; + int yCenter = 100 + random.nextInt(41); + int zRange = random.nextInt(13) + 20; + int height = 12; + int initialHeight = height; + Ellipse2D.Double ellipse = new Ellipse2D.Double(0, 0, xRange, zRange); + + //Basic shape + for (int x = 0; x <= xRange; x++) + { + for (int z = 0; z <= zRange; z++) + { + for (int y = 0; y <= height; y++) + { + if (ellipse.contains(x, z)) + world.setBlock(x + xChunk, y + yCenter, z + zChunk, baseID, 5, 0); + } + } + } + + //Erode bottom + height = 8; + for (int x = 0; x <= xRange; x++) + { + for (int z = 0; z <= zRange; z++) + { + for (int y = 0; y >= -height; y--) + { + int xPos = x + xChunk; + int yPos = y + yCenter + height; + int zPos = z + zChunk; + if (world.getBlockId(xPos - 1, yPos + 1, zPos) == baseID && world.getBlockId(xPos + 1, yPos + 1, zPos) == baseID && world.getBlockId(xPos, yPos + 1, zPos - 1) == baseID + && world.getBlockId(xPos - 1, yPos + 1, zPos + 1) == baseID && random.nextInt(100) > randomness) + { + ; + } + else + { + world.setBlock(xPos, yPos, zPos, 0, 0, 0); + + } + } + } + } + + //Erode top + height = 3; + for (int x = 0; x <= xRange; x++) + { + for (int z = 0; z <= zRange; z++) + { + for (int y = 1; y <= height; y++) + { + int xPos = x + xChunk; + int yPos = y + yCenter + initialHeight - height + 1; + int zPos = z + zChunk; + if (world.getBlockId(xPos - 1, yPos - 1, zPos) == baseID && world.getBlockId(xPos + 1, yPos - 1, zPos) == baseID && world.getBlockId(xPos, yPos - 1, zPos - 1) == baseID + && world.getBlockId(xPos - 1, yPos - 1, zPos + 1) == baseID) + { + ; + } + else + { + world.setBlock(xPos, yPos, zPos, 0, 0, 0); + } + } + } + } + + //Replace blocks + for (int x = 0; x <= xRange; x++) + { + for (int z = 0; z <= zRange; z++) + { + for (int y = 0; y <= height; y++) + { + int xPos = x + xChunk; + int yPos = y + yCenter + initialHeight - height; + int zPos = z + zChunk; + if (world.getBlockId(xPos, yPos, zPos) == baseID) + { + Block block = Block.blocksList[world.getBlockId(xPos, yPos + 1, zPos)]; + if (block == null || block.isAirBlock(world, xPos, yPos + 1, zPos)) + world.setBlock(xPos, yPos, zPos, topID, 0, 0); + } + } + } + } + + //Decorate + generateSlimePool(world, rand, xChunk + xRange / 2, yCenter + initialHeight, zChunk + zRange / 2); + + PlantGen tallGrass = new PlantGen(TContent.slimeTallGrass.blockID, 0, 128, xRange, 1, zRange, false); + tallGrass.generate(world, rand, xChunk, yCenter + initialHeight + 1, zChunk); + for (int i = 0; i < 3; i++) + { + trees.generate(world, random, xChunk + random.nextInt(xRange), yCenter + initialHeight + 3, zChunk + random.nextInt(zRange)); + } + } + + public void generateSlimePool (World world, Random rand, int x, int y, int z) + { + this.generate(world, rand, x, y, z); + } + + public boolean generate (World world, Random rand, int x, int y, int z) //WorldGenerator version + { + x -= 8; + z -= 8; + /*for (z -= 8; y > 5 && world.isAirBlock(x, y, z); --y) + { + ; + } + + if (y <= 4) + { + return false; + } + else + {*/ + y -= 4; + boolean[] validLocations = new boolean[2048]; + int var7 = rand.nextInt(4) + 4; + int xPos; + + for (xPos = 0; xPos < var7; ++xPos) + { + double noise1 = rand.nextDouble() * 6.0D + 3.0D; + double noise2 = rand.nextDouble() * 4.0D + 2.0D; + double noise3 = rand.nextDouble() * 6.0D + 3.0D; + double noise4 = rand.nextDouble() * (16.0D - noise1 - 2.0D) + 1.0D + noise1 / 2.0D; + double noise5 = rand.nextDouble() * (8.0D - noise2 - 4.0D) + 2.0D + noise2 / 2.0D; + double noise6 = rand.nextDouble() * (16.0D - noise3 - 2.0D) + 1.0D + noise3 / 2.0D; + + for (int xIter = 1; xIter < 15; ++xIter) + { + for (int zIter = 1; zIter < 15; ++zIter) + { + for (int yIter = 1; yIter < 7; ++yIter) + { + double var24 = ((double) xIter - noise4) / (noise1 / 2.0D); + double var26 = ((double) yIter - noise5) / (noise2 / 2.0D); + double var28 = ((double) zIter - noise6) / (noise3 / 2.0D); + double validSpot = var24 * var24 + var26 * var26 + var28 * var28; + + if (validSpot < 1.0D) + { + validLocations[(xIter * 16 + zIter) * 8 + yIter] = true; + } + } + } + } + } + + int yPos; + int zPos; + boolean var33; + + for (xPos = 0; xPos < 16; ++xPos) + { + for (zPos = 0; zPos < 16; ++zPos) + { + for (yPos = 0; yPos < 8; ++yPos) + { + var33 = !validLocations[(xPos * 16 + zPos) * 8 + yPos] + && (xPos < 15 && validLocations[((xPos + 1) * 16 + zPos) * 8 + yPos] || xPos > 0 && validLocations[((xPos - 1) * 16 + zPos) * 8 + yPos] || zPos < 15 + && validLocations[(xPos * 16 + zPos + 1) * 8 + yPos] || zPos > 0 && validLocations[(xPos * 16 + (zPos - 1)) * 8 + yPos] || yPos < 7 + && validLocations[(xPos * 16 + zPos) * 8 + yPos + 1] || yPos > 0 && validLocations[(xPos * 16 + zPos) * 8 + (yPos - 1)]); + + if (var33) + { + Material var12 = world.getBlockMaterial(x + xPos, y + yPos, z + zPos); + + if (yPos >= 4 && var12.isLiquid()) + { + return false; + } + + if (yPos < 4 && !var12.isSolid() && world.getBlockId(x + xPos, y + yPos, z + zPos) != this.liquidBlock) + { + return false; + } + } + } + } + } + + for (xPos = 0; xPos < 16; ++xPos) + { + for (zPos = 0; zPos < 16; ++zPos) + { + for (yPos = 0; yPos < 8; ++yPos) + { + if (validLocations[(xPos * 16 + zPos) * 8 + yPos]) + { + world.setBlock(x + xPos, y + yPos, z + zPos, yPos >= 4 ? 0 : this.liquidBlock); + } + } + } + } + + for (xPos = 0; xPos < 16; ++xPos) + { + for (zPos = 0; zPos < 16; ++zPos) + { + for (yPos = 4; yPos < 8; ++yPos) + { + if (validLocations[(xPos * 16 + zPos) * 8 + yPos] && world.getBlockId(x + xPos, y + yPos - 1, z + zPos) == baseID + && world.getSavedLightValue(EnumSkyBlock.Sky, x + xPos, y + yPos, z + zPos) > 0) + { + world.setBlock(x + xPos, y + yPos - 1, z + zPos, topID, 2, 0); + } + } + } + } + + //Generate blocks around + if (Block.blocksList[this.liquidBlock].blockMaterial == Material.water) + { + for (xPos = 0; xPos < 16; ++xPos) + { + for (zPos = 0; zPos < 16; ++zPos) + { + for (yPos = 0; yPos < 8; ++yPos) + { + var33 = !validLocations[(xPos * 16 + zPos) * 8 + yPos] + && (xPos < 15 && validLocations[((xPos + 1) * 16 + zPos) * 8 + yPos] || xPos > 0 && validLocations[((xPos - 1) * 16 + zPos) * 8 + yPos] || zPos < 15 + && validLocations[(xPos * 16 + zPos + 1) * 8 + yPos] || zPos > 0 && validLocations[(xPos * 16 + (zPos - 1)) * 8 + yPos] || yPos < 7 + && validLocations[(xPos * 16 + zPos) * 8 + yPos + 1] || yPos > 0 && validLocations[(xPos * 16 + zPos) * 8 + (yPos - 1)]); + + if (var33 && (yPos < 4 || rand.nextInt(2) != 0) && world.getBlockMaterial(x + xPos, y + yPos, z + zPos).isSolid() + && world.getBlockMaterial(x + xPos, y + yPos + 1, z + zPos) != Material.water) + { + world.setBlock(x + xPos, y + yPos, z + zPos, TContent.slimeGel.blockID, gelMeta, 2); + } + } + } + } + } + + return true; + //} + } +} diff --git a/tconstruct/worldgen/SlimeTreeGen.java b/tconstruct/worldgen/SlimeTreeGen.java new file mode 100644 index 00000000..ac2b1923 --- /dev/null +++ b/tconstruct/worldgen/SlimeTreeGen.java @@ -0,0 +1,166 @@ +package tconstruct.worldgen; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraftforge.common.ForgeDirection; +import tconstruct.common.TContent; + +public class SlimeTreeGen extends WorldGenerator +{ + public final int minTreeHeight; + public final int treeHeightRange; + public final int metaWood; + public final int metaLeaves; + public final boolean seekHeight; + + public SlimeTreeGen(boolean notify, int treeHeight, int treeRange, int woodMeta, int leavesMeta) + { + super(notify); + this.minTreeHeight = treeHeight; + this.treeHeightRange = treeRange; + this.metaWood = woodMeta; + this.metaLeaves = leavesMeta; + this.seekHeight = !notify; + } + + public boolean generate (World world, Random random, int xPos, int yPos, int zPos) + { + int height = random.nextInt(this.treeHeightRange) + this.minTreeHeight; + boolean flag = true; + if (seekHeight) + { + yPos = findGround(world, xPos, yPos, zPos); + if (yPos == -1) + return false; + } + + if (yPos >= 1 && yPos + height + 1 <= 256) + { + Block soil = Block.blocksList[world.getBlockId(xPos, yPos - 1, zPos)]; + boolean isSoil = (soil != null && soil.canSustainPlant(world, xPos, yPos - 1, zPos, ForgeDirection.UP, TContent.slimeSapling)); + + if (isSoil) + { + if (!checkClear(world, xPos, yPos, zPos, height)) + return false; + + soil.onPlantGrow(world, xPos, yPos - 1, zPos, xPos, yPos, zPos); + placeCanopy(world, random, xPos, yPos, zPos, height); + placeTrunk(world, xPos, yPos, zPos, height); + return true; + } + } + return false; + } + + boolean checkClear (World world, int x, int y, int z, int treeHeight) + { + for (int yPos = 0; yPos < treeHeight + 1; yPos++) + { + int range = 1; + + if (yPos == 0) + range = 0; + else if (yPos >= treeHeight - 1) + range = 2; + + for (int xPos = range; xPos <= range; xPos++) + { + for (int zPos = range; zPos <= range; zPos++) + { + int blockID = world.getBlockId(x + xPos, y + yPos, z + zPos); + Block block = Block.blocksList[blockID]; + if (block != null && blockID != TContent.slimeSapling.blockID && !block.isLeaves(world, x + xPos, y + yPos, z + zPos)) + return false; + } + } + } + return true; + } + + int findGround (World world, int x, int y, int z) + { + int ret = -1; + int height = y; + do + { + int heightID = world.getBlockId(x, height, z); + if ((heightID == TContent.craftedSoil.blockID || heightID == TContent.slimeGrass.blockID) && !Block.opaqueCubeLookup[world.getBlockId(x, height + 1, z)]) + { + ret = height + 1; + break; + } + height--; + } while (height > 0); + return ret; + } + + void placeCanopy (World world, Random random, int xPos, int yPos, int zPos, int height) + { + for (int i = 0; i < 4; i++) + { + placeDiamondLayer(world, xPos, yPos + height - i, zPos, i + 1); + } + + this.setBlockAndMetadata(world, xPos+4, yPos + height - 3, zPos, 0, 0); + this.setBlockAndMetadata(world, xPos-4, yPos + height - 3, zPos, 0, 0); + this.setBlockAndMetadata(world, xPos, yPos + height - 3, zPos+4, 0, 0); + this.setBlockAndMetadata(world, xPos, yPos + height - 3, zPos-4, 0, 0); + this.setBlockAndMetadata(world, xPos+1, yPos + height - 3, zPos+1, 0, 0); + this.setBlockAndMetadata(world, xPos+1, yPos + height - 3, zPos-1, 0, 0); + this.setBlockAndMetadata(world, xPos-1, yPos + height - 3, zPos+1, 0, 0); + this.setBlockAndMetadata(world, xPos-1, yPos + height - 3, zPos-1, 0, 0); + + //Drippers + this.setBlockAndMetadata(world, xPos+3, yPos + height - 4, zPos, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos-3, yPos + height - 4, zPos, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos, yPos + height - 4, zPos-3, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos, yPos + height - 4, zPos+3, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos+2, yPos + height - 4, zPos+2, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos+2, yPos + height - 4, zPos-2, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos-2, yPos + height - 4, zPos+2, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos-2, yPos + height - 4, zPos-2, TContent.slimeLeaves.blockID, this.metaLeaves); + + this.setBlockAndMetadata(world, xPos+3, yPos + height - 5, zPos, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos-3, yPos + height - 5, zPos, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos, yPos + height - 5, zPos-3, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos, yPos + height - 5, zPos+3, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos+2, yPos + height - 5, zPos+2, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos+2, yPos + height - 5, zPos-2, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos-2, yPos + height - 5, zPos+2, TContent.slimeLeaves.blockID, this.metaLeaves); + this.setBlockAndMetadata(world, xPos-2, yPos + height - 5, zPos-2, TContent.slimeLeaves.blockID, this.metaLeaves); + } + + void placeDiamondLayer(World world, int xPos, int yPos, int zPos, int range ) + { + for (int x = -range; x <= range; x++) + { + for (int z = -range; z <= range; z++) + { + if (Math.abs(x) + Math.abs(z) <= range) + { + this.setBlockAndMetadata(world, x+xPos, yPos, z+zPos, TContent.slimeLeaves.blockID, this.metaLeaves); + } + } + } + } + + void placeTrunk (World world, int xPos, int yPos, int zPos, int height) + { + for (int localHeight = 0; localHeight < height; ++localHeight) + { + int blockID = world.getBlockId(xPos, yPos + localHeight, zPos); + + Block block = Block.blocksList[blockID]; + + if (blockID == 0 || block == null || block.isLeaves(world, xPos, yPos + localHeight, zPos)) + { + this.setBlockAndMetadata(world, xPos, yPos + localHeight, zPos, TContent.slimeGel.blockID, this.metaWood); + } + } + } + +}