diff --git a/FM/.gitattributes b/FM/.gitattributes new file mode 100644 index 000000000..b45edecd1 --- /dev/null +++ b/FM/.gitattributes @@ -0,0 +1,33 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain + +# These files are text and should be normalized (Convert crlf => lf) +*.java text +*.xml text +*.txt text + +# These files are binary and should be left untouched +# (binary is a macro for -text -diff) +*.jar binary +*.so binary +*.dll binary diff --git a/FM/.gitignore b/FM/.gitignore new file mode 100644 index 000000000..a1d35d9eb --- /dev/null +++ b/FM/.gitignore @@ -0,0 +1 @@ +!*.* diff --git a/FM/LICENSE.txt b/FM/LICENSE.txt new file mode 100644 index 000000000..7ecce8724 --- /dev/null +++ b/FM/LICENSE.txt @@ -0,0 +1,91 @@ +Copyright (c) 2013, DarkGuardsman +All rights reserved. + +0. Definitions + +-------------- + +Minecraft: Denotes a copy of the Minecraft game licensed by Mojang AB + +User: Anybody that interacts with the software in one of the following ways: +- play +- decompile +- recompile or compile +- modify +- distribute + +Mod: The mod code designated by the present license, in source form, binary form, as obtained standalone, as part of a wider distribution or resulting from the compilation of the original or modified Minecraft sources. + +Mod Pack - Package distribution of mods and there assets to be used by the user for easy install and collective download. + +Texture Pack - Package distribution of texture or art work to change the visual look of the mod. + +Dependency: Code required for the Mod to work properly. This includes dependencies required to compile the code as well as any file or modification +that is explicatively or implicatively required for the Mod to be working. + +Owner: The project leader of the Mod regardlessly of repo holder, manager, or developer + +1. Scope +-------- + +The present license is granted to any user of the Mod. As a prerequisite, a user must own a legally acquired copy of Minecraft. Terms of license may change anytime with or without notice. The user of this Mod will be subject to the newest version of this license. + +2. Liability +------------ + +This Mod is provided 'as is' with no warranties, implied or otherwise. The owner of this Mod takes no responsibility for any damages incurred from the use of this Mod. This Mod alters fundamental parts of the Minecraft game, parts of Minecraft may not work with this Mod installed. All damages caused from the use or misuse of this Mod fall on the user. + +3. Play rights +-------------- + +A) The user is allowed to install this Mod on a client and to play without restriction. + +B) Server owners are allowed to install the mod as part of the server as long as the following is meet + 1) Membership to the server is not required to access the content. + +4. Modification rights +---------------------- + +The user may modify the original code for private use, learning experience, or to make a contribution to the original project source code. This does not give the right to redistribute any part of the original or modified code. + +5. Distribution of original or modified copy rights +--------------------------------------------------- + +Is subject to distribution rights this entire Mod in its various forms which +includes but not limited too. +- binaries both original or modified +- source code both original or modified +- patches to its source or binary files +- any copy of a portion of its binaries, or source files + +A) The user is NOT allowed to redistribute this Mod partially, in totality, or included in a distribution without explicate permissions from the owner. With the only exceptions being for the case in section 5 part B. + +B) Distribution of this mod in a mod pack is only allowed if you have permission from the author. Once you have a permission you must agree to the following: + 1) The mod pack should not contain a major version release of the mod within one week of its release to allow for bug fixes. + 2) The mod pack should not contain a modified version of the mod unless to change the texture look of parts of the mod + 3) The mod pack owner or contributors must redirect issues, errors and bug reports to the issue area of the mod's original github repo + 4) The mod pack needs full public permission from all parts of the mod pack including mods, assets, and textures if it is publicly released. + 5) The mod pack or its download site should allow access by users to the list of permissions and credits to authors + 6) The mod pack or its download site should contain links to mod documentation and original mod sites + 7) The mod pack can not make any profit from the distribution of the mod. Including but not limited to adfly links. + 8) Any time any member of the mod's team can revoke the permission without reason + +C)Private mod packs have permission automatically as long as its for a small server. Large server mod packs are considered to be public and need public permission from the author. + +D) Textures of this mod are allowed to be used in the creation or modification of texture packs without permission. That is as long as links and credit to the original mod are given for easy user understanding. + +6. Use in media creations rights +------------------------------------------------------ + +Subject of media includes pictures, films, streams, or any form of graphic based content. +This includes but is not limited to +- You-tube video uploads +- Live streams such as twitch.TV +- Game play videos created by programs like fraps + +A) The user is fully permitted to create media that show content of the mod. However the creator is subject to the following. + 1) The media can not be used to collect profit without permission + 2) The media should not deface the mod in any way. + 3) The media should follow the rules of distribution for the mod + 4) The media should give credit to the mod author + 5) At any time the author can request media to be removed diff --git a/FM/README.md b/FM/README.md new file mode 100644 index 000000000..229a6b8cc --- /dev/null +++ b/FM/README.md @@ -0,0 +1,16 @@ +## Fluid Mechanics + +### Brief +Fluid Mechanics is a modifaction for minecraft that uses Forge, and UE to add support for Liquids and Mechanical energy transport and storage. + +### Leaders and Developers +* Darkguardsman - Lead + +### License +This intellectual property is licensed under the following license: https://github.com/DarkGuardsman/Fluid-Mechanics/blob/master/LISENCE.txt + +### Translations +Please submit a pull request if you would be willing to translate this mod into another language. + +### Contact +Join *#universalelectricity* on EsperNet. Remember to follow the rules and respect others as with any other channel. diff --git a/FM/docs/BoilerSystemDesign.png b/FM/docs/BoilerSystemDesign.png new file mode 100644 index 000000000..62759d30b Binary files /dev/null and b/FM/docs/BoilerSystemDesign.png differ diff --git a/FM/docs/HRSG_FLOW-DIAGRAM.jpg b/FM/docs/HRSG_FLOW-DIAGRAM.jpg new file mode 100644 index 000000000..04ef39a91 Binary files /dev/null and b/FM/docs/HRSG_FLOW-DIAGRAM.jpg differ diff --git a/FM/docs/Hydroelectric_dam.svg.png b/FM/docs/Hydroelectric_dam.svg.png new file mode 100644 index 000000000..6f6d2f60f Binary files /dev/null and b/FM/docs/Hydroelectric_dam.svg.png differ diff --git a/FM/docs/Plan.txt b/FM/docs/Plan.txt new file mode 100644 index 000000000..2c49269e6 --- /dev/null +++ b/FM/docs/Plan.txt @@ -0,0 +1 @@ +Block Smelter Turns blocks into lava for use as fuel, or building. Very basic 3 block machine that uses massive power to melt all items down into liquid blocks. Can be used to mass smelt ores down into liquid ores. Will produce sludge as a byproduct for items that can't be smelted. Steam Piston Takes steam and uses the force generated by it to do work. Give the right amount of pressure, and flow rate to create power. Will output steam at a lower pressure, and flow rate. Void pipe Uses to teleport fluids around the world at a high energy cost. Uses expensive material to create but does output 8 pipe connectors. Can temp store 100K fluid but doesn't save on world save Void tank Very expensive system for storing fluid at a high energy cost. Energy is only used to access the fluid. The tank can store 10MB of fluid per world. Can be accessed by anymore who knows the name of the tank. Does allow for remote access as long as the tank is created with the same tank name. Cost x10 more than void pipes to run and craft making void pipes a nicer idea. Boiler gas exchanger Place between an upper & lower tank set to help exchange gases between the two. The tanks themselves will act as a boiler. Heater Generates heat from diffrent types of fuels. When placed bellow a boiler setup will heat the lower tank and create gases. Pressure Release valve Controls the pressure created by a network. Will stop flow if pressure is too high or too low. Can be configured by the user, and increases pressure slightly at cost of flow rate One way valve Only allows fluid to flow in one direction Valve Both redstone and manaul versions for the player to control the flow threw pipes Fluid detector Normal redstone version as well advanced computer craft version. Detects fluid and will ouput redstone Pressure detector Triggers redstone when pressure is at a key level Flow rate detector Triggers redstone when pressure is at a key level Fluids Oil - Both cruid and refined versions Fuel - Created from refined oil Bio Fuel - created from plant matter Air - normal air from the world, uses as a pressure source. O2 - seperated from air to be used for several diffrent things CO2 - sperated from air to be used for several diffrent things N2 - """" Sludge - byproduct of varies industrial process. Works like waste liquid and stores the exact items uses to create it. this way it can be salvaged later on. Milk - Milk fluid as well override the bucket to allow working with it Chocolate Milk - mixing byproduct of chocolatte and milk. Easter egg since it will not be defined as a normal mixing process Chocolate Fluid - fluid version of chocolate, other than the milk it will have other crafting designs later on Mixer Mixes items and fluid together to create new items or fluids. Involves a complex setup of a mixer tank. Can create potions Potion filler Mass fills potions or fluid containers. Is only added when assembly line is added to the game. Condenser Turns gases into liquid form using varies methods. Is basicly a pipes that can be surrounded by diffent object to cool the fluid down. Eg. ICE, water, coolant. Fluid will drop in tempature by so much per block, and per block surrounding the block. Uses a heating api to calculate this. \ No newline at end of file diff --git a/FM/docs/beer-production.jpg b/FM/docs/beer-production.jpg new file mode 100644 index 000000000..bd0120715 Binary files /dev/null and b/FM/docs/beer-production.jpg differ diff --git a/FM/docs/steam-boiler-ft-a.gif b/FM/docs/steam-boiler-ft-a.gif new file mode 100644 index 000000000..8fa608d6b Binary files /dev/null and b/FM/docs/steam-boiler-ft-a.gif differ diff --git a/FM/docs/tanks.txt b/FM/docs/tanks.txt new file mode 100644 index 000000000..89e5e5c96 --- /dev/null +++ b/FM/docs/tanks.txt @@ -0,0 +1,11 @@ +Need improved just a bit to provide better features. Currently the only features are lagless mutli-block networks, and redstone output. + +Feature ideas +Auto feed system. Tanks use to have this were they feed machines bellow them with fluids. was original designed to support the tank design and was removed during a rewrite. + + +Graphics +Though i've been working to reduce graphics so things run better i had a few ideas. +Fluid flow - actually show the fluid moving and sloshing in the tank. +Connections - show the fluid moving in and out of connected machines/pipe +Wrench support - allow the wrench to turn off side renders. Too improve design and performance. \ No newline at end of file diff --git a/FM/models/Archive/BOILER TANK.tcn b/FM/models/Archive/BOILER TANK.tcn new file mode 100644 index 000000000..5a03accad Binary files /dev/null and b/FM/models/Archive/BOILER TANK.tcn differ diff --git a/FM/models/Archive/CornerTank.tcn b/FM/models/Archive/CornerTank.tcn new file mode 100644 index 000000000..43a0fda2e Binary files /dev/null and b/FM/models/Archive/CornerTank.tcn differ diff --git a/FM/models/Archive/Generator.tcn b/FM/models/Archive/Generator.tcn new file mode 100644 index 000000000..b75f9e963 Binary files /dev/null and b/FM/models/Archive/Generator.tcn differ diff --git a/FM/models/Archive/Pump.tcn b/FM/models/Archive/Pump.tcn new file mode 100644 index 000000000..6789f39c7 Binary files /dev/null and b/FM/models/Archive/Pump.tcn differ diff --git a/FM/models/Archive/STEAM ENGINE.tcn b/FM/models/Archive/STEAM ENGINE.tcn new file mode 100644 index 000000000..1539e8cb3 Binary files /dev/null and b/FM/models/Archive/STEAM ENGINE.tcn differ diff --git a/FM/models/Archive/SteamPiston.tcn b/FM/models/Archive/SteamPiston.tcn new file mode 100644 index 000000000..7e039c805 Binary files /dev/null and b/FM/models/Archive/SteamPiston.tcn differ diff --git a/FM/models/Archive/TankCorner2.tcn b/FM/models/Archive/TankCorner2.tcn new file mode 100644 index 000000000..4ca8f7289 Binary files /dev/null and b/FM/models/Archive/TankCorner2.tcn differ diff --git a/FM/models/Archive/TankSingle2.tcn b/FM/models/Archive/TankSingle2.tcn new file mode 100644 index 000000000..3715d4547 Binary files /dev/null and b/FM/models/Archive/TankSingle2.tcn differ diff --git a/FM/models/Archive/furnace.tcn b/FM/models/Archive/furnace.tcn new file mode 100644 index 000000000..0307421e7 Binary files /dev/null and b/FM/models/Archive/furnace.tcn differ diff --git a/FM/models/Archive/submittedPipe.tcn b/FM/models/Archive/submittedPipe.tcn new file mode 100644 index 000000000..3329f7535 Binary files /dev/null and b/FM/models/Archive/submittedPipe.tcn differ diff --git a/FM/models/Current_Models/BasicPump.tcn b/FM/models/Current_Models/BasicPump.tcn new file mode 100644 index 000000000..b84fc5a83 Binary files /dev/null and b/FM/models/Current_Models/BasicPump.tcn differ diff --git a/FM/models/Current_Models/ConstructionPump.tcn b/FM/models/Current_Models/ConstructionPump.tcn new file mode 100644 index 000000000..b48de9384 Binary files /dev/null and b/FM/models/Current_Models/ConstructionPump.tcn differ diff --git a/FM/models/Current_Models/GearShaft.tcn b/FM/models/Current_Models/GearShaft.tcn new file mode 100644 index 000000000..06ce842af Binary files /dev/null and b/FM/models/Current_Models/GearShaft.tcn differ diff --git a/FM/models/Current_Models/GearShaftPiston.tcn b/FM/models/Current_Models/GearShaftPiston.tcn new file mode 100644 index 000000000..2f7b5e419 Binary files /dev/null and b/FM/models/Current_Models/GearShaftPiston.tcn differ diff --git a/FM/models/Current_Models/Generator.tcn b/FM/models/Current_Models/Generator.tcn new file mode 100644 index 000000000..b5e106ceb Binary files /dev/null and b/FM/models/Current_Models/Generator.tcn differ diff --git a/FM/models/Current_Models/HandValve.tcn b/FM/models/Current_Models/HandValve.tcn new file mode 100644 index 000000000..146aa984a Binary files /dev/null and b/FM/models/Current_Models/HandValve.tcn differ diff --git a/FM/models/Current_Models/LargePipe.tcn b/FM/models/Current_Models/LargePipe.tcn new file mode 100644 index 000000000..fc32eb84a Binary files /dev/null and b/FM/models/Current_Models/LargePipe.tcn differ diff --git a/FM/models/Current_Models/MechRod.tcn b/FM/models/Current_Models/MechRod.tcn new file mode 100644 index 000000000..06bb0c008 Binary files /dev/null and b/FM/models/Current_Models/MechRod.tcn differ diff --git a/FM/models/Current_Models/Piston.tcn b/FM/models/Current_Models/Piston.tcn new file mode 100644 index 000000000..224014c58 Binary files /dev/null and b/FM/models/Current_Models/Piston.tcn differ diff --git a/FM/models/Current_Models/Sink.tcn b/FM/models/Current_Models/Sink.tcn new file mode 100644 index 000000000..d3e8c62ac Binary files /dev/null and b/FM/models/Current_Models/Sink.tcn differ diff --git a/FM/models/Current_Models/Tank.tcn b/FM/models/Current_Models/Tank.tcn new file mode 100644 index 000000000..51d439b5a Binary files /dev/null and b/FM/models/Current_Models/Tank.tcn differ diff --git a/FM/models/Current_Models/TankSide.java b/FM/models/Current_Models/TankSide.java new file mode 100644 index 000000000..5ee17f59f --- /dev/null +++ b/FM/models/Current_Models/TankSide.java @@ -0,0 +1,155 @@ +// Date: 6/3/2013 8:45:19 PM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + + + + + + +package net.minecraft.src; + +public class ModelTankSide extends ModelBase +{ + //fields + ModelRenderer rightSiding; + ModelRenderer leftSiding; + ModelRenderer topSiding; + ModelRenderer botSiding; + ModelRenderer botRightOut; + ModelRenderer botLeftOut; + ModelRenderer topRightOut; + ModelRenderer topLeftOut; + ModelRenderer leftSide; + ModelRenderer leftTopSide; + ModelRenderer leftBotSide; + ModelRenderer rightBotSide; + ModelRenderer rightSide; + ModelRenderer rightTopSide; + + public ModelTankSide() + { + textureWidth = 128; + textureHeight = 128; + + rightSiding = new ModelRenderer(this, 0, 19); + rightSiding.addBox(-7F, 11F, 7F, 2, 10, 1); + rightSiding.setRotationPoint(0F, 0F, 0F); + rightSiding.setTextureSize(128, 128); + rightSiding.mirror = true; + setRotation(rightSiding, 0F, 0F, 0F); + leftSiding = new ModelRenderer(this, 0, 19); + leftSiding.addBox(5F, 11F, 7F, 2, 10, 1); + leftSiding.setRotationPoint(0F, 0F, 0F); + leftSiding.setTextureSize(128, 128); + leftSiding.mirror = true; + setRotation(leftSiding, 0F, 0F, 0F); + topSiding = new ModelRenderer(this, 7, 8); + topSiding.addBox(-5F, 8F, 7F, 10, 3, 1); + topSiding.setRotationPoint(0F, 0F, 0F); + topSiding.setTextureSize(128, 128); + topSiding.mirror = true; + setRotation(topSiding, 0F, 0F, 0F); + botSiding = new ModelRenderer(this, 7, 8); + botSiding.addBox(-5F, 21F, 7F, 10, 3, 1); + botSiding.setRotationPoint(0F, 0F, 0F); + botSiding.setTextureSize(128, 128); + botSiding.mirror = true; + setRotation(botSiding, 0F, 0F, 0F); + botRightOut = new ModelRenderer(this, 0, 0); + botRightOut.addBox(-7F, 21F, 7F, 2, 3, 1); + botRightOut.setRotationPoint(0F, 0F, 0F); + botRightOut.setTextureSize(128, 128); + botRightOut.mirror = true; + setRotation(botRightOut, 0F, 0F, 0F); + botLeftOut = new ModelRenderer(this, 0, 0); + botLeftOut.addBox(5F, 21F, 7F, 2, 3, 1); + botLeftOut.setRotationPoint(0F, 0F, 0F); + botLeftOut.setTextureSize(128, 128); + botLeftOut.mirror = true; + setRotation(botLeftOut, 0F, 0F, 0F); + topRightOut = new ModelRenderer(this, 0, 0); + topRightOut.addBox(-7F, 8F, 7F, 2, 3, 1); + topRightOut.setRotationPoint(0F, 0F, 0F); + topRightOut.setTextureSize(128, 128); + topRightOut.mirror = true; + setRotation(topRightOut, 0F, 0F, 0F); + topLeftOut = new ModelRenderer(this, 0, 0); + topLeftOut.addBox(5F, 8F, 7F, 2, 3, 1); + topLeftOut.setRotationPoint(0F, 0F, 0F); + topLeftOut.setTextureSize(128, 128); + topLeftOut.mirror = true; + setRotation(topLeftOut, 0F, 0F, 0F); + leftSide = new ModelRenderer(this, 0, 19); + leftSide.addBox(7F, 11F, 7F, 1, 10, 1); + leftSide.setRotationPoint(0F, 0F, 0F); + leftSide.setTextureSize(128, 128); + leftSide.mirror = true; + setRotation(leftSide, 0F, 0F, 0F); + leftTopSide = new ModelRenderer(this, 0, 0); + leftTopSide.addBox(7F, 8F, 7F, 1, 3, 1); + leftTopSide.setRotationPoint(0F, 0F, 0F); + leftTopSide.setTextureSize(128, 128); + leftTopSide.mirror = true; + setRotation(leftTopSide, 0F, 0F, 0F); + leftBotSide = new ModelRenderer(this, 0, 0); + leftBotSide.addBox(7F, 21F, 7F, 1, 3, 1); + leftBotSide.setRotationPoint(0F, 0F, 0F); + leftBotSide.setTextureSize(128, 128); + leftBotSide.mirror = true; + setRotation(leftBotSide, 0F, 0F, 0F); + rightBotSide = new ModelRenderer(this, 0, 0); + rightBotSide.addBox(-8F, 21F, 7F, 1, 3, 1); + rightBotSide.setRotationPoint(0F, 0F, 0F); + rightBotSide.setTextureSize(128, 128); + rightBotSide.mirror = true; + setRotation(rightBotSide, 0F, 0F, 0F); + rightSide = new ModelRenderer(this, 0, 19); + rightSide.addBox(-8F, 11F, 7F, 1, 10, 1); + rightSide.setRotationPoint(0F, 0F, 0F); + rightSide.setTextureSize(128, 128); + rightSide.mirror = true; + setRotation(rightSide, 0F, 0F, 0F); + rightTopSide = new ModelRenderer(this, 0, 0); + rightTopSide.addBox(-8F, 8F, 7F, 1, 3, 1); + rightTopSide.setRotationPoint(0F, 0F, 0F); + rightTopSide.setTextureSize(128, 128); + rightTopSide.mirror = true; + setRotation(rightTopSide, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5); + rightSiding.render(f5); + leftSiding.render(f5); + topSiding.render(f5); + botSiding.render(f5); + botRightOut.render(f5); + botLeftOut.render(f5); + topRightOut.render(f5); + topLeftOut.render(f5); + leftSide.render(f5); + leftTopSide.render(f5); + leftBotSide.render(f5); + rightBotSide.render(f5); + rightSide.render(f5); + rightTopSide.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5); + } + +} diff --git a/FM/models/Current_Models/TankSide.png b/FM/models/Current_Models/TankSide.png new file mode 100644 index 000000000..2b0a650de Binary files /dev/null and b/FM/models/Current_Models/TankSide.png differ diff --git a/FM/models/Current_Models/pipe.tcn b/FM/models/Current_Models/pipe.tcn new file mode 100644 index 000000000..3329f7535 Binary files /dev/null and b/FM/models/Current_Models/pipe.tcn differ diff --git a/FM/models/WIP/Condensor.tcn b/FM/models/WIP/Condensor.tcn new file mode 100644 index 000000000..ef1c6c62d Binary files /dev/null and b/FM/models/WIP/Condensor.tcn differ diff --git a/FM/models/WIP/WindMill.tcn b/FM/models/WIP/WindMill.tcn new file mode 100644 index 000000000..3e6c85ebc Binary files /dev/null and b/FM/models/WIP/WindMill.tcn differ diff --git a/FM/models/WIP/tube.tcn b/FM/models/WIP/tube.tcn new file mode 100644 index 000000000..1831e6766 Binary files /dev/null and b/FM/models/WIP/tube.tcn differ diff --git a/FM/models/rejected/Pump3.tcn b/FM/models/rejected/Pump3.tcn new file mode 100644 index 000000000..36082c36c Binary files /dev/null and b/FM/models/rejected/Pump3.tcn differ diff --git a/FM/models/rejected/PumpV2.tcn b/FM/models/rejected/PumpV2.tcn new file mode 100644 index 000000000..ba009bf9e Binary files /dev/null and b/FM/models/rejected/PumpV2.tcn differ diff --git a/FM/models/rejected/something.tcn b/FM/models/rejected/something.tcn new file mode 100644 index 000000000..080d6348a Binary files /dev/null and b/FM/models/rejected/something.tcn differ diff --git a/FM/resources/assets/FM_Banner.png b/FM/resources/assets/FM_Banner.png new file mode 100644 index 000000000..554e0b58a Binary files /dev/null and b/FM/resources/assets/FM_Banner.png differ diff --git a/FM/resources/assets/fm/languages/de_DE.properties b/FM/resources/assets/fm/languages/de_DE.properties new file mode 100644 index 000000000..ea003c896 --- /dev/null +++ b/FM/resources/assets/fm/languages/de_DE.properties @@ -0,0 +1,413 @@ +# FluidMechanics Language Properties +# @author DarkGuardsman and Vexatos + +itemGroup.FluidMechanics=Fluid Mechanics + +# Blocks +tile.MechanicalGenerator.name=Generator +tile.lmMachines.0.name=Pumpe +tile.MechanicalRod.name=Mechanische Stange +tile.ReleaseValve.0.name=Freilassventil +tile.FluidTank.name = Tank +tile.FluidSink.name = Sp\u00FCle + +# Fluid pipes +tile.FluidPipe.1.name =Holztrog +tile.FluidPipe.1.name =Schwarzer Holztrog +tile.FluidPipe.2.name =Roter Holztrog +tile.FluidPipe.3.name =Gr\u00FCner Holztrog +tile.FluidPipe.4.name =Brauner Holztrog +tile.FluidPipe.5.name =Blauer Holztrog +tile.FluidPipe.6.name =Violetter Holztrog +tile.FluidPipe.7.name =T\u00FCrkiser Holztrog +tile.FluidPipe.8.name =Hellgrauer Holztrog +tile.FluidPipe.9.name =Grauer Holztrog +tile.FluidPipe.10.name =Pinker Holztrog +tile.FluidPipe.11.name =Hellgr\u00FCner Holztrog +tile.FluidPipe.12.name =Gelber Holztrog +tile.FluidPipe.13.name =Hellblauer Holztrog +tile.FluidPipe.14.name =Magentafarbenesfarbener Holztrog +tile.FluidPipe.15.name =Oranger Holztrog +tile.FluidPipe.16.name =Wei\u00DFer Holztrog + +tile.FluidPipe.1000.name =Glasr\u00F6hre +tile.FluidPipe.1001.name =Schwarze Glasr\u00F6hre +tile.FluidPipe.1002.name =Rote Glasr\u00F6hre +tile.FluidPipe.1003.name =Gr\u00FCne Glasr\u00F6hre +tile.FluidPipe.1004.name =Braune Glasr\u00F6hre +tile.FluidPipe.1005.name =Blaue Glasr\u00F6hre +tile.FluidPipe.1006.name =Violette Glasr\u00F6hre +tile.FluidPipe.1007.name =T\u00FCrkise Glasr\u00F6hre +tile.FluidPipe.1008.name =Hellgraue Glasr\u00F6hre +tile.FluidPipe.1009.name =Graue Glasr\u00F6hre +tile.FluidPipe.1010.name =Pinke Glasr\u00F6hre +tile.FluidPipe.1011.name =Hellgr\u00FCne Glasr\u00F6hre +tile.FluidPipe.1012.name =Gelbe Glasr\u00F6hre +tile.FluidPipe.1013.name =Hellblaue Glasr\u00F6hre +tile.FluidPipe.1014.name =Magentafarbene Glasr\u00F6hre +tile.FluidPipe.1015.name =Orange Glasr\u00F6hre +tile.FluidPipe.1016.name =Wei\u00DFe Glasr\u00F6hre + +tile.FluidPipe.2000.name =Steintrog +tile.FluidPipe.2001.name =Schwarzer Steintrog +tile.FluidPipe.2002.name =Roter Steintrog +tile.FluidPipe.2003.name =Gr\u00FCner Steintrog +tile.FluidPipe.2004.name =Brauner Steintrog +tile.FluidPipe.2005.name =Blauer Steintrog +tile.FluidPipe.2006.name =Violetter Steintrog +tile.FluidPipe.2007.name =T\u00FCrkiser Steintrog +tile.FluidPipe.2008.name =Hellgrauer Steintrog +tile.FluidPipe.2009.name =Grauer Steintrog +tile.FluidPipe.2010.name =Pinker Steintrog +tile.FluidPipe.2011.name =Hellgr\u00FCner Steintrog +tile.FluidPipe.2012.name =Gelber Steintrog +tile.FluidPipe.2013.name =Hellblauer Steintrog +tile.FluidPipe.2014.name =Magentafarbener Steintrog +tile.FluidPipe.2015.name =Oranger Steintrog +tile.FluidPipe.2016.name =Wei\u00DFer Steintrog + +tile.FluidPipe.3000.name =Zinnrohr +tile.FluidPipe.3001.name =Schwarzes Zinnrohr +tile.FluidPipe.3002.name =Rotes Zinnrohr +tile.FluidPipe.3003.name =Gr\u00FCnes Zinnrohr +tile.FluidPipe.3004.name =Braunes Zinnrohr +tile.FluidPipe.3005.name =Blaues Zinnrohr +tile.FluidPipe.3006.name =Violettes Zinnrohr +tile.FluidPipe.3007.name =T\u00FCrkises Zinnrohr +tile.FluidPipe.3008.name =Hellgraues Zinnrohr +tile.FluidPipe.3009.name =Graues Zinnrohr +tile.FluidPipe.3010.name =Pinkes Zinnrohr +tile.FluidPipe.3011.name =Hellgr\u00FCnes Zinnrohr +tile.FluidPipe.3012.name =Gelbes Zinnrohr +tile.FluidPipe.3013.name =Hellblaues Zinnrohr +tile.FluidPipe.3014.name =Magentafarbenes Zinnrohr +tile.FluidPipe.3015.name =Oranges Zinnrohr +tile.FluidPipe.3016.name =Wei\u00DFes Zinnrohr + +tile.FluidPipe.4000.name =Kupferrohr +tile.FluidPipe.4001.name =Schwarzes Kupferrohr +tile.FluidPipe.4002.name =Rotes Kupferrohr +tile.FluidPipe.4003.name =Gr\u00FCnes Kupferrohr +tile.FluidPipe.4004.name =Braunes Kupferrohr +tile.FluidPipe.4005.name =Blaues Kupferrohr +tile.FluidPipe.4006.name =Violettes Kupferrohr +tile.FluidPipe.4007.name =T\u00FCrkises Kupferrohr +tile.FluidPipe.4008.name =Hellgraues Kupferrohr +tile.FluidPipe.4009.name =Graues Kupferrohr +tile.FluidPipe.4010.name =Pinkes Kupferrohr +tile.FluidPipe.4011.name =Hellgr\u00FCnes Kupferrohr +tile.FluidPipe.4012.name =Gelbes Kupferrohr +tile.FluidPipe.4013.name =Hellblaues Kupferrohr +tile.FluidPipe.4014.name =Magentafarbenes Kupferrohr +tile.FluidPipe.4015.name =Oranges Kupferrohr +tile.FluidPipe.4016.name =Wei\u00DFes Kupferrohr + +tile.FluidPipe.5000.name =Eisenrohr +tile.FluidPipe.5001.name =Schwarzes Eisenrohr +tile.FluidPipe.5002.name =Rotes Eisenrohr +tile.FluidPipe.5003.name =Gr\u00FCnes Eisenrohr +tile.FluidPipe.5004.name =Braunes Eisenrohr +tile.FluidPipe.5005.name =Blaues Eisenrohr +tile.FluidPipe.5006.name =Violettes Eisenrohr +tile.FluidPipe.5007.name =T\u00FCrkises Eisenrohr +tile.FluidPipe.5008.name =Hellgraues Eisenrohr +tile.FluidPipe.5009.name =Graues Eisenrohr +tile.FluidPipe.5010.name =Pinkes Eisenrohr +tile.FluidPipe.5011.name =Hellgr\u00FCnes Eisenrohr +tile.FluidPipe.5012.name =Gelbes Eisenrohr +tile.FluidPipe.5013.name =Hellblaues Eisenrohr +tile.FluidPipe.5014.name =Magentafarbenes Eisenrohr +tile.FluidPipe.5015.name =Oranges Eisenrohr +tile.FluidPipe.5016.name =Wei\u00DFes Eisenrohr + +tile.FluidPipe.6000.name =Goldrohr +tile.FluidPipe.6001.name =Schwarzes Goldrohr +tile.FluidPipe.6002.name =Rotes Goldrohr +tile.FluidPipe.6003.name =Gr\u00FCnes Goldrohr +tile.FluidPipe.6004.name =Braunes Goldrohr +tile.FluidPipe.6005.name =Blaues Goldrohr +tile.FluidPipe.6006.name =Violettes Goldrohr +tile.FluidPipe.6007.name =T\u00FCrkises Goldrohr +tile.FluidPipe.6008.name =Hellgraues Goldrohr +tile.FluidPipe.6009.name =Graues Goldrohr +tile.FluidPipe.6010.name =Pinkes Goldrohr +tile.FluidPipe.6011.name =Hellgr\u00FCnes Goldrohr +tile.FluidPipe.6012.name =Gelbes Goldrohr +tile.FluidPipe.6013.name =Hellblaues Goldrohr +tile.FluidPipe.6014.name =Magentafarbenes Goldrohr +tile.FluidPipe.6015.name =Oranges Goldrohr +tile.FluidPipe.6016.name =Wei\u00DFes Goldrohr + +tile.FluidPipe.7000.name =Obsidianrohr +tile.FluidPipe.7001.name =Schwarzes Obsidianrohr +tile.FluidPipe.7002.name =Rotes Obsidianrohr +tile.FluidPipe.7003.name =Gr\u00FCnes Obsidianrohr +tile.FluidPipe.7004.name =Braunes Obsidianrohr +tile.FluidPipe.7005.name =Blaues Obsidianrohr +tile.FluidPipe.7006.name =Violettes Obsidianrohr +tile.FluidPipe.7007.name =T\u00FCrkises Obsidianrohr +tile.FluidPipe.7008.name =Hellgraues Obsidianrohr +tile.FluidPipe.7009.name =Graues Obsidianrohr +tile.FluidPipe.7010.name =Pinkes Obsidianrohr +tile.FluidPipe.7011.name =Hellgr\u00FCnes Obsidianrohr +tile.FluidPipe.7012.name =Gelbes Obsidianrohr +tile.FluidPipe.7013.name =Hellblaues Obsidianrohr +tile.FluidPipe.7014.name =Magentafarbenes Obsidianrohr +tile.FluidPipe.7015.name =Oranges Obsidianrohr +tile.FluidPipe.7016.name =Wei\u00DFes Obsidianrohr + +tile.FluidPipe.8000.name =Stahlrohr +tile.FluidPipe.8001.name =Schwarzes Stahlrohr +tile.FluidPipe.8002.name =Rotes Stahlrohr +tile.FluidPipe.8003.name =Gr\u00FCnes Stahlrohr +tile.FluidPipe.8004.name =Braunes Stahlrohr +tile.FluidPipe.8005.name =Blaues Stahlrohr +tile.FluidPipe.8006.name =Violettes Stahlrohr +tile.FluidPipe.8007.name =T\u00FCrkises Stahlrohr +tile.FluidPipe.8008.name =Hellgraues Stahlrohr +tile.FluidPipe.8009.name =Graues Stahlrohr +tile.FluidPipe.8010.name =Pinkes Stahlrohr +tile.FluidPipe.8011.name =Hellgr\u00FCnes Stahlrohr +tile.FluidPipe.8012.name =Gelbes Stahlrohr +tile.FluidPipe.8013.name =Hellblaues Stahlrohr +tile.FluidPipe.8014.name =Magentafarbenes Stahlrohr +tile.FluidPipe.8015.name =Oranges Stahlrohr +tile.FluidPipe.8016.name =Wei\u00DFes Stahlrohr + +tile.FluidPipe.9000.name =Bronzerohr +tile.FluidPipe.9001.name =Schwarzes Bronzerohr +tile.FluidPipe.9002.name =Rotes Bronzerohr +tile.FluidPipe.9003.name =Gr\u00FCnes Bronzerohr +tile.FluidPipe.9004.name =Braunes Bronzerohr +tile.FluidPipe.9005.name =Blaues Bronzerohr +tile.FluidPipe.9006.name =Violettes Bronzerohr +tile.FluidPipe.9007.name =T\u00FCrkises Bronzerohr +tile.FluidPipe.9008.name =Hellgraues Bronzerohr +tile.FluidPipe.9009.name =Graues Bronzerohr +tile.FluidPipe.9010.name =Pinkes Bronzerohr +tile.FluidPipe.9011.name =Hellgr\u00FCnes Bronzerohr +tile.FluidPipe.9012.name =Gelbes Bronzerohr +tile.FluidPipe.9013.name =Hellblaues Bronzerohr +tile.FluidPipe.9014.name =Magentafarbenes Bronzerohr +tile.FluidPipe.9015.name =Oranges Bronzerohr +tile.FluidPipe.9016.name =Wei\u00DFes Bronzerohr + +tile.FluidPipe.10000.name =H\u00F6llenrohr +tile.FluidPipe.10001.name =Schwarzes H\u00F6llenrohr +tile.FluidPipe.10002.name =Rotes H\u00F6llenrohr +tile.FluidPipe.10003.name =Gr\u00FCnes H\u00F6llenrohr +tile.FluidPipe.10004.name =Braunes H\u00F6llenrohr +tile.FluidPipe.10005.name =Blaues H\u00F6llenrohr +tile.FluidPipe.10006.name =Violettes H\u00F6llenrohr +tile.FluidPipe.10007.name =T\u00FCrkises H\u00F6llenrohr +tile.FluidPipe.10008.name =Hellgraues H\u00F6llenrohr +tile.FluidPipe.10009.name =Graues H\u00F6llenrohr +tile.FluidPipe.10010.name =Pinkes H\u00F6llenrohr +tile.FluidPipe.10011.name =Hellgr\u00FCnes H\u00F6llenrohr +tile.FluidPipe.10012.name =Gelbes H\u00F6llenrohr +tile.FluidPipe.10013.name =Hellblaues H\u00F6llenrohr +tile.FluidPipe.10014.name =Magentafarbenes H\u00F6llenrohr +tile.FluidPipe.10015.name =Oranges H\u00F6llenrohr +tile.FluidPipe.10016.name =Wei\u00DFes H\u00F6llenrohr + +tile.FluidTank.0.name =Holztank +tile.FluidTank.1.name =Schwarzer Holztank +tile.FluidTank.2.name =Roter Holztank +tile.FluidTank.3.name =Gr\u00FCner Holztank +tile.FluidTank.4.name =Brauner Holztank +tile.FluidTank.5.name =Blauer Holztank +tile.FluidTank.6.name =Violetter Holztank +tile.FluidTank.7.name =T\u00FCrkiser Holztank +tile.FluidTank.8.name =Hellgrauer Holztank +tile.FluidTank.9.name =Grauer Holztank +tile.FluidTank.10.name =Pinker Holztank +tile.FluidTank.11.name =Hellgr\u00FCner Holztank +tile.FluidTank.12.name =Gelber Holztank +tile.FluidTank.13.name =Hellblauer Holztank +tile.FluidTank.14.name =Magentafarbener Holztank +tile.FluidTank.15.name =Oranger Holztank +tile.FluidTank.16.name =Wei\u00DFer Holztank + +tile.FluidTank.1000.name =Glastank +tile.FluidTank.1001.name =Schwarzer Glastank +tile.FluidTank.1002.name =Roter Glastank +tile.FluidTank.1003.name =Gr\u00FCner Glastank +tile.FluidTank.1004.name =Brauner Glastank +tile.FluidTank.1005.name =Blauer Glastank +tile.FluidTank.1006.name =Violetter Glastank +tile.FluidTank.1007.name =T\u00FCrkiser Glastank +tile.FluidTank.1008.name =Hellgrauer Glastank +tile.FluidTank.1009.name =Grauer Glastank +tile.FluidTank.1010.name =Pinker Glastank +tile.FluidTank.1011.name =Hellgr\u00FCner Glastank +tile.FluidTank.1012.name =Gelber Glastank +tile.FluidTank.1013.name =Hellblauer Glastank +tile.FluidTank.1014.name =Magentafarbener Glastank +tile.FluidTank.1015.name =Oranger Glastank +tile.FluidTank.1016.name =Wei\u00DFer Glastank + +tile.FluidTank.2000.name =Steintank +tile.FluidTank.2001.name =Schwarzer Steintank +tile.FluidTank.2002.name =Roter Steintank +tile.FluidTank.2003.name =Gr\u00FCner Steintank +tile.FluidTank.2004.name =Brauner Steintank +tile.FluidTank.2005.name =Blauer Steintank +tile.FluidTank.2006.name =Violetter Steintank +tile.FluidTank.2007.name =T\u00FCrkiser Steintank +tile.FluidTank.2008.name =Hellgrauer Steintank +tile.FluidTank.2009.name =Grauer Steintank +tile.FluidTank.2010.name =Pinker Steintank +tile.FluidTank.2011.name =Hellgr\u00FCner Steintank +tile.FluidTank.2012.name =Gelber Steintank +tile.FluidTank.2013.name =Hellblauer Steintank +tile.FluidTank.2014.name =Magentafarbener Steintank +tile.FluidTank.2015.name =Oranger Steintank +tile.FluidTank.2016.name =Wei\u00DFer Steintank + +tile.FluidTank.3000.name =Zinntank +tile.FluidTank.3001.name =Schwarzer Zinntank +tile.FluidTank.3002.name =Roter Zinntank +tile.FluidTank.3003.name =Gr\u00FCner Zinntank +tile.FluidTank.3004.name =Brauner Zinntank +tile.FluidTank.3005.name =Blauer Zinntank +tile.FluidTank.3006.name =Violetter Zinntank +tile.FluidTank.3007.name =T\u00FCrkiser Zinntank +tile.FluidTank.3008.name =Hellgrauer Zinntank +tile.FluidTank.3009.name =Grauer Zinntank +tile.FluidTank.3010.name =Pinker Zinntank +tile.FluidTank.3011.name =Hellgr\u00FCner Zinntank +tile.FluidTank.3012.name =Gelber Zinntank +tile.FluidTank.3013.name =Hellblauer Zinntank +tile.FluidTank.3014.name =Magentafarbener Zinntank +tile.FluidTank.3015.name =Oranger Zinntank +tile.FluidTank.3016.name =Wei\u00DFer Zinntank + +tile.FluidTank.4000.name =Kupfertank +tile.FluidTank.4001.name =Schwarzer Kupfertank +tile.FluidTank.4002.name =Roter Kupfertank +tile.FluidTank.4003.name =Gr\u00FCner Kupfertank +tile.FluidTank.4004.name =Brauner Kupfertank +tile.FluidTank.4005.name =Blauer Kupfertank +tile.FluidTank.4006.name =Violetter Kupfertank +tile.FluidTank.4007.name =T\u00FCrkiser Kupfertank +tile.FluidTank.4008.name =Hellgrauer Kupfertank +tile.FluidTank.4009.name =Grauer Kupfertank +tile.FluidTank.4010.name =Pinker Kupfertank +tile.FluidTank.4011.name =Hellgr\u00FCner Kupfertank +tile.FluidTank.4012.name =Gelber Kupfertank +tile.FluidTank.4013.name =Hellblauer Kupfertank +tile.FluidTank.4014.name =Magentafarbener Kupfertank +tile.FluidTank.4015.name =Oranger Kupfertank +tile.FluidTank.4016.name =Wei\u00DFer Kupfertank + +tile.FluidTank.5000.name =Eisentank +tile.FluidTank.5001.name =Schwarzer Eisentank +tile.FluidTank.5002.name =Roter Eisentank +tile.FluidTank.5003.name =Gr\u00FCner Eisentank +tile.FluidTank.5004.name =Brauner Eisentank +tile.FluidTank.5005.name =Blauer Eisentank +tile.FluidTank.5006.name =Violetter Eisentank +tile.FluidTank.5007.name =T\u00FCrkiser Eisentank +tile.FluidTank.5008.name =Hellgrauer Eisentank +tile.FluidTank.5009.name =Grauer Eisentank +tile.FluidTank.5010.name =Pinker Eisentank +tile.FluidTank.5011.name =Hellgr\u00FCner Eisentank +tile.FluidTank.5012.name =Gelber Eisentank +tile.FluidTank.5013.name =Hellblauer Eisentank +tile.FluidTank.5014.name =Magentafarbener Eisentank +tile.FluidTank.5015.name =Oranger Eisentank +tile.FluidTank.5016.name =Wei\u00DFer Eisentank + +tile.FluidTank.6000.name =Goldtank +tile.FluidTank.6001.name =Schwarzer Goldtank +tile.FluidTank.6002.name =Roter Goldtank +tile.FluidTank.6003.name =Gr\u00FCner Goldtank +tile.FluidTank.6004.name =Brauner Goldtank +tile.FluidTank.6005.name =Blauer Goldtank +tile.FluidTank.6006.name =Violetter Goldtank +tile.FluidTank.6007.name =T\u00FCrkiser Goldtank +tile.FluidTank.6008.name =Hellgrauer Goldtank +tile.FluidTank.6009.name =Grauer Goldtank +tile.FluidTank.6010.name =Pinker Goldtank +tile.FluidTank.6011.name =Hellgr\u00FCner Goldtank +tile.FluidTank.6012.name =Gelber Goldtank +tile.FluidTank.6013.name =Hellblauer Goldtank +tile.FluidTank.6014.name =Magentafarbener Goldtank +tile.FluidTank.6015.name =Oranger Goldtank +tile.FluidTank.6016.name =Wei\u00DFer Goldtank + +tile.FluidTank.7000.name =Obsidiantank +tile.FluidTank.7001.name =Schwarzer Obsidiantank +tile.FluidTank.7002.name =Roter Obsidiantank +tile.FluidTank.7003.name =Gr\u00FCner Obsidiantank +tile.FluidTank.7004.name =Brauner Obsidiantank +tile.FluidTank.7005.name =Blauer Obsidiantank +tile.FluidTank.7006.name =Violetter Obsidiantank +tile.FluidTank.7007.name =T\u00FCrkiser Obsidiantank +tile.FluidTank.7008.name =Hellgrauer Obsidiantank +tile.FluidTank.7009.name =Grauer Obsidiantank +tile.FluidTank.7010.name =Pinker Obsidiantank +tile.FluidTank.7011.name =Hellgr\u00FCner Obsidiantank +tile.FluidTank.7012.name =Gelber Obsidiantank +tile.FluidTank.7013.name =Hellblauer Obsidiantank +tile.FluidTank.7014.name =Magentafarbener Obsidiantank +tile.FluidTank.7015.name =Oranger Obsidiantank +tile.FluidTank.7016.name =Wei\u00DFer Obsidiantank + +tile.FluidTank.8000.name =Stahltank +tile.FluidTank.8001.name =Schwarzer Stahltank +tile.FluidTank.8002.name =Roter Stahltank +tile.FluidTank.8003.name =Gr\u00FCner Stahltank +tile.FluidTank.8004.name =Brauner Stahltank +tile.FluidTank.8005.name =Blauer Stahltank +tile.FluidTank.8006.name =Violetter Stahltank +tile.FluidTank.8007.name =T\u00FCrkiser Stahltank +tile.FluidTank.8008.name =Hellgrauer Stahltank +tile.FluidTank.8009.name =Grauer Stahltank +tile.FluidTank.8010.name =Pinker Stahltank +tile.FluidTank.8011.name =Hellgr\u00FCner Stahltank +tile.FluidTank.8012.name =Gelber Stahltank +tile.FluidTank.8013.name =Hellblauer Stahltank +tile.FluidTank.8014.name =Magentafarbener Stahltank +tile.FluidTank.8015.name =Oranger Stahltank +tile.FluidTank.8016.name =Wei\u00DFer Stahltank + +tile.FluidTank.9000.name =Bronzetank +tile.FluidTank.9001.name =Schwarzer Bronzetank +tile.FluidTank.9002.name =Roter Bronzetank +tile.FluidTank.9003.name =Gr\u00FCner Bronzetank +tile.FluidTank.9004.name =Brauner Bronzetank +tile.FluidTank.9005.name =Blauer Bronzetank +tile.FluidTank.9006.name =Violetter Bronzetank +tile.FluidTank.9007.name =T\u00FCrkiser Bronzetank +tile.FluidTank.9008.name =Hellgrauer Bronzetank +tile.FluidTank.9009.name =Grauer Bronzetank +tile.FluidTank.9010.name =Pinker Bronzetank +tile.FluidTank.9011.name =Hellgr\u00FCner Bronzetank +tile.FluidTank.9012.name =Gelber Bronzetank +tile.FluidTank.9013.name =Hellblauer Bronzetank +tile.FluidTank.9014.name =Magentafarbener Bronzetank +tile.FluidTank.9015.name =Oranger Bronzetank +tile.FluidTank.9016.name =Wei\u00DFer Bronzetank + +tile.FluidTank.10000.name =H\u00F6llentank +tile.FluidTank.10001.name =Schwarzer H\u00F6llentank +tile.FluidTank.10002.name =Roter H\u00F6llentank +tile.FluidTank.10003.name =Gr\u00FCner H\u00F6llentank +tile.FluidTank.10004.name =Brauner H\u00F6llentank +tile.FluidTank.10005.name =Blauer H\u00F6llentank +tile.FluidTank.10006.name =Violetter H\u00F6llentank +tile.FluidTank.10007.name =T\u00FCrkiser H\u00F6llentank +tile.FluidTank.10008.name =Hellgrauer H\u00F6llentank +tile.FluidTank.10009.name =Grauer H\u00F6llentank +tile.FluidTank.10010.name =Pinker H\u00F6llentank +tile.FluidTank.10011.name =Hellgr\u00FCner H\u00F6llentank +tile.FluidTank.10012.name =Gelber H\u00F6llentank +tile.FluidTank.10013.name =Hellblauer H\u00F6llentank +tile.FluidTank.10014.name =Magentafarbener H\u00F6llentank +tile.FluidTank.10015.name =Oranger H\u00F6llentank +tile.FluidTank.10016.name =Wei\u00DFer H\u00F6llentank + +tile.FluidDrain.name = Fl\u00FCssigkeitenabfluss + +tile.ConstructionPump.name = Konstruktionspumpe diff --git a/FM/resources/assets/fm/languages/en_US.properties b/FM/resources/assets/fm/languages/en_US.properties new file mode 100644 index 000000000..2a3bcaa6a --- /dev/null +++ b/FM/resources/assets/fm/languages/en_US.properties @@ -0,0 +1,412 @@ +# FluidMechanics Language Properties +# @author DarkGuardsman + +itemGroup.FluidMechanics=Fluid Mechanics + +# Blocks +tile.StarterPump.0.name=Pump +tile.ReleaseValve.0.name=Release Valve +tile.FluidSink.0.name = Sink +tile.FluidDrain.0.name = Fluid Drain +tile.ConstructionPump.0.name = Construction Pump + +# Fluid pipes +tile.FluidPipe.0.name =Wood Trough +tile.FluidPipe.1.name =Black Wood Trough +tile.FluidPipe.2.name =Red Wood Trough +tile.FluidPipe.3.name =Green Wood Trough +tile.FluidPipe.4.name =Brown Wood Trough +tile.FluidPipe.5.name =Blue Wood Trough +tile.FluidPipe.6.name =Purple Wood Trough +tile.FluidPipe.7.name =Cyan Wood Trough +tile.FluidPipe.8.name =Silver Wood Trough +tile.FluidPipe.9.name =Grey Wood Trough +tile.FluidPipe.10.name =Pink Wood Trough +tile.FluidPipe.11.name =Lime Wood Trough +tile.FluidPipe.12.name =Yellow Wood Trough +tile.FluidPipe.13.name =Light Blue Wood Trough +tile.FluidPipe.14.name =Magenta Wood Trough +tile.FluidPipe.15.name =Orange Wood Trough +tile.FluidPipe.16.name =White Wood Trough + +tile.FluidPipe.1000.name =Glass Tube +tile.FluidPipe.1001.name =Black Glass Tube +tile.FluidPipe.1002.name =Red Glass Tube +tile.FluidPipe.1003.name =Green Glass Tube +tile.FluidPipe.1004.name =Brown Glass Tube +tile.FluidPipe.1005.name =Blue Glass Tube +tile.FluidPipe.1006.name =Purple Glass Tube +tile.FluidPipe.1007.name =Cyan Glass Tube +tile.FluidPipe.1008.name =Silver Glass Tube +tile.FluidPipe.1009.name =Grey Glass Tube +tile.FluidPipe.1010.name =Pink Glass Tube +tile.FluidPipe.1011.name =Lime Glass Tube +tile.FluidPipe.1012.name =Yellow Glass Tube +tile.FluidPipe.1013.name =Light Blue Glass Tube +tile.FluidPipe.1014.name =Magenta Glass Tube +tile.FluidPipe.1015.name =Orange Glass Tube +tile.FluidPipe.1016.name =White Glass Tube + +tile.FluidPipe.2000.name =Stone Trough +tile.FluidPipe.2001.name =Black Stone Trough +tile.FluidPipe.2002.name =Red Stone Trough +tile.FluidPipe.2003.name =Green Stone Trough +tile.FluidPipe.2004.name =Brown Stone Trough +tile.FluidPipe.2005.name =Blue Stone Trough +tile.FluidPipe.2006.name =Purple Stone Trough +tile.FluidPipe.2007.name =Cyan Stone Trough +tile.FluidPipe.2008.name =Silver Stone Trough +tile.FluidPipe.2009.name =Grey Stone Trough +tile.FluidPipe.2010.name =Pink Stone Trough +tile.FluidPipe.2011.name =Lime Stone Trough +tile.FluidPipe.2012.name =Yellow Stone Trough +tile.FluidPipe.2013.name =Light Blue Stone Trough +tile.FluidPipe.2014.name =Magenta Stone Trough +tile.FluidPipe.2015.name =Orange Stone Trough +tile.FluidPipe.2016.name =White Stone Trough + +tile.FluidPipe.3000.name =Tin Pipe +tile.FluidPipe.3001.name =Black Tin Pipe +tile.FluidPipe.3002.name =Red Tin Pipe +tile.FluidPipe.3003.name =Green Tin Pipe +tile.FluidPipe.3004.name =Brown Tin Pipe +tile.FluidPipe.3005.name =Blue Tin Pipe +tile.FluidPipe.3006.name =Purple Tin Pipe +tile.FluidPipe.3007.name =Cyan Tin Pipe +tile.FluidPipe.3008.name =Silver Tin Pipe +tile.FluidPipe.3009.name =Grey Tin Pipe +tile.FluidPipe.3010.name =Pink Tin Pipe +tile.FluidPipe.3011.name =Lime Tin Pipe +tile.FluidPipe.3012.name =Yellow Tin Pipe +tile.FluidPipe.3013.name =Light Blue Tin Pipe +tile.FluidPipe.3014.name =Magenta Tin Pipe +tile.FluidPipe.3015.name =Orange Tin Pipe +tile.FluidPipe.3016.name =White Tin Pipe + +tile.FluidPipe.4000.name =Copper Pipe +tile.FluidPipe.4001.name =Black Copper Pipe +tile.FluidPipe.4002.name =Red Copper Pipe +tile.FluidPipe.4003.name =Green Copper Pipe +tile.FluidPipe.4004.name =Brown Copper Pipe +tile.FluidPipe.4005.name =Blue Copper Pipe +tile.FluidPipe.4006.name =Purple Copper Pipe +tile.FluidPipe.4007.name =Cyan Copper Pipe +tile.FluidPipe.4008.name =Silver Copper Pipe +tile.FluidPipe.4009.name =Grey Copper Pipe +tile.FluidPipe.4010.name =Pink Copper Pipe +tile.FluidPipe.4011.name =Lime Copper Pipe +tile.FluidPipe.4012.name =Yellow Copper Pipe +tile.FluidPipe.4013.name =Light Blue Copper Pipe +tile.FluidPipe.4014.name =Magenta Copper Pipe +tile.FluidPipe.4015.name =Orange Copper Pipe +tile.FluidPipe.4016.name =White Copper Pipe + +tile.FluidPipe.5000.name =Iron Pipe +tile.FluidPipe.5001.name =Black Iron Pipe +tile.FluidPipe.5002.name =Red Iron Pipe +tile.FluidPipe.5003.name =Green Iron Pipe +tile.FluidPipe.5004.name =Brown Iron Pipe +tile.FluidPipe.5005.name =Blue Iron Pipe +tile.FluidPipe.5006.name =Purple Iron Pipe +tile.FluidPipe.5007.name =Cyan Iron Pipe +tile.FluidPipe.5008.name =Silver Iron Pipe +tile.FluidPipe.5009.name =Grey Iron Pipe +tile.FluidPipe.5010.name =Pink Iron Pipe +tile.FluidPipe.5011.name =Lime Iron Pipe +tile.FluidPipe.5012.name =Yellow Iron Pipe +tile.FluidPipe.5013.name =Light Blue Iron Pipe +tile.FluidPipe.5014.name =Magenta Iron Pipe +tile.FluidPipe.5015.name =Orange Iron Pipe +tile.FluidPipe.5016.name =White Iron Pipe + +tile.FluidPipe.6000.name =Gold Pipe +tile.FluidPipe.6001.name =Black Gold Pipe +tile.FluidPipe.6002.name =Red Gold Pipe +tile.FluidPipe.6003.name =Green Gold Pipe +tile.FluidPipe.6004.name =Brown Gold Pipe +tile.FluidPipe.6005.name =Blue Gold Pipe +tile.FluidPipe.6006.name =Purple Gold Pipe +tile.FluidPipe.6007.name =Cyan Gold Pipe +tile.FluidPipe.6008.name =Silver Gold Pipe +tile.FluidPipe.6009.name =Grey Gold Pipe +tile.FluidPipe.6010.name =Pink Gold Pipe +tile.FluidPipe.6011.name =Lime Gold Pipe +tile.FluidPipe.6012.name =Yellow Gold Pipe +tile.FluidPipe.6013.name =Light Blue Gold Pipe +tile.FluidPipe.6014.name =Magenta Gold Pipe +tile.FluidPipe.6015.name =Orange Gold Pipe +tile.FluidPipe.6016.name =White Gold Pipe + +tile.FluidPipe.7000.name =Obby Pipe +tile.FluidPipe.7001.name =Black Obby Pipe +tile.FluidPipe.7002.name =Red Obby Pipe +tile.FluidPipe.7003.name =Green Obby Pipe +tile.FluidPipe.7004.name =Brown Obby Pipe +tile.FluidPipe.7005.name =Blue Obby Pipe +tile.FluidPipe.7006.name =Purple Obby Pipe +tile.FluidPipe.7007.name =Cyan Obby Pipe +tile.FluidPipe.7008.name =Silver Obby Pipe +tile.FluidPipe.7009.name =Grey Obby Pipe +tile.FluidPipe.7010.name =Pink Obby Pipe +tile.FluidPipe.7011.name =Lime Obby Pipe +tile.FluidPipe.7012.name =Yellow Obby Pipe +tile.FluidPipe.7013.name =Light Blue Obby Pipe +tile.FluidPipe.7014.name =Magenta Obby Pipe +tile.FluidPipe.7015.name =Orange Obby Pipe +tile.FluidPipe.7016.name =White Obby Pipe + +tile.FluidPipe.8000.name =Steel Pipe +tile.FluidPipe.8001.name =Black Steel Pipe +tile.FluidPipe.8002.name =Red Steel Pipe +tile.FluidPipe.8003.name =Green Steel Pipe +tile.FluidPipe.8004.name =Brown Steel Pipe +tile.FluidPipe.8005.name =Blue Steel Pipe +tile.FluidPipe.8006.name =Purple Steel Pipe +tile.FluidPipe.8007.name =Cyan Steel Pipe +tile.FluidPipe.8008.name =Silver Steel Pipe +tile.FluidPipe.8009.name =Grey Steel Pipe +tile.FluidPipe.8010.name =Pink Steel Pipe +tile.FluidPipe.8011.name =Lime Steel Pipe +tile.FluidPipe.8012.name =Yellow Steel Pipe +tile.FluidPipe.8013.name =Light Blue Steel Pipe +tile.FluidPipe.8014.name =Magenta Steel Pipe +tile.FluidPipe.8015.name =Orange Steel Pipe +tile.FluidPipe.8016.name =White Steel Pipe + +tile.FluidPipe.9000.name =Bronze Pipe +tile.FluidPipe.9001.name =Black Bronze Pipe +tile.FluidPipe.9002.name =Red Bronze Pipe +tile.FluidPipe.9003.name =Green Bronze Pipe +tile.FluidPipe.9004.name =Brown Bronze Pipe +tile.FluidPipe.9005.name =Blue Bronze Pipe +tile.FluidPipe.9006.name =Purple Bronze Pipe +tile.FluidPipe.9007.name =Cyan Bronze Pipe +tile.FluidPipe.9008.name =Silver Bronze Pipe +tile.FluidPipe.9009.name =Grey Bronze Pipe +tile.FluidPipe.9010.name =Pink Bronze Pipe +tile.FluidPipe.9011.name =Lime Bronze Pipe +tile.FluidPipe.9012.name =Yellow Bronze Pipe +tile.FluidPipe.9013.name =Light Blue Bronze Pipe +tile.FluidPipe.9014.name =Magenta Bronze Pipe +tile.FluidPipe.9015.name =Orange Bronze Pipe +tile.FluidPipe.9016.name =White Bronze Pipe + +tile.FluidPipe.10000.name =Hell Pipe +tile.FluidPipe.10001.name =Black Hell Pipe +tile.FluidPipe.10002.name =Red Hell Pipe +tile.FluidPipe.10003.name =Green Hell Pipe +tile.FluidPipe.10004.name =Brown Hell Pipe +tile.FluidPipe.10005.name =Blue Hell Pipe +tile.FluidPipe.10006.name =Purple Hell Pipe +tile.FluidPipe.10007.name =Cyan Hell Pipe +tile.FluidPipe.10008.name =Silver Hell Pipe +tile.FluidPipe.10009.name =Grey Hell Pipe +tile.FluidPipe.10010.name =Pink Hell Pipe +tile.FluidPipe.10011.name =Lime Hell Pipe +tile.FluidPipe.10012.name =Yellow Hell Pipe +tile.FluidPipe.10013.name =Light Blue Hell Pipe +tile.FluidPipe.10014.name =Magenta Hell Pipe +tile.FluidPipe.10015.name =Orange Hell Pipe +tile.FluidPipe.10016.name =White Hell Pipe + +tile.FluidTank.0.name =Wood Tank +tile.FluidTank.1.name =Black Wood Tank +tile.FluidTank.2.name =Red Wood Tank +tile.FluidTank.3.name =Green Wood Tank +tile.FluidTank.4.name =Brown Wood Tank +tile.FluidTank.5.name =Blue Wood Tank +tile.FluidTank.6.name =Purple Wood Tank +tile.FluidTank.7.name =Cyan Wood Tank +tile.FluidTank.8.name =Silver Wood Tank +tile.FluidTank.9.name =Grey Wood Tank +tile.FluidTank.10.name =Pink Wood Tank +tile.FluidTank.11.name =Lime Wood Tank +tile.FluidTank.12.name =Yellow Wood Tank +tile.FluidTank.13.name =Light Blue Wood Tank +tile.FluidTank.14.name =Magenta Wood Tank +tile.FluidTank.15.name =Orange Wood Tank +tile.FluidTank.16.name =White Wood Tank + +tile.FluidTank.1000.name =Glass Tank +tile.FluidTank.1001.name =Black Glass Tank +tile.FluidTank.1002.name =Red Glass Tank +tile.FluidTank.1003.name =Green Glass Tank +tile.FluidTank.1004.name =Brown Glass Tank +tile.FluidTank.1005.name =Blue Glass Tank +tile.FluidTank.1006.name =Purple Glass Tank +tile.FluidTank.1007.name =Cyan Glass Tank +tile.FluidTank.1008.name =Silver Glass Tank +tile.FluidTank.1009.name =Grey Glass Tank +tile.FluidTank.1010.name =Pink Glass Tank +tile.FluidTank.1011.name =Lime Glass Tank +tile.FluidTank.1012.name =Yellow Glass Tank +tile.FluidTank.1013.name =Light Blue Glass Tank +tile.FluidTank.1014.name =Magenta Glass Tank +tile.FluidTank.1015.name =Orange Glass Tank +tile.FluidTank.1016.name =White Glass Tank + +tile.FluidTank.2000.name =Stone Tank +tile.FluidTank.2001.name =Black Stone Tank +tile.FluidTank.2002.name =Red Stone Tank +tile.FluidTank.2003.name =Green Stone Tank +tile.FluidTank.2004.name =Brown Stone Tank +tile.FluidTank.2005.name =Blue Stone Tank +tile.FluidTank.2006.name =Purple Stone Tank +tile.FluidTank.2007.name =Cyan Stone Tank +tile.FluidTank.2008.name =Silver Stone Tank +tile.FluidTank.2009.name =Grey Stone Tank +tile.FluidTank.2010.name =Pink Stone Tank +tile.FluidTank.2011.name =Lime Stone Tank +tile.FluidTank.2012.name =Yellow Stone Tank +tile.FluidTank.2013.name =Light Blue Stone Tank +tile.FluidTank.2014.name =Magenta Stone Tank +tile.FluidTank.2015.name =Orange Stone Tank +tile.FluidTank.2016.name =White Stone Tank + +tile.FluidTank.3000.name =Tin Tank +tile.FluidTank.3001.name =Black Tin Tank +tile.FluidTank.3002.name =Red Tin Tank +tile.FluidTank.3003.name =Green Tin Tank +tile.FluidTank.3004.name =Brown Tin Tank +tile.FluidTank.3005.name =Blue Tin Tank +tile.FluidTank.3006.name =Purple Tin Tank +tile.FluidTank.3007.name =Cyan Tin Tank +tile.FluidTank.3008.name =Silver Tin Tank +tile.FluidTank.3009.name =Grey Tin Tank +tile.FluidTank.3010.name =Pink Tin Tank +tile.FluidTank.3011.name =Lime Tin Tank +tile.FluidTank.3012.name =Yellow Tin Tank +tile.FluidTank.3013.name =Light Blue Tin Tank +tile.FluidTank.3014.name =Magenta Tin Tank +tile.FluidTank.3015.name =Orange Tin Tank +tile.FluidTank.3016.name =White Tin Tank + +tile.FluidTank.4000.name =Copper Tank +tile.FluidTank.4001.name =Black Copper Tank +tile.FluidTank.4002.name =Red Copper Tank +tile.FluidTank.4003.name =Green Copper Tank +tile.FluidTank.4004.name =Brown Copper Tank +tile.FluidTank.4005.name =Blue Copper Tank +tile.FluidTank.4006.name =Purple Copper Tank +tile.FluidTank.4007.name =Cyan Copper Tank +tile.FluidTank.4008.name =Silver Copper Tank +tile.FluidTank.4009.name =Grey Copper Tank +tile.FluidTank.4010.name =Pink Copper Tank +tile.FluidTank.4011.name =Lime Copper Tank +tile.FluidTank.4012.name =Yellow Copper Tank +tile.FluidTank.4013.name =Light Blue Copper Tank +tile.FluidTank.4014.name =Magenta Copper Tank +tile.FluidTank.4015.name =Orange Copper Tank +tile.FluidTank.4016.name =White Copper Tank + +tile.FluidTank.5000.name =Iron Tank +tile.FluidTank.5001.name =Black Iron Tank +tile.FluidTank.5002.name =Red Iron Tank +tile.FluidTank.5003.name =Green Iron Tank +tile.FluidTank.5004.name =Brown Iron Tank +tile.FluidTank.5005.name =Blue Iron Tank +tile.FluidTank.5006.name =Purple Iron Tank +tile.FluidTank.5007.name =Cyan Iron Tank +tile.FluidTank.5008.name =Silver Iron Tank +tile.FluidTank.5009.name =Grey Iron Tank +tile.FluidTank.5010.name =Pink Iron Tank +tile.FluidTank.5011.name =Lime Iron Tank +tile.FluidTank.5012.name =Yellow Iron Tank +tile.FluidTank.5013.name =Light Blue Iron Tank +tile.FluidTank.5014.name =Magenta Iron Tank +tile.FluidTank.5015.name =Orange Iron Tank +tile.FluidTank.5016.name =White Iron Tank + +tile.FluidTank.6000.name =Gold Tank +tile.FluidTank.6001.name =Black Gold Tank +tile.FluidTank.6002.name =Red Gold Tank +tile.FluidTank.6003.name =Green Gold Tank +tile.FluidTank.6004.name =Brown Gold Tank +tile.FluidTank.6005.name =Blue Gold Tank +tile.FluidTank.6006.name =Purple Gold Tank +tile.FluidTank.6007.name =Cyan Gold Tank +tile.FluidTank.6008.name =Silver Gold Tank +tile.FluidTank.6009.name =Grey Gold Tank +tile.FluidTank.6010.name =Pink Gold Tank +tile.FluidTank.6011.name =Lime Gold Tank +tile.FluidTank.6012.name =Yellow Gold Tank +tile.FluidTank.6013.name =Light Blue Gold Tank +tile.FluidTank.6014.name =Magenta Gold Tank +tile.FluidTank.6015.name =Orange Gold Tank +tile.FluidTank.6016.name =White Gold Tank + +tile.FluidTank.7000.name =Obby Tank +tile.FluidTank.7001.name =Black Obby Tank +tile.FluidTank.7002.name =Red Obby Tank +tile.FluidTank.7003.name =Green Obby Tank +tile.FluidTank.7004.name =Brown Obby Tank +tile.FluidTank.7005.name =Blue Obby Tank +tile.FluidTank.7006.name =Purple Obby Tank +tile.FluidTank.7007.name =Cyan Obby Tank +tile.FluidTank.7008.name =Silver Obby Tank +tile.FluidTank.7009.name =Grey Obby Tank +tile.FluidTank.7010.name =Pink Obby Tank +tile.FluidTank.7011.name =Lime Obby Tank +tile.FluidTank.7012.name =Yellow Obby Tank +tile.FluidTank.7013.name =Light Blue Obby Tank +tile.FluidTank.7014.name =Magenta Obby Tank +tile.FluidTank.7015.name =Orange Obby Tank +tile.FluidTank.7016.name =White Obby Tank + +tile.FluidTank.8000.name =Steel Tank +tile.FluidTank.8001.name =Black Steel Tank +tile.FluidTank.8002.name =Red Steel Tank +tile.FluidTank.8003.name =Green Steel Tank +tile.FluidTank.8004.name =Brown Steel Tank +tile.FluidTank.8005.name =Blue Steel Tank +tile.FluidTank.8006.name =Purple Steel Tank +tile.FluidTank.8007.name =Cyan Steel Tank +tile.FluidTank.8008.name =Silver Steel Tank +tile.FluidTank.8009.name =Grey Steel Tank +tile.FluidTank.8010.name =Pink Steel Tank +tile.FluidTank.8011.name =Lime Steel Tank +tile.FluidTank.8012.name =Yellow Steel Tank +tile.FluidTank.8013.name =Light Blue Steel Tank +tile.FluidTank.8014.name =Magenta Steel Tank +tile.FluidTank.8015.name =Orange Steel Tank +tile.FluidTank.8016.name =White Steel Tank + +tile.FluidTank.9000.name =Bronze Tank +tile.FluidTank.9001.name =Black Bronze Tank +tile.FluidTank.9002.name =Red Bronze Tank +tile.FluidTank.9003.name =Green Bronze Tank +tile.FluidTank.9004.name =Brown Bronze Tank +tile.FluidTank.9005.name =Blue Bronze Tank +tile.FluidTank.9006.name =Purple Bronze Tank +tile.FluidTank.9007.name =Cyan Bronze Tank +tile.FluidTank.9008.name =Silver Bronze Tank +tile.FluidTank.9009.name =Grey Bronze Tank +tile.FluidTank.9010.name =Pink Bronze Tank +tile.FluidTank.9011.name =Lime Bronze Tank +tile.FluidTank.9012.name =Yellow Bronze Tank +tile.FluidTank.9013.name =Light Blue Bronze Tank +tile.FluidTank.9014.name =Magenta Bronze Tank +tile.FluidTank.9015.name =Orange Bronze Tank +tile.FluidTank.9016.name =White Bronze Tank + +tile.FluidTank.10000.name =Hell Tank +tile.FluidTank.10001.name =Black Hell Tank +tile.FluidTank.10002.name =Red Hell Tank +tile.FluidTank.10003.name =Green Hell Tank +tile.FluidTank.10004.name =Brown Hell Tank +tile.FluidTank.10005.name =Blue Hell Tank +tile.FluidTank.10006.name =Purple Hell Tank +tile.FluidTank.10007.name =Cyan Hell Tank +tile.FluidTank.10008.name =Silver Hell Tank +tile.FluidTank.10009.name =Grey Hell Tank +tile.FluidTank.10010.name =Pink Hell Tank +tile.FluidTank.10011.name =Lime Hell Tank +tile.FluidTank.10012.name =Yellow Hell Tank +tile.FluidTank.10013.name =Light Blue Hell Tank +tile.FluidTank.10014.name =Magenta Hell Tank +tile.FluidTank.10015.name =Orange Hell Tank +tile.FluidTank.10016.name =White Hell Tank + +tile.FluidDrain.name = Liquid Drain + +tile.ConstructionPump.name = Construction Pump diff --git a/FM/resources/assets/fm/languages/zh_CN.properties b/FM/resources/assets/fm/languages/zh_CN.properties new file mode 100644 index 000000000..e3c131a83 --- /dev/null +++ b/FM/resources/assets/fm/languages/zh_CN.properties @@ -0,0 +1,233 @@ +# FluidMechanics Language Properties +# @author crafteverywhere + +itemGroup.FluidMechanics=\u6d41\u4f53\u673a\u68b0 + +# Blocks +tile.MechanicalGenerator.name=\u53d1\u7535\u673a +tile.lmMachines.0.name=\u6cf5 +tile.MechanicalRod.name=\u9f7f\u8f6e\u8f74 +tile.ReleaseValve.0.name=\u91ca\u653e\u9600\u95e8 +tile.FluidTank.name=\u50a8\u6db2\u7f50 +tile.FluidSink.name=\u6c34\u69fd + +# Fluid pipes now have more than 32 sub types, currently there are only 160 sub types of pipe +tile.FluidPipe.0.name=\u6728\u69fd +tile.FluidPipe.1.name=\u9ed1\u8272\u6728\u69fd +tile.FluidPipe.2.name=\u7ea2\u8272\u6728\u69fd +tile.FluidPipe.3.name=\u7eff\u8272\u6728\u69fd +tile.FluidPipe.4.name=\u68d5\u8272\u6728\u69fd +tile.FluidPipe.5.name=\u84dd\u8272\u6728\u69fd +tile.FluidPipe.6.name=\u7d2b\u8272\u6728\u69fd +tile.FluidPipe.7.name=\u9752\u8272\u6728\u69fd +tile.FluidPipe.8.name=\u94f6\u8272\u6728\u69fd +tile.FluidPipe.9.name=\u7070\u8272\u6728\u69fd +tile.FluidPipe.10.name=\u7c89\u8272\u6728\u69fd +tile.FluidPipe.11.name=\u67e0\u6aac\u8272\u6728\u69fd +tile.FluidPipe.12.name=\u9ec4\u8272\u6728\u69fd +tile.FluidPipe.13.name=\u6d45\u84dd\u8272\u6728\u69fd +tile.FluidPipe.14.name=\u54c1\u7ea2\u8272\u6728\u69fd +tile.FluidPipe.15.name=\u6a59\u8272\u6728\u69fd +tile.FluidPipe.16.name=\u767d\u8272\u6728\u69fd + +tile.FluidPipe.1000.name=\u73bb\u7483\u7ba1\u9053 +tile.FluidPipe.1001.name=\u9ed1\u8272\u73bb\u7483\u7ba1\u9053 +tile.FluidPipe.1002.name=\u7ea2\u8272\u73bb\u7483\u7ba1\u9053 +tile.FluidPipe.1003.name=\u7eff\u8272\u73bb\u7483\u7ba1\u9053 +tile.FluidPipe.1004.name=\u68d5\u8272\u73bb\u7483\u7ba1\u9053 +tile.FluidPipe.1005.name=\u84dd\u8272\u73bb\u7483\u7ba1\u9053 +tile.FluidPipe.1006.name=\u7d2b\u8272\u73bb\u7483\u7ba1\u9053 +tile.FluidPipe.1007.name=\u9752\u8272\u73bb\u7483\u7ba1\u9053 +tile.FluidPipe.1008.name=\u94f6\u8272\u73bb\u7483\u7ba1\u9053 +tile.FluidPipe.1009.name=\u7070\u8272\u73bb\u7483\u7ba1\u9053 +tile.FluidPipe.1010.name=\u7c89\u8272\u73bb\u7483\u7ba1\u9053 +tile.FluidPipe.1011.name=\u67e0\u6aac\u8272\u73bb\u7483\u7ba1\u9053 +tile.FluidPipe.1012.name=\u9ec4\u8272\u73bb\u7483\u7ba1\u9053 +tile.FluidPipe.1013.name=\u6d45\u84dd\u8272\u73bb\u7483\u7ba1\u9053 +tile.FluidPipe.1014.name=\u54c1\u7ea2\u8272\u73bb\u7483\u7ba1\u9053 +tile.FluidPipe.1015.name=\u6a59\u8272\u73bb\u7483\u7ba1\u9053 +tile.FluidPipe.1016.name=\u767d\u8272\u73bb\u7483\u7ba1\u9053 + +tile.FluidPipe.2000.name=\u77f3\u5934\u69fd +tile.FluidPipe.2001.name=\u9ed1\u8272\u77f3\u5934\u69fd +tile.FluidPipe.2002.name=\u7ea2\u8272\u77f3\u5934\u69fd +tile.FluidPipe.2003.name=\u7eff\u8272\u77f3\u5934\u69fd +tile.FluidPipe.2004.name=\u68d5\u8272\u77f3\u5934\u69fd +tile.FluidPipe.2005.name=\u84dd\u8272\u77f3\u5934\u69fd +tile.FluidPipe.2006.name=\u7d2b\u8272\u77f3\u5934\u69fd +tile.FluidPipe.2007.name=\u9752\u8272\u77f3\u5934\u69fd +tile.FluidPipe.2008.name=\u94f6\u8272\u77f3\u5934\u69fd +tile.FluidPipe.2009.name=\u7070\u8272\u77f3\u5934\u69fd +tile.FluidPipe.2010.name=\u7c89\u8272\u77f3\u5934\u69fd +tile.FluidPipe.2011.name=\u67e0\u6aac\u8272\u77f3\u5934\u69fd +tile.FluidPipe.2012.name=\u9ec4\u8272\u77f3\u5934\u69fd +tile.FluidPipe.2013.name=\u6d45\u84dd\u8272\u77f3\u5934\u69fd +tile.FluidPipe.2014.name=\u54c1\u7ea2\u8272\u77f3\u5934\u69fd +tile.FluidPipe.2015.name=\u6a59\u8272\u77f3\u5934\u69fd +tile.FluidPipe.2016.name=\u767d\u8272\u77f3\u5934\u69fd + +tile.FluidPipe.3000.name=\u9521\u7ba1 +tile.FluidPipe.3001.name=\u9ed1\u8272\u9521\u7ba1 +tile.FluidPipe.3002.name=\u7ea2\u8272\u9521\u7ba1 +tile.FluidPipe.3003.name=\u7eff\u8272\u9521\u7ba1 +tile.FluidPipe.3004.name=\u68d5\u8272\u9521\u7ba1 +tile.FluidPipe.3005.name=\u84dd\u8272\u9521\u7ba1 +tile.FluidPipe.3006.name=\u7d2b\u8272\u9521\u7ba1 +tile.FluidPipe.3007.name=\u9752\u8272\u9521\u7ba1 +tile.FluidPipe.3008.name=\u94f6\u8272\u9521\u7ba1 +tile.FluidPipe.3009.name=\u7070\u8272\u9521\u7ba1 +tile.FluidPipe.3010.name=\u7c89\u8272\u9521\u7ba1 +tile.FluidPipe.3011.name=\u67e0\u6aac\u8272\u9521\u7ba1 +tile.FluidPipe.3012.name=\u9ec4\u8272\u9521\u7ba1 +tile.FluidPipe.3013.name=\u6d45\u84dd\u8272\u9521\u7ba1 +tile.FluidPipe.3014.name=\u54c1\u7ea2\u8272\u9521\u7ba1 +tile.FluidPipe.3015.name=\u6a59\u8272\u9521\u7ba1 +tile.FluidPipe.3016.name=\u767d\u8272\u9521\u7ba1 + +tile.FluidPipe.4000.name=\u94dc\u7ba1 +tile.FluidPipe.4001.name=\u9ed1\u8272\u94dc\u7ba1 +tile.FluidPipe.4002.name=\u7ea2\u8272\u94dc\u7ba1 +tile.FluidPipe.4003.name=\u7eff\u8272\u94dc\u7ba1 +tile.FluidPipe.4004.name=\u68d5\u8272\u94dc\u7ba1 +tile.FluidPipe.4005.name=\u84dd\u8272\u94dc\u7ba1 +tile.FluidPipe.4006.name=\u7d2b\u8272\u94dc\u7ba1 +tile.FluidPipe.4007.name=\u9752\u8272\u94dc\u7ba1 +tile.FluidPipe.4008.name=\u94f6\u8272\u94dc\u7ba1 +tile.FluidPipe.4009.name=\u7070\u8272\u94dc\u7ba1 +tile.FluidPipe.4010.name=\u7c89\u8272\u94dc\u7ba1 +tile.FluidPipe.4011.name=\u67e0\u6aac\u8272\u94dc\u7ba1 +tile.FluidPipe.4012.name=\u9ec4\u8272\u94dc\u7ba1 +tile.FluidPipe.4013.name=\u6d45\u84dd\u8272\u94dc\u7ba1 +tile.FluidPipe.4014.name=\u54c1\u7ea2\u8272\u94dc\u7ba1 +tile.FluidPipe.4015.name=\u6a59\u8272\u94dc\u7ba1 +tile.FluidPipe.4016.name=\u767d\u8272\u94dc\u7ba1 + +tile.FluidPipe.5000.name=\u94c1\u7ba1 +tile.FluidPipe.5001.name=\u9ed1\u8272\u94c1\u7ba1 +tile.FluidPipe.5002.name=\u7ea2\u8272\u94c1\u7ba1 +tile.FluidPipe.5003.name=\u7eff\u8272\u94c1\u7ba1 +tile.FluidPipe.5004.name=\u68d5\u8272\u94c1\u7ba1 +tile.FluidPipe.5005.name=\u84dd\u8272\u94c1\u7ba1 +tile.FluidPipe.5006.name=\u7d2b\u8272\u94c1\u7ba1 +tile.FluidPipe.5007.name=\u9752\u8272\u94c1\u7ba1 +tile.FluidPipe.5008.name=\u94f6\u8272\u94c1\u7ba1 +tile.FluidPipe.5009.name=\u7070\u8272\u94c1\u7ba1 +tile.FluidPipe.5010.name=\u7c89\u8272\u94c1\u7ba1 +tile.FluidPipe.5011.name=\u67e0\u6aac\u8272\u94c1\u7ba1 +tile.FluidPipe.5012.name=\u9ec4\u8272\u94c1\u7ba1 +tile.FluidPipe.5013.name=\u6d45\u84dd\u8272\u94c1\u7ba1 +tile.FluidPipe.5014.name=\u54c1\u7ea2\u8272\u94c1\u7ba1 +tile.FluidPipe.5015.name=\u6a59\u8272\u94c1\u7ba1 +tile.FluidPipe.5016.name=\u767d\u8272\u94c1\u7ba1 + +tile.FluidPipe.6000.name=\u91d1\u7ba1 +tile.FluidPipe.6001.name=\u9ed1\u8272\u91d1\u7ba1 +tile.FluidPipe.6002.name=\u7ea2\u8272\u91d1\u7ba1 +tile.FluidPipe.6003.name=\u7eff\u8272\u91d1\u7ba1 +tile.FluidPipe.6004.name=\u68d5\u8272\u91d1\u7ba1 +tile.FluidPipe.6005.name=\u84dd\u8272\u91d1\u7ba1 +tile.FluidPipe.6006.name=\u7d2b\u8272\u91d1\u7ba1 +tile.FluidPipe.6007.name=\u9752\u8272\u91d1\u7ba1 +tile.FluidPipe.6008.name=\u94f6\u8272\u91d1\u7ba1 +tile.FluidPipe.6009.name=\u7070\u8272\u91d1\u7ba1 +tile.FluidPipe.6010.name=\u7c89\u8272\u91d1\u7ba1 +tile.FluidPipe.6011.name=\u67e0\u6aac\u8272\u91d1\u7ba1 +tile.FluidPipe.6012.name=\u9ec4\u8272\u91d1\u7ba1 +tile.FluidPipe.6013.name=\u6d45\u84dd\u8272\u91d1\u7ba1 +tile.FluidPipe.6014.name=\u54c1\u7ea2\u8272\u91d1\u7ba1 +tile.FluidPipe.6015.name=\u6a59\u8272\u91d1\u7ba1 +tile.FluidPipe.6016.name=\u767d\u8272\u91d1\u7ba1 + +tile.FluidPipe.7000.name=\u5b9d\u77f3\u7ba1 +tile.FluidPipe.7001.name=\u9ed1\u8272\u5b9d\u77f3\u7ba1 +tile.FluidPipe.7002.name=\u7ea2\u8272\u5b9d\u77f3\u7ba1 +tile.FluidPipe.7003.name=\u7eff\u8272\u5b9d\u77f3\u7ba1 +tile.FluidPipe.7004.name=\u68d5\u8272\u5b9d\u77f3\u7ba1 +tile.FluidPipe.7005.name=\u84dd\u8272\u5b9d\u77f3\u7ba1 +tile.FluidPipe.7006.name=\u7d2b\u8272\u5b9d\u77f3\u7ba1 +tile.FluidPipe.7007.name=\u9752\u8272\u5b9d\u77f3\u7ba1 +tile.FluidPipe.7008.name=\u94f6\u8272\u5b9d\u77f3\u7ba1 +tile.FluidPipe.7009.name=\u7070\u8272\u5b9d\u77f3\u7ba1 +tile.FluidPipe.7010.name=\u7c89\u8272\u5b9d\u77f3\u7ba1 +tile.FluidPipe.7011.name=\u67e0\u6aac\u8272\u5b9d\u77f3\u7ba1 +tile.FluidPipe.7012.name=\u9ec4\u8272\u5b9d\u77f3\u7ba1 +tile.FluidPipe.7013.name=\u6d45\u84dd\u8272\u5b9d\u77f3\u7ba1 +tile.FluidPipe.7014.name=\u54c1\u7ea2\u8272\u5b9d\u77f3\u7ba1 +tile.FluidPipe.7015.name=\u6a59\u8272\u5b9d\u77f3\u7ba1 +tile.FluidPipe.7016.name=\u767d\u8272\u5b9d\u77f3\u7ba1 + +tile.FluidPipe.8000.name=\u94a2\u7ba1 +tile.FluidPipe.8001.name=\u9ed1\u8272\u94a2\u7ba1 +tile.FluidPipe.8002.name=\u7ea2\u8272\u94a2\u7ba1 +tile.FluidPipe.8003.name=\u7eff\u8272\u94a2\u7ba1 +tile.FluidPipe.8004.name=\u68d5\u8272\u94a2\u7ba1 +tile.FluidPipe.8005.name=\u84dd\u8272\u94a2\u7ba1 +tile.FluidPipe.8006.name=\u7d2b\u8272\u94a2\u7ba1 +tile.FluidPipe.8007.name=\u9752\u8272\u94a2\u7ba1 +tile.FluidPipe.8008.name=\u94f6\u8272\u94a2\u7ba1 +tile.FluidPipe.8009.name=\u7070\u8272\u94a2\u7ba1 +tile.FluidPipe.8010.name=\u7c89\u8272\u94a2\u7ba1 +tile.FluidPipe.8011.name=\u67e0\u6aac\u8272\u94a2\u7ba1 +tile.FluidPipe.8012.name=\u9ec4\u8272\u94a2\u7ba1 +tile.FluidPipe.8013.name=\u6d45\u84dd\u8272\u94a2\u7ba1 +tile.FluidPipe.8014.name=\u54c1\u7ea2\u8272\u94a2\u7ba1 +tile.FluidPipe.8015.name=\u6a59\u8272\u94a2\u7ba1 +tile.FluidPipe.8016.name=\u767d\u8272\u94a2\u7ba1 + +tile.FluidPipe.9000.name=\u9752\u94dc\u7ba1 +tile.FluidPipe.9001.name=\u9ed1\u8272\u9752\u94dc\u7ba1 +tile.FluidPipe.9002.name=\u7ea2\u8272\u9752\u94dc\u7ba1 +tile.FluidPipe.9003.name=\u7eff\u8272\u9752\u94dc\u7ba1 +tile.FluidPipe.9004.name=\u68d5\u8272\u9752\u94dc\u7ba1 +tile.FluidPipe.9005.name=\u84dd\u8272\u9752\u94dc\u7ba1 +tile.FluidPipe.9006.name=\u7d2b\u8272\u9752\u94dc\u7ba1 +tile.FluidPipe.9007.name=\u9752\u8272\u9752\u94dc\u7ba1 +tile.FluidPipe.9008.name=\u94f6\u8272\u9752\u94dc\u7ba1 +tile.FluidPipe.9009.name=\u7070\u8272\u9752\u94dc\u7ba1 +tile.FluidPipe.9010.name=\u7c89\u8272\u9752\u94dc\u7ba1 +tile.FluidPipe.9011.name=\u67e0\u6aac\u8272\u9752\u94dc\u7ba1 +tile.FluidPipe.9012.name=\u9ec4\u8272\u9752\u94dc\u7ba1 +tile.FluidPipe.9013.name=\u6d45\u84dd\u8272\u9752\u94dc\u7ba1 +tile.FluidPipe.9014.name=\u54c1\u7ea2\u8272\u9752\u94dc\u7ba1 +tile.FluidPipe.9015.name=\u6a59\u8272\u9752\u94dc\u7ba1 +tile.FluidPipe.9016.name=\u767d\u8272\u9752\u94dc\u7ba1 + +tile.FluidPipe.10000.name=\u5730\u72f1\u7ba1 +tile.FluidPipe.10001.name=\u9ed1\u8272\u5730\u72f1\u7ba1 +tile.FluidPipe.10002.name=\u7ea2\u8272\u5730\u72f1\u7ba1 +tile.FluidPipe.10003.name=\u7eff\u8272\u5730\u72f1\u7ba1 +tile.FluidPipe.10004.name=\u68d5\u8272\u5730\u72f1\u7ba1 +tile.FluidPipe.10005.name=\u84dd\u8272\u5730\u72f1\u7ba1 +tile.FluidPipe.10006.name=\u7d2b\u8272\u5730\u72f1\u7ba1 +tile.FluidPipe.10007.name=\u9752\u8272\u5730\u72f1\u7ba1 +tile.FluidPipe.10008.name=\u94f6\u8272\u5730\u72f1\u7ba1 +tile.FluidPipe.10009.name=\u7070\u8272\u5730\u72f1\u7ba1 +tile.FluidPipe.10010.name=\u7c89\u8272\u5730\u72f1\u7ba1 +tile.FluidPipe.10011.name=\u67e0\u6aac\u8272\u5730\u72f1\u7ba1 +tile.FluidPipe.10012.name=\u9ec4\u8272\u5730\u72f1\u7ba1 +tile.FluidPipe.10013.name=\u6d45\u84dd\u8272\u5730\u72f1\u7ba1 +tile.FluidPipe.10014.name=\u54c1\u7ea2\u8272\u5730\u72f1\u7ba1 +tile.FluidPipe.10015.name=\u6a59\u8272\u5730\u72f1\u7ba1 +tile.FluidPipe.10016.name=\u767d\u8272\u5730\u72f1\u7ba1 + + +tile.FluidTank.0.name=\u77f3\u6cb9\u50a8\u6db2\u7f50 +tile.FluidTank.1.name=\u5ca9\u6d46\u50a8\u6db2\u7f50 +tile.FluidTank.2.name=\u7eff\u8272\u50a8\u6db2\u7f50 +tile.FluidTank.3.name=\u5e9f\u6c34\u50a8\u6db2\u7f50 +tile.FluidTank.4.name=\u84c4\u6c34\u7f50 +tile.FluidTank.5.name=\u7d2b\u8272\u50a8\u6db2\u7f50 +tile.FluidTank.6.name=\u9752\u8272\u50a8\u6db2\u7f50 +tile.FluidTank.7.name=\u94f6\u8272\u50a8\u6db2\u7f50 +tile.FluidTank.8.name=\u7070\u8272\u50a8\u6db2\u7f50 +tile.FluidTank.9.name=\u7c89\u8272\u50a8\u6db2\u7f50 +tile.FluidTank.10.name=\u67e0\u6aac\u8272\u50a8\u6db2\u7f50 +tile.FluidTank.11.name=\u71c3\u6cb9\u50a8\u6db2\u7f50 +tile.FluidTank.12.name=\u6d45\u84dd\u8272\u50a8\u6db2\u7f50 +tile.FluidTank.13.name=\u725b\u5976\u7f50 +tile.FluidTank.14.name=\u84b8\u6c7d\u7f50 +tile.FluidTank.15.name=\u901a\u7528\u7f50 + +tile.FluidDrain.name=\u901a\u6db2\u6e20 + +tile.ConstructionPump.name=\u6784\u9020\u6cf5 diff --git a/FM/resources/assets/fm/textures/blocks/drain.png b/FM/resources/assets/fm/textures/blocks/drain.png new file mode 100644 index 000000000..0ed90458e Binary files /dev/null and b/FM/resources/assets/fm/textures/blocks/drain.png differ diff --git a/FM/resources/assets/fm/textures/blocks/drain2.png b/FM/resources/assets/fm/textures/blocks/drain2.png new file mode 100644 index 000000000..6efeabe3b Binary files /dev/null and b/FM/resources/assets/fm/textures/blocks/drain2.png differ diff --git a/FM/resources/assets/fm/textures/blocks/inputMachineSide.png b/FM/resources/assets/fm/textures/blocks/inputMachineSide.png new file mode 100644 index 000000000..7db5b4658 Binary files /dev/null and b/FM/resources/assets/fm/textures/blocks/inputMachineSide.png differ diff --git a/FM/resources/assets/fm/textures/blocks/ironMachineSide.png b/FM/resources/assets/fm/textures/blocks/ironMachineSide.png new file mode 100644 index 000000000..bf34da026 Binary files /dev/null and b/FM/resources/assets/fm/textures/blocks/ironMachineSide.png differ diff --git a/FM/resources/assets/fm/textures/blocks/iron_block.png b/FM/resources/assets/fm/textures/blocks/iron_block.png new file mode 100644 index 000000000..7816799ef Binary files /dev/null and b/FM/resources/assets/fm/textures/blocks/iron_block.png differ diff --git a/FM/resources/assets/fm/textures/blocks/obsidian.png b/FM/resources/assets/fm/textures/blocks/obsidian.png new file mode 100644 index 000000000..ff0a68363 Binary files /dev/null and b/FM/resources/assets/fm/textures/blocks/obsidian.png differ diff --git a/FM/resources/assets/fm/textures/blocks/outputMachineSide.png b/FM/resources/assets/fm/textures/blocks/outputMachineSide.png new file mode 100644 index 000000000..0075b012c Binary files /dev/null and b/FM/resources/assets/fm/textures/blocks/outputMachineSide.png differ diff --git a/FM/resources/assets/fm/textures/guis/SteamGUI.png b/FM/resources/assets/fm/textures/guis/SteamGUI.png new file mode 100644 index 000000000..c68427369 Binary files /dev/null and b/FM/resources/assets/fm/textures/guis/SteamGUI.png differ diff --git a/FM/resources/assets/fm/textures/items/GuardKit.png b/FM/resources/assets/fm/textures/items/GuardKit.png new file mode 100644 index 000000000..386080081 Binary files /dev/null and b/FM/resources/assets/fm/textures/items/GuardKit.png differ diff --git a/FM/resources/assets/fm/textures/items/items.png b/FM/resources/assets/fm/textures/items/items.png new file mode 100644 index 000000000..3a5c5cafe Binary files /dev/null and b/FM/resources/assets/fm/textures/items/items.png differ diff --git a/FM/resources/assets/fm/textures/models/ConstructionPump.png b/FM/resources/assets/fm/textures/models/ConstructionPump.png new file mode 100644 index 000000000..1e47b8230 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/ConstructionPump.png differ diff --git a/FM/resources/assets/fm/textures/models/CornerTank.png b/FM/resources/assets/fm/textures/models/CornerTank.png new file mode 100644 index 000000000..43e1ddefa Binary files /dev/null and b/FM/resources/assets/fm/textures/models/CornerTank.png differ diff --git a/FM/resources/assets/fm/textures/models/Furnace.png b/FM/resources/assets/fm/textures/models/Furnace.png new file mode 100644 index 000000000..a3eca6753 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/Furnace.png differ diff --git a/FM/resources/assets/fm/textures/models/GearShaftPiston.png b/FM/resources/assets/fm/textures/models/GearShaftPiston.png new file mode 100644 index 000000000..fa16d1d6b Binary files /dev/null and b/FM/resources/assets/fm/textures/models/GearShaftPiston.png differ diff --git a/FM/resources/assets/fm/textures/models/ReleaseValve.png b/FM/resources/assets/fm/textures/models/ReleaseValve.png new file mode 100644 index 000000000..532f83233 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/ReleaseValve.png differ diff --git a/FM/resources/assets/fm/textures/models/Sink.png b/FM/resources/assets/fm/textures/models/Sink.png new file mode 100644 index 000000000..0d973dfdb Binary files /dev/null and b/FM/resources/assets/fm/textures/models/Sink.png differ diff --git a/FM/resources/assets/fm/textures/models/TankSide.png b/FM/resources/assets/fm/textures/models/TankSide.png new file mode 100644 index 000000000..24c78389b Binary files /dev/null and b/FM/resources/assets/fm/textures/models/TankSide.png differ diff --git a/FM/resources/assets/fm/textures/models/gear_shaft_piston.png b/FM/resources/assets/fm/textures/models/gear_shaft_piston.png new file mode 100644 index 000000000..fa16d1d6b Binary files /dev/null and b/FM/resources/assets/fm/textures/models/gear_shaft_piston.png differ diff --git a/FM/resources/assets/fm/textures/models/mechanical/GearRod.png b/FM/resources/assets/fm/textures/models/mechanical/GearRod.png new file mode 100644 index 000000000..11f4720d6 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/mechanical/GearRod.png differ diff --git a/FM/resources/assets/fm/textures/models/mechanical/Generator.png b/FM/resources/assets/fm/textures/models/mechanical/Generator.png new file mode 100644 index 000000000..32a3ae904 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/mechanical/Generator.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/BlackPipe.png b/FM/resources/assets/fm/textures/models/pipes/BlackPipe.png new file mode 100644 index 000000000..9bf026505 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/BlackPipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/BluePipe.png b/FM/resources/assets/fm/textures/models/pipes/BluePipe.png new file mode 100644 index 000000000..097f6ae5a Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/BluePipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/BrownPipe.png b/FM/resources/assets/fm/textures/models/pipes/BrownPipe.png new file mode 100644 index 000000000..31f496f5a Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/BrownPipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/CyanPipe.png b/FM/resources/assets/fm/textures/models/pipes/CyanPipe.png new file mode 100644 index 000000000..18e21f9fa Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/CyanPipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/GreenPipe.png b/FM/resources/assets/fm/textures/models/pipes/GreenPipe.png new file mode 100644 index 000000000..9b296cff2 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/GreenPipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/GreyPipe.png b/FM/resources/assets/fm/textures/models/pipes/GreyPipe.png new file mode 100644 index 000000000..7f8646d04 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/GreyPipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/LavaPipe.png b/FM/resources/assets/fm/textures/models/pipes/LavaPipe.png new file mode 100644 index 000000000..85fc2dc80 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/LavaPipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/LightBluePipe.png b/FM/resources/assets/fm/textures/models/pipes/LightBluePipe.png new file mode 100644 index 000000000..7df991646 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/LightBluePipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/LimePipe.png b/FM/resources/assets/fm/textures/models/pipes/LimePipe.png new file mode 100644 index 000000000..e37acbabe Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/LimePipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/MagentaPipe.png b/FM/resources/assets/fm/textures/models/pipes/MagentaPipe.png new file mode 100644 index 000000000..6cb4bce94 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/MagentaPipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/OrangePipe.png b/FM/resources/assets/fm/textures/models/pipes/OrangePipe.png new file mode 100644 index 000000000..61f9128f5 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/OrangePipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/PinkPipe.png b/FM/resources/assets/fm/textures/models/pipes/PinkPipe.png new file mode 100644 index 000000000..3f790e22d Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/PinkPipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/Pipe.png b/FM/resources/assets/fm/textures/models/pipes/Pipe.png new file mode 100644 index 000000000..e690a5000 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/Pipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/PurplePipe.png b/FM/resources/assets/fm/textures/models/pipes/PurplePipe.png new file mode 100644 index 000000000..c3db55b54 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/PurplePipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/RedPipe.png b/FM/resources/assets/fm/textures/models/pipes/RedPipe.png new file mode 100644 index 000000000..2f7aacd8e Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/RedPipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/SilverPipe.png b/FM/resources/assets/fm/textures/models/pipes/SilverPipe.png new file mode 100644 index 000000000..d41d91579 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/SilverPipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/WhitePipe.png b/FM/resources/assets/fm/textures/models/pipes/WhitePipe.png new file mode 100644 index 000000000..9576758d6 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/WhitePipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/YellowPipe.png b/FM/resources/assets/fm/textures/models/pipes/YellowPipe.png new file mode 100644 index 000000000..288785bbf Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/YellowPipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/bronze/Pipe.png b/FM/resources/assets/fm/textures/models/pipes/bronze/Pipe.png new file mode 100644 index 000000000..b10e7382d Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/bronze/Pipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/copper/Pipe.png b/FM/resources/assets/fm/textures/models/pipes/copper/Pipe.png new file mode 100644 index 000000000..6bd0cac59 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/copper/Pipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/glass/Pipe.png b/FM/resources/assets/fm/textures/models/pipes/glass/Pipe.png new file mode 100644 index 000000000..f156e14ed Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/glass/Pipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/gold/Pipe.png b/FM/resources/assets/fm/textures/models/pipes/gold/Pipe.png new file mode 100644 index 000000000..b6461dbf8 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/gold/Pipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/hell/Pipe.png b/FM/resources/assets/fm/textures/models/pipes/hell/Pipe.png new file mode 100644 index 000000000..9feeb8d92 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/hell/Pipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/iron/Pipe.png b/FM/resources/assets/fm/textures/models/pipes/iron/Pipe.png new file mode 100644 index 000000000..a408ad4c0 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/iron/Pipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/obby/Pipe.png b/FM/resources/assets/fm/textures/models/pipes/obby/Pipe.png new file mode 100644 index 000000000..df31cb4f6 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/obby/Pipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/steel/Pipe.png b/FM/resources/assets/fm/textures/models/pipes/steel/Pipe.png new file mode 100644 index 000000000..c371da096 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/steel/Pipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/stone/Pipe.png b/FM/resources/assets/fm/textures/models/pipes/stone/Pipe.png new file mode 100644 index 000000000..cdc34db8a Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/stone/Pipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/tin/Pipe.png b/FM/resources/assets/fm/textures/models/pipes/tin/Pipe.png new file mode 100644 index 000000000..ce6a9c096 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/tin/Pipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pipes/wood/Pipe.png b/FM/resources/assets/fm/textures/models/pipes/wood/Pipe.png new file mode 100644 index 000000000..086a20d5a Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pipes/wood/Pipe.png differ diff --git a/FM/resources/assets/fm/textures/models/pumps/WaterPump.png b/FM/resources/assets/fm/textures/models/pumps/WaterPump.png new file mode 100644 index 000000000..98cb3553c Binary files /dev/null and b/FM/resources/assets/fm/textures/models/pumps/WaterPump.png differ diff --git a/FM/resources/assets/fm/textures/models/tankBlock.png b/FM/resources/assets/fm/textures/models/tankBlock.png new file mode 100644 index 000000000..21b97d4c5 Binary files /dev/null and b/FM/resources/assets/fm/textures/models/tankBlock.png differ diff --git a/FM/resources/assets/fm/textures/models/tankTexture.png b/FM/resources/assets/fm/textures/models/tankTexture.png new file mode 100644 index 000000000..82b85311d Binary files /dev/null and b/FM/resources/assets/fm/textures/models/tankTexture.png differ diff --git a/FM/src/dark/api/fluid/IDrain.java b/FM/src/dark/api/fluid/IDrain.java new file mode 100644 index 000000000..a133174cc --- /dev/null +++ b/FM/src/dark/api/fluid/IDrain.java @@ -0,0 +1,38 @@ +package dark.api.fluid; + +import java.util.Set; + +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.fluids.IFluidHandler; +import universalelectricity.core.vector.Vector3; +import universalelectricity.prefab.tile.IRotatable; + +/** Interface to make or use the TileEntityDrain. This is mostly a dummy interface to help the + * construction pump use the TileEntity as the center of drain location + * + * The use of ITankContainer is optional but is need for the drain to be added to a Fluid Network + * Same goes for IRotatable but make sure to return direction as the direction the drain faces */ +public interface IDrain extends IFluidHandler, IRotatable +{ + /** Can the pump drain in the area in the given direction + * + * @param direction - not the side of the block but rather the direction the block is facing + * @return true if it can */ + public boolean canDrain(ForgeDirection direction); + + /** Can the pump fill in the area in the given direction + * + * @param direction - not the side of the block but rather the direction the block is facing + * @return true if it can */ + public boolean canFill(ForgeDirection direction); + + /** Gets the list of fillable blocks */ + public Set getFillList(); + + /** Gets the list of drainable blocks */ + public Set getFluidList(); + + /** Call this after the drain was used to edit a block at the location */ + public void onUse(Vector3 vec); + +} diff --git a/FM/src/dark/api/fluid/INetworkFluidPart.java b/FM/src/dark/api/fluid/INetworkFluidPart.java new file mode 100644 index 000000000..8bcbe3581 --- /dev/null +++ b/FM/src/dark/api/fluid/INetworkFluidPart.java @@ -0,0 +1,50 @@ +package dark.api.fluid; + +import com.dark.tilenetwork.INetworkPart; + +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +/** Interface used by part that are members of a fluid tile network. Parts in the network will act as + * one entity and will be controlled by the network. This means the network need the part to access + * the parts in a set way to function correctly + * + * @author DarkGuardsman */ +public interface INetworkFluidPart extends IFluidHandler, INetworkPart +{ + + /** Gets information about the tanks internal storage that the network has access to. */ + public FluidTankInfo[] getTankInfo(); + + /** Fills the pipe in the same way that fill method is called in IFluidHandler. This is used so + * the network has a direct method to access the pipes internal fluid storage */ + public int fillTankContent(int index, FluidStack stack, boolean doFill); + + /** Removes from from the pipe in the same way that drain method is called in IFluidHandler. This + * is used so the network has a direct method to access the pipes internal fluid storage */ + public FluidStack drainTankContent(int index, int volume, boolean doDrain); + + /** Can the fluid pass from one side to the next. Used by path finder to see if the fluid can + * move threw the pipes. + * + * @param fluid - fluid that is trying to pass threw + * @param from - direction the fluid is coming from + * @param to - direction the fluid is going to + * + * @Note only do logic in the method as it may be called many times and expect no change from + * the pipes or world. + * @return true will let the fluid pass. */ + public boolean canPassThrew(FluidStack fluid, ForgeDirection from, ForgeDirection to); + + /** Called while the fluid is passing threw the pipe. This is the pipes chance to modify the + * fluid or react to the fluid + * + * @param fluid - fluid that is trying to pass threw + * @param from - direction the fluid is coming from + * @param to - direction the fluid is going to + * @return true if something happened to completely stop the fluid from moving. Eg. pipe blew + * up, or jammed */ + public boolean onPassThrew(FluidStack fluid, ForgeDirection from, ForgeDirection to); +} diff --git a/FM/src/dark/api/fluid/INetworkPipe.java b/FM/src/dark/api/fluid/INetworkPipe.java new file mode 100644 index 000000000..7ceda05da --- /dev/null +++ b/FM/src/dark/api/fluid/INetworkPipe.java @@ -0,0 +1,29 @@ +package dark.api.fluid; + +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +/** A machine that acts as one with the liquid network using the networks pressure for some function + * that doesn't change the over all network pressure. So pipes, gauges, tubes, buffers, decor + * blocks. */ +public interface INetworkPipe extends INetworkFluidPart +{ + /** Gets the parts max pressure limit it can handle + * + * Note this is not recommended max limit by rather actual breaking point of the part */ + public double getMaxPressure(ForgeDirection side); + + /** Max flow rate of liquid flow this part from the side for the liquid type that his part will + * allow + * + * @return limit in bucket parts(1/1000 of a bucket) */ + public int getMaxFlowRate(FluidStack stack, ForgeDirection side); + + /** Called when the pressure on the machine goes beyond max limits. Suggest doing random chance + * of damage or break too simulate real chances of pipe going beyond designed limits + * + * @param damageAllowed - can this tileEntity cause grief damage + * @return true if the device over pressured and destroyed itself */ + public boolean onOverPressure(Boolean damageAllowed); + +} diff --git a/FM/src/dark/core/prefab/tilenetwork/fluid/FluidCraftingHandler.java b/FM/src/dark/core/prefab/tilenetwork/fluid/FluidCraftingHandler.java new file mode 100644 index 000000000..7954fbc27 --- /dev/null +++ b/FM/src/dark/core/prefab/tilenetwork/fluid/FluidCraftingHandler.java @@ -0,0 +1,290 @@ +package dark.core.prefab.tilenetwork.fluid; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import com.builtbroken.common.Pair; +import com.builtbroken.common.Triple; +import com.dark.fluid.FluidHelper; + +import dark.core.prefab.tilenetwork.fluid.FluidRecipeInfo.SimpleFluidRecipe; + +/** Handles all kinds of process involving mixing Fluids with other fluids and/or Items, Blocks, + * ItemStack, or Liquids + * + * @author DarkGuardsman */ +public class FluidCraftingHandler +{ + /** Map of results of two different liquids merging */ + public static HashMap, Object> fluidMergeResults = new HashMap, Object>(); + + static + { + registerRecipe(FluidRegistry.LAVA, FluidRegistry.WATER, Block.obsidian); + registerRecipe(FluidRegistry.WATER, FluidRegistry.LAVA, Block.cobblestone); + } + + /** Creates a very basic A + B = C result for mixing two objects together. Suggest that the use + * of a SimpleFluidRecipe i used instead to create a more refined fluid mixing that takes into + * account ratios, and fluid volumes */ + public static void registerRecipe(Object a, Object b, Object c) + { + if (a != null && b != null && c != null) + { + registerFluidRecipe(new SimpleFluidRecipe(a, b, c)); + } + } + + public static void registerFluidRecipe(SimpleFluidRecipe recipe) + { + if (recipe != null && recipe.recipeObjectA != null && recipe.recipeObjectB != null && recipe.recipeObjectC != null) + { + if (!fluidMergeResults.containsKey(new Pair(recipe.recipeObjectA, recipe.recipeObjectB))) + { + fluidMergeResults.put(new Pair(recipe.recipeObjectA, recipe.recipeObjectB), recipe); + } + if (recipe.canBeReversed) + { + if (!fluidMergeResults.containsKey(new Pair(recipe.recipeObjectB, recipe.recipeObjectA))) + { + fluidMergeResults.put(new Pair(recipe.recipeObjectB, recipe.recipeObjectA), recipe); + } + } + } + } + + public static void loadPotionRecipes() + { + //TODO load the process by which a potion would be created threw fliud crafting + } + + /** Does the fluid recipe crafting for the crafter object. Requires that the object fully use all + * methods from the #IFluidRecipeCrafter + * + * @param crafter - crafting object, recommend it be a tile but can be anything as long as the + * method are used correctly. In some recipe cases when the setRecipeObjectContent nothing will + * be used. If result is null assume not crafting was performed. If there is a result the + * crafter couldn't use the output to reduce the input values. From here the IFluidRecipeCrafter + * will need to process the output and decress the input values correctly */ + public static void craft(IFluidRecipeCrafter crafter) + { + Object received = crafter.getReceivingObjectStack(); + int receivedVolume = 0; + Object input = crafter.getInputObjectStack(); + int inputVolume = 0; + if (crafter != null && received != null && input != null) + { + //Trip input values so they will match the correct mapped values + if (received instanceof FluidStack) + { + receivedVolume = ((FluidStack) received).amount; + received = FluidHelper.getStack((FluidStack) received, 1); + } + if (received instanceof ItemStack) + { + receivedVolume = ((ItemStack) received).stackSize; + ((ItemStack) received).stackSize = 1; + } + if (input instanceof FluidStack) + { + inputVolume = ((FluidStack) input).amount; + input = FluidHelper.getStack((FluidStack) input, 1); + } + if (input instanceof ItemStack) + { + receivedVolume = ((ItemStack) input).stackSize; + ((ItemStack) input).stackSize = 1; + } + + //Get result + Object result = fluidMergeResults.containsKey(new Pair(crafter.getReceivingObjectStack(), crafter.getInputObjectStack())); + + //reset stack sized + if (received instanceof FluidStack) + { + ((FluidStack) received).amount = receivedVolume; + } + if (received instanceof ItemStack) + { + ((ItemStack) received).stackSize = receivedVolume; + } + if (input instanceof FluidStack) + { + ((FluidStack) input).amount = inputVolume; + } + if (input instanceof ItemStack) + { + ((ItemStack) input).stackSize = inputVolume; + } + if (result != null) + { + if (result instanceof SimpleFluidRecipe) + { + Triple> re = ((SimpleFluidRecipe) result).mix(crafter.getInputObjectStack(), crafter.getInputObjectStack()); + crafter.setRecipeObjectContent(received, re.getA(), input, re.getB(), re.getC().left(), re.getC().right()); + } + } + crafter.setRecipeObjectContent(received, 0, input, 0, result, 0); + } + } + + /** Merges two fluids together that don't result in damage to the network */ + public static FluidStack mergeFluidStacks(FluidStack stackOne, FluidStack stackTwo) + { + FluidStack resultStack = null; + + if (stackTwo != null && stackOne != null && stackOne.isFluidEqual(stackTwo)) + { + resultStack = stackOne.copy(); + resultStack.amount += stackTwo.amount; + } + else if (stackOne == null && stackTwo != null) + { + resultStack = stackTwo.copy(); + } + else if (stackOne != null && stackTwo == null) + { + resultStack = stackOne.copy(); + } + else if (stackTwo != null && stackOne != null && !stackOne.isFluidEqual(stackTwo)) + { + System.out.println("preforming fluid merge event"); + Object result = fluidMergeResults.get(new Pair(stackOne.getFluid(), stackTwo.getFluid())); + /* Try to merge fluids by mod defined rules first */ + if (result != null) + { + System.out.println("result = " + result.toString()); + if (result instanceof Fluid) + { + resultStack = new FluidStack(((Fluid) result).getID(), stackOne.amount + stackTwo.amount); + } + else if (result instanceof FluidStack) + { + resultStack = ((FluidStack) result).copy(); + resultStack.amount = stackOne.amount + stackTwo.amount; + } + else if (result instanceof String && ((String) result).startsWith("Liquid:")) + { + resultStack = new FluidStack(FluidRegistry.getFluid(((String) result).replace("Liquid:", "")), stackOne.amount + stackTwo.amount); + } + else if (result instanceof SimpleFluidRecipe) + { + Triple> re = ((SimpleFluidRecipe) result).mix(stackOne, stackTwo); + if (re.getC().left() instanceof FluidStack) + { + resultStack = FluidHelper.getStack((FluidStack) re.getC().left(), re.getC().right()); + } + else if (re.getC().left() instanceof FluidStack) + { + resultStack = new FluidStack((Fluid) re.getC().left(), re.getC().right()); + } + } + } + if (resultStack == null) + { + System.out.println("Merging fluids into a waste fluid stack"); + Fluid waste = FluidRegistry.getFluid("waste"); + if (waste == null) + { + System.out.println("[FluidNetworkHelper] Attempted to merge two fluids into a waste fluid stack but Forge fluid registry return null for waste. Possible that waste fluid was disabled or not registered correctly."); + return null; + } + /* If both liquids are waste then copy fluidStack lists then merge */ + if (stackTwo.fluidID == waste.getID() && stackOne.fluidID == waste.getID()) + { + List stacks = new ArrayList(); + stacks.addAll(getStacksFromWaste(stackOne.copy())); + stacks.addAll(getStacksFromWaste(stackTwo.copy())); + resultStack = createNewWasteStack(stacks.toArray(new FluidStack[stacks.size()])); + } + else + { + resultStack = createNewWasteStack(stackOne.copy(), stackTwo.copy()); + } + } + } + return resultStack; + } + + /** Gets the fluidStacks that make up a waste FluidStack */ + public static List getStacksFromWaste(FluidStack wasteStack) + { + List stacks = new ArrayList(); + if (wasteStack.fluidID == FluidRegistry.getFluidID("waste")) + { + for (int i = 1; i <= wasteStack.tag.getInteger("liquids"); i++) + { + FluidStack readStack = FluidStack.loadFluidStackFromNBT(wasteStack.tag.getCompoundTag("Liquid" + i)); + if (readStack != null) + { + stacks.add(readStack); + } + } + } + return stacks; + } + + /** Creates a new waste stack from the listed fluidStacks */ + public static FluidStack createNewWasteStack(FluidStack... liquids) + { + FluidStack stack = new FluidStack(FluidRegistry.getFluid("waste"), 0); + stack.tag = new NBTTagCompound(); + if (liquids != null) + { + int count = 0; + for (int i = 0; i < liquids.length; i++) + { + if (liquids[i] != null) + { + if (!liquids[i].getFluid().equals(stack.getFluid())) + { + count++; + stack.tag.setCompoundTag("Liquids" + count, liquids[i].writeToNBT(new NBTTagCompound())); + stack.amount += liquids[i].amount; + } + else + { + for (FluidStack loadStack : getStacksFromWaste(liquids[i])) + { + count++; + stack.tag.setCompoundTag("Liquids" + count, loadStack.writeToNBT(new NBTTagCompound())); + stack.amount += loadStack.amount; + } + } + } + } + stack.tag.setInteger("liquids", count); + } + return stack; + } + + /** Gets the result of the merge of the two fluids, order of merge does matter and will produce + * different results. + * + * @param stackOne - Receiving fluid, eg the one that is not moving + * @param stackTwo - Flowing fluid, eg the one moving into the first fluid + * @return Object result of the merge, can be anything from string, ItemStack, Item, Block, or + * enum action */ + public static Object getMergeResult(FluidStack stackOne, FluidStack stackTwo) + { + FluidStack sampleStackOne, sampleStackTwo; + if (stackOne != null && stackTwo != null && !stackOne.equals(stackTwo)) + { + sampleStackOne = FluidHelper.getStack(stackOne, 1); + sampleStackTwo = FluidHelper.getStack(stackTwo, 1); + if (fluidMergeResults.containsKey(new Pair(sampleStackOne, sampleStackTwo))) + { + return fluidMergeResults.get(new Pair(sampleStackOne, sampleStackTwo)); + } + } + return null; + } +} diff --git a/FM/src/dark/core/prefab/tilenetwork/fluid/FluidPressurePack.java b/FM/src/dark/core/prefab/tilenetwork/fluid/FluidPressurePack.java new file mode 100644 index 000000000..7cf55affc --- /dev/null +++ b/FM/src/dark/core/prefab/tilenetwork/fluid/FluidPressurePack.java @@ -0,0 +1,26 @@ +package dark.core.prefab.tilenetwork.fluid; + +import net.minecraftforge.fluids.FluidStack; + +public class FluidPressurePack implements Cloneable +{ + public FluidStack liquidStack; + public double pressure; + + public FluidPressurePack(FluidStack liquidStack, double voltage) + { + this.liquidStack = liquidStack; + this.pressure = voltage; + } + + @Override + public FluidPressurePack clone() + { + return new FluidPressurePack(this.liquidStack, this.pressure); + } + + public boolean isEqual(FluidPressurePack packet) + { + return this.liquidStack.isFluidEqual(packet.liquidStack) && this.pressure == packet.pressure; + } +} diff --git a/FM/src/dark/core/prefab/tilenetwork/fluid/FluidRecipeInfo.java b/FM/src/dark/core/prefab/tilenetwork/fluid/FluidRecipeInfo.java new file mode 100644 index 000000000..9458b47c6 --- /dev/null +++ b/FM/src/dark/core/prefab/tilenetwork/fluid/FluidRecipeInfo.java @@ -0,0 +1,219 @@ +package dark.core.prefab.tilenetwork.fluid; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +import com.builtbroken.common.Pair; +import com.builtbroken.common.Triple; + +/** Used to store more complex info, than A + B = C, on two FluidStack mixing behavior + * + * @author DarkGuardsman */ +public class FluidRecipeInfo +{ + /** A + Energy = C, simple recipe designed to tell a boiler like machine how to handle input to + * output process */ + public static class BoilingFluidRecipe + { + /** Unboiled object */ + public Object boiledObject; + /** Boiled object */ + public Object boiledResult; + /** In kelvin tempature units only */ + public float heatLevel = 0; + /** Energy in jouls need to turn convert A to B */ + public float energyPerMb = 1; + + public BoilingFluidRecipe(Object unboiled, Object boiled, float boilingTempature, float energyPerUnitBoiled) + { + this.boiledObject = unboiled; + this.boiledResult = boiled; + this.heatLevel = boilingTempature; + this.energyPerMb = energyPerUnitBoiled; + } + + @Override + public String toString() + { + return "[BoilingFluidRecipe] UnboiledObject: " + (this.boiledObject != null ? this.boiledObject.toString() : "null") + " | BoiledObject: " + (this.boiledResult != null ? this.boiledResult.toString() : "null") + " | BoilingTemp: " + this.heatLevel + "k | EnergyPerUnit: " + this.energyPerMb + "j"; + } + } + + /** Basic A + B = C recipe result that should involve fluids but can be used as a 2 item crafting + * system if needed */ + public static class SimpleFluidRecipe + { + public Object recipeObjectA, recipeObjectB, recipeObjectC; + public int ratioOfA = 1, ratioOfB = 1, ratioOfC = 1; + /** Size compared to the largest volume that the smallest volume can be */ + public float mixingPercentMin = .1f; + public boolean canBeReversed = false; + + /** receiving & input object must be either be an instance of a class extending Item, + * ItemStack, Block, Fluid, FluidStack, or OreNames. Anything else and the mixing will never + * work + * + * @param receiving - receiving object that is waiting to be mixed + * @param input - object being added to the receiving object + * @param output - result of mixing the object together. Can be anything but not all + * machines using this will respect all output types */ + public SimpleFluidRecipe(Object receiving, Object input, Object output) + { + this.recipeObjectA = receiving; + this.recipeObjectB = input; + this.recipeObjectC = output; + } + + public SimpleFluidRecipe setRatio(int receivingVolume, int inputVolume, int result) + { + this.ratioOfA = receivingVolume; + this.ratioOfB = inputVolume; + this.ratioOfC = result; + return this; + } + + public SimpleFluidRecipe setIsReversable(boolean canBeReversed) + { + this.canBeReversed = canBeReversed; + return this; + } + + public Object getResult() + { + return this.recipeObjectC; + } + + /** Can the mixing be complete in anyway. Does a basic volume check but does not check for + * volume wasted in mixing + * + * @param receiving - Object stored and waiting for mixing + * @param input - Object being added to the receiving object + * @return true if the process can be completed */ + public boolean canComplete(Object receiving, Object input) + { + int countReceiving = 0; + int countInput = 0; + float percent = 0; + if (receiving != null && input != null && recipeObjectA.equals(receiving) && recipeObjectB.equals(input)) + { + countReceiving = this.getObjectVolume(receiving); + countInput = this.getObjectVolume(input); + if (countReceiving > 0 && countInput > 0) + { + float per = countInput / countReceiving; + float per2 = countReceiving / countInput; + percent = per > per2 ? per2 : per; + if (percent >= this.mixingPercentMin) + { + return true; + } + } + } + return false; + } + + public int getObjectVolume(Object object) + { + int volume = 0; + if (object instanceof Item) + { + volume = 1; + } + else if (object instanceof ItemStack) + { + volume = ((ItemStack) object).stackSize; + } + else if (object instanceof FluidStack) + { + volume = ((FluidStack) object).amount; + } + else if (object instanceof Fluid) + { + volume = 1; + } + + return volume; + } + + /** @param receiving - Object receiving an input object for mixing + * @param input - Object being added to the receiving object + * @return Triple containing values of mixing. Complex way to handle it, and may be replaced + * later, However to prevent 4 different methods be created for mixing this is the best + * output design. As well this doesn't consume the object but does the calculations of the + * recipe out at the given object volumes + * + * First value is amount of the first object used. Second value is the amount of the second + * object used. Third value Pair containing object output then amount of output */ + public Triple> mix(Object receiving, Object input) + { + if (this.canComplete(receiving, input)) + { + //Collect volume of each input object + int volumeReceiving = this.getObjectVolume(receiving); + int volumeInput = this.getObjectVolume(input); + int volAUsed, volBUsed; + + //check if there is enough to mix even once + if (volumeReceiving > this.ratioOfA && volumeInput > this.ratioOfB) + { + //Collect ratio of each + int ratioA = (volumeReceiving / this.ratioOfA); + int ratioB = (volumeInput / this.ratioOfB); + + //Take the least ratio value and multiply it by the ratio of the output + int outputVolume = ratioA > ratioB ? ratioB * this.ratioOfC : ratioA * this.ratioOfC; + + volAUsed = (outputVolume / this.ratioOfC) * this.ratioOfA; + volBUsed = (outputVolume / this.ratioOfC) * this.ratioOfB; + return new Triple>(volAUsed, volBUsed, new Pair(this.recipeObjectC, outputVolume)); + } + + } + return null; + } + } + + /** Stores the list of processes needed to complete a fluid recipe that require more than one + * step to complete. Only used by brewing factories, and is suggest too still register result as + * a SimpleFluidRecipe unless the result can't be stored or moved easily. */ + public static class ComplexFluidRecipe + { + public int numberOfSteps; + public SimpleFluidRecipe[] stepArray; + + public ComplexFluidRecipe(int numberOfSteps) + { + this.numberOfSteps = numberOfSteps; + this.stepArray = new SimpleFluidRecipe[this.numberOfSteps]; + } + + public ComplexFluidRecipe createStep(int step, SimpleFluidRecipe stepRecipe) + { + if (step < numberOfSteps) + { + stepArray[step] = stepRecipe; + } + return this; + } + + public boolean canCompleteStep(int step, Object receiving, Object input) + { + if (this.getStep(step) != null) + { + return this.getStep(step).canComplete(receiving, input); + } + return false; + } + + public SimpleFluidRecipe getStep(int step) + { + if (step < numberOfSteps) + { + return stepArray[step]; + } + return null; + } + } +} diff --git a/FM/src/dark/core/prefab/tilenetwork/fluid/IFluidRecipeCrafter.java b/FM/src/dark/core/prefab/tilenetwork/fluid/IFluidRecipeCrafter.java new file mode 100644 index 000000000..e08f0f63b --- /dev/null +++ b/FM/src/dark/core/prefab/tilenetwork/fluid/IFluidRecipeCrafter.java @@ -0,0 +1,18 @@ +package dark.core.prefab.tilenetwork.fluid; + +/** Use this if you want to take advantage of the {@link #FluidCraftingHandler} 's auto crafting + * methods to do as little as work as possible to create recipe results + * + * @author DarkGuardsman */ +public interface IFluidRecipeCrafter +{ + /** After calling {@link #FluidCraftingHandler} 's crafting method this will be called to setup + * the end result of all 3 objects. That is if crafting was not called for calculations only */ + public void setRecipeObjectContent(Object receivingObject, int usedReceivingVolume, Object inputObject, int usedInputVolume, Object resultObject, int resultCreatedVolume); + + /** Stack that is receiving the input object (ItemStack & FluidStack are best) */ + public Object getReceivingObjectStack(); + + /** Stack that will be received by the receiving object (ItemStack & FluidStack are best) */ + public Object getInputObjectStack(); +} diff --git a/FM/src/dark/core/prefab/tilenetwork/fluid/NetworkFluidContainers.java b/FM/src/dark/core/prefab/tilenetwork/fluid/NetworkFluidContainers.java new file mode 100644 index 000000000..b1e1c539e --- /dev/null +++ b/FM/src/dark/core/prefab/tilenetwork/fluid/NetworkFluidContainers.java @@ -0,0 +1,104 @@ +package dark.core.prefab.tilenetwork.fluid; + +import java.util.ArrayList; +import java.util.List; + +import com.dark.fluid.FluidHelper; +import com.dark.tilenetwork.INetworkPart; +import com.dark.tilenetwork.prefab.NetworkUpdateHandler; + +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; +import dark.api.fluid.INetworkFluidPart; + +/** Basically the same as network Fluid tiles class with the only difference being in how it stores + * the fluid. When it goes to sort the fluid it will use the fluid properties to adjust its position + * in the over all tank. Eg water goes down air goes up. + * + * @author DarkGuardsman */ +public class NetworkFluidContainers extends NetworkFluidTiles +{ + static + { + NetworkUpdateHandler.registerNetworkClass("FluidContainers", NetworkFluidContainers.class); + } + + public NetworkFluidContainers() + { + super(); + } + + public NetworkFluidContainers(INetworkPart... parts) + { + super(parts); + } + + @Override + public void save() + { + this.cleanUpMembers(); + + if (this.getNetworkTank() == null || this.getNetworkTank().getFluid() == null) + { + super.save(); + return; + } + FluidStack fillStack = this.getNetworkTank().getFluid().copy(); + + int lowestY = 255, highestY = 0; + + if (this.getNetworkTank().getFluid() != null && this.getMembers().size() > 0) + { + for (INetworkPart part : this.getMembers()) + { + if (part instanceof IFluidHandler) + { + ((INetworkFluidPart) part).drainTankContent(0, Integer.MAX_VALUE, true); + } + if (part instanceof TileEntity && ((TileEntity) part).yCoord < lowestY) + { + lowestY = ((TileEntity) part).yCoord; + } + if (part instanceof TileEntity && ((TileEntity) part).yCoord > highestY) + { + highestY = ((TileEntity) part).yCoord; + } + } + + //TODO change this to use hydraulics to not only place fluid at the lowest but as well not move it to another side if there is no path there threw fluid + for (int y = lowestY; y <= highestY; y++) + { + /** List of parts for this Y level */ + List parts = new ArrayList(); + + /* Grab all parts that share this Y level*/ + for (INetworkPart part : this.getMembers()) + { + if (part instanceof INetworkFluidPart && ((TileEntity) part).yCoord == y) + { + parts.add((INetworkFluidPart) part); + } + } + if (!parts.isEmpty()) + { + /* Div out the volume for this level. TODO change this to use a percent system for even filling */ + int fillvolume = Math.abs(fillStack.amount / parts.size()); + + /* Fill all tanks on this level */ + for (INetworkFluidPart part : parts) + { + part.drainTankContent(0, Integer.MAX_VALUE, true); + fillStack.amount -= part.fillTankContent(0, FluidHelper.getStack(fillStack, fillvolume), true); + } + } + + if (fillStack == null || fillStack.amount <= 0) + { + break; + } + } + } + + } +} diff --git a/FM/src/dark/core/prefab/tilenetwork/fluid/NetworkFluidTiles.java b/FM/src/dark/core/prefab/tilenetwork/fluid/NetworkFluidTiles.java new file mode 100644 index 000000000..1c193df91 --- /dev/null +++ b/FM/src/dark/core/prefab/tilenetwork/fluid/NetworkFluidTiles.java @@ -0,0 +1,310 @@ +package dark.core.prefab.tilenetwork.fluid; + +import java.util.EnumSet; +import java.util.HashMap; +import java.util.Iterator; + +import com.dark.fluid.FluidHelper; +import com.dark.tilenetwork.INetworkPart; +import com.dark.tilenetwork.ITileNetwork; +import com.dark.tilenetwork.prefab.NetworkTileEntities; +import com.dark.tilenetwork.prefab.NetworkUpdateHandler; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; +import dark.api.fluid.INetworkFluidPart; + +public class NetworkFluidTiles extends NetworkTileEntities +{ + /** Fluid Tanks that are connected to the network but not part of the network's main body */ + public HashMap> connctedFluidHandlers = new HashMap>(); + /** Collective storage tank of all fluid tile that make up this networks main body */ + protected FluidTank sharedTank; + protected FluidTankInfo sharedTankInfo; + + /** Has the collective tank been loaded yet */ + protected boolean loadedLiquids = false; + + static + { + NetworkUpdateHandler.registerNetworkClass("FluidTiles", NetworkFluidTiles.class); + } + + public NetworkFluidTiles() + { + super(); + } + + public NetworkFluidTiles(INetworkPart... parts) + { + super(parts); + } + + /** Gets the collective tank of the network */ + public FluidTank getNetworkTank() + { + if (this.sharedTank == null) + { + this.sharedTank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME); + this.getNetworkTankInfo(); + } + return this.sharedTank; + } + + public FluidTankInfo getNetworkTankInfo() + { + if (this.sharedTankInfo == null) + { + this.sharedTankInfo = this.getNetworkTank().getInfo(); + } + return this.sharedTankInfo; + } + + public int fillNetworkTank(TileEntity source, FluidStack stack, boolean doFill) + { + if (!this.loadedLiquids) + { + this.load(); + this.loadedLiquids = true; + } + if (!source.worldObj.isRemote && this.getNetworkTank() != null && stack != null) + { + int p = this.getNetworkTank().getFluidAmount(); + int r = this.getNetworkTank().fill(stack, doFill); + //System.out.println((world.isRemote ? "Client" : "Server") + " Network Fill: B:" + p + " A:" + this.getNetworkTank().getFluidAmount()); + if (doFill) + { + if (p != this.getNetworkTank().getFluidAmount()) + { + this.sharedTankInfo = this.getNetworkTank().getInfo(); + this.save(); + } + } + return r; + } + return 0; + } + + public FluidStack drainNetworkTank(World world, int volume, boolean doDrain) + { + + if (!this.loadedLiquids) + { + this.load(); + this.loadedLiquids = true; + } + FluidStack before = this.getNetworkTank().getFluid(); + if (!world.isRemote && this.getNetworkTank() != null && before != null) + { + FluidStack drain = this.getNetworkTank().drain(volume, doDrain); + FluidStack after = this.getNetworkTank().getFluid(); + // System.out.println((doDrain ? "" : "Fake") + " Network Drain for " + volume + " B:" + (before != null ? before.amount : 0) + " A:" + (after != null ? after.amount : 0) + " D:" + (drain != null ? drain.amount : 0)); + if (doDrain) + { + //Has the tank changed any. If yes then update all info and do a client update + if (!before.isFluidEqual(after) || (before != null && after != null && before.amount != after.amount)) + { + this.sharedTankInfo = this.getNetworkTank().getInfo(); + this.save(); + /*TODO do a client update from the network rather than each pipe updating itself. + *This will save on packet size but will increase the CPU load of the client since the client + *will need to do network calculations */ + } + } + return drain; + } + return null; + } + + @Override + public void save() + { + this.cleanUpMembers(); + if (this.getNetworkTank().getFluid() != null && this.getMembers().size() > 0) + { + FluidStack stack = this.getNetworkTank().getFluid() == null ? null : this.getNetworkTank().getFluid().copy(); + int membersFilled = 0; + + for (INetworkPart par : this.getMembers()) + { + //UPDATE FILL VOLUME + int fillVol = stack == null ? 0 : (stack.amount / (this.getMembers().size() - membersFilled)); + + if (par instanceof INetworkFluidPart) + { + //EMPTY TANK + ((INetworkFluidPart) par).drainTankContent(0, Integer.MAX_VALUE, true); + //FILL TANK + if (stack != null) + { + stack.amount -= ((INetworkFluidPart) par).fillTankContent(0, FluidHelper.getStack(stack, fillVol), true); + membersFilled++; + } + } + } + } + + } + + @Override + public void load() + { + FluidStack stack = null; + this.cleanUpMembers(); + for (INetworkPart par : this.getMembers()) + { + if (par instanceof INetworkFluidPart) + { + if (((INetworkFluidPart) par).getTankInfo()[0] != null && ((INetworkFluidPart) par).getTankInfo()[0].fluid != null) + { + if (stack == null) + { + stack = ((INetworkFluidPart) par).getTankInfo()[0].fluid.copy(); + } + else + { + stack.amount += ((INetworkFluidPart) par).getTankInfo()[0].fluid.amount; + } + } + } + } + if (stack != null && stack.amount > 0) + { + this.getNetworkTank().setFluid(stack); + } + else + { + this.getNetworkTank().setFluid(null); + } + this.loadedLiquids = true; + } + + @Override + public boolean removeTile(TileEntity ent) + { + return super.removeTile(ent) || this.connctedFluidHandlers.remove(ent) != null; + } + + /** Checks too see if the tileEntity is part of or connected too the network */ + public boolean isConnected(TileEntity tileEntity) + { + return this.connctedFluidHandlers.containsKey(tileEntity); + } + + public void addTank(ForgeDirection side, IFluidHandler tank) + { + if (this.connctedFluidHandlers.containsKey(tank)) + { + EnumSet d = this.connctedFluidHandlers.get(tank); + d.add(side); + this.connctedFluidHandlers.put(tank, d); + } + else + { + EnumSet d = EnumSet.noneOf(ForgeDirection.class); + d.add(side); + this.connctedFluidHandlers.put(tank, d); + } + } + + @Override + public boolean preMergeProcessing(ITileNetwork mergingNetwork, INetworkPart mergePoint) + { + if (mergingNetwork instanceof NetworkFluidTiles) + { + if (!((NetworkFluidTiles) mergingNetwork).loadedLiquids) + { + ((NetworkFluidTiles) mergingNetwork).load(); + } + if (!this.loadedLiquids) + { + this.load(); + } + } + return super.preMergeProcessing(mergingNetwork, mergePoint); + + } + + @Override + protected void mergeDo(ITileNetwork network) + { + ITileNetwork newNetwork = NetworkUpdateHandler.createNewNetwork(NetworkUpdateHandler.getID(this.getClass())); + if (newNetwork != null) + { + if (newNetwork instanceof NetworkFluidTiles) + { + FluidStack one = this.getNetworkTank().getFluid(); + FluidStack two = ((NetworkFluidTiles) network).getNetworkTank().getFluid(); + + this.getNetworkTank().setFluid(null); + ((NetworkFluidTiles) network).getNetworkTank().setFluid(null); + + ((NetworkFluidTiles) newNetwork).getNetworkTank().setFluid(FluidCraftingHandler.mergeFluidStacks(one, two)); + ((NetworkFluidTiles) newNetwork).sharedTankInfo = ((NetworkFluidTiles) newNetwork).getNetworkTank().getInfo(); + } + newNetwork.getMembers().addAll(this.getMembers()); + newNetwork.getMembers().addAll(network.getMembers()); + newNetwork.onCreated(); + newNetwork.save(); + } + else + { + System.out.println("[NetworkFluidTiles] Failed to merge network due to the new network returned null"); + } + } + + @Override + public void cleanUpMembers() + { + Iterator it = this.getMembers().iterator(); + int capacity = 0; + while (it.hasNext()) + { + INetworkPart part = it.next(); + if (!this.isValidMember(part)) + { + it.remove(); + } + else + { + part.setTileNetwork(this); + if (part instanceof INetworkFluidPart && ((INetworkFluidPart) part).getTankInfo()[0] != null) + { + capacity += ((INetworkFluidPart) part).getTankInfo()[0].capacity; + } + } + } + this.getNetworkTank().setCapacity(capacity); + this.sharedTankInfo = this.getNetworkTank().getInfo(); + } + + @Override + public boolean isValidMember(INetworkPart part) + { + return super.isValidMember(part) && part instanceof INetworkFluidPart; + } + + @Override + public String toString() + { + return "FluidNetwork[" + this.hashCode() + "|parts:" + this.getMembers().size() + "]"; + } + + public String getNetworkFluid() + { + if (this.getNetworkTank() != null && this.getNetworkTank().getFluid() != null && this.getNetworkTank().getFluid().getFluid() != null) + { + int cap = this.getNetworkTank().getCapacity() / FluidContainerRegistry.BUCKET_VOLUME; + int vol = this.getNetworkTank().getFluid() != null ? (this.getNetworkTank().getFluid().amount / FluidContainerRegistry.BUCKET_VOLUME) : 0; + String name = this.getNetworkTank().getFluid().getFluid().getLocalizedName(); + return String.format("%d/%d %S Stored", vol, cap, name); + } + return ("Empty"); + } +} diff --git a/FM/src/dark/core/prefab/tilenetwork/fluid/NetworkPipes.java b/FM/src/dark/core/prefab/tilenetwork/fluid/NetworkPipes.java new file mode 100644 index 000000000..f6ac34a75 --- /dev/null +++ b/FM/src/dark/core/prefab/tilenetwork/fluid/NetworkPipes.java @@ -0,0 +1,140 @@ +package dark.core.prefab.tilenetwork.fluid; + +import java.util.EnumSet; +import java.util.Map.Entry; + +import com.dark.fluid.FluidHelper; +import com.dark.tilenetwork.INetworkPart; +import com.dark.tilenetwork.prefab.NetworkUpdateHandler; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; +import dark.api.fluid.INetworkPipe; + +/** Extension on the fluid container network to provide a more advanced reaction to fluid passing + * threw each pipe. As well this doubled as a pressure network for those machines that support the + * use of pressure. + * + * @author Rseifert */ +public class NetworkPipes extends NetworkFluidTiles +{ + private boolean processingRequest; + public float pressureProduced; + + static + { + NetworkUpdateHandler.registerNetworkClass("FluidPipes", NetworkPipes.class); + } + + public NetworkPipes() + { + super(); + } + + public NetworkPipes(INetworkPart... parts) + { + super(parts); + } + + @Override + public int fillNetworkTank(TileEntity source, FluidStack stack, boolean doFill) + { + int netFill = this.addFluidToNetwork(source, stack, doFill); + if (netFill > 0) + { + return netFill; + } + return super.fillNetworkTank(source, stack, doFill); + } + + /** Adds FLuid to this network from one of the connected Pipes + * + * @param source - Were this liquid came from + * @param stack - LiquidStack to be sent + * @param doFill - actually fill the tank or just check numbers + * @return the amount of liquid consumed from the init stack */ + public int addFluidToNetwork(TileEntity source, FluidStack stack, boolean doFill) + { + return this.addFluidToNetwork(source, stack, doFill, false); + } + + /** Adds FLuid to this network from one of the connected Pipes + * + * @param source - Were this liquid came from + * @param stack - LiquidStack to be sent + * @param doFill - actually fill the tank or just check numbers + * @param allowStore - allows the network to store this liquid in the pipes + * @return the amount of liquid consumed from the init stack */ + public int addFluidToNetwork(TileEntity source, FluidStack sta, boolean doFill, boolean allowStore) + { + int used = 0; + FluidStack stack = sta.copy(); + + if (!this.processingRequest && stack != null) + { + this.processingRequest = true; + if (stack.amount > this.getMaxFlow(stack)) + { + stack = FluidHelper.getStack(stack, this.getMaxFlow(stack)); + } + + /* Secondary fill target if the main target is not found */ + IFluidHandler tankToFill = null; + int mostFill = 0; + ForgeDirection fillDir = ForgeDirection.UNKNOWN; + + boolean found = false; + + /* FIND THE FILL TARGET FROM THE LIST OF FLUID RECIEVERS */ + for (Entry> entry : this.connctedFluidHandlers.entrySet()) + { + IFluidHandler tankContainer = entry.getKey(); + if (tankContainer instanceof TileEntity && tankContainer != source && !(tankContainer instanceof INetworkPipe)) + { + for (ForgeDirection dir : entry.getValue()) + { + if (tankContainer.canFill(dir, sta.getFluid())) + { + int fill = tankContainer.fill(dir, stack, false); + + if (fill > mostFill) + { + tankToFill = tankContainer; + mostFill = fill; + fillDir = dir; + } + } + } + } + if (found) + { + break; + } + }// End of tank finder + if (tankToFill != null) + { + //TODO set up a list of tanks to actually fill rather than one at a time + used = tankToFill.fill(fillDir, stack, doFill); + // System.out.println("Seconday Target " + used + doFill); + } + } + this.processingRequest = false; + return used; + } + + /** Gets the flow rate of the system using the lowest flow rate */ + public int getMaxFlow(FluidStack stack) + { + return 1000; + } + + /** Updates after the pressure has changed a good bit */ + public void onPresureChange() + { + this.cleanUpMembers(); + } + +} diff --git a/FM/src/dark/fluid/client/ClientProxy.java b/FM/src/dark/fluid/client/ClientProxy.java new file mode 100644 index 000000000..76c12ca0d --- /dev/null +++ b/FM/src/dark/fluid/client/ClientProxy.java @@ -0,0 +1,59 @@ +package dark.fluid.client; + +import net.minecraftforge.client.MinecraftForgeClient; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.client.render.BlockRenderHelper; +import dark.fluid.client.render.ItemPipeRenderer; +import dark.fluid.client.render.ItemTankRenderer; +import dark.fluid.client.render.RenderConstructionPump; +import dark.fluid.client.render.RenderPipe; +import dark.fluid.client.render.RenderPump; +import dark.fluid.client.render.RenderReleaseValve; +import dark.fluid.client.render.RenderSink; +import dark.fluid.client.render.RenderTank; +import dark.fluid.common.CommonProxy; +import dark.fluid.common.FMRecipeLoader; +import dark.fluid.common.machines.TileEntityReleaseValve; +import dark.fluid.common.machines.TileEntitySink; +import dark.fluid.common.machines.TileEntityTank; +import dark.fluid.common.pipes.TileEntityPipe; +import dark.fluid.common.pump.TileEntityConstructionPump; +import dark.fluid.common.pump.TileEntityStarterPump; + +@SideOnly(Side.CLIENT) +public class ClientProxy extends CommonProxy +{ + @Override + public void preInit() + { + + } + + @Override + public void Init() + { + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPipe.class, new RenderPipe()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityStarterPump.class, new RenderPump()); + //ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRod.class, new RenderGearRod()); + //ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGenerator.class, new RenderGenerator()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityReleaseValve.class, new RenderReleaseValve()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySink.class, new RenderSink()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityConstructionPump.class, new RenderConstructionPump()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTank.class, new RenderTank()); + + MinecraftForgeClient.registerItemRenderer(FMRecipeLoader.blockPipe.blockID, new ItemPipeRenderer()); + MinecraftForgeClient.registerItemRenderer(FMRecipeLoader.blockTank.blockID, new ItemTankRenderer()); + MinecraftForgeClient.registerItemRenderer(FMRecipeLoader.blockReleaseValve.blockID, new ItemPipeRenderer()); + + RenderingRegistry.registerBlockHandler(new BlockRenderHelper()); + } + + @Override + public void postInit() + { + + } +} diff --git a/FM/src/dark/fluid/client/model/ModelCenterTank.java b/FM/src/dark/fluid/client/model/ModelCenterTank.java new file mode 100644 index 000000000..1b26c8188 --- /dev/null +++ b/FM/src/dark/fluid/client/model/ModelCenterTank.java @@ -0,0 +1,45 @@ +// Date: 8/14/2012 1:48:41 AM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package dark.fluid.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelCenterTank extends ModelBase +{ + + ModelRenderer Block; + + public ModelCenterTank(float par1) + { + textureWidth = 128; + textureHeight = 128; + + //block + Block = new ModelRenderer(this, 0, 0); + Block.addBox(0F, 0F, 0F, 16, 16, 16); + Block.setRotationPoint(-8F, 8F, -8F); + Block.setTextureSize(128, 32); + Block.mirror = true; + setRotation(Block, 0F, 0F, 0F); + } + + public void renderBlock(float f5) + { + Block.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/FM/src/dark/fluid/client/model/ModelConstructionPump.java b/FM/src/dark/fluid/client/model/ModelConstructionPump.java new file mode 100644 index 000000000..3a58f543b --- /dev/null +++ b/FM/src/dark/fluid/client/model/ModelConstructionPump.java @@ -0,0 +1,94 @@ +// Date: 4/15/2013 6:17:44 AM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package dark.fluid.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; + +public class ModelConstructionPump extends ModelBase +{ + // fields + ModelRenderer Side3; + ModelRenderer Motor2; + ModelRenderer Motor; + ModelRenderer side; + ModelRenderer base; + ModelRenderer side2; + ModelRenderer side4; + + public ModelConstructionPump() + { + textureWidth = 128; + textureHeight = 128; + + Side3 = new ModelRenderer(this, 46, 37); + Side3.addBox(-5F, 0F, -3F, 10, 11, 5); + Side3.setRotationPoint(0F, 10F, -4F); + Side3.setTextureSize(64, 32); + Side3.mirror = true; + setRotation(Side3, 0F, 0F, 0F); + Motor2 = new ModelRenderer(this, 10, 23); + Motor2.addBox(-4F, -4F, 0F, 8, 8, 4); + Motor2.setRotationPoint(0F, 15F, -2F); + Motor2.setTextureSize(64, 32); + Motor2.mirror = true; + setRotation(Motor2, 0F, 0F, 0F); + Motor = new ModelRenderer(this, 10, 23); + Motor.addBox(-4F, -4F, 0F, 8, 8, 4); + Motor.setRotationPoint(0F, 15F, -2F); + Motor.setTextureSize(64, 32); + Motor.mirror = true; + setRotation(Motor, 0F, 0F, 0.7853982F); + side = new ModelRenderer(this, 15, 37); + side.addBox(-5F, 0F, -3F, 10, 11, 5); + side.setRotationPoint(0F, 10F, 5F); + side.setTextureSize(64, 32); + side.mirror = true; + setRotation(side, 0F, 0F, 0F); + base = new ModelRenderer(this, 16, 54); + base.addBox(-7F, 0F, -8F, 14, 3, 16); + base.setRotationPoint(0F, 21F, 0F); + base.setTextureSize(64, 32); + base.mirror = true; + setRotation(base, 0F, 0F, 0F); + side2 = new ModelRenderer(this, 0, 37); + side2.addBox(-3F, 0F, 2F, 6, 10, 1); + side2.setRotationPoint(0F, 11F, 5F); + side2.setTextureSize(64, 32); + side2.mirror = true; + setRotation(side2, 0F, 0F, 0F); + side4 = new ModelRenderer(this, 77, 37); + side4.addBox(-3F, 0F, -3F, 6, 10, 1); + side4.setRotationPoint(0F, 11F, -5F); + side4.setTextureSize(64, 32); + side4.mirror = true; + setRotation(side4, 0F, 0F, 0F); + } + + public void render(float f5) + { + Side3.render(f5); + side.render(f5); + base.render(f5); + side2.render(f5); + side4.render(f5); + } + + public void renderMotor(float f5) + { + Motor2.render(f5); + Motor.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/FM/src/dark/fluid/client/model/ModelCornerTank.java b/FM/src/dark/fluid/client/model/ModelCornerTank.java new file mode 100644 index 000000000..7639b9252 --- /dev/null +++ b/FM/src/dark/fluid/client/model/ModelCornerTank.java @@ -0,0 +1,86 @@ +// Date: 8/14/2012 1:48:41 AM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package dark.fluid.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelCornerTank extends ModelBase +{ + //Corner + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape3; + ModelRenderer Shape6; + ModelRenderer Shape7; + ModelRenderer Shape4; + + public ModelCornerTank(float par1) + { + textureWidth = 128; + textureHeight = 128; + + //corner + Shape1 = new ModelRenderer(this, 0, 1); + Shape1.addBox(0F, 0F, 0F, 1, 16, 20); + Shape1.setRotationPoint(7F, 8F, -7F); + Shape1.setTextureSize(128, 128); + Shape1.mirror = true; + setRotation(Shape1, 0F, -0.7853982F, 0F); + Shape2 = new ModelRenderer(this, 44, 0); + Shape2.addBox(0F, 0F, 0F, 2, 16, 2); + Shape2.setRotationPoint(-8F, 8F, 6F); + Shape2.setTextureSize(128, 128); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 44, 0); + Shape3.addBox(0F, 0F, 0F, 2, 16, 2); + Shape3.setRotationPoint(6F, 8F, -8F); + Shape3.setTextureSize(128, 128); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0F, 0F); + Shape6 = new ModelRenderer(this, 0, 44); + Shape6.addBox(0F, 0F, 0F, 1, 15, 13); + Shape6.setRotationPoint(-8F, 9F, -7F); + Shape6.setTextureSize(128, 128); + Shape6.mirror = true; + setRotation(Shape6, 0F, 0F, 0F); + Shape7 = new ModelRenderer(this, 0, 73); + Shape7.addBox(0F, 0F, 0F, 14, 15, 1); + Shape7.setRotationPoint(-8F, 9F, -8F); + Shape7.setTextureSize(128, 128); + Shape7.mirror = true; + setRotation(Shape7, 0F, 0F, 0F); + Shape4 = new ModelRenderer(this, 0, 92); + Shape4.addBox(0F, 0F, 0F, 16, 1, 16); + Shape4.setRotationPoint(-8F, 8F, -8F); + Shape4.setTextureSize(128, 128); + Shape4.mirror = true; + setRotation(Shape4, 0F, 0F, 0F); + } + + public void renderCorner(float f5) + { + Shape1.render(f5); + Shape2.render(f5); + Shape3.render(f5); + Shape6.render(f5); + Shape7.render(f5); + Shape4.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/FM/src/dark/fluid/client/model/ModelEngine.java b/FM/src/dark/fluid/client/model/ModelEngine.java new file mode 100644 index 000000000..7339c7447 --- /dev/null +++ b/FM/src/dark/fluid/client/model/ModelEngine.java @@ -0,0 +1,102 @@ +// Date: 8/24/2012 1:44:37 PM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package dark.fluid.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelEngine extends ModelBase +{ + //fields + ModelRenderer Base; + ModelRenderer top; + ModelRenderer TopPiston; + ModelRenderer BottomPiston; + ModelRenderer center; + ModelRenderer C1; + ModelRenderer C2; + + public ModelEngine() + { + textureWidth = 64; + textureHeight = 64; + + Base = new ModelRenderer(this, 0, 20); + Base.addBox(-6F, 0F, -6F, 12, 8, 12); + Base.setRotationPoint(0F, 16F, 0F); + Base.setTextureSize(64, 64); + Base.mirror = true; + setRotation(Base, 0F, 0F, 0F); + top = new ModelRenderer(this, 0, 0); + top.addBox(-6F, 0F, -6F, 12, 8, 12); + top.setRotationPoint(0F, -8F, 0F); + top.setTextureSize(64, 64); + top.mirror = true; + setRotation(top, 0F, 0F, 0F); + TopPiston = new ModelRenderer(this, 0, 52); + TopPiston.addBox(-2F, 0F, -2F, 4, 8, 4); + TopPiston.setRotationPoint(0F, 0F, 0F); + TopPiston.setTextureSize(64, 64); + TopPiston.mirror = true; + setRotation(TopPiston, 0F, 0F, 0F); + BottomPiston = new ModelRenderer(this, 16, 52); + BottomPiston.addBox(-2F, 0F, -2F, 4, 8, 4); + BottomPiston.setRotationPoint(0F, 8F, 0F); + BottomPiston.setTextureSize(64, 64); + BottomPiston.mirror = true; + setRotation(BottomPiston, 0F, 0F, 0F); + center = new ModelRenderer(this, 32, 52); + center.addBox(-3F, 0F, -3F, 6, 6, 6); + //center.setRotationPoint(0F, 5F, 0F); + center.setTextureSize(64, 64); + center.mirror = true; + setRotation(center, 0F, 0F, 0F); + C1 = new ModelRenderer(this, 0, 41); + C1.addBox(-2F, -3F, 0F, 4, 6, 3); + C1.setRotationPoint(0F, 8F, 3F); + C1.setTextureSize(64, 64); + C1.mirror = true; + setRotation(C1, 0F, 0F, 0F); + C2 = new ModelRenderer(this, 15, 41); + C2.addBox(-2F, -3F, -3F, 4, 6, 3); + C2.setRotationPoint(0F, 8F, -3F); + C2.setTextureSize(64, 64); + C2.mirror = true; + setRotation(C2, 0F, 0F, 0F); + } + + public void renderBot(float f5) + { + Base.render(f5); + BottomPiston.render(f5); + } + + public void renderTop(float f5) + { + top.render(f5); + TopPiston.render(f5); + C1.render(f5); + C2.render(f5); + } + + public void renderMid(float f5, float p) + { + + center.setRotationPoint(0F, p, 0F); + center.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/FM/src/dark/fluid/client/model/ModelFurnace.java b/FM/src/dark/fluid/client/model/ModelFurnace.java new file mode 100644 index 000000000..499694f34 --- /dev/null +++ b/FM/src/dark/fluid/client/model/ModelFurnace.java @@ -0,0 +1,69 @@ +// Date: 8/14/2012 3:02:31 AM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package dark.fluid.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelFurnace extends ModelBase +{ + //fields + ModelRenderer Body; + ModelRenderer top; + ModelRenderer bottom; + ModelRenderer Shape1; + + public ModelFurnace() + { + textureWidth = 256; + textureHeight = 256; + + Body = new ModelRenderer(this, 0, 0); + Body.addBox(-8F, -8F, -8F, 14, 14, 12); + Body.setRotationPoint(1F, 18F, 1F); + Body.setTextureSize(64, 32); + Body.mirror = true; + setRotation(Body, 0F, 0F, 0F); + top = new ModelRenderer(this, 80, 20); + top.addBox(-8F, 0F, -8F, 16, 2, 16); + top.setRotationPoint(0F, 8F, 0F); + top.setTextureSize(64, 32); + top.mirror = true; + setRotation(top, 0F, 0F, 0F); + bottom = new ModelRenderer(this, 80, 0); + bottom.addBox(-8F, 22F, -8F, 16, 2, 16); + bottom.setRotationPoint(0F, 0F, 0F); + bottom.setTextureSize(64, 32); + bottom.mirror = true; + setRotation(bottom, 0F, 0F, 0F); + Shape1 = new ModelRenderer(this, 0, 27); + Shape1.addBox(-4F, -4F, 0F, 10, 8, 1); + Shape1.setRotationPoint(-1F, 16F, 5F); + Shape1.setTextureSize(64, 32); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + } + + public void genRender(float f5) + { + Body.render(f5); + top.render(f5); + bottom.render(f5); + Shape1.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/FM/src/dark/fluid/client/model/ModelGearPiston.java b/FM/src/dark/fluid/client/model/ModelGearPiston.java new file mode 100644 index 000000000..942517fd0 --- /dev/null +++ b/FM/src/dark/fluid/client/model/ModelGearPiston.java @@ -0,0 +1,386 @@ +// Date: 10/1/2012 12:32:21 AM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package dark.fluid.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelGearPiston extends ModelBase +{ + //fields + ModelRenderer PistonCover; + ModelRenderer RSpiston; + ModelRenderer LSpiston; + ModelRenderer RodPiston; + ModelRenderer Base; + ModelRenderer Front; + ModelRenderer BackCC; + ModelRenderer RightPipe; + ModelRenderer FrontCC; + ModelRenderer LeftCC; + ModelRenderer FrontPipe; + ModelRenderer Right; + ModelRenderer RightCC; + ModelRenderer Back; + ModelRenderer BackPipe; + ModelRenderer Left; + ModelRenderer LeftPipe; + ModelRenderer RigthF4; + ModelRenderer LeftF4; + ModelRenderer LeftF3; + ModelRenderer LeftF2; + ModelRenderer LeftF1; + ModelRenderer RigthF3; + ModelRenderer RigthF2; + ModelRenderer RigthF1; + ModelRenderer RigthGCC; + ModelRenderer RightSlide; + ModelRenderer midRod; + ModelRenderer RightRod2; + ModelRenderer LeftGCC; + ModelRenderer LeftRod2; + ModelRenderer LeftSlide2; + + public ModelGearPiston() + { + textureWidth = 128; + textureHeight = 128; + + PistonCover = new ModelRenderer(this, 13, 31); + PistonCover.addBox(0F, -9F, -3F, 6, 10, 6); + PistonCover.setRotationPoint(-3F, 20F, 0F); + PistonCover.setTextureSize(128, 128); + PistonCover.mirror = true; + setRotation(PistonCover, 0F, 0F, 0F); + RSpiston = new ModelRenderer(this, 0, 32); + RSpiston.addBox(-3F, -2F, -2F, 1, 7, 4); + RSpiston.setRotationPoint(1F, 3F, 0F); + RSpiston.setTextureSize(128, 128); + RSpiston.mirror = true; + setRotation(RSpiston, 0F, 0F, 0F); + LSpiston = new ModelRenderer(this, 0, 32); + LSpiston.addBox(-1F, -2F, -2F, 1, 7, 4); + LSpiston.setRotationPoint(2F, 3F, 0F); + LSpiston.setTextureSize(128, 128); + LSpiston.mirror = true; + setRotation(LSpiston, 0F, 0F, 0F); + RodPiston = new ModelRenderer(this, 0, 59); + RodPiston.addBox(-1F, -2F, -1.5F, 2, 13, 3); + RodPiston.setRotationPoint(0F, 8F, 0F); + RodPiston.setTextureSize(128, 128); + RodPiston.mirror = true; + setRotation(RodPiston, 0F, 0F, 0F); + Base = new ModelRenderer(this, 12, 49); + Base.addBox(0F, 0F, 0F, 10, 5, 10); + Base.setRotationPoint(-5F, 19F, -5F); + Base.setTextureSize(128, 128); + Base.mirror = true; + setRotation(Base, 0F, 0F, 0F); + Front = new ModelRenderer(this, 28, 68); + Front.addBox(-3F, 0F, 0F, 6, 12, 1); + Front.setRotationPoint(0F, 12F, -7F); + Front.setTextureSize(128, 128); + Front.mirror = true; + setRotation(Front, 0F, 0F, 0F); + BackCC = new ModelRenderer(this, 43, 68); + BackCC.addBox(-2F, -2F, 1F, 4, 4, 1); + BackCC.setRotationPoint(0F, 16F, 6F); + BackCC.setTextureSize(128, 128); + BackCC.mirror = true; + setRotation(BackCC, 0F, 0F, 0F); + RightPipe = new ModelRenderer(this, 12, 87); + RightPipe.addBox(0F, 0F, -2F, 2, 10, 4); + RightPipe.setRotationPoint(-6F, 14F, 0F); + RightPipe.setTextureSize(128, 128); + RightPipe.mirror = true; + setRotation(RightPipe, 0F, 0F, 0F); + FrontCC = new ModelRenderer(this, 43, 68); + FrontCC.addBox(-2F, -2F, -1F, 4, 4, 1); + FrontCC.setRotationPoint(0F, 16F, -7F); + FrontCC.setTextureSize(128, 128); + FrontCC.mirror = true; + setRotation(FrontCC, 0F, 0F, 0F); + LeftCC = new ModelRenderer(this, 43, 74); + LeftCC.addBox(0F, -2F, -2F, 1, 4, 4); + LeftCC.setRotationPoint(7F, 16F, 0F); + LeftCC.setTextureSize(128, 128); + LeftCC.mirror = true; + setRotation(LeftCC, 0F, 0F, 0F); + FrontPipe = new ModelRenderer(this, 28, 82); + FrontPipe.addBox(-2F, 0F, 0F, 4, 10, 2); + FrontPipe.setRotationPoint(0F, 14F, -6F); + FrontPipe.setTextureSize(128, 128); + FrontPipe.mirror = true; + setRotation(FrontPipe, 0F, 0F, 0F); + Right = new ModelRenderer(this, 12, 68); + Right.addBox(0F, 0F, -3F, 1, 12, 6); + Right.setRotationPoint(-7F, 12F, 0F); + Right.setTextureSize(128, 128); + Right.mirror = true; + setRotation(Right, 0F, 0F, 0F); + RightCC = new ModelRenderer(this, 43, 74); + RightCC.addBox(-1F, -2F, -2F, 1, 4, 4); + RightCC.setRotationPoint(-7F, 16F, 0F); + RightCC.setTextureSize(128, 128); + RightCC.mirror = true; + setRotation(RightCC, 0F, 0F, 0F); + Back = new ModelRenderer(this, 28, 68); + Back.addBox(-3F, 0F, 0F, 6, 12, 1); + Back.setRotationPoint(0F, 12F, 6F); + Back.setTextureSize(128, 128); + Back.mirror = true; + setRotation(Back, 0F, 0F, 0F); + BackPipe = new ModelRenderer(this, 28, 82); + BackPipe.addBox(-2F, 0F, -2F, 4, 10, 2); + BackPipe.setRotationPoint(0F, 14F, 6F); + BackPipe.setTextureSize(128, 128); + BackPipe.mirror = true; + setRotation(BackPipe, 0F, 0F, 0F); + Left = new ModelRenderer(this, 12, 68); + Left.addBox(0F, 0F, -3F, 1, 12, 6); + Left.setRotationPoint(6F, 12F, 0F); + Left.setTextureSize(128, 128); + Left.mirror = true; + setRotation(Left, 0F, 0F, 0F); + LeftPipe = new ModelRenderer(this, 12, 87); + LeftPipe.addBox(-2F, 0F, -2F, 2, 10, 4); + LeftPipe.setRotationPoint(6F, 14F, 0F); + LeftPipe.setTextureSize(128, 128); + LeftPipe.mirror = true; + setRotation(LeftPipe, 0F, 0F, 0F); + RigthF4 = new ModelRenderer(this, 0, 56); + RigthF4.addBox(-2F, 1F, 1F, 2, 1, 1); + RigthF4.setRotationPoint(-8F, 0F, 0F); + RigthF4.setTextureSize(128, 128); + RigthF4.mirror = true; + setRotation(RigthF4, 0F, 0F, 0F); + LeftF4 = new ModelRenderer(this, 0, 56); + LeftF4.addBox(0F, 1F, 1F, 2, 1, 1); + LeftF4.setRotationPoint(8F, 0F, 0F); + LeftF4.setTextureSize(128, 128); + LeftF4.mirror = true; + setRotation(LeftF4, 0.7853982F, 0F, 0F); + LeftF3 = new ModelRenderer(this, 0, 56); + LeftF3.addBox(0F, 1F, -2F, 2, 1, 1); + LeftF3.setRotationPoint(8F, 0F, 0F); + LeftF3.setTextureSize(128, 128); + LeftF3.mirror = true; + setRotation(LeftF3, 0.7853982F, 0F, 0F); + LeftF2 = new ModelRenderer(this, 0, 56); + LeftF2.addBox(0F, -2F, -2F, 2, 1, 1); + LeftF2.setRotationPoint(8F, 0F, 0F); + LeftF2.setTextureSize(128, 128); + LeftF2.mirror = true; + setRotation(LeftF2, 0.7853982F, 0F, 0F); + LeftF1 = new ModelRenderer(this, 0, 56); + LeftF1.addBox(0F, -2F, 1F, 2, 1, 1); + LeftF1.setRotationPoint(8F, 0F, 0F); + LeftF1.setTextureSize(128, 128); + LeftF1.mirror = true; + setRotation(LeftF1, 0.7853982F, 0F, 0F); + RigthF3 = new ModelRenderer(this, 0, 56); + RigthF3.addBox(-2F, 1F, -2F, 2, 1, 1); + RigthF3.setRotationPoint(-8F, 0F, 0F); + RigthF3.setTextureSize(128, 128); + RigthF3.mirror = true; + setRotation(RigthF3, 0F, 0F, 0F); + RigthF2 = new ModelRenderer(this, 0, 56); + RigthF2.addBox(-2F, -2F, 1F, 2, 1, 1); + RigthF2.setRotationPoint(-8F, 0F, 0F); + RigthF2.setTextureSize(128, 128); + RigthF2.mirror = true; + setRotation(RigthF2, 0F, 0F, 0F); + RigthF1 = new ModelRenderer(this, 0, 56); + RigthF1.addBox(-2F, -2F, -2F, 2, 1, 1); + RigthF1.setRotationPoint(-8F, 0F, 0F); + RigthF1.setTextureSize(128, 128); + RigthF1.mirror = true; + setRotation(RigthF1, 0F, 0F, 0F); + RigthGCC = new ModelRenderer(this, 12, 18); + RigthGCC.addBox(-2F, -2F, -2F, 2, 4, 4); + RigthGCC.setRotationPoint(-6F, 0F, 0F); + RigthGCC.setTextureSize(128, 128); + RigthGCC.mirror = true; + setRotation(RigthGCC, 0F, 0F, 0F); + RightSlide = new ModelRenderer(this, 0, 44); + RightSlide.addBox(0F, -2F, -2F, 1, 7, 4); + RightSlide.setRotationPoint(-4F, 0F, 0F); + RightSlide.setTextureSize(128, 128); + RightSlide.mirror = true; + setRotation(RightSlide, 0F, 0F, 0F); + LeftSlide2 = new ModelRenderer(this, 0, 27); + LeftSlide2.addBox(0F, 2F, -1F, 6, 2, 2); + LeftSlide2.setRotationPoint(-3F, 0F, 0F); + LeftSlide2.setTextureSize(128, 128); + LeftSlide2.mirror = true; + setRotation(LeftSlide2, 0F, 0F, 0F); + RightRod2 = new ModelRenderer(this, 0, 20); + RightRod2.addBox(0F, -1.5F, -1.5F, 2, 3, 3); + RightRod2.setRotationPoint(-6F, 0F, 0F); + RightRod2.setTextureSize(128, 128); + RightRod2.mirror = true; + setRotation(RightRod2, 0F, 0F, 0F); + LeftGCC = new ModelRenderer(this, 24, 18); + LeftGCC.addBox(-1F, -2F, -2F, 2, 4, 4); + LeftGCC.setRotationPoint(7F, 0F, 0F); + LeftGCC.setTextureSize(128, 128); + LeftGCC.mirror = true; + setRotation(LeftGCC, 0.7853982F, 0F, 0F); + LeftRod2 = new ModelRenderer(this, 0, 20); + LeftRod2.addBox(-3F, -1.5F, -1.5F, 2, 3, 3); + LeftRod2.setRotationPoint(7F, 0F, 0F); + LeftRod2.setTextureSize(128, 128); + LeftRod2.mirror = true; + setRotation(LeftRod2, 0F, 0F, 0F); + midRod = new ModelRenderer(this, 0, 32); + midRod.addBox(-1F, -2F, -2F, 1, 7, 4); + midRod.setRotationPoint(4F, 0F, 0F); + midRod.setTextureSize(128, 128); + midRod.mirror = true; + setRotation(midRod, 0F, 0F, 0F); + } + + public void renderBody(float f5) + { + Base.render(f5); + PistonCover.render(f5); + + } + + public void renderGear(float f5) + { + //Rod connectors + LeftF4.render(f5); + LeftF3.render(f5); + LeftF2.render(f5); + LeftF1.render(f5); + RigthF4.render(f5); + RigthF3.render(f5); + RigthF2.render(f5); + RigthF1.render(f5); + RigthGCC.render(f5); + LeftGCC.render(f5); + } + + public void renderR(float f5, int pos) + { + switch (pos) + { + case 0: + RSpiston.setRotationPoint(1F, 3F, 0F); + LSpiston.setRotationPoint(2F, 3F, 0F); + RodPiston.setRotationPoint(0F, 8F, 0F); + setRotation(RSpiston, 0F, 0F, 0F); + setRotation(LSpiston, 0F, 0F, 0F); + break; + case 1: + RodPiston.setRotationPoint(0F, 6F, 0F); + LSpiston.setRotationPoint(2F, 2F, 2F); + RSpiston.setRotationPoint(1F, 2F, 2F); + setRotation(LSpiston, -0.5235988F, 0F, 0F); + setRotation(RSpiston, -0.5235988F, 0F, 0F); + break; + case 2: + LSpiston.setRotationPoint(2F, 0F, 3F); + RSpiston.setRotationPoint(1F, 0F, 3F); + RodPiston.setRotationPoint(0F, 3F, 0F); + setRotation(RSpiston, -1.047198F, 0F, 0F); + setRotation(LSpiston, -1.047198F, 0F, 0F); + break; + case 3: + LSpiston.setRotationPoint(2F, -2F, 2F); + RSpiston.setRotationPoint(1F, -2F, 2F); + RodPiston.setRotationPoint(0F, 1F, 0F); + setRotation(LSpiston, -0.7853982F, 0F, 0F); + setRotation(RSpiston, -0.7853982F, 0F, 0F); + break; + case 4: + LSpiston.setRotationPoint(2F, -3F, 0F); + RSpiston.setRotationPoint(1F, -3F, 0F); + RodPiston.setRotationPoint(0F, 1F, 0F); + setRotation(LSpiston, 0F, 0F, 0F); + setRotation(RSpiston, 0F, 0F, 0F); + break; + case 5: + LSpiston.setRotationPoint(2F, -2F, -2F); + RSpiston.setRotationPoint(1F, -2F, -2F); + RodPiston.setRotationPoint(0F, 1F, 0F); + setRotation(LSpiston, 0.7853982F, 0F, 0F); + setRotation(RSpiston, 0.7853982F, 0F, 0F); + break; + case 6: + RSpiston.setRotationPoint(1F, 0F, -3F); + LSpiston.setRotationPoint(2F, 0F, -3F); + RodPiston.setRotationPoint(0F, 2F, 0F); + setRotation(RSpiston, 1.047198F, 0F, 0F); + setRotation(LSpiston, 1.047198F, 0F, 0F); + break; + case 7: + RodPiston.setRotationPoint(0F, 6F, 0F); + LSpiston.setRotationPoint(2F, 2F, -2F); + RSpiston.setRotationPoint(1F, 2F, -2F); + setRotation(LSpiston, 0.5235988F, 0F, 0F); + setRotation(RSpiston, 0.5235988F, 0F, 0F); + break; + } + //Piston Arm + RSpiston.render(f5); + LSpiston.render(f5); + RodPiston.render(f5); + //GearShaft + RightSlide.rotateAngleX = 0.7853982F * pos; + midRod.rotateAngleX = 0.7853982F * pos; + midRod.rotateAngleX = 0.7853982F * pos; + RightRod2.rotateAngleX = 0.7853982F * pos; + LeftRod2.rotateAngleX = 0.7853982F * pos; + LeftSlide2.rotateAngleX = 0.7853982F * pos; + RightSlide.render(f5); + midRod.render(f5); + RightRod2.render(f5); + LeftRod2.render(f5); + LeftSlide2.render(f5); + } + + public void renderLeft(float f5) + { + Left.render(f5); + LeftPipe.render(f5); + LeftCC.render(f5); + } + + public void renderRight(float f5) + { + Right.render(f5); + RightCC.render(f5); + RightPipe.render(f5); + } + + public void renderFront(float f5) + { + Front.render(f5); + FrontCC.render(f5); + FrontPipe.render(f5); + } + + public void renderBack(float f5) + { + Back.render(f5); + BackPipe.render(f5); + BackCC.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/FM/src/dark/fluid/client/model/ModelGenerator.java b/FM/src/dark/fluid/client/model/ModelGenerator.java new file mode 100644 index 000000000..254f61d3e --- /dev/null +++ b/FM/src/dark/fluid/client/model/ModelGenerator.java @@ -0,0 +1,125 @@ +// Date: 8/27/2012 3:20:21 PM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package dark.fluid.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelGenerator extends ModelBase +{ + //fields + ModelRenderer BasePlate; + ModelRenderer LeftConnection; + ModelRenderer RightConnection; + ModelRenderer Mid; + ModelRenderer Mid2; + ModelRenderer front; + ModelRenderer front2; + ModelRenderer front3; + ModelRenderer Mid3; + ModelRenderer FrontConnector; + + public ModelGenerator() + { + textureWidth = 128; + textureHeight = 128; + + BasePlate = new ModelRenderer(this, 0, 0); + BasePlate.addBox(-7F, 0F, -7F, 14, 1, 14); + BasePlate.setRotationPoint(0F, 23F, 0F); + BasePlate.setTextureSize(128, 128); + BasePlate.mirror = true; + setRotation(BasePlate, 0F, 0F, 0F); + LeftConnection = new ModelRenderer(this, 0, 112); + LeftConnection.addBox(-2F, -2F, -2F, 2, 4, 4); + LeftConnection.setRotationPoint(-6F, 16F, 0F); + LeftConnection.setTextureSize(128, 128); + LeftConnection.mirror = true; + setRotation(LeftConnection, 0F, 0F, 0F); + RightConnection = new ModelRenderer(this, 12, 112); + RightConnection.addBox(0F, -2F, -2F, 2, 4, 4); + RightConnection.setRotationPoint(6F, 16F, 0F); + RightConnection.setTextureSize(128, 128); + RightConnection.mirror = true; + setRotation(RightConnection, 0F, 0F, 0F); + Mid = new ModelRenderer(this, 0, 29); + Mid.addBox(-4F, 0F, -6F, 8, 12, 12); + Mid.setRotationPoint(0F, 10F, 0F); + Mid.setTextureSize(128, 128); + Mid.mirror = true; + setRotation(Mid, 0F, 0F, 0F); + Mid2 = new ModelRenderer(this, 0, 53); + Mid2.addBox(-6F, 0F, -6F, 12, 8, 12); + Mid2.setRotationPoint(0F, 12F, 0F); + Mid2.setTextureSize(128, 128); + Mid2.mirror = true; + setRotation(Mid2, 0F, 0F, 0F); + front = new ModelRenderer(this, 20, 15); + front.addBox(-2F, -4F, 0F, 4, 8, 1); + front.setRotationPoint(0F, 16F, -7F); + front.setTextureSize(128, 128); + front.mirror = true; + setRotation(front, 0F, 0F, 0F); + front2 = new ModelRenderer(this, 0, 24); + front2.addBox(-4F, -2F, 0F, 8, 4, 1); + front2.setRotationPoint(0F, 16F, -7F); + front2.setTextureSize(128, 128); + front2.mirror = true; + setRotation(front2, 0F, 0F, 0F); + front3 = new ModelRenderer(this, 0, 16); + front3.addBox(-3F, -3F, 0F, 6, 6, 1); + front3.setRotationPoint(0F, 16F, -7F); + front3.setTextureSize(128, 128); + front3.mirror = true; + setRotation(front3, 0F, 0F, 0F); + Mid3 = new ModelRenderer(this, 40, 29); + Mid3.addBox(-5F, -1F, -6F, 10, 10, 12); + Mid3.setRotationPoint(0F, 12F, 0F); + Mid3.setTextureSize(128, 128); + Mid3.mirror = true; + setRotation(Mid3, 0F, 0F, 0F); + FrontConnector = new ModelRenderer(this, 0, 120); + FrontConnector.addBox(-2F, 0F, -2F, 4, 4, 4); + FrontConnector.setRotationPoint(0F, 14F, -6F); + FrontConnector.setTextureSize(128, 128); + FrontConnector.mirror = true; + setRotation(FrontConnector, 0F, 0F, 0F); + } + + public void RenderMain(float f5) + { + BasePlate.render(f5); + Mid.render(f5); + Mid2.render(f5); + front.render(f5); + front2.render(f5); + front3.render(f5); + Mid3.render(f5); + FrontConnector.render(f5); + } + + public void RenderLeft(float f5) + { + LeftConnection.render(f5); + } + + public void RenderRight(float f5) + { + RightConnection.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/FM/src/dark/fluid/client/model/ModelLargePipe.java b/FM/src/dark/fluid/client/model/ModelLargePipe.java new file mode 100644 index 000000000..3e6b15de4 --- /dev/null +++ b/FM/src/dark/fluid/client/model/ModelLargePipe.java @@ -0,0 +1,213 @@ +// Date: 9/20/2012 12:00:21 AM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package dark.fluid.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelLargePipe extends ModelBase +{ + // fields + ModelRenderer Mid; + ModelRenderer RightPipe; + ModelRenderer RightInter; + ModelRenderer RightConnect; + ModelRenderer LeftInter; + ModelRenderer LeftPipe; + ModelRenderer LeftConnect; + ModelRenderer TopInter; + ModelRenderer TopPipe; + ModelRenderer TopConnect; + ModelRenderer BottomPipe; + ModelRenderer BottomInter; + ModelRenderer BottomConnect; + ModelRenderer BackPipe; + ModelRenderer BackInter; + ModelRenderer BackConnect; + ModelRenderer FrontInter; + ModelRenderer FrontPipe; + ModelRenderer FrontConnect; + + public ModelLargePipe() + { + textureWidth = 128; + textureHeight = 32; + + Mid = new ModelRenderer(this, 50, 13); + Mid.addBox(-3F, -3F, -3F, 6, 6, 6); + Mid.setRotationPoint(0F, 16F, 0F); + Mid.setTextureSize(128, 32); + Mid.mirror = true; + setRotation(Mid, 0F, 0F, 0F); + RightPipe = new ModelRenderer(this, 25, 0); + RightPipe.addBox(0F, -3F, -3F, 4, 6, 6); + RightPipe.setRotationPoint(3F, 16F, 0F); + RightPipe.setTextureSize(128, 32); + RightPipe.mirror = true; + setRotation(RightPipe, 0F, 0F, 0F); + RightInter = new ModelRenderer(this, 98, 0); + RightInter.addBox(0F, -4F, -4F, 1, 8, 8); + RightInter.setRotationPoint(2F, 16F, 0F); + RightInter.setTextureSize(128, 32); + RightInter.mirror = true; + setRotation(RightInter, 0F, 0F, 0F); + RightConnect = new ModelRenderer(this, 98, 0); + RightConnect.addBox(0F, -4F, -4F, 1, 8, 8); + RightConnect.setRotationPoint(7F, 16F, 0F); + RightConnect.setTextureSize(128, 32); + RightConnect.mirror = true; + setRotation(RightConnect, 0F, 0F, 0F); + LeftInter = new ModelRenderer(this, 98, 0); + LeftInter.addBox(-1F, -4F, -4F, 1, 8, 8); + LeftInter.setRotationPoint(-2F, 16F, 0F); + LeftInter.setTextureSize(128, 32); + LeftInter.mirror = true; + setRotation(LeftInter, 0F, 0F, 0F); + LeftPipe = new ModelRenderer(this, 25, 0); + LeftPipe.addBox(-4F, -3F, -3F, 4, 6, 6); + LeftPipe.setRotationPoint(-3F, 16F, 0F); + LeftPipe.setTextureSize(128, 32); + LeftPipe.mirror = true; + setRotation(LeftPipe, 0F, 0F, 0F); + LeftConnect = new ModelRenderer(this, 98, 0); + LeftConnect.addBox(-1F, -4F, -4F, 1, 8, 8); + LeftConnect.setRotationPoint(-7F, 16F, 0F); + LeftConnect.setTextureSize(128, 32); + LeftConnect.mirror = true; + setRotation(LeftConnect, 0F, 0F, 0F); + TopInter = new ModelRenderer(this, 77, 17); + TopInter.addBox(-4F, -1F, -4F, 8, 1, 8); + TopInter.setRotationPoint(0F, 14F, 0F); + TopInter.setTextureSize(128, 32); + TopInter.mirror = true; + setRotation(TopInter, 0F, 0F, 0F); + TopPipe = new ModelRenderer(this, 50, 0); + TopPipe.addBox(-3F, -4F, -3F, 6, 4, 6); + TopPipe.setRotationPoint(0F, 13F, 0F); + TopPipe.setTextureSize(128, 32); + TopPipe.mirror = true; + setRotation(TopPipe, 0F, 0F, 0F); + TopConnect = new ModelRenderer(this, 77, 17); + TopConnect.addBox(-4F, -1F, -4F, 8, 1, 8); + TopConnect.setRotationPoint(0F, 9F, 0F); + TopConnect.setTextureSize(128, 32); + TopConnect.mirror = true; + setRotation(TopConnect, 0F, 0F, 0F); + BottomPipe = new ModelRenderer(this, 50, 0); + BottomPipe.addBox(-3F, 0F, -3F, 6, 4, 6); + BottomPipe.setRotationPoint(0F, 19F, 0F); + BottomPipe.setTextureSize(128, 32); + BottomPipe.mirror = true; + setRotation(BottomPipe, 0F, 0F, 0F); + BottomInter = new ModelRenderer(this, 77, 17); + BottomInter.addBox(-4F, 0F, -4F, 8, 1, 8); + BottomInter.setRotationPoint(0F, 18F, 0F); + BottomInter.setTextureSize(128, 32); + BottomInter.mirror = true; + setRotation(BottomInter, 0F, 0F, 0F); + BottomConnect = new ModelRenderer(this, 77, 17); + BottomConnect.addBox(-4F, 0F, -4F, 8, 1, 8); + BottomConnect.setRotationPoint(0F, 23F, 0F); + BottomConnect.setTextureSize(128, 32); + BottomConnect.mirror = true; + setRotation(BottomConnect, 0F, 0F, 0F); + BackPipe = new ModelRenderer(this, 0, 0); + BackPipe.addBox(-3F, -3F, 0F, 6, 6, 4); + BackPipe.setRotationPoint(0F, 16F, 3F); + BackPipe.setTextureSize(128, 32); + BackPipe.mirror = true; + setRotation(BackPipe, 0F, 0F, 0F); + BackInter = new ModelRenderer(this, 0, 23); + BackInter.addBox(-4F, -4F, 0F, 8, 8, 1); + BackInter.setRotationPoint(0F, 16F, 2F); + BackInter.setTextureSize(128, 32); + BackInter.mirror = true; + setRotation(BackInter, 0F, 0F, 0F); + BackConnect = new ModelRenderer(this, 0, 23); + BackConnect.addBox(-4F, -4F, 0F, 8, 8, 1); + BackConnect.setRotationPoint(0F, 16F, 7F); + BackConnect.setTextureSize(128, 32); + BackConnect.mirror = true; + setRotation(BackConnect, 0F, 0F, 0F); + FrontInter = new ModelRenderer(this, 0, 23); + FrontInter.addBox(-4F, -4F, -1F, 8, 8, 1); + FrontInter.setRotationPoint(0F, 16F, -2F); + FrontInter.setTextureSize(128, 32); + FrontInter.mirror = true; + setRotation(FrontInter, 0F, 0F, 0F); + FrontPipe = new ModelRenderer(this, 0, 0); + FrontPipe.addBox(-3F, -3F, -4F, 6, 6, 4); + FrontPipe.setRotationPoint(0F, 16F, -3F); + FrontPipe.setTextureSize(128, 32); + FrontPipe.mirror = true; + setRotation(FrontPipe, 0F, 0F, 0F); + FrontConnect = new ModelRenderer(this, 0, 23); + FrontConnect.addBox(-4F, -4F, -1F, 8, 8, 1); + FrontConnect.setRotationPoint(0F, 16F, -7F); + FrontConnect.setTextureSize(128, 32); + FrontConnect.mirror = true; + setRotation(FrontConnect, 0F, 0F, 0F); + } + + public void renderMiddle() + { + Mid.render(0.0625F); + } + + public void renderBottom() + { + BottomPipe.render(0.0625F); + BottomConnect.render(0.0625F); + BottomInter.render(0.0625F); + } + + public void renderTop() + { + TopPipe.render(0.0625F); + TopConnect.render(0.0625F); + TopInter.render(0.0625F); + } + + public void renderLeft() + { + LeftPipe.render(0.0625F); + LeftConnect.render(0.0625F); + LeftInter.render(0.0625F); + } + + public void renderRight() + { + RightPipe.render(0.0625F); + RightConnect.render(0.0625F); + RightInter.render(0.0625F); + } + + public void renderBack() + { + BackPipe.render(0.0625F); + BackConnect.render(0.0625F); + BackInter.render(0.0625F); + } + + public void renderFront() + { + FrontPipe.render(0.0625F); + FrontConnect.render(0.0625F); + FrontInter.render(0.0625F); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/FM/src/dark/fluid/client/model/ModelLiquidTankCorner.java b/FM/src/dark/fluid/client/model/ModelLiquidTankCorner.java new file mode 100644 index 000000000..fdd07151c --- /dev/null +++ b/FM/src/dark/fluid/client/model/ModelLiquidTankCorner.java @@ -0,0 +1,135 @@ +package dark.fluid.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelLiquidTankCorner extends ModelBase +{ + // fields + ModelRenderer sOne; + ModelRenderer sTwo; + ModelRenderer d7; + ModelRenderer d5; + ModelRenderer d3; + ModelRenderer d4; + ModelRenderer d1; + ModelRenderer d6; + ModelRenderer d2; + ModelRenderer d8; + ModelRenderer d9; + ModelRenderer d10; + ModelRenderer face; + + public ModelLiquidTankCorner() + { + textureWidth = 128; + textureHeight = 128; + + sOne = new ModelRenderer(this, 0, 30); + sOne.addBox(-1F, 0F, -1F, 2, 16, 2); + sOne.setRotationPoint(-7F, 8F, 7F); + sOne.setTextureSize(128, 128); + sOne.mirror = true; + setRotation(sOne, 0F, 0F, 0F); + sTwo = new ModelRenderer(this, 0, 30); + sTwo.addBox(-1F, 0F, -1F, 2, 16, 2); + sTwo.setRotationPoint(-7F, 8F, -7F); + sTwo.setTextureSize(128, 128); + sTwo.mirror = true; + setRotation(sTwo, 0F, 0F, 0F); + d7 = new ModelRenderer(this, 43, 2); + d7.addBox(-1F, 0F, -1F, 2, 16, 12); + d7.setRotationPoint(-7F, 8F, -5F); + d7.setTextureSize(128, 128); + d7.mirror = true; + setRotation(d7, 0F, 0F, 0F); + d5 = new ModelRenderer(this, 9, 12); + d5.addBox(-1F, 0F, -1F, 14, 16, 2); + d5.setRotationPoint(-5F, 8F, 7F); + d5.setTextureSize(128, 128); + d5.mirror = true; + setRotation(d5, 0F, 0F, 0F); + d3 = new ModelRenderer(this, 9, 67); + d3.addBox(-1.5F, 0F, -1.3F, 20, 2, 2); + d3.setRotationPoint(-6F, 22F, -6F); + d3.setTextureSize(128, 128); + d3.mirror = true; + setRotation(d3, 0F, -0.7853982F, 0F); + d4 = new ModelRenderer(this, 9, 88); + d4.addBox(0F, 0F, -9F, 5, 2, 4); + d4.setRotationPoint(-6F, 22F, 6F); + d4.setTextureSize(128, 128); + d4.mirror = true; + setRotation(d4, 0F, 0F, 0F); + d1 = new ModelRenderer(this, 9, 67); + d1.addBox(-1.5F, 0F, -1.3F, 20, 2, 2); + d1.setRotationPoint(-6F, 8F, -6F); + d1.setTextureSize(128, 128); + d1.mirror = true; + setRotation(d1, 0F, -0.7853982F, 0F); + d6 = new ModelRenderer(this, 9, 75); + d6.addBox(-1.5F, 0F, -1.3F, 17, 2, 2); + d6.setRotationPoint(-6F, 22F, -4F); + d6.setTextureSize(128, 128); + d6.mirror = true; + setRotation(d6, 0F, -0.7853982F, 0F); + d2 = new ModelRenderer(this, 9, 80); + d2.addBox(0F, 0F, -5F, 9, 2, 5); + d2.setRotationPoint(-6F, 22F, 6F); + d2.setTextureSize(128, 128); + d2.mirror = true; + setRotation(d2, 0F, 0F, 0F); + d8 = new ModelRenderer(this, 9, 75); + d8.addBox(-1.5F, 0F, -1.3F, 17, 2, 2); + d8.setRotationPoint(-6F, 8F, -4F); + d8.setTextureSize(128, 128); + d8.mirror = true; + setRotation(d8, 0F, -0.7853982F, 0F); + d9 = new ModelRenderer(this, 9, 88); + d9.addBox(0F, 0F, -9F, 5, 2, 4); + d9.setRotationPoint(-6F, 8F, 6F); + d9.setTextureSize(128, 128); + d9.mirror = true; + setRotation(d9, 0F, 0F, 0F); + d10 = new ModelRenderer(this, 9, 80); + d10.addBox(0F, 0F, -5F, 9, 2, 5); + d10.setRotationPoint(-6F, 8F, 6F); + d10.setTextureSize(128, 128); + d10.mirror = true; + setRotation(d10, 0F, 0F, 0F); + face = new ModelRenderer(this, 0, 50); + face.addBox(-8.5F, 0F, 0F, 17, 14, 2); + face.setRotationPoint(0F, 9F, 0F); + face.setTextureSize(128, 128); + face.mirror = true; + setRotation(face, 0F, -0.7853982F, 0F); + } + + public void render(float f5) + { + sOne.render(f5); + sTwo.render(f5); + d7.render(f5); + d5.render(f5); + d3.render(f5); + d4.render(f5); + d1.render(f5); + d6.render(f5); + d2.render(f5); + d8.render(f5); + d9.render(f5); + d10.render(f5); + face.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/FM/src/dark/fluid/client/model/ModelPump.java b/FM/src/dark/fluid/client/model/ModelPump.java new file mode 100644 index 000000000..7b16f5bab --- /dev/null +++ b/FM/src/dark/fluid/client/model/ModelPump.java @@ -0,0 +1,294 @@ +// Date: 1/22/2013 9:59:56 AM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package dark.fluid.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelPump extends ModelBase +{ + // fields + ModelRenderer Body; + ModelRenderer pipecc1; + ModelRenderer pipecc3; + ModelRenderer wheelcenter; + ModelRenderer wheelcenter2; + ModelRenderer joint; + ModelRenderer wheelcc0; + ModelRenderer wheelcc1; + ModelRenderer wheelcc2; + ModelRenderer wheelcc3; + ModelRenderer wheelcc4; + ModelRenderer wheelcc5; + ModelRenderer wheelcc6; + ModelRenderer wheelcc7; + ModelRenderer wheelBrace; + ModelRenderer piston_top; + ModelRenderer piston; + ModelRenderer wheelBrace2; + ModelRenderer joint2; + ModelRenderer w2; + ModelRenderer w22; + ModelRenderer w2cc; + ModelRenderer w2cc1; + ModelRenderer w2cc2; + ModelRenderer w2cc3; + ModelRenderer w2cc4; + ModelRenderer w2cc5; + ModelRenderer w2cc6; + ModelRenderer w2cc7; + ModelRenderer side7; + ModelRenderer side8; + + public ModelPump() + { + textureWidth = 128; + textureHeight = 128; + + Body = new ModelRenderer(this, 0, 109); + Body.addBox(-3F, 0F, -3F, 6, 12, 6); + Body.setRotationPoint(0F, 12F, 0F); + Body.setTextureSize(128, 128); + Body.mirror = true; + setRotation(Body, 0F, 0F, 0F); + pipecc1 = new ModelRenderer(this, 21, 92); + pipecc1.addBox(-3.5F, -3.5F, 3F, 7, 7, 5); + pipecc1.setRotationPoint(0F, 16F, 0F); + pipecc1.setTextureSize(128, 128); + pipecc1.mirror = true; + setRotation(pipecc1, 0F, 1.570796F, 0F); + pipecc3 = new ModelRenderer(this, 8, 50); + pipecc3.addBox(-3.5F, -4F, 3F, 7, 5, 5); + pipecc3.setRotationPoint(0F, 16F, 0F); + pipecc3.setTextureSize(128, 128); + pipecc3.mirror = true; + setRotation(pipecc3, 0F, 3.141593F, 0F); + wheelcenter = new ModelRenderer(this, 0, 25); + wheelcenter.addBox(0F, -2.5F, -2.5F, 1, 5, 5); + wheelcenter.setRotationPoint(-5F, 18F, 0F); + wheelcenter.setTextureSize(128, 128); + wheelcenter.mirror = true; + setRotation(wheelcenter, 0F, 0F, 0F); + wheelcenter2 = new ModelRenderer(this, 0, 25); + wheelcenter2.addBox(0F, -2.5F, -2.5F, 1, 5, 5); + wheelcenter2.setRotationPoint(-5F, 18F, 0F); + wheelcenter2.setTextureSize(128, 128); + wheelcenter2.mirror = true; + setRotation(wheelcenter2, 0.7853982F, 0F, 0F); + joint = new ModelRenderer(this, 0, 18); + joint.addBox(0F, -1.5F, -1.5F, 1, 3, 3); + joint.setRotationPoint(-4F, 18F, 0F); + joint.setTextureSize(128, 128); + joint.mirror = true; + setRotation(joint, 0F, 0F, 0F); + wheelcc0 = new ModelRenderer(this, 0, 0); + wheelcc0.addBox(0F, -4.5F, -2F, 1, 1, 4); + wheelcc0.setRotationPoint(-5F, 18F, 0F); + wheelcc0.setTextureSize(128, 128); + wheelcc0.mirror = true; + setRotation(wheelcc0, 1.570796F, 0F, 0F); + wheelcc1 = new ModelRenderer(this, 0, 0); + wheelcc1.addBox(0F, -4.5F, -2F, 1, 1, 4); + wheelcc1.setRotationPoint(-5F, 18F, 0F); + wheelcc1.setTextureSize(128, 128); + wheelcc1.mirror = true; + setRotation(wheelcc1, 0F, 0F, 0F); + wheelcc2 = new ModelRenderer(this, 0, 0); + wheelcc2.addBox(0F, -4.5F, -2F, 1, 1, 4); + wheelcc2.setRotationPoint(-5F, 18F, 0F); + wheelcc2.setTextureSize(128, 128); + wheelcc2.mirror = true; + setRotation(wheelcc2, -1.570796F, 0F, 0F); + wheelcc3 = new ModelRenderer(this, 0, 0); + wheelcc3.addBox(0F, -4.5F, -2F, 1, 1, 4); + wheelcc3.setRotationPoint(-5F, 18F, 0F); + wheelcc3.setTextureSize(128, 128); + wheelcc3.mirror = true; + setRotation(wheelcc3, 3.141593F, 0F, 0F); + wheelcc4 = new ModelRenderer(this, 0, 0); + wheelcc4.addBox(0F, -4.5F, -2F, 1, 1, 4); + wheelcc4.setRotationPoint(-5F, 18F, 0F); + wheelcc4.setTextureSize(128, 128); + wheelcc4.mirror = true; + setRotation(wheelcc4, 0.7853982F, 0F, 0F); + wheelcc5 = new ModelRenderer(this, 0, 0); + wheelcc5.addBox(0F, -4.5F, -2F, 1, 1, 4); + wheelcc5.setRotationPoint(-5F, 18F, 0F); + wheelcc5.setTextureSize(128, 128); + wheelcc5.mirror = true; + setRotation(wheelcc5, -2.356194F, 0F, 0F); + wheelcc6 = new ModelRenderer(this, 0, 0); + wheelcc6.addBox(0F, -4.5F, -2F, 1, 1, 4); + wheelcc6.setRotationPoint(-5F, 18F, 0F); + wheelcc6.setTextureSize(128, 128); + wheelcc6.mirror = true; + setRotation(wheelcc6, -0.7853982F, 0F, 0F); + wheelcc7 = new ModelRenderer(this, 0, 0); + wheelcc7.addBox(0F, -4.5F, -2F, 1, 1, 4); + wheelcc7.setRotationPoint(-5F, 18F, 0F); + wheelcc7.setTextureSize(128, 128); + wheelcc7.mirror = true; + setRotation(wheelcc7, 2.356194F, 0F, 0F); + wheelBrace = new ModelRenderer(this, 27, 5); + wheelBrace.addBox(0F, -1.5F, -1.5F, 1, 8, 3); + wheelBrace.setRotationPoint(-6F, 18F, 0F); + wheelBrace.setTextureSize(128, 128); + wheelBrace.mirror = true; + setRotation(wheelBrace, 0F, 0F, 0F); + piston_top = new ModelRenderer(this, 0, 81); + piston_top.addBox(-3F, 0F, -3F, 6, 1, 6); + piston_top.setRotationPoint(0F, 10F, 0F); + piston_top.setTextureSize(128, 128); + piston_top.mirror = true; + setRotation(piston_top, 0F, 0F, 0F); + piston = new ModelRenderer(this, 0, 90); + piston.addBox(-2.5F, 0F, -2.5F, 5, 12, 5); + piston.setRotationPoint(0F, 11F, 0F); + piston.setTextureSize(128, 128); + piston.mirror = true; + setRotation(piston, 0F, 0F, 0F); + wheelBrace2 = new ModelRenderer(this, 26, 18); + wheelBrace2.addBox(0F, 0F, -1.5F, 2, 1, 3); + wheelBrace2.setRotationPoint(-5F, 23F, 0F); + wheelBrace2.setTextureSize(128, 128); + wheelBrace2.mirror = true; + setRotation(wheelBrace2, 0F, 0F, 0F); + joint2 = new ModelRenderer(this, 0, 14); + joint2.addBox(0F, -0.5F, -0.5F, 1, 1, 1); + joint2.setRotationPoint(-4F, 14F, -6F); + joint2.setTextureSize(128, 128); + joint2.mirror = true; + setRotation(joint2, 0F, 0F, 0F); + w2 = new ModelRenderer(this, 0, 55); + w2.addBox(0F, -1F, -1F, 1, 2, 2); + w2.setRotationPoint(-5F, 14F, -6F); + w2.setTextureSize(128, 128); + w2.mirror = true; + setRotation(w2, 0.7853982F, 0F, 0F); + w22 = new ModelRenderer(this, 0, 55); + w22.addBox(0F, -1F, -1F, 1, 2, 2); + w22.setRotationPoint(-5F, 14F, -6F); + w22.setTextureSize(128, 128); + w22.mirror = true; + setRotation(w22, 0F, 0F, 0F); + w2cc = new ModelRenderer(this, 0, 50); + w2cc.addBox(0F, 1.3F, -1F, 1, 1, 2); + w2cc.setRotationPoint(-5F, 14F, -6F); + w2cc.setTextureSize(128, 128); + w2cc.mirror = true; + setRotation(w2cc, 1.570796F, 0F, 0F); + w2cc1 = new ModelRenderer(this, 0, 50); + w2cc1.addBox(0F, 1.3F, -1F, 1, 1, 2); + w2cc1.setRotationPoint(-5F, 14F, -6F); + w2cc1.setTextureSize(128, 128); + w2cc1.mirror = true; + setRotation(w2cc1, 0.7853982F, 0F, 0F); + w2cc2 = new ModelRenderer(this, 0, 50); + w2cc2.addBox(0F, 1.3F, -1F, 1, 1, 2); + w2cc2.setRotationPoint(-5F, 14F, -6F); + w2cc2.setTextureSize(128, 128); + w2cc2.mirror = true; + setRotation(w2cc2, 0F, 0F, 0F); + w2cc3 = new ModelRenderer(this, 0, 50); + w2cc3.addBox(0F, 1.3F, -1F, 1, 1, 2); + w2cc3.setRotationPoint(-5F, 14F, -6F); + w2cc3.setTextureSize(128, 128); + w2cc3.mirror = true; + setRotation(w2cc3, -0.7853982F, 0F, 0F); + w2cc4 = new ModelRenderer(this, 0, 50); + w2cc4.addBox(0F, 1.3F, -1F, 1, 1, 2); + w2cc4.setRotationPoint(-5F, 14F, -6F); + w2cc4.setTextureSize(128, 128); + w2cc4.mirror = true; + setRotation(w2cc4, -1.570796F, 0F, 0F); + w2cc5 = new ModelRenderer(this, 0, 50); + w2cc5.addBox(0F, 1.3F, -1F, 1, 1, 2); + w2cc5.setRotationPoint(-5F, 14F, -6F); + w2cc5.setTextureSize(128, 128); + w2cc5.mirror = true; + setRotation(w2cc5, -2.356194F, 0F, 0F); + w2cc6 = new ModelRenderer(this, 0, 50); + w2cc6.addBox(0F, 1.3F, -1F, 1, 1, 2); + w2cc6.setRotationPoint(-5F, 14F, -6F); + w2cc6.setTextureSize(128, 128); + w2cc6.mirror = true; + setRotation(w2cc6, 3.141593F, 0F, 0F); + w2cc7 = new ModelRenderer(this, 0, 50); + w2cc7.addBox(0F, 1.3F, -1F, 1, 1, 2); + w2cc7.setRotationPoint(-5F, 14F, -6F); + w2cc7.setTextureSize(128, 128); + w2cc7.mirror = true; + setRotation(w2cc7, -3.926991F, 0F, 0F); + side7 = new ModelRenderer(this, 0, 65); + side7.addBox(-2.5F, -4F, 3F, 5, 7, 4); + side7.setRotationPoint(0F, 21F, 0F); + side7.setTextureSize(128, 128); + side7.mirror = true; + setRotation(side7, 0F, 3.141593F, 0F); + side8 = new ModelRenderer(this, 25, 111); + side8.addBox(-2.5F, 0F, 3F, 5, 11, 3); + side8.setRotationPoint(0F, 13F, 0F); + side8.setTextureSize(128, 128); + side8.mirror = true; + setRotation(side8, 0F, 0F, 0F); + } + + public void render(float f5) + { + Body.render(f5); + pipecc1.render(f5); + pipecc3.render(f5); + + joint.render(f5); + + wheelBrace.render(f5); + piston_top.render(f5); + piston.render(f5); + wheelBrace2.render(f5); + joint2.render(f5); + + side7.render(f5); + side8.render(f5); + } + + public void renderMotion(float f5, int i) + { + //wheel 1 + wheelcenter.render(f5); + wheelcenter2.render(f5); + wheelcc0.render(f5); + wheelcc1.render(f5); + wheelcc2.render(f5); + wheelcc3.render(f5); + wheelcc4.render(f5); + wheelcc5.render(f5); + wheelcc6.render(f5); + wheelcc7.render(f5); + // wheel 2 + w2.render(f5); + w22.render(f5); + w2cc.render(f5); + w2cc1.render(f5); + w2cc2.render(f5); + w2cc3.render(f5); + w2cc4.render(f5); + w2cc5.render(f5); + w2cc6.render(f5); + w2cc7.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/FM/src/dark/fluid/client/model/ModelReleaseValve.java b/FM/src/dark/fluid/client/model/ModelReleaseValve.java new file mode 100644 index 000000000..f0419b298 --- /dev/null +++ b/FM/src/dark/fluid/client/model/ModelReleaseValve.java @@ -0,0 +1,137 @@ +// Date: 1/7/2013 12:20:13 PM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package dark.fluid.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelReleaseValve extends ModelBase +{ + + // fields + ModelRenderer ValveStem; + ModelRenderer ValveWheelCenter; + ModelRenderer ValveRest; + ModelRenderer WheelBar3; + ModelRenderer WheelBar4; + ModelRenderer Wheel; + ModelRenderer Wheel2; + ModelRenderer Wheel3; + ModelRenderer Wheel4; + ModelRenderer WheelB; + ModelRenderer WheelB2; + ModelRenderer WheelB3; + ModelRenderer WheelB4; + ModelRenderer[] renders; + + public ModelReleaseValve() + { + textureWidth = 128; + textureHeight = 32; + + ValveStem = new ModelRenderer(this, 50, 21); + ValveStem.addBox(-1F, -6F, -1F, 2, 3, 2); + ValveStem.setRotationPoint(0F, 16F, 0F); + ValveStem.setTextureSize(128, 32); + ValveStem.mirror = true; + setRotation(ValveStem, 0F, 0F, 0F); + ValveWheelCenter = new ModelRenderer(this, 50, 17); + ValveWheelCenter.addBox(-0.5F, -7.5F, -0.5F, 1, 2, 1); + ValveWheelCenter.setRotationPoint(0F, 16F, 0F); + ValveWheelCenter.setTextureSize(128, 32); + ValveWheelCenter.mirror = true; + setRotation(ValveWheelCenter, 0F, 0F, 0F); + ValveRest = new ModelRenderer(this, 50, 27); + ValveRest.addBox(-1.5F, -4F, -1.5F, 3, 1, 3); + ValveRest.setRotationPoint(0F, 16F, 0F); + ValveRest.setTextureSize(128, 32); + ValveRest.mirror = true; + setRotation(ValveRest, 0F, 0F, 0F); + WheelBar3 = new ModelRenderer(this, 85, 15); + WheelBar3.addBox(-3F, -7F, -0.5F, 6, 1, 1); + WheelBar3.setRotationPoint(0F, 16F, 0F); + WheelBar3.setTextureSize(128, 32); + WheelBar3.mirror = true; + setRotation(WheelBar3, 0F, 0.7853982F, 0F); + WheelBar4 = new ModelRenderer(this, 85, 18); + WheelBar4.addBox(-3F, -7F, -0.5F, 6, 1, 1); + WheelBar4.setRotationPoint(0F, 16F, 0F); + WheelBar4.setTextureSize(128, 32); + WheelBar4.mirror = true; + setRotation(WheelBar4, 0F, -0.7853982F, 0F); + Wheel = new ModelRenderer(this, 50, 13); + Wheel.addBox(-1.5F, -7.5F, -3.5F, 3, 1, 1); + Wheel.setRotationPoint(0F, 16F, 0F); + Wheel.setTextureSize(128, 32); + Wheel.mirror = true; + setRotation(Wheel, 0F, -0.7853982F, 0F); + Wheel2 = new ModelRenderer(this, 50, 13); + Wheel2.addBox(-1.5F, -7.5F, -3.5F, 3, 1, 1); + Wheel2.setRotationPoint(0F, 16F, 0F); + Wheel2.setTextureSize(128, 32); + Wheel2.mirror = true; + setRotation(Wheel2, 0F, 2.356194F, 0F); + Wheel3 = new ModelRenderer(this, 50, 13); + Wheel3.addBox(-1.5F, -7.5F, -3.5F, 3, 1, 1); + Wheel3.setRotationPoint(0F, 16F, 0F); + Wheel3.setTextureSize(128, 32); + Wheel3.mirror = true; + setRotation(Wheel3, 0F, -2.356194F, 0F); + Wheel4 = new ModelRenderer(this, 50, 13); + Wheel4.addBox(-1.5F, -7.5F, -3.5F, 3, 1, 1); + Wheel4.setRotationPoint(0F, 16F, 0F); + Wheel4.setTextureSize(128, 32); + Wheel4.mirror = true; + setRotation(Wheel4, 0F, 0.7853982F, 0F); + WheelB = new ModelRenderer(this, 50, 13); + WheelB.addBox(-1.5F, -7.5F, 2.5F, 3, 1, 1); + WheelB.setRotationPoint(0F, 16F, 0F); + WheelB.setTextureSize(128, 32); + WheelB.mirror = true; + setRotation(WheelB, 0F, -3.141593F, 0F); + WheelB2 = new ModelRenderer(this, 50, 13); + WheelB2.addBox(-1.5F, -7.5F, 2.5F, 3, 1, 1); + WheelB2.setRotationPoint(0F, 16F, 0F); + WheelB2.setTextureSize(128, 32); + WheelB2.mirror = true; + setRotation(WheelB2, 0F, 0F, 0F); + WheelB3 = new ModelRenderer(this, 50, 13); + WheelB3.addBox(-1.5F, -7.5F, 2.5F, 3, 1, 1); + WheelB3.setRotationPoint(0F, 16F, 0F); + WheelB3.setTextureSize(128, 32); + WheelB3.mirror = true; + setRotation(WheelB3, 0F, 1.570796F, 0F); + WheelB4 = new ModelRenderer(this, 50, 13); + WheelB4.addBox(-1.5F, -7.5F, 2.5F, 3, 1, 1); + WheelB4.setRotationPoint(0F, 16F, 0F); + WheelB4.setTextureSize(128, 32); + WheelB4.mirror = true; + setRotation(WheelB4, 0F, -1.570796F, 0F); + renders = new ModelRenderer[] { ValveStem, ValveWheelCenter, ValveRest, WheelBar3, WheelBar4, Wheel, Wheel2, Wheel3, Wheel4, WheelB, WheelB2, WheelB3, WheelB4 }; + + } + + public void render() + { + ModelRenderer[] renderSet = renders; + for (int i = 0; i < renders.length; i++) + { + renderSet[i].render(0.0625F); + } + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/FM/src/dark/fluid/client/model/ModelSink.java b/FM/src/dark/fluid/client/model/ModelSink.java new file mode 100644 index 000000000..9db26a253 --- /dev/null +++ b/FM/src/dark/fluid/client/model/ModelSink.java @@ -0,0 +1,114 @@ +// Date: 1/22/2013 12:21:32 AM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package dark.fluid.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelSink extends ModelBase +{ + // fields + ModelRenderer Base; + ModelRenderer FrontLip; + ModelRenderer BottomLip; + ModelRenderer RightLip; + ModelRenderer LeftLip; + ModelRenderer BLip; + ModelRenderer Edge; + ModelRenderer Edge2; + ModelRenderer Water; + + public ModelSink() + { + textureWidth = 128; + textureHeight = 128; + + Base = new ModelRenderer(this, 0, 0); + Base.addBox(-7F, 0F, -7F, 14, 12, 14); + Base.setRotationPoint(0F, 12F, 0F); + Base.setTextureSize(128, 128); + Base.mirror = true; + setRotation(Base, 0F, 0F, 0F); + FrontLip = new ModelRenderer(this, 10, 62); + FrontLip.addBox(-8F, -4F, -8F, 16, 4, 2); + FrontLip.setRotationPoint(0F, 12F, 0F); + FrontLip.setTextureSize(128, 128); + FrontLip.mirror = true; + setRotation(FrontLip, 0F, 0F, 0F); + BottomLip = new ModelRenderer(this, 5, 37); + BottomLip.addBox(-8F, -4F, 4F, 16, 4, 4); + BottomLip.setRotationPoint(0F, 12F, 0F); + BottomLip.setTextureSize(128, 128); + BottomLip.mirror = true; + setRotation(BottomLip, 0F, 0F, 0F); + RightLip = new ModelRenderer(this, 0, 47); + RightLip.addBox(-8F, -4F, -6F, 2, 4, 10); + RightLip.setRotationPoint(0F, 12F, 0F); + RightLip.setTextureSize(128, 128); + RightLip.mirror = true; + setRotation(RightLip, 0F, 0F, 0F); + LeftLip = new ModelRenderer(this, 25, 47); + LeftLip.addBox(6F, -4F, -6F, 2, 4, 10); + LeftLip.setRotationPoint(0F, 12F, 0F); + LeftLip.setTextureSize(128, 128); + LeftLip.mirror = true; + setRotation(LeftLip, 0F, 0F, 0F); + BLip = new ModelRenderer(this, 9, 32); + BLip.addBox(-1F, -1F, 4F, 2, 2, 2); + BLip.setRotationPoint(0F, 12F, 0F); + BLip.setTextureSize(128, 128); + BLip.mirror = true; + setRotation(BLip, 0.5061455F, 0F, 0F); + Edge = new ModelRenderer(this, 5, 64); + Edge.addBox(0F, 0F, 0F, 1, 12, 1); + Edge.setRotationPoint(7F, 12F, 7F); + Edge.setTextureSize(128, 128); + Edge.mirror = true; + setRotation(Edge, 0F, 0F, 0F); + Edge2 = new ModelRenderer(this, 0, 64); + Edge2.addBox(0F, 0F, 0F, 1, 12, 1); + Edge2.setRotationPoint(-8F, 12F, 7F); + Edge2.setTextureSize(128, 128); + Edge2.mirror = true; + setRotation(Edge2, 0F, 0F, 0F); + Water = new ModelRenderer(this, 0, 0); + Water.addBox(-6F, 0F, -6F, 12, 0, 10); + Water.setRotationPoint(0F, 12F, 0F); + Water.setTextureSize(128, 128); + Water.mirror = true; + setRotation(Water, 0F, 0F, 0F); + } + + public void render(float f5) + { + Base.render(f5); + FrontLip.render(f5); + BottomLip.render(f5); + RightLip.render(f5); + LeftLip.render(f5); + BLip.render(f5); + Edge.render(f5); + Edge2.render(f5); + + } + + public void renderLiquid(float f5, float level) + { + Water.setRotationPoint(0F, 12F - level, 0F); + Water.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/FM/src/dark/fluid/client/model/ModelTank.java b/FM/src/dark/fluid/client/model/ModelTank.java new file mode 100644 index 000000000..da8b168e5 --- /dev/null +++ b/FM/src/dark/fluid/client/model/ModelTank.java @@ -0,0 +1,140 @@ +// Date: 8/14/2012 1:48:41 AM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package dark.fluid.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelTank extends ModelBase +{ + //One Block Tank + ModelRenderer TANK_WALL_1; + ModelRenderer TANK_WALL_2; + ModelRenderer TANK_WALL_3; + ModelRenderer TANK_WALL_4; + ModelRenderer TANK_SUPPORT_1; + ModelRenderer TANK_TOP_1; + ModelRenderer TANK_WALL_5; + ModelRenderer TANK_SUPPORT_2; + ModelRenderer TANK_SUPPORT_3; + ModelRenderer TANK_WALL_6; + ModelRenderer TANK_TOP_2; + ModelRenderer TANK_TOP_3; + ModelRenderer TANK_VALVE; + + public ModelTank(float par1) + { + textureWidth = 128; + textureHeight = 128; + + TANK_WALL_1 = new ModelRenderer(this, 0, 49); + TANK_WALL_1.addBox(0F, 0F, 0F, 1, 12, 8, par1); + TANK_WALL_1.setRotationPoint(6F, 12F, -4F); + TANK_WALL_1.setTextureSize(128, 128); + TANK_WALL_1.mirror = true; + setRotation(TANK_WALL_1, 0F, 0F, 0F); + TANK_WALL_2 = new ModelRenderer(this, 0, 70); + TANK_WALL_2.addBox(0F, 0F, 0F, 1, 12, 7, par1); + TANK_WALL_2.setRotationPoint(-8F, 12F, -4F); + TANK_WALL_2.setTextureSize(128, 128); + TANK_WALL_2.mirror = true; + setRotation(TANK_WALL_2, 0F, 0F, 0F); + TANK_WALL_3 = new ModelRenderer(this, 0, 34); + TANK_WALL_3.addBox(0F, 0F, 0F, 8, 12, 1, par1); + TANK_WALL_3.setRotationPoint(0F, 12F, 8F); + TANK_WALL_3.setTextureSize(128, 128); + TANK_WALL_3.mirror = true; + setRotation(TANK_WALL_3, 0F, 2.617994F, 0F); + TANK_WALL_4 = new ModelRenderer(this, 0, 34); + TANK_WALL_4.addBox(0F, 0F, 0F, 8, 12, 1, par1); + TANK_WALL_4.setRotationPoint(0F, 12F, -8F); + TANK_WALL_4.setTextureSize(128, 128); + TANK_WALL_4.mirror = true; + setRotation(TANK_WALL_4, 0F, -0.5235988F, 0F); + TANK_SUPPORT_1 = new ModelRenderer(this, 43, 22); + TANK_SUPPORT_1.addBox(-1F, 0F, -8F, 2, 14, 16, par1); + TANK_SUPPORT_1.setRotationPoint(0F, 10F, 0F); + TANK_SUPPORT_1.setTextureSize(128, 128); + TANK_SUPPORT_1.mirror = true; + setRotation(TANK_SUPPORT_1, 0F, 0F, 0F); + TANK_TOP_1 = new ModelRenderer(this, 43, 11); + TANK_TOP_1.addBox(-8F, 0F, -4F, 16, 2, 8, par1); + TANK_TOP_1.setRotationPoint(0F, 10F, 0F); + TANK_TOP_1.setTextureSize(128, 128); + TANK_TOP_1.mirror = true; + setRotation(TANK_TOP_1, 0F, 0F, 0F); + TANK_WALL_5 = new ModelRenderer(this, 0, 34); + TANK_WALL_5.addBox(0F, 0F, 0F, 8, 12, 1, par1); + TANK_WALL_5.setRotationPoint(0F, 12F, -7F); + TANK_WALL_5.setTextureSize(128, 128); + TANK_WALL_5.mirror = true; + setRotation(TANK_WALL_5, 0F, -2.617994F, 0F); + TANK_SUPPORT_2 = new ModelRenderer(this, 0, 0); + TANK_SUPPORT_2.addBox(-1F, 0F, -9F, 2, 14, 18, par1); + TANK_SUPPORT_2.setRotationPoint(0F, 10F, 0F); + TANK_SUPPORT_2.setTextureSize(128, 128); + TANK_SUPPORT_2.mirror = true; + setRotation(TANK_SUPPORT_2, 0F, 1.047198F, 0F); + TANK_SUPPORT_3 = new ModelRenderer(this, 0, 0); + TANK_SUPPORT_3.addBox(-1F, 0F, -9F, 2, 14, 18, par1); + TANK_SUPPORT_3.setRotationPoint(0F, 10F, 0F); + TANK_SUPPORT_3.setTextureSize(128, 128); + TANK_SUPPORT_3.mirror = true; + setRotation(TANK_SUPPORT_3, 0F, -1.047198F, 0F); + TANK_WALL_6 = new ModelRenderer(this, 0, 34); + TANK_WALL_6.addBox(0F, 0F, 0F, 8, 12, 1, par1); + TANK_WALL_6.setRotationPoint(0F, 12F, 7F); + TANK_WALL_6.setTextureSize(128, 128); + TANK_WALL_6.mirror = true; + setRotation(TANK_WALL_6, 0F, 0.5235988F, 0F); + TANK_TOP_2 = new ModelRenderer(this, 43, 0); + TANK_TOP_2.addBox(-6F, 0F, -4F, 12, 2, 8, par1); + TANK_TOP_2.setRotationPoint(0F, 10F, 0F); + TANK_TOP_2.setTextureSize(128, 128); + TANK_TOP_2.mirror = true; + setRotation(TANK_TOP_2, 0F, 1.047198F, 0F); + TANK_TOP_3 = new ModelRenderer(this, 43, 0); + TANK_TOP_3.addBox(-6F, 0F, -4F, 12, 2, 8, par1); + TANK_TOP_3.setRotationPoint(0F, 10F, 0F); + TANK_TOP_3.setTextureSize(128, 128); + TANK_TOP_3.mirror = true; + setRotation(TANK_TOP_3, 0F, -1.047198F, 0F); + TANK_VALVE = new ModelRenderer(this, 84, 0); + TANK_VALVE.addBox(0F, 0F, 0F, 2, 1, 2, par1); + TANK_VALVE.setRotationPoint(-1F, 9F, -1F); + TANK_VALVE.setTextureSize(128, 128); + TANK_VALVE.mirror = true; + setRotation(TANK_VALVE, 0F, 0F, 0F); + } + + public void generalRender(float f5) + { + TANK_WALL_1.render(f5); + TANK_WALL_2.render(f5); + TANK_WALL_3.render(f5); + TANK_WALL_4.render(f5); + TANK_SUPPORT_1.render(f5); + TANK_TOP_1.render(f5); + TANK_WALL_5.render(f5); + TANK_SUPPORT_2.render(f5); + TANK_SUPPORT_3.render(f5); + TANK_WALL_6.render(f5); + TANK_TOP_2.render(f5); + TANK_TOP_3.render(f5); + TANK_VALVE.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/FM/src/dark/fluid/client/model/ModelTankSide.java b/FM/src/dark/fluid/client/model/ModelTankSide.java new file mode 100644 index 000000000..37c651b0f --- /dev/null +++ b/FM/src/dark/fluid/client/model/ModelTankSide.java @@ -0,0 +1,208 @@ +// Date: 6/3/2013 6:47:54 AM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package dark.fluid.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelTankSide extends ModelBase +{ + + ModelRenderer botSiding; + ModelRenderer botRightOut; + ModelRenderer botLeftOut; + + ModelRenderer topSiding; + ModelRenderer topRightOut; + ModelRenderer topLeftOut; + + ModelRenderer leftSiding; + ModelRenderer leftBotSide; + ModelRenderer leftTopSide; + ModelRenderer leftSide; + + ModelRenderer rightSiding; + ModelRenderer rightBotSide; + ModelRenderer rightTopSide; + ModelRenderer rightSide; + + public ModelTankSide() + { + textureWidth = 128; + textureHeight = 128; + + rightSiding = new ModelRenderer(this, 0, 19); + rightSiding.addBox(-7F, 11F, 7F, 2, 10, 1); + rightSiding.setRotationPoint(0F, 0F, 0F); + rightSiding.setTextureSize(128, 128); + rightSiding.mirror = true; + setRotation(rightSiding, 0F, 0F, 0F); + leftSiding = new ModelRenderer(this, 0, 19); + leftSiding.addBox(5F, 11F, 7F, 2, 10, 1); + leftSiding.setRotationPoint(0F, 0F, 0F); + leftSiding.setTextureSize(128, 128); + leftSiding.mirror = true; + setRotation(leftSiding, 0F, 0F, 0F); + topSiding = new ModelRenderer(this, 7, 8); + topSiding.addBox(-5F, 8F, 7F, 10, 3, 1); + topSiding.setRotationPoint(0F, 0F, 0F); + topSiding.setTextureSize(128, 128); + topSiding.mirror = true; + setRotation(topSiding, 0F, 0F, 0F); + botSiding = new ModelRenderer(this, 7, 8); + botSiding.addBox(-5F, 21F, 7F, 10, 3, 1); + botSiding.setRotationPoint(0F, 0F, 0F); + botSiding.setTextureSize(128, 128); + botSiding.mirror = true; + setRotation(botSiding, 0F, 0F, 0F); + botRightOut = new ModelRenderer(this, 0, 0); + botRightOut.addBox(-7F, 21F, 7F, 2, 3, 1); + botRightOut.setRotationPoint(0F, 0F, 0F); + botRightOut.setTextureSize(128, 128); + botRightOut.mirror = true; + setRotation(botRightOut, 0F, 0F, 0F); + botLeftOut = new ModelRenderer(this, 0, 0); + botLeftOut.addBox(5F, 21F, 7F, 2, 3, 1); + botLeftOut.setRotationPoint(0F, 0F, 0F); + botLeftOut.setTextureSize(128, 128); + botLeftOut.mirror = true; + setRotation(botLeftOut, 0F, 0F, 0F); + topRightOut = new ModelRenderer(this, 0, 0); + topRightOut.addBox(-7F, 8F, 7F, 2, 3, 1); + topRightOut.setRotationPoint(0F, 0F, 0F); + topRightOut.setTextureSize(128, 128); + topRightOut.mirror = true; + setRotation(topRightOut, 0F, 0F, 0F); + topLeftOut = new ModelRenderer(this, 0, 0); + topLeftOut.addBox(5F, 8F, 7F, 2, 3, 1); + topLeftOut.setRotationPoint(0F, 0F, 0F); + topLeftOut.setTextureSize(128, 128); + topLeftOut.mirror = true; + setRotation(topLeftOut, 0F, 0F, 0F); + leftSide = new ModelRenderer(this, 0, 19); + leftSide.addBox(7F, 11F, 7F, 1, 10, 1); + leftSide.setRotationPoint(0F, 0F, 0F); + leftSide.setTextureSize(128, 128); + leftSide.mirror = true; + setRotation(leftSide, 0F, 0F, 0F); + leftTopSide = new ModelRenderer(this, 0, 0); + leftTopSide.addBox(7F, 8F, 7F, 1, 3, 1); + leftTopSide.setRotationPoint(0F, 0F, 0F); + leftTopSide.setTextureSize(128, 128); + leftTopSide.mirror = true; + setRotation(leftTopSide, 0F, 0F, 0F); + leftBotSide = new ModelRenderer(this, 0, 0); + leftBotSide.addBox(7F, 21F, 7F, 1, 3, 1); + leftBotSide.setRotationPoint(0F, 0F, 0F); + leftBotSide.setTextureSize(128, 128); + leftBotSide.mirror = true; + setRotation(leftBotSide, 0F, 0F, 0F); + rightBotSide = new ModelRenderer(this, 0, 0); + rightBotSide.addBox(-8F, 21F, 7F, 1, 3, 1); + rightBotSide.setRotationPoint(0F, 0F, 0F); + rightBotSide.setTextureSize(128, 128); + rightBotSide.mirror = true; + setRotation(rightBotSide, 0F, 0F, 0F); + rightSide = new ModelRenderer(this, 0, 19); + rightSide.addBox(-8F, 11F, 7F, 1, 10, 1); + rightSide.setRotationPoint(0F, 0F, 0F); + rightSide.setTextureSize(128, 128); + rightSide.mirror = true; + setRotation(rightSide, 0F, 0F, 0F); + rightTopSide = new ModelRenderer(this, 0, 0); + rightTopSide.addBox(-8F, 8F, 7F, 1, 3, 1); + rightTopSide.setRotationPoint(0F, 0F, 0F); + rightTopSide.setTextureSize(128, 128); + rightTopSide.mirror = true; + setRotation(rightTopSide, 0F, 0F, 0F); + } + + /** @param size - render size normal is 0.0625F + * @param left - is the an instance of this to the left + * @param right - "" to the right + * @param bot - "" to the bot + * @param top - "" to the top + * + * Not this only renders one side of the block. You will need to rotate it to face another + * direction then render it. If rotating up or down you will need to translate it a bit */ + public void render(float size, boolean left, boolean right, boolean bot, boolean top) + { + if (!top) + { + topSiding.render(size); + topRightOut.render(size); + topLeftOut.render(size); + if (right) + { + rightTopSide.render(size); + } + if (left) + { + leftTopSide.render(size); + } + } + if (!bot) + { + botSiding.render(size); + botRightOut.render(size); + botLeftOut.render(size); + if (right) + { + rightBotSide.render(size); + } + if (left) + { + leftBotSide.render(size); + } + } + if (!right) + { + rightSiding.render(size); + rightBotSide.render(size); + rightTopSide.render(size); + rightSide.render(size); + + if (top) + { + topRightOut.render(size); + + } + if (bot) + { + botRightOut.render(size); + } + } + if (!left) + { + leftSiding.render(size); + leftBotSide.render(size); + leftTopSide.render(size); + leftSide.render(size); + + if (top) + { + topLeftOut.render(size); + } + if (bot) + { + botLeftOut.render(size); + } + } + + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/FM/src/dark/fluid/client/render/BlockRenderHelper.java b/FM/src/dark/fluid/client/render/BlockRenderHelper.java new file mode 100644 index 000000000..34bd0a85e --- /dev/null +++ b/FM/src/dark/fluid/client/render/BlockRenderHelper.java @@ -0,0 +1,100 @@ +package dark.fluid.client.render; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; + +import org.lwjgl.opengl.GL11; + +import com.dark.DarkCore; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.client.model.ModelConstructionPump; +import dark.fluid.client.model.ModelPump; +import dark.fluid.client.model.ModelSink; +import dark.fluid.common.FMRecipeLoader; +import dark.fluid.common.FluidMech; +import dark.mech.client.model.ModelGearRod; +import dark.mech.client.model.ModelGenerator; + +@SideOnly(Side.CLIENT) +public class BlockRenderHelper implements ISimpleBlockRenderingHandler +{ + public static BlockRenderHelper instance = new BlockRenderHelper(); + public static int renderID = RenderingRegistry.getNextAvailableRenderId(); + private ModelPump modelPump = new ModelPump(); + private ModelGearRod modelRod = new ModelGearRod(); + private ModelGenerator modelGen = new ModelGenerator(); + private ModelSink sink = new ModelSink(); + private ModelConstructionPump conPump = new ModelConstructionPump(); + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) + { + GL11.glPushMatrix(); + if (FMRecipeLoader.blockPumpMachine != null && block.blockID == FMRecipeLoader.blockPumpMachine.blockID && metadata < 4) + { + GL11.glTranslatef(0.0F, 1.1F, 0.0F); + GL11.glRotatef(180f, 0f, 0f, 1f); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(FluidMech.instance.DOMAIN, DarkCore.MODEL_DIRECTORY + "pumps/WaterPump.png")); + modelPump.render(0.0725F); + modelPump.renderMotion(0.0725F, 0); + } + else if (FMRecipeLoader.blockSink != null && block.blockID == FMRecipeLoader.blockSink.blockID) + { + GL11.glTranslatef(0.0F, .8F, 0.0F); + GL11.glRotatef(180f, 0f, 0f, 1f); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(FluidMech.instance.DOMAIN, DarkCore.MODEL_DIRECTORY + "Sink.png")); + sink.render(0.0565F); + } + else if (FMRecipeLoader.blockRod != null && block.blockID == FMRecipeLoader.blockRod.blockID) + { + GL11.glTranslatef(0.0F, 1.5F, 0.0F); + GL11.glRotatef(180f, 0f, 0f, 1f); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(FluidMech.instance.DOMAIN, DarkCore.MODEL_DIRECTORY + "mechanical/GearRod.png")); + modelRod.render(0.0825F, 0); + } + else if (FMRecipeLoader.blockGenerator != null && block.blockID == FMRecipeLoader.blockGenerator.blockID) + { + GL11.glTranslatef(0.0F, 1.0F, 0.0F); + GL11.glRotatef(180f, 0f, 0f, 1f); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(FluidMech.instance.DOMAIN, DarkCore.MODEL_DIRECTORY + "mechanical/Generator.png")); + modelGen.render(null); + } + else if (FMRecipeLoader.blockConPump != null && block.blockID == FMRecipeLoader.blockConPump.blockID && metadata < 4) + { + GL11.glTranslatef(0.0F, 1.2F, 0.0F); + GL11.glRotatef(180f, 0f, 0f, 1f); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(FluidMech.instance.DOMAIN, DarkCore.MODEL_DIRECTORY + "ConstructionPump.png")); + conPump.render(0.0725F); + conPump.renderMotor(0.0725F); + + } + GL11.glPopMatrix(); + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) + { + return false; + } + + @Override + public boolean shouldRender3DInInventory() + { + + return true; + } + + @Override + public int getRenderId() + { + return renderID; + } +} diff --git a/FM/src/dark/fluid/client/render/ItemPipeRenderer.java b/FM/src/dark/fluid/client/render/ItemPipeRenderer.java new file mode 100644 index 000000000..b25fcf62c --- /dev/null +++ b/FM/src/dark/fluid/client/render/ItemPipeRenderer.java @@ -0,0 +1,108 @@ +package dark.fluid.client.render; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.IItemRenderer; + +import org.lwjgl.opengl.GL11; + +import com.dark.DarkCore; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.client.model.ModelReleaseValve; +import dark.fluid.common.FMRecipeLoader; +import dark.fluid.common.FluidMech; +import dark.fluid.common.FluidPartsMaterial; + +@SideOnly(Side.CLIENT) +public class ItemPipeRenderer implements IItemRenderer +{ + private ModelReleaseValve valve = new ModelReleaseValve(); + private RenderPipe pipe = new RenderPipe(); + + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) + { + if (item.itemID == FMRecipeLoader.blockPipe.blockID) + { + this.renderPipeItem((RenderBlocks) data[0], item, type == ItemRenderType.EQUIPPED); + } + if (item.itemID == FMRecipeLoader.blockReleaseValve.blockID) + { + this.renderReleaseValve((RenderBlocks) data[0], item.getItemDamage(), type == ItemRenderType.EQUIPPED); + } + + } + + public void renderPipeItem(RenderBlocks renderer, ItemStack item, boolean equ) + { + + GL11.glPushMatrix(); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderPipe.getTexture(FluidPartsMaterial.getFromItemMeta(item.getItemDamage()), item.getItemDamage() % FluidPartsMaterial.spacing)); + if (!equ) + { + GL11.glTranslatef(0.5F, -0.5F, 0.5F); + pipe.SixPipe.renderRight(); + pipe.SixPipe.renderLeft(); + pipe.SixPipe.renderMiddle(); + } + else + { + GL11.glTranslatef(0.5F, -0.5F, 0.5F); + pipe.SixPipe.renderFront(); + pipe.SixPipe.renderBack(); + pipe.SixPipe.renderMiddle(); + } + + GL11.glPopMatrix(); + } + + public void renderReleaseValve(RenderBlocks renderer, int meta, boolean equ) + { + GL11.glPushMatrix(); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(pipe.getTexture(FMRecipeLoader.blockPipe.blockID, 15)); + if (!equ) + { + GL11.glTranslatef(0.5F, -0.5F, 0.5F); + pipe.SixPipe.renderRight(); + pipe.SixPipe.renderLeft(); + pipe.SixPipe.renderMiddle(); + } + else + { + GL11.glTranslatef(0.5F, -0.5F, 0.5F); + pipe.SixPipe.renderFront(); + pipe.SixPipe.renderBack(); + pipe.SixPipe.renderMiddle(); + } + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(FluidMech.instance.DOMAIN, DarkCore.MODEL_DIRECTORY + "ReleaseValve.png")); + GL11.glRotatef(180f, 0f, 0f, 1f); + if (!equ) + { + GL11.glTranslatef(0, -2.0F, 0); + } + else + { + GL11.glTranslatef(0, -2.0F, 0); + } + valve.render(); + GL11.glPopMatrix(); + } + +} diff --git a/FM/src/dark/fluid/client/render/ItemTankRenderer.java b/FM/src/dark/fluid/client/render/ItemTankRenderer.java new file mode 100644 index 000000000..98fa3269b --- /dev/null +++ b/FM/src/dark/fluid/client/render/ItemTankRenderer.java @@ -0,0 +1,125 @@ +package dark.fluid.client.render; + +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.client.model.ModelTankSide; +import dark.fluid.common.FMRecipeLoader; +import dark.fluid.common.FluidMech; +import dark.fluid.common.machines.BlockTank; +import dark.machines.client.renders.RenderBlockFluid; + +@SideOnly(Side.CLIENT) +public class ItemTankRenderer implements IItemRenderer +{ + private ModelTankSide tank = new ModelTankSide(); + + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) + { + if (item.itemID == FMRecipeLoader.blockTank.blockID) + { + + GL11.glPushMatrix(); + GL11.glScalef(1.0F, 1.0F, 1.0F); + if (type == ItemRenderType.ENTITY) + { + GL11.glTranslatef(0F, 0.2F, 0F); + } + else if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) + { + GL11.glTranslatef(0.4F, 0.6F, 0.2F); + } + else if (type == ItemRenderType.EQUIPPED) + { + GL11.glTranslatef(0.1F, 0.4F, 1.2F); + } + else + { + GL11.glTranslatef(0.7F, .4F, 0.7F); + } + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(FluidMech.instance.DOMAIN, item.getItemDamage() == 1 ? "textures/blocks/obsidian.png" : "textures/blocks/iron_block.png")); + GL11.glTranslatef(0.0F, -0.9F, 0.0F); + tank.render(0.0625F, false, false, false, false); + GL11.glRotatef(90f, 0f, 1f, 0f); + tank.render(0.0625F, false, false, false, false); + GL11.glRotatef(90f, 0f, 1f, 0f); + tank.render(0.0625F, false, false, false, false); + GL11.glRotatef(90f, 0f, 1f, 0f); + tank.render(0.0625F, false, false, false, false); + GL11.glPopMatrix(); + + } + + if (item.getTagCompound() != null && item.getTagCompound().hasKey("fluid")) + { + FluidStack liquid = FluidStack.loadFluidStackFromNBT(item.getTagCompound().getCompoundTag("fluid")); + + if (liquid != null && liquid.amount > 100) + { + + int[] displayList = RenderBlockFluid.getFluidDisplayLists(liquid, Minecraft.getMinecraft().theWorld, false); + + GL11.glPushMatrix(); + GL11.glPushAttrib(GL11.GL_ENABLE_BIT); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + //GL11.glScalef(0.80F, 0.9F, 0.80F); + if (type == ItemRenderType.ENTITY) + { + GL11.glTranslatef(-.5F, -0.2F, -.5F); + } + else if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) + { + GL11.glTranslatef(-0.1F, 0.2F, -.3F); + } + else if (type == ItemRenderType.EQUIPPED) + { + GL11.glScalef(0.9F, 0.9F, 0.9F); + GL11.glTranslatef(-0.4F, 0.1F, 0.9F); + } + else + { + GL11.glScalef(0.80F, 0.9F, 0.80F); + GL11.glTranslatef(0.5F, .2F, 0.5F); + } + + FMLClientHandler.instance().getClient().renderEngine.bindTexture((RenderBlockFluid.getFluidSheet(liquid))); + + int cap = BlockTank.tankVolume * FluidContainerRegistry.BUCKET_VOLUME; + if (liquid.getFluid().isGaseous()) + { + cap = liquid.amount; + } + GL11.glCallList(displayList[(int) Math.min(((float) liquid.amount / (float) (cap) * (RenderBlockFluid.DISPLAY_STAGES - 1)), displayList.length - 1)]); + + GL11.glPopAttrib(); + GL11.glPopMatrix(); + } + } + } +} diff --git a/FM/src/dark/fluid/client/render/RenderConstructionPump.java b/FM/src/dark/fluid/client/render/RenderConstructionPump.java new file mode 100644 index 000000000..bf4b2a3b2 --- /dev/null +++ b/FM/src/dark/fluid/client/render/RenderConstructionPump.java @@ -0,0 +1,66 @@ +package dark.fluid.client.render; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import com.dark.DarkCore; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.client.model.ModelConstructionPump; +import dark.fluid.common.FluidMech; +import dark.fluid.common.pump.TileEntityConstructionPump; +import dark.machines.client.renders.RenderTileMachine; + +@SideOnly(Side.CLIENT) +public class RenderConstructionPump extends RenderTileMachine +{ + int type = 0; + private ModelConstructionPump model; + + public RenderConstructionPump() + { + model = new ModelConstructionPump(); + } + + @Override + public void renderModel(TileEntity tileEntity, double d, double d1, double d2, float d3) + { + bindTexture(this.getTexture(0, 0)); + GL11.glPushMatrix(); + GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.45F, (float) d2 + 0.5F); + GL11.glScalef(1.0F, -1F, -1F); + int meta = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); + switch (meta) + { + case 0: + GL11.glRotatef(0f, 0f, 1f, 0f); + break; + case 1: + GL11.glRotatef(90f, 0f, 1f, 0f); + break; + case 2: + GL11.glRotatef(180f, 0f, 1f, 0f); + break; + case 3: + GL11.glRotatef(270f, 0f, 1f, 0f); + break; + } + model.render(0.0625F); + if (tileEntity instanceof TileEntityConstructionPump) + { + //TODO animation life + } + model.renderMotor(0.0625F); + GL11.glPopMatrix(); + } + + @Override + public ResourceLocation getTexture(int block, int meta) + { + return new ResourceLocation(FluidMech.instance.DOMAIN, DarkCore.MODEL_DIRECTORY + "ConstructionPump.png"); + } + +} \ No newline at end of file diff --git a/FM/src/dark/fluid/client/render/RenderFurnace.java b/FM/src/dark/fluid/client/render/RenderFurnace.java new file mode 100644 index 000000000..b6903eb41 --- /dev/null +++ b/FM/src/dark/fluid/client/render/RenderFurnace.java @@ -0,0 +1,61 @@ +package dark.fluid.client.render; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import com.dark.DarkCore; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.client.model.ModelFurnace; +import dark.fluid.common.FluidMech; +import dark.machines.client.renders.RenderTileMachine; + +@SideOnly(Side.CLIENT) +public class RenderFurnace extends RenderTileMachine +{ + int type = 0; + private ModelFurnace model; + + public RenderFurnace() + { + model = new ModelFurnace(); + } + + @Override + public void renderModel(TileEntity te, double d, double d1, double d2, float d3) + { + bindTextureByName(FluidMech.instance.PREFIX, DarkCore.MODEL_DIRECTORY + "Furnace.png"); + GL11.glPushMatrix(); + GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); + GL11.glScalef(1.0F, -1F, -1F); + int meta = te.worldObj.getBlockMetadata(te.xCoord, te.yCoord, te.zCoord); + switch (meta) + { + case 0: + GL11.glRotatef(0f, 0f, 1f, 0f); + break; + case 1: + GL11.glRotatef(90f, 0f, 1f, 0f); + break; + case 2: + GL11.glRotatef(180f, 0f, 1f, 0f); + break; + case 3: + GL11.glRotatef(270f, 0f, 1f, 0f); + break; + } + model.genRender(0.0625F); + GL11.glPopMatrix(); + } + + @Override + public ResourceLocation getTexture(int block, int meta) + { + // TODO Auto-generated method stub + return null; + } + +} \ No newline at end of file diff --git a/FM/src/dark/fluid/client/render/RenderGearPiston.java b/FM/src/dark/fluid/client/render/RenderGearPiston.java new file mode 100644 index 000000000..ca9c29d95 --- /dev/null +++ b/FM/src/dark/fluid/client/render/RenderGearPiston.java @@ -0,0 +1,74 @@ +package dark.fluid.client.render; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import com.dark.DarkCore; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.client.model.ModelGearPiston; +import dark.fluid.common.FluidMech; +import dark.machines.client.renders.RenderTileMachine; +import dark.mech.common.machines.TileEntitySteamPiston; + +@SideOnly(Side.CLIENT) +public class RenderGearPiston extends RenderTileMachine +{ + private ModelGearPiston model; + + public RenderGearPiston() + { + model = new ModelGearPiston(); + } + + public void renderTileEntityAt(TileEntitySteamPiston tileEntity, double d, double d1, double d2, float d3) + { + bindTextureByName(FluidMech.instance.PREFIX, DarkCore.MODEL_DIRECTORY + "GearShaftPiston.png"); + GL11.glPushMatrix(); + GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); + GL11.glScalef(1.0F, -1F, -1F); + int meta = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); + + switch (meta) + { + case 1: + GL11.glRotatef(0f, 0f, 1f, 0f); + break; + case 2: + GL11.glRotatef(90f, 0f, 1f, 0f); + break; + case 3: + GL11.glRotatef(180f, 0f, 1f, 0f); + break; + case 0: + GL11.glRotatef(270f, 0f, 1f, 0f); + break; + } + model.renderGear(0.0625F); + model.renderR(0.0625F, 0);//TODO fix + model.renderBody(0.0625F); + model.renderBack(0.0625F); + model.renderFront(0.0625F); + model.renderLeft(0.0625F); + model.renderRight(0.0625F); + GL11.glPopMatrix(); + } + + @Override + public void renderModel(TileEntity var1, double d, double d1, double d2, float d3) + { + this.renderTileEntityAt(((TileEntitySteamPiston) var1), d, d1, d2, d3); + + } + + @Override + public ResourceLocation getTexture(int block, int meta) + { + // TODO Auto-generated method stub + return null; + } + +} \ No newline at end of file diff --git a/FM/src/dark/fluid/client/render/RenderPipe.java b/FM/src/dark/fluid/client/render/RenderPipe.java new file mode 100644 index 000000000..ca2abe825 --- /dev/null +++ b/FM/src/dark/fluid/client/render/RenderPipe.java @@ -0,0 +1,110 @@ +package dark.fluid.client.render; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import com.dark.DarkCore; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.client.model.ModelLargePipe; +import dark.fluid.common.FluidMech; +import dark.fluid.common.FluidPartsMaterial; +import dark.fluid.common.pipes.EnumPipeType; +import dark.fluid.common.pipes.TileEntityPipe; +import dark.machines.client.renders.RenderTileMachine; + +@SideOnly(Side.CLIENT) +public class RenderPipe extends RenderTileMachine +{ + public ModelLargePipe SixPipe; + + public RenderPipe() + { + SixPipe = new ModelLargePipe(); + } + + public void renderAModelAt(TileEntity te, double d, double d1, double d2, float f) + { + // Texture file + GL11.glPushMatrix(); + GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); + GL11.glScalef(1.0F, -1F, -1F); + + FluidPartsMaterial mat = FluidPartsMaterial.IRON; + if (te.getBlockMetadata() < FluidPartsMaterial.values().length) + { + mat = FluidPartsMaterial.values()[te.getBlockMetadata()]; + } + + if (te instanceof TileEntityPipe) + { + this.render(mat, ((TileEntityPipe) te).getSubID(), ((TileEntityPipe) te).renderConnection); + } + else + { + this.render(FluidPartsMaterial.STONE, 0, new boolean[6]); + } + GL11.glPopMatrix(); + + } + + @Override + public ResourceLocation getTexture(int block, int meta) + { + return new ResourceLocation(FluidMech.instance.DOMAIN, DarkCore.MODEL_DIRECTORY + "pipes/Pipe.png"); + } + + public static ResourceLocation getTexture(FluidPartsMaterial mat, int pipeID) + { + if (mat != null) + { + String s = ""; + if (EnumPipeType.get(pipeID) != null) + { + s = EnumPipeType.get(pipeID).getName(pipeID); + } + return new ResourceLocation(FluidMech.instance.DOMAIN, DarkCore.MODEL_DIRECTORY + "pipes/" + mat.matName + "/" + s + "Pipe.png"); + } + return new ResourceLocation(FluidMech.instance.DOMAIN, DarkCore.MODEL_DIRECTORY + "pipes/Pipe.png"); + } + + public void render(FluidPartsMaterial mat, int pipeID, boolean[] side) + { + bindTexture(RenderPipe.getTexture(mat, pipeID)); + if (side[0]) + { + SixPipe.renderBottom(); + } + if (side[1]) + { + SixPipe.renderTop(); + } + if (side[3]) + { + SixPipe.renderFront(); + } + if (side[2]) + { + SixPipe.renderBack(); + } + if (side[5]) + { + SixPipe.renderRight(); + } + if (side[4]) + { + SixPipe.renderLeft(); + } + SixPipe.renderMiddle(); + } + + @Override + public void renderModel(TileEntity tileEntity, double var2, double var4, double var6, float var8) + { + this.renderAModelAt(tileEntity, var2, var4, var6, var8); + } + +} \ No newline at end of file diff --git a/FM/src/dark/fluid/client/render/RenderPump.java b/FM/src/dark/fluid/client/render/RenderPump.java new file mode 100644 index 000000000..b2ccb5aa0 --- /dev/null +++ b/FM/src/dark/fluid/client/render/RenderPump.java @@ -0,0 +1,72 @@ +package dark.fluid.client.render; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import com.dark.DarkCore; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.client.model.ModelPump; +import dark.fluid.common.FluidMech; +import dark.fluid.common.pump.TileEntityStarterPump; +import dark.machines.client.renders.RenderTileMachine; + +@SideOnly(Side.CLIENT) +public class RenderPump extends RenderTileMachine +{ + int type = 0; + private ModelPump model; + + public RenderPump() + { + model = new ModelPump(); + } + + public void renderAModelAt(TileEntityStarterPump te, double d, double d1, double d2, float f) + { + int meta = te.worldObj.getBlockMetadata(te.xCoord, te.yCoord, te.zCoord); + + bindTexture(this.getTexture(te.getBlockType().blockID, te.getBlockMetadata())); + GL11.glPushMatrix(); + GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); + GL11.glScalef(1.0F, -1F, -1F); + switch (meta) + { + case 2: + GL11.glRotatef(0f, 0f, 1f, 0f); + break; + case 3: + GL11.glRotatef(90f, 0f, 1f, 0f); + break; + case 0: + GL11.glRotatef(180f, 0f, 1f, 0f); + break; + case 1: + GL11.glRotatef(270f, 0f, 1f, 0f); + break; + } + model.render(0.0625F); + model.renderMotion(0.0625F, te.rotation); + GL11.glPopMatrix(); + + } + + @Override + public void renderModel(TileEntity tileEntity, double var2, double var4, double var6, float var8) + { + if (tileEntity instanceof TileEntityStarterPump) + { + this.renderAModelAt((TileEntityStarterPump) tileEntity, var2, var4, var6, var8); + } + } + + @Override + public ResourceLocation getTexture(int block, int meta) + { + return new ResourceLocation(FluidMech.instance.DOMAIN, DarkCore.MODEL_DIRECTORY + "pumps/WaterPump.png"); + } + +} \ No newline at end of file diff --git a/FM/src/dark/fluid/client/render/RenderReleaseValve.java b/FM/src/dark/fluid/client/render/RenderReleaseValve.java new file mode 100644 index 000000000..8fb7e1f2c --- /dev/null +++ b/FM/src/dark/fluid/client/render/RenderReleaseValve.java @@ -0,0 +1,79 @@ +package dark.fluid.client.render; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import com.dark.DarkCore; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.api.ColorCode; +import dark.fluid.client.model.ModelLargePipe; +import dark.fluid.client.model.ModelReleaseValve; +import dark.fluid.common.FluidMech; +import dark.fluid.common.machines.TileEntityReleaseValve; +import dark.machines.client.renders.RenderTileMachine; + +@SideOnly(Side.CLIENT) +public class RenderReleaseValve extends RenderTileMachine +{ + private ModelLargePipe SixPipe; + private ModelReleaseValve valve; + private TileEntity[] ents = new TileEntity[6]; + + public RenderReleaseValve() + { + SixPipe = new ModelLargePipe(); + valve = new ModelReleaseValve(); + } + + public void renderAModelAt(TileEntity te, double d, double d1, double d2, float f) + { + // Texture file + GL11.glPushMatrix(); + GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); + GL11.glScalef(1.0F, -1F, -1F); + if (te instanceof TileEntityReleaseValve) + { + ents = ((TileEntityReleaseValve) te).connected; + } + bindTexture(this.getTexture(te.getBlockType().blockID, te.getBlockMetadata())); + if (ents[0] != null) + SixPipe.renderBottom(); + if (ents[1] != null) + SixPipe.renderTop(); + if (ents[3] != null) + SixPipe.renderFront(); + if (ents[2] != null) + SixPipe.renderBack(); + if (ents[5] != null) + SixPipe.renderRight(); + if (ents[4] != null) + SixPipe.renderLeft(); + SixPipe.renderMiddle(); + bindTextureByName(FluidMech.instance.DOMAIN, DarkCore.MODEL_DIRECTORY + "ReleaseValve.png"); + if (ents[1] == null) + valve.render(); + GL11.glPopMatrix(); + + } + + public static String getPipeTexture(int meta) + { + return DarkCore.MODEL_DIRECTORY + "pipes/" + ColorCode.get(meta).getName() + "Pipe.png"; + } + + @Override + public void renderModel(TileEntity tileEntity, double var2, double var4, double var6, float var8) + { + this.renderAModelAt(tileEntity, var2, var4, var6, var8); + } + + @Override + public ResourceLocation getTexture(int block, int meta) + { + return new ResourceLocation(FluidMech.instance.DOMAIN, DarkCore.MODEL_DIRECTORY + "pipes/" + ColorCode.get(15).getName() + "Pipe.png"); + } +} \ No newline at end of file diff --git a/FM/src/dark/fluid/client/render/RenderSink.java b/FM/src/dark/fluid/client/render/RenderSink.java new file mode 100644 index 000000000..7f3430b7b --- /dev/null +++ b/FM/src/dark/fluid/client/render/RenderSink.java @@ -0,0 +1,90 @@ +package dark.fluid.client.render; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fluids.FluidStack; + +import org.lwjgl.opengl.GL11; + +import com.dark.DarkCore; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.client.model.ModelSink; +import dark.fluid.common.FluidMech; +import dark.fluid.common.machines.TileEntitySink; +import dark.machines.client.renders.RenderTileMachine; + +@SideOnly(Side.CLIENT) +public class RenderSink extends RenderTileMachine +{ + int type = 0; + private ModelSink model; + + public RenderSink() + { + model = new ModelSink(); + } + + public void renderWater(FluidStack stack) + { + if (stack == null || stack.amount <= 1) + { + return; + } + //bindTextureByName(Block.waterStill.getBlockTextureFromSide(0) + "blue.png"); + float p = 0; + if (stack.amount > 0) + p = 0.5f; + if (stack.amount > 500) + p = 1.5f; + if (stack.amount > 1000) + p = 2.5f; + if (stack.amount > 1500) + p = 3.5f; + + model.renderLiquid(0.0625F, p); + } + + public void renderAModelAt(TileEntitySink te, double d, double d1, double d2, float f) + { + int meta = te.worldObj.getBlockMetadata(te.xCoord, te.yCoord, te.zCoord); + + bindTexture(this.getTexture(te.getBlockType().blockID, te.getBlockMetadata())); + GL11.glPushMatrix(); + GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); + GL11.glScalef(1.0F, -1F, -1F); + switch (meta) + { + case 3: + GL11.glRotatef(90f, 0f, 1f, 0f); + break; + case 0: + GL11.glRotatef(180f, 0f, 1f, 0f); + break; + case 1: + GL11.glRotatef(270f, 0f, 1f, 0f); + break; + case 2: + GL11.glRotatef(0f, 0f, 1f, 0f); + break; + } + model.render(0.0625F); + renderWater(te.getTank().getFluid()); + GL11.glPopMatrix(); + + } + + @Override + public void renderModel(TileEntity tileEntity, double var2, double var4, double var6, float var8) + { + this.renderAModelAt((TileEntitySink) tileEntity, var2, var4, var6, var8); + } + + @Override + public ResourceLocation getTexture(int block, int meta) + { + return new ResourceLocation(FluidMech.instance.DOMAIN, DarkCore.MODEL_DIRECTORY + "Sink.png"); + } + +} \ No newline at end of file diff --git a/FM/src/dark/fluid/client/render/RenderTank.java b/FM/src/dark/fluid/client/render/RenderTank.java new file mode 100644 index 000000000..69799fff3 --- /dev/null +++ b/FM/src/dark/fluid/client/render/RenderTank.java @@ -0,0 +1,135 @@ +package dark.fluid.client.render; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.api.ColorCode; +import dark.fluid.client.model.ModelTankSide; +import dark.fluid.common.machines.TileEntityTank; +import dark.machines.client.renders.RenderBlockFluid; +import dark.machines.client.renders.RenderTileMachine; + +@SideOnly(Side.CLIENT) +public class RenderTank extends RenderTileMachine +{ + private ModelTankSide model; + + //TODO https://www.opengl.org/sdk/docs/man/xhtml/glDepthMask.xml <- fix z fighting + public RenderTank() + { + model = new ModelTankSide(); + } + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8) + { + FluidStack liquid = tileEntity instanceof TileEntityTank ? ((TileEntityTank) tileEntity).getTankInfo()[0].fluid : null; + this.renderTank(tileEntity, x, y, z, 0, liquid); + } + + public void renderTank(TileEntity tileEntity, double x, double y, double z, int meta, FluidStack liquid) + { + boolean[] render = new boolean[6]; + if (tileEntity instanceof TileEntityTank) + { + render = ((TileEntityTank) tileEntity).renderConnection; + } + if (liquid != null && liquid.amount > 100) + { + + int[] displayList = RenderBlockFluid.getFluidDisplayLists(liquid, tileEntity.worldObj, false); + + GL11.glPushMatrix(); + GL11.glPushAttrib(GL11.GL_ENABLE_BIT); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + + bindTexture(RenderBlockFluid.getFluidSheet(liquid)); + + GL11.glTranslatef((float) x, (float) y, (float) z); + GL11.glScalef(1.01F, 1.01F, 1.01F); + int cap = tileEntity instanceof TileEntityTank ? ((TileEntityTank) tileEntity).getTankInfo()[0].capacity : liquid.amount; + GL11.glCallList(displayList[(int) ((float) liquid.amount / (float) (cap) * (RenderBlockFluid.DISPLAY_STAGES - 1))]); + + GL11.glPopAttrib(); + GL11.glPopMatrix(); + } + + boolean bot = render[1]; + boolean top = render[0]; + boolean north = render[2]; + boolean south = render[3]; + boolean east = render[5]; + boolean west = render[4]; + for (int i = 0; i < 4; i++) + { + ForgeDirection dir = ForgeDirection.getOrientation(i + 2); + if (!render[dir.getOpposite().ordinal()]) + { + GL11.glPushMatrix(); + + GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); + GL11.glScalef(1.0F, -1F, -1F); + boolean left = false; + boolean right = false; + switch (dir) + { + case NORTH: + GL11.glRotatef(180f, 0f, 1f, 0f); + left = west; + right = east; + break; + case SOUTH: + GL11.glRotatef(0f, 0f, 1f, 0f); + left = east; + right = west; + break; + case WEST: + GL11.glRotatef(90f, 0f, 1f, 0f); + left = south; + right = north; + break; + case EAST: + GL11.glRotatef(270f, 0f, 1f, 0f); + left = north; + right = south; + break; + } + bindTexture(this.getTexture(tileEntity.getBlockType().blockID, tileEntity.getBlockMetadata())); + model.render(0.0625F, left, right, top, bot); + GL11.glPopMatrix(); + } + } + + } + + @Override + public ResourceLocation getTexture(int block, int meta) + { + String texture = ""; + if (ColorCode.get(meta) == ColorCode.RED) + { + texture = "textures/blocks/obsidian.png"; + } + else + { + texture = "textures/blocks/iron_block.png"; + } + return new ResourceLocation(texture); + } + + @Override + public void renderModel(TileEntity tileEntity, double x, double y, double z, float size) + { + // TODO Auto-generated method stub + + } +} \ No newline at end of file diff --git a/FM/src/dark/fluid/common/CommonProxy.java b/FM/src/dark/fluid/common/CommonProxy.java new file mode 100644 index 000000000..b112f382c --- /dev/null +++ b/FM/src/dark/fluid/common/CommonProxy.java @@ -0,0 +1,38 @@ +package dark.fluid.common; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import cpw.mods.fml.common.network.IGuiHandler; + +public class CommonProxy implements IGuiHandler +{ + + @Override + public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) + { + // TODO Auto-generated method stub + return null; + } + + public void preInit() + { + + } + + public void Init() + { + + } + + public void postInit() + { + + } +} diff --git a/FM/src/dark/fluid/common/FMRecipeLoader.java b/FM/src/dark/fluid/common/FMRecipeLoader.java new file mode 100644 index 000000000..a006352cf --- /dev/null +++ b/FM/src/dark/fluid/common/FMRecipeLoader.java @@ -0,0 +1,86 @@ +package dark.fluid.common; + +import com.dark.prefab.RecipeLoader; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; +import cpw.mods.fml.common.registry.GameRegistry; +import dark.api.ColorCode; +import dark.core.basics.EnumMaterial; +import dark.core.basics.EnumOrePart; +import dark.core.basics.ItemParts; +import dark.core.basics.ItemParts.Parts; +import dark.machines.CoreRecipeLoader; + +public class FMRecipeLoader extends RecipeLoader +{ + + public static Block blockPipe; + public static Block blockTank; + public static Block blockPumpMachine; + public static Block blockRod; + public static Block blockGenerator; + public static Block blockReleaseValve; + public static Block blockSink; + public static Block blockDrain; + public static Block blockConPump; + public static Block blockHeater; + public static Block blockPiston; + public static Block blockBoiler; + + public static Block blockWasteLiquid; + public static Block blockOilLiquid; + public static Block blockFuelLiquid; + + @Override + public void loadRecipes() + { + super.loadRecipes(); + this.registerPipes(); + this.registerTanks(); + + // pump + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockPumpMachine, 1, 0), new Object[] { "C@C", "BMB", "@X@", '@', steelPlate, 'X', new ItemStack(blockPipe, 1), 'B', new ItemStack(CoreRecipeLoader.itemParts, 1, Parts.Valve.ordinal()), 'C', circuit, 'M', "motor" })); + // construction pump + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockConPump, 1, 0), new Object[] { "@C@", "BMB", "@@@", '@', steelPlate, 'B', new ItemStack(CoreRecipeLoader.itemParts, 1, Parts.Valve.ordinal()), 'C', "advancedCircuit", 'M', "motor" })); + // Drain + GameRegistry.addRecipe(new ItemStack(blockDrain, 1, 0), new Object[] { "IGI", "SVS", " P ", 'I', Item.ingotIron, 'G', Block.dispenser, 'S', Block.stone, 'P', new ItemStack(blockPipe, 1), 'V', new ItemStack(CoreRecipeLoader.itemParts, 1, Parts.Valve.ordinal()) }); + + // release valve + GameRegistry.addRecipe(new ItemStack(blockReleaseValve, 1), new Object[] { "RPR", "PVP", "RPR", 'P', new ItemStack(blockPipe, 1), 'V', new ItemStack(CoreRecipeLoader.itemParts, 1, Parts.Valve.ordinal()), 'R', Item.redstone }); + // sink + //GameRegistry.addRecipe(new ItemStack(blockSink, 1), new Object[] { "I I", "SIS", "SPS", 'P', new ItemStack(blockPipe, 1), 'I', Item.ingotIron, 'S', Block.stone }); + } + + public void registerTanks() + { + GameRegistry.addRecipe(new ItemStack(blockPumpMachine, 1, 0), new Object[] { "IXI", "X X", "IXI", 'I', Item.ingotIron, 'X', Block.glass }); + } + + public void registerPipes() + { + GameRegistry.addRecipe(new ShapelessOreRecipe(FluidPartsMaterial.IRON.getStack(2), new Object[] { EnumMaterial.IRON.getOreName(EnumOrePart.TUBE), ItemParts.Parts.Seal.name })); + GameRegistry.addRecipe(new ShapelessOreRecipe(FluidPartsMaterial.GOLD.getStack(2), new Object[] { EnumMaterial.GOLD.getOreName(EnumOrePart.TUBE), ItemParts.Parts.Seal.name })); + GameRegistry.addRecipe(new ShapelessOreRecipe(FluidPartsMaterial.TIN.getStack(2), new Object[] { EnumMaterial.TIN.getOreName(EnumOrePart.TUBE), ItemParts.Parts.Seal.name })); + GameRegistry.addRecipe(new ShapelessOreRecipe(FluidPartsMaterial.COPPER.getStack(2), new Object[] { EnumMaterial.COPPER.getOreName(EnumOrePart.TUBE), ItemParts.Parts.Seal.name })); + GameRegistry.addRecipe(new ShapelessOreRecipe(FluidPartsMaterial.BRONZE.getStack(2), new Object[] { EnumMaterial.BRONZE.getOreName(EnumOrePart.TUBE), ItemParts.Parts.GasSeal.name })); + GameRegistry.addRecipe(new ShapelessOreRecipe(FluidPartsMaterial.STEEL.getStack(2), new Object[] { EnumMaterial.STEEL.getOreName(EnumOrePart.TUBE), ItemParts.Parts.GasSeal.name })); + + GameRegistry.addRecipe(new ShapelessOreRecipe(FluidPartsMaterial.OBBY.getStack(2), new Object[] { EnumMaterial.OBBY.getOreName(EnumOrePart.TUBE), Block.netherBrick, Block.netherBrick })); + GameRegistry.addRecipe(new ShapedOreRecipe(FluidPartsMaterial.HELL.getStack(4), new Object[] { "OOO", "BNB", "OOO", 'N', Block.netherBrick, 'B', Item.blazeRod, 'O', Block.obsidian })); + + for (FluidPartsMaterial mat : FluidPartsMaterial.values()) + { + for (ColorCode color : ColorCode.values()) + { + GameRegistry.addRecipe(mat.getStack(color), new Object[] { " X ", "XIX", " X ", 'I', new ItemStack(Item.dyePowder, 1, color.ordinal()), 'X', blockPipe }); + GameRegistry.addShapelessRecipe(mat.getStack(), new Object[] { mat.getStack(color) }); + } + + } + + } +} diff --git a/FM/src/dark/fluid/common/FluidMech.java b/FM/src/dark/fluid/common/FluidMech.java new file mode 100644 index 000000000..f21b0ee3f --- /dev/null +++ b/FM/src/dark/fluid/common/FluidMech.java @@ -0,0 +1,187 @@ +package dark.fluid.common; + +import java.io.File; +import java.util.Arrays; +import java.util.logging.Logger; + +import net.minecraftforge.common.Configuration; +import net.minecraftforge.fluids.Fluid; + +import org.modstats.ModstatInfo; + +import universalelectricity.prefab.TranslationHelper; + +import com.dark.DarkCore; +import com.dark.CoreRegistry; +import com.dark.IndustryTabs; +import com.dark.prefab.ItemBlockHolder; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.Mod.Metadata; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.network.NetworkMod; +import dark.core.prefab.ModPrefab; +import dark.fluid.common.machines.BlockReleaseValve; +import dark.fluid.common.machines.BlockSink; +import dark.fluid.common.machines.BlockTank; +import dark.fluid.common.pipes.BlockPipe; +import dark.fluid.common.pipes.ItemBlockPipe; +import dark.fluid.common.pump.BlockConstructionPump; +import dark.fluid.common.pump.BlockDrain; +import dark.fluid.common.pump.BlockPumpMachine; +import dark.machines.CoreMachine; + +@ModstatInfo(prefix = "fluidmech") +@Mod(modid = FluidMech.MOD_ID, name = FluidMech.MOD_NAME, version = FluidMech.VERSION, dependencies = "after:DarkCore", useMetadata = true) +@NetworkMod(clientSideRequired = true, serverSideRequired = false) +public class FluidMech extends ModPrefab +{ + + public static final String MAJOR_VERSION = "@MAJOR@"; + public static final String MINOR_VERSION = "@MINOR@"; + public static final String REVIS_VERSION = "@REVIS@"; + public static final String BUILD_VERSION = "@BUILD@"; + public static final String VERSION = MAJOR_VERSION + "." + MINOR_VERSION + "." + REVIS_VERSION + "." + BUILD_VERSION; + // @Mod + public static final String MOD_ID = "FluidMech"; + public static final String MOD_NAME = "Fluid_Mechanics"; + + public static final String DOMAIN = "fm"; + public static final String PREFIX = DOMAIN + ":"; + + public static String DIRECTORY_NO_SLASH = "assets/" + DOMAIN + "/"; + public static String DIRECTORY = "/" + DIRECTORY_NO_SLASH; + public static String LANGUAGE_PATH = DIRECTORY + "languages/"; + public static String SOUND_PATH = DIRECTORY + "audio/"; + + public static final String WASTE_FLUID_NAME = "mixedWaste"; + public static final String OIL_FLUID_NAME = "oil"; + public static final String FUEL_FLUID_NAME = "fuel"; + public static final String BIO_FUEL_Name = ""; + + public static Fluid fmWaste, fmOil, fmFuel, fmBio; + public static Fluid waste, oil, fuel, bio; + + @Metadata(FluidMech.MOD_ID) + public static ModMetadata meta; + + /* SUPPORTED LANGS */ + private static final String[] LANGUAGES_SUPPORTED = new String[] { "en_US", "de_DE" }; + + /* CONFIG FILE */ + public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir() + "/Dark/", FluidMech.MOD_NAME + ".cfg")); + + /* BLOCKS */ + + @SidedProxy(clientSide = "dark.fluid.client.ClientProxy", serverSide = "dark.fluid.common.CommonProxy") + public static CommonProxy proxy; + + @Instance(FluidMech.MOD_NAME) + public static FluidMech instance; + + public static FMRecipeLoader recipeLoader; + + /* LOGGER - EXTENDS FORGE'S LOG SYSTEM */ + public static Logger FMLog = Logger.getLogger(FluidMech.MOD_NAME); + + @Override + @EventHandler + public void preInit(FMLPreInitializationEvent event) + { + instance = this; + super.preInit(event); + + /* BLOCK REGISTER CALLS */ + + proxy.preInit(); + } + + @Override + @EventHandler + public void init(FMLInitializationEvent event) + { + super.init(event); + proxy.Init(); + + /* LANG LOADING */ + FMLog.info(" Loaded: " + TranslationHelper.loadLanguages(LANGUAGE_PATH, LANGUAGES_SUPPORTED) + " Languages."); + if (FMRecipeLoader.blockPipe instanceof BlockPipe) + { + IndustryTabs.tabHydraulic().setIconItemStack(FluidPartsMaterial.IRON.getStack()); + } + } + + @Override + @EventHandler + public void postInit(FMLPostInitializationEvent event) + { + super.postInit(event); + proxy.postInit(); + + /* /******** RECIPES ************* */ + recipeLoader.loadRecipes(); + + FMLog.info("Done Loading"); + } + + @Override + public void registerObjects() + { + if (recipeLoader == null) + { + recipeLoader = new FMRecipeLoader(); + } + CONFIGURATION.load(); + + FMRecipeLoader.blockWasteLiquid = CoreRegistry.createNewFluidBlock(FluidMech.MOD_ID, FluidMech.CONFIGURATION, new Fluid(WASTE_FLUID_NAME).setUnlocalizedName("fluid.waste.name").setDensity(1300).setViscosity(1800)); + FMRecipeLoader.blockOilLiquid = CoreRegistry.createNewFluidBlock(FluidMech.MOD_ID, FluidMech.CONFIGURATION, new Fluid(OIL_FLUID_NAME).setUnlocalizedName("fluid.oil.name").setDensity(1500).setViscosity(4700)); + + FMRecipeLoader.blockPipe = CoreRegistry.createNewBlock("FMBlockPipe", FluidMech.MOD_ID, BlockPipe.class, ItemBlockPipe.class); + FMRecipeLoader.blockPumpMachine = CoreRegistry.createNewBlock("FMBlockPump", FluidMech.MOD_ID, BlockPumpMachine.class, ItemBlockHolder.class); + FMRecipeLoader.blockReleaseValve = CoreRegistry.createNewBlock("FMBlockReleaseValve", FluidMech.MOD_ID, BlockReleaseValve.class, ItemBlockHolder.class); + FMRecipeLoader.blockTank = CoreRegistry.createNewBlock("FMBlockTank", FluidMech.MOD_ID, BlockTank.class, ItemBlockPipe.class); + FMRecipeLoader.blockSink = CoreRegistry.createNewBlock("FMBlockSink", FluidMech.MOD_ID, BlockSink.class, ItemBlockHolder.class); + FMRecipeLoader.blockDrain = CoreRegistry.createNewBlock("FMBlockDrain", FluidMech.MOD_ID, BlockDrain.class, ItemBlockHolder.class); + FMRecipeLoader.blockConPump = CoreRegistry.createNewBlock("FMBlockConstructionPump", FluidMech.MOD_ID, BlockConstructionPump.class, ItemBlockHolder.class); + + CONFIGURATION.save(); + } + + @Override + public void loadModMeta() + { + /* MCMOD.INFO FILE BUILDER? */ + meta.modId = FluidMech.MOD_ID; + meta.name = FluidMech.MOD_NAME; + meta.description = "Fluid Mechanics is a combination between supporting fluid handling and mechanical energy handling system. " + "Its designed to help other mods move there liquids using a universal liquid system managed by forge. As a bonus it also " + "comes with suppot to help mods move energy by means of mechanics motion along rods. This mod by itself doesn't offer much more " + "than basic liquid storage, placement, and removel in the world. Its suggest to download other mods that supports the Forge's " + "Fluid System. " + "\n\n" + "Suported Power systems: Universal Electric, BuildCraft, IndustrialCraft "; + + meta.url = "http://www.universalelectricity.com/coremachine"; + + meta.logoFile = DarkCore.TEXTURE_DIRECTORY + "FM_Banner.png"; + meta.version = CoreMachine.VERSION; + meta.authorList = Arrays.asList(new String[] { "DarkGuardsman AKA DarkCow" }); + meta.credits = "Please see the website."; + meta.autogenerated = false; + + } + + @Override + public String getDomain() + { + return "fm"; + } + + @Override + public void loadRecipes() + { + // TODO Auto-generated method stub + + } +} diff --git a/FM/src/dark/fluid/common/FluidPartsMaterial.java b/FM/src/dark/fluid/common/FluidPartsMaterial.java new file mode 100644 index 000000000..4f5d88999 --- /dev/null +++ b/FM/src/dark/fluid/common/FluidPartsMaterial.java @@ -0,0 +1,161 @@ +package dark.fluid.common; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; +import dark.api.ColorCode; +import dark.fluid.common.prefab.TileEntityFluidNetworkTile; + +/** Enum to hold info about each pipe material. Values are by default and some can change with pipe + * upgrades. + * + * @Note unsupportedFluids should only be used by filters. All pipes should allow all fluid types. + * However, pipes that can't support the fluid should have an effect. Eg no gas support should cause + * the pipe to leak. No molten support should cause the pipe to take damage. + * + * @author DarkGuardsman */ +public enum FluidPartsMaterial +{ + /** Simple water only pipe. Should render open toped when it can */ + WOOD("wood", false, true, false, -1, 200), + /** Gas only pipe */ + GLASS("glass", true, false, false, 100, 300), + /** Another version of the wooden pipe */ + STONE("stone", false, true, false, -1, 1000), + /** Cheap fluid pipe */ + TIN("tin", false, true, false, 300, 1000), + /** Cheap fluid pipe */ + COPPER("copper", false, true, false, 400, 1000), + /** First duel gas and fluid pipe */ + IRON("iron", true, true, false, 500, 1000), + /** Fluid movement pipe that doesn't work well with pressure */ + GOLD("gold", true, true, false, 200, 2000), + /** Cheap molten metal pipe */ + OBBY("obby", false, true, true, 1000, 1000), + /** Very strong fluid and gas support pipe. Should also support molten metal as long as they + * don't stay in the pipe too long. */ + STEEL("steel", true, true, false, 10000, 3000), + /** Weaker equal to steel pipes. Should also support steam very well */ + BRONZE("bronze", true, true, false, 6000, 2000), + /** Hell fluids only. Meaning lava, and molten metals. Water should turn to steam, fuel and oil + * should cause an explosion around the pipe */ + HELL("hell", true, true, true, 10000, 5000, "water", "fuel", "oil"); + public String matName = "material"; + List unsupportedFluids = new ArrayList(); + public boolean canSupportGas = false; + public boolean canSupportFluids = false; + public boolean canSupportMoltenFluids = false; + public int maxPressure = 1000; + public int maxVolume = 2000; + /** Materials are stored as meta were there sub types are stored by NBT. Item versions of the + * pipes are still meta so there is a set spacing to allow for a large but defined range of sub + * pipes */ + public static int spacing = 1000; + + private FluidPartsMaterial() + { + this.canSupportGas = true; + this.canSupportFluids = true; + canSupportMoltenFluids = true; + } + + private FluidPartsMaterial(String name, boolean gas, boolean fluid, boolean molten, String... strings) + { + this.matName = name; + this.canSupportGas = gas; + this.canSupportFluids = fluid; + this.canSupportMoltenFluids = molten; + } + + private FluidPartsMaterial(String name, boolean gas, boolean fluid, boolean molten, int pressure, int volume, String... strings) + { + this(name, gas, fluid, molten, strings); + this.maxPressure = pressure; + this.maxVolume = volume; + } + + public static FluidPartsMaterial get(World world, int x, int y, int z) + { + return get(world.getBlockMetadata(x, y, z)); + } + + public static FluidPartsMaterial get(int i) + { + if (i < FluidPartsMaterial.values().length) + { + return FluidPartsMaterial.values()[i]; + } + return null; + } + + public static FluidPartsMaterial get(ItemStack stack) + { + if (stack != null) + { + return getFromItemMeta(stack.getItemDamage()); + } + return null; + } + + public static FluidPartsMaterial getFromItemMeta(int meta) + { + meta = meta / spacing; + if (meta < FluidPartsMaterial.values().length) + { + return FluidPartsMaterial.values()[meta]; + } + return FluidPartsMaterial.WOOD; + } + + public ItemStack getStack() + { + return getStack(1); + } + + public ItemStack getStack(ColorCode color) + { + return getStack(1, color); + } + + public ItemStack getStack(int s) + { + return new ItemStack(FMRecipeLoader.blockPipe, s, (this.ordinal() * spacing)); + } + + public ItemStack getStack(int s, ColorCode color) + { + return new ItemStack(FMRecipeLoader.blockPipe, s, (this.ordinal() * spacing) + color.ordinal() + 1); + } + + public static int getDropItemMeta(World world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + TileEntity ent = world.getBlockTileEntity(x, y, z); + meta *= spacing; + if (ent instanceof TileEntityFluidNetworkTile) + { + meta += ((TileEntityFluidNetworkTile) ent).getSubID(); + } + return meta; + } + + public boolean canSupport(FluidStack fluid) + { + if (fluid != null && fluid.getFluid() != null) + { + if (fluid.getFluid().isGaseous(fluid) && this.canSupportGas) + { + return true; + } + else if (!fluid.getFluid().isGaseous(fluid) && this.canSupportFluids) + { + return true; + } + } + return false; + } +} diff --git a/FM/src/dark/fluid/common/machines/BlockFM.java b/FM/src/dark/fluid/common/machines/BlockFM.java new file mode 100644 index 000000000..0aadf6d91 --- /dev/null +++ b/FM/src/dark/fluid/common/machines/BlockFM.java @@ -0,0 +1,17 @@ +package dark.fluid.common.machines; + +import com.dark.IndustryTabs; +import com.dark.prefab.BlockMachine; + +import net.minecraft.block.material.Material; +import dark.fluid.common.FluidMech; + +public abstract class BlockFM extends BlockMachine +{ + + public BlockFM(String name, Material material) + { + super(FluidMech.CONFIGURATION, name, material); + this.setCreativeTab(IndustryTabs.tabHydraulic()); + } +} diff --git a/FM/src/dark/fluid/common/machines/BlockReleaseValve.java b/FM/src/dark/fluid/common/machines/BlockReleaseValve.java new file mode 100644 index 000000000..3538c750d --- /dev/null +++ b/FM/src/dark/fluid/common/machines/BlockReleaseValve.java @@ -0,0 +1,91 @@ +package dark.fluid.common.machines; + +import java.util.Random; +import java.util.Set; + +import net.minecraft.block.material.Material; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import com.builtbroken.common.Pair; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.common.FMRecipeLoader; + +public class BlockReleaseValve extends BlockFM +{ + public BlockReleaseValve() + { + super("ReleaseValve", Material.iron); + this.setHardness(1f); + this.setResistance(5f); + } + + @Override + public TileEntity createNewTileEntity(World var1) + { + return new TileEntityReleaseValve(); + } + + @Override + public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) + { + return true; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderType() + { + return -1; + } + + @Override + public int damageDropped(int meta) + { + return 0; + } + + @Override + public int quantityDropped(Random par1Random) + { + return 1; + } + + @Override + public void onNeighborBlockChange(World par1World, int x, int y, int z, int side) + { + super.onNeighborBlockChange(par1World, x, y, z, side); + + } + + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) + { + return new ItemStack(FMRecipeLoader.blockReleaseValve, 1, 0); + } + + @Override + public void getTileEntities(int blockID, Set>> list) + { + list.add(new Pair>("ReleaseValve", TileEntityReleaseValve.class)); + + } +} diff --git a/FM/src/dark/fluid/common/machines/BlockSink.java b/FM/src/dark/fluid/common/machines/BlockSink.java new file mode 100644 index 000000000..f478a31bf --- /dev/null +++ b/FM/src/dark/fluid/common/machines/BlockSink.java @@ -0,0 +1,113 @@ +package dark.fluid.common.machines; + +import java.util.Set; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import universalelectricity.prefab.tile.TileEntityAdvanced; + +import com.builtbroken.common.Pair; +import com.dark.fluid.FluidHelper; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.client.render.BlockRenderHelper; + +public class BlockSink extends BlockFM +{ + public BlockSink() + { + super("FluidSink", Material.iron); + this.setResistance(4f); + this.setHardness(4f); + } + + @Override + public TileEntity createNewTileEntity(World var1) + { + return new TileEntitySink(); + } + + @Override + public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ) + { + return FluidHelper.playerActivatedFluidItem(world, x, y, z, entityplayer, side); + } + + @Override + public boolean onUseWrench(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) + { + int meta = par1World.getBlockMetadata(x, y, z); + int metaGroup = meta % 4; + + if (meta == (metaGroup * 4) + 3) + { + par1World.setBlockMetadataWithNotify(x, y, z, (metaGroup * 4), 3); + return true; + } + else + { + par1World.setBlockMetadataWithNotify(x, y, z, meta + 1, 3); + return true; + } + // return false; + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase par5EntityLiving, ItemStack itemStack) + { + int meta = world.getBlockMetadata(x, y, z); + int angle = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + TileEntity ent = world.getBlockTileEntity(x, y, z); + + world.setBlockMetadataWithNotify(x, y, z, angle * 4, 3); + if (ent instanceof TileEntityAdvanced) + { + ((TileEntityAdvanced) world.getBlockTileEntity(x, y, z)).initiate(); + } + + world.notifyBlocksOfNeighborChange(x, y, z, this.blockID); + } + + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + + return new ItemStack(this, 1, 0); + + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderType() + { + return BlockRenderHelper.renderID; + } + + @Override + public void getTileEntities(int blockID, Set>> list) + { + list.add(new Pair>("FluidSink", TileEntitySink.class)); + + } +} diff --git a/FM/src/dark/fluid/common/machines/BlockTank.java b/FM/src/dark/fluid/common/machines/BlockTank.java new file mode 100644 index 000000000..572282788 --- /dev/null +++ b/FM/src/dark/fluid/common/machines/BlockTank.java @@ -0,0 +1,151 @@ +package dark.fluid.common.machines; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraftforge.common.Configuration; +import universalelectricity.core.vector.Vector3; + +import com.builtbroken.common.Pair; +import com.dark.fluid.FluidHelper; +import com.dark.helpers.ItemWorldHelper; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.client.render.BlockRenderHelper; +import dark.fluid.common.FluidPartsMaterial; +import dark.fluid.common.pipes.ItemBlockPipe; +import dark.fluid.common.pipes.TileEntityPipe; + +public class BlockTank extends BlockFM +{ + public static int tankVolume = 16; + + public BlockTank() + { + super("FluidTank", Material.rock); + this.setHardness(1f); + this.setResistance(5f); + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderType() + { + return BlockRenderHelper.renderID; + } + + @Override + public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ) + { + return FluidHelper.playerActivatedFluidItem(world, x, y, z, entityplayer, side); + } + + @Override + public TileEntity createNewTileEntity(World var1) + { + return new TileEntityTank(); + } + + @Override + public boolean hasComparatorInputOverride() + { + return true; + } + + @Override + public int getComparatorInputOverride(World world, int x, int y, int z, int par5) + { + TileEntityTank tileEntity = (TileEntityTank) world.getBlockTileEntity(x, y, z); + if (tileEntity != null && tileEntity.getTileNetwork().getNetworkTankInfo().fluid != null) + { + return 15 * (tileEntity.getTileNetwork().getNetworkTankInfo().fluid.amount / tileEntity.getTileNetwork().getNetworkTankInfo().capacity); + } + return 0; + } + + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) + { + return new ItemStack(this, 1, FluidPartsMaterial.getDropItemMeta(world, x, y, z)); + } + + @Override + public ArrayList getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = new ArrayList(); + TileEntity entity = world.getBlockTileEntity(x, y, z); + if (entity instanceof TileEntityPipe) + { + ret.add(new ItemStack(this, 1, FluidPartsMaterial.getDropItemMeta(world, x, y, z))); + } + return ret; + } + + @SuppressWarnings("unchecked") + @Override + public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) + { + for (FluidPartsMaterial data : FluidPartsMaterial.values()) + { + par3List.add(new ItemStack(this, 1, data.ordinal() * FluidPartsMaterial.spacing)); + } + } + + @Override + public boolean onSneakMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) + { + if (!world.isRemote) + { + ItemStack dropStack = ItemBlockPipe.getWrenchedItem(world, new Vector3(x, y, z)); + if (dropStack != null) + { + if (entityPlayer.getHeldItem() == null) + { + entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, dropStack); + } + else + { + ItemWorldHelper.dropItemStack(world, new Vector3(x, y, z), dropStack, false); + } + world.setBlockToAir(x, y, z); + } + } + return true; + } + + @Override + public void loadExtraConfigs(Configuration config) + { + BlockTank.tankVolume = config.get("settings", "TankBucketVolume", 16, "Number of buckets each tank block can store, Settings this to zero is the same as one").getInt(); + + } + + @Override + public void getTileEntities(int blockID, Set>> list) + { + list.add(new Pair>("FluidTank", TileEntityTank.class)); + + } +} diff --git a/FM/src/dark/fluid/common/machines/TileEntityReleaseValve.java b/FM/src/dark/fluid/common/machines/TileEntityReleaseValve.java new file mode 100644 index 000000000..da1a626a4 --- /dev/null +++ b/FM/src/dark/fluid/common/machines/TileEntityReleaseValve.java @@ -0,0 +1,112 @@ +package dark.fluid.common.machines; + +import com.dark.helpers.ConnectionHelper; +import com.dark.tilenetwork.ITileConnector; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; +import dark.api.IToolReadOut; +import dark.api.fluid.INetworkPipe; +import dark.core.prefab.tilenetwork.fluid.NetworkPipes; +import dark.fluid.common.prefab.TileEntityFluidDevice; + +public class TileEntityReleaseValve extends TileEntityFluidDevice implements ITileConnector, IToolReadOut +{ + public TileEntity[] connected = new TileEntity[6]; + + @Override + public void updateEntity() + { + super.updateEntity(); + + if (this.ticks % 10 == 0) + { + this.refresh(); + if (!this.worldObj.isRemote && !worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) + { + for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) + { + if (connected[dir.ordinal()] instanceof IFluidHandler && !(connected[dir.ordinal()] instanceof INetworkPipe)) + { + IFluidHandler drainedTank = (IFluidHandler) connected[dir.ordinal()]; + FluidStack stack = drainedTank.drain(dir.getOpposite(), FluidContainerRegistry.BUCKET_VOLUME, false); + if (stack != null && stack.amount > 0) + { + INetworkPipe inputPipe = this.findValidPipe(stack); + if (inputPipe != null) + { + int ammountFilled = ((NetworkPipes) inputPipe.getTileNetwork()).addFluidToNetwork((TileEntity) drainedTank, stack, true); + drainedTank.drain(dir.getOpposite(), ammountFilled, true); + } + } + } + } + } + } + } + + /** used to find a valid pipe for filling of the liquid type */ + public INetworkPipe findValidPipe(FluidStack stack) + { + // find normal color selective pipe first + for (int i = 0; i < connected.length; i++) + { + TileEntity tile = connected[i]; + if (tile instanceof INetworkPipe && ((INetworkPipe) tile).fill(ForgeDirection.getOrientation(i), stack, false) > 0) + { + return (INetworkPipe) tile; + } + } + return null; + } + + /** Collects info about the surrounding 6 tiles and orders them into drain-able(ITankContainer) + * and fill-able(TileEntityPipes) instances */ + public void refresh() + { + // cleanup + this.connected = ConnectionHelper.getSurroundingTileEntities(this); + // read surroundings + for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) + { + TileEntity tileEntity = connected[dir.ordinal()]; + if (tileEntity instanceof ITileConnector) + { + if (this.canTileConnect(Connection.FLUIDS, dir.getOpposite())) + { + this.connected[dir.ordinal()] = tileEntity; + } + } + else if (tileEntity instanceof IFluidHandler) + { + this.connected[dir.ordinal()] = tileEntity; + } + } + } + + @Override + public boolean canTileConnect(Connection type, ForgeDirection dir) + { + return type == Connection.FLUIDS; + } + + @Override + public String getMeterReading(EntityPlayer user, ForgeDirection side, EnumTools tool) + { + // TODO maybe debug on # of connected units of input/output + String output = ""; + if (!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) + { + output += "Open"; + } + else + { + output += "Closed"; + } + return output; + } +} diff --git a/FM/src/dark/fluid/common/machines/TileEntitySink.java b/FM/src/dark/fluid/common/machines/TileEntitySink.java new file mode 100644 index 000000000..84a757e69 --- /dev/null +++ b/FM/src/dark/fluid/common/machines/TileEntitySink.java @@ -0,0 +1,110 @@ +package dark.fluid.common.machines; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.INetworkManager; +import net.minecraft.network.packet.Packet; +import net.minecraft.network.packet.Packet250CustomPayload; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import universalelectricity.prefab.network.IPacketReceiver; + +import com.dark.network.PacketHandler; +import com.google.common.io.ByteArrayDataInput; + +import dark.api.ColorCode; +import dark.fluid.common.prefab.TileEntityFluidStorage; +import dark.machines.CoreMachine; + +public class TileEntitySink extends TileEntityFluidStorage implements IPacketReceiver +{ + @Override + public int getTankSize() + { + return FluidContainerRegistry.BUCKET_VOLUME * 2; + } + + @Override + public void updateEntity() + { + if (!worldObj.isRemote) + { + if (ticks % (random.nextInt(5) * 10 + 20) == 0) + { + this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); + } + } + } + + @Override + public Packet getDescriptionPacket() + { + FluidStack stack = new FluidStack(FluidRegistry.WATER, 0); + if (this.getTank().getFluid() != null) + { + stack = this.getTank().getFluid(); + } + return PacketHandler.instance().getTilePacket(CoreMachine.CHANNEL, this, stack.writeToNBT(new NBTTagCompound())); + } + + @Override + public void handlePacketData(INetworkManager network, int packetType, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput data) + { + try + { + this.getTank().setFluid(FluidStack.loadFluidStackFromNBT(PacketHandler.instance().readNBTTagCompound(data))); + } + catch (Exception e) + { + e.printStackTrace(); + System.out.println("Fail reading data for fluid sink"); + } + + } + + @Override + public int fill(ForgeDirection side, FluidStack resource, boolean doFill) + { + int f = super.fill(side, resource, doFill); + if (doFill && f > 0) + { + this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); + } + return f; + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) + { + return fluid != null && fluid.getName().equalsIgnoreCase("water") && from != ForgeDirection.UP; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean setColor(Object obj) + { + return false; + } + + @Override + public ColorCode getColor() + { + return ColorCode.BLUE; + } +} diff --git a/FM/src/dark/fluid/common/machines/TileEntityTank.java b/FM/src/dark/fluid/common/machines/TileEntityTank.java new file mode 100644 index 000000000..d107fc3c8 --- /dev/null +++ b/FM/src/dark/fluid/common/machines/TileEntityTank.java @@ -0,0 +1,54 @@ +package dark.fluid.common.machines; + +import com.dark.tilenetwork.INetworkPart; +import com.dark.tilenetwork.ITileNetwork; + +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.ForgeDirection; +import dark.api.fluid.INetworkFluidPart; +import dark.core.prefab.tilenetwork.fluid.NetworkFluidContainers; +import dark.fluid.common.prefab.TileEntityFluidNetworkTile; + +public class TileEntityTank extends TileEntityFluidNetworkTile +{ + public TileEntityTank() + { + super(BlockTank.tankVolume); + } + + @Override + public NetworkFluidContainers getTileNetwork() + { + if (!(this.network instanceof NetworkFluidContainers)) + { + this.setTileNetwork(new NetworkFluidContainers(this)); + } + return (NetworkFluidContainers) this.network; + } + + @Override + public void setTileNetwork(ITileNetwork network) + { + if (network instanceof NetworkFluidContainers) + { + this.network = (NetworkFluidContainers) network; + } + } + + @Override + public void validateConnectionSide(TileEntity tileEntity, ForgeDirection side) + { + if (!this.worldObj.isRemote) + { + if (tileEntity instanceof TileEntityTank) + { + if (this.canTileConnect(Connection.NETWORK, side.getOpposite())) + { + this.getTileNetwork().mergeNetwork(((INetworkFluidPart) tileEntity).getTileNetwork(), (INetworkPart) tileEntity); + this.renderConnection[side.ordinal()] = true; + connectedBlocks.add(tileEntity); + } + } + } + } +} diff --git a/FM/src/dark/fluid/common/pipes/BlockPipe.java b/FM/src/dark/fluid/common/pipes/BlockPipe.java new file mode 100644 index 000000000..b25564c5a --- /dev/null +++ b/FM/src/dark/fluid/common/pipes/BlockPipe.java @@ -0,0 +1,180 @@ +package dark.fluid.common.pipes; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.Configuration; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.fluids.FluidTankInfo; + +import com.builtbroken.common.Pair; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.api.ColorCode; +import dark.api.ColorCode.IColorCoded; +import dark.fluid.common.FluidPartsMaterial; +import dark.fluid.common.machines.BlockFM; + +public class BlockPipe extends BlockFM +{ + + public static int waterFlowRate = 3000; + + public BlockPipe() + { + super("FluidPipe", Material.iron); + this.setBlockBounds(0.30F, 0.30F, 0.30F, 0.70F, 0.70F, 0.70F); + this.setHardness(1f); + this.setResistance(3f); + + } + + @Override + public void fillWithRain(World world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + if (meta == FluidPartsMaterial.WOOD.ordinal() || meta == FluidPartsMaterial.STONE.ordinal()) + { + //TODO fill pipe since it will have an open top and can gather rain + } + } + + @Override + public ArrayList getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = new ArrayList(); + TileEntity entity = world.getBlockTileEntity(x, y, z); + if (entity instanceof TileEntityPipe) + { + ret.add(new ItemStack(this, 1, FluidPartsMaterial.getDropItemMeta(world, x, y, z))); + } + return ret; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderType() + { + return -1; + } + + @Override + public TileEntity createNewTileEntity(World var1) + { + return new TileEntityPipe(); + } + + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) + { + return new ItemStack(this, 1, FluidPartsMaterial.getDropItemMeta(world, x, y, z)); + } + + @Override + public boolean canSilkHarvest(World world, EntityPlayer player, int x, int y, int z, int metadata) + { + return false; + } + + @Override + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + if (world.getBlockMetadata(x, y, z) == FluidPartsMaterial.HELL.ordinal()) + { + return 5; + } + return super.getLightValue(world, x, y, z); + } + + @Override + public boolean isLadder(World world, int x, int y, int z, EntityLivingBase entity) + { + return true; + } + + @Override + public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) + { + for (FluidPartsMaterial data : FluidPartsMaterial.values()) + { + par3List.add(data.getStack()); + } + } + + @Override + public void breakBlock(World world, int x, int y, int z, int par5, int par6) + { + TileEntity entity = world.getBlockTileEntity(x, y, z); + super.breakBlock(world, x, y, z, par5, par6); + + if (entity instanceof TileEntityPipe) + { + FluidTankInfo tank = ((TileEntityPipe) entity).getTankInfo()[0]; + if (tank != null && tank.fluid != null && tank.fluid.getFluid() != null && tank.fluid.amount > 0) + { + if (tank.fluid.getFluid().getName().equalsIgnoreCase("water")) + { + world.setBlock(x, y, z, Block.waterStill.blockID); + } + if (tank.fluid.getFluid().getName().equalsIgnoreCase("lava")) + { + world.setBlock(x, y, z, Block.lavaStill.blockID); + } + } + } + } + + @Override + public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour) + { + if (world.getBlockTileEntity(x, y, z) instanceof IColorCoded) + { + return ((IColorCoded) world.getBlockTileEntity(x, y, z)).setColor(ColorCode.get(colour)); + } + return false; + } + + @Override + public void getTileEntities(int blockID, Set>> list) + { + list.add(new Pair>("FluidPipe", TileEntityPipe.class)); + list.add(new Pair>("ColoredPipe", TileEntityPipe.class)); + } + + @Override + public boolean hasExtraConfigs() + { + return true; + } + + @Override + public void loadExtraConfigs(Configuration config) + { + BlockPipe.waterFlowRate = config.get("settings", "FlowRate", BlockPipe.waterFlowRate, "Base value for flow rate is based off of water. It is in milibuckets so 1000 equals one bucket of fluid").getInt(); + + } +} diff --git a/FM/src/dark/fluid/common/pipes/EnumPipeType.java b/FM/src/dark/fluid/common/pipes/EnumPipeType.java new file mode 100644 index 000000000..fbd4f87dc --- /dev/null +++ b/FM/src/dark/fluid/common/pipes/EnumPipeType.java @@ -0,0 +1,111 @@ +package dark.fluid.common.pipes; + +import dark.api.ColorCode; +import dark.api.ColorCode.IColoredId; + +public enum EnumPipeType implements IColoredId +{ + Base(0, 0, true), + COLOR(new IPipeType() + { + @Override + public ColorCode getColor(int meta) + { + return ColorCode.get(meta); + } + + @Override + public String getName(int pipeID) + { + if (pipeID < 16 && pipeID > 0) + { + return ColorCode.get(pipeID - 1).name; + } + return ""; + } + }, 1, 16, true); + + private IPipeType type; + public int metaStart = 1; + public int metaEnd = 16; + public boolean canColor = false; + + private EnumPipeType() + { + this.metaStart = this.ordinal() * 16; + this.metaEnd = this.metaStart + 15; + } + + private EnumPipeType(int metaStart, int metaEnd, boolean canColor) + { + + } + + private EnumPipeType(IPipeType type, int metaStart, int metaEnd, boolean canColor) + { + this.type = type; + this.metaStart = metaStart; + this.metaEnd = metaEnd; + this.canColor = canColor; + } + + public static EnumPipeType get(int meta) + { + for (EnumPipeType type : EnumPipeType.values()) + { + if (meta >= type.metaStart && meta <= type.metaEnd) + { + return type; + } + } + return null; + } + + public static boolean canColor(int meta) + { + EnumPipeType type = get(meta); + if (type != null) + { + return type.canColor; + } + return false; + } + + public static int getUpdatedID(int pipeID, ColorCode newColor) + { + if (pipeID == 0) + { + return 1 + newColor.ordinal(); + } + return pipeID; + } + + public static ColorCode getColorCode(int meta) + { + EnumPipeType type = get(meta); + if (type != null) + { + return type.getColor(meta); + } + return ColorCode.UNKOWN; + } + + @Override + public ColorCode getColor(int meta) + { + if (type != null) + { + return type.getColor(meta); + } + return ColorCode.UNKOWN; + } + + public String getName(int pipeID) + { + if (type != null) + { + return type.getName(pipeID); + } + return ""; + } +} diff --git a/FM/src/dark/fluid/common/pipes/EnumTankTypes.java b/FM/src/dark/fluid/common/pipes/EnumTankTypes.java new file mode 100644 index 000000000..da7b55a97 --- /dev/null +++ b/FM/src/dark/fluid/common/pipes/EnumTankTypes.java @@ -0,0 +1,111 @@ +package dark.fluid.common.pipes; + +import dark.api.ColorCode; +import dark.api.ColorCode.IColoredId; + +public enum EnumTankTypes implements IColoredId +{ + Base(0, 0, true), + COLOR(new IPipeType() + { + @Override + public ColorCode getColor(int meta) + { + return ColorCode.get(meta); + } + + @Override + public String getName(int pipeID) + { + if (pipeID < 16 && pipeID > 0) + { + return ColorCode.get(pipeID - 1).name; + } + return ""; + } + }, 1, 16, true); + + private IPipeType type; + public int metaStart = 1; + public int metaEnd = 16; + public boolean canColor = false; + + private EnumTankTypes() + { + this.metaStart = this.ordinal() * 16; + this.metaEnd = this.metaStart + 15; + } + + private EnumTankTypes(int metaStart, int metaEnd, boolean canColor) + { + + } + + private EnumTankTypes(IPipeType type, int metaStart, int metaEnd, boolean canColor) + { + this.type = type; + this.metaStart = metaStart; + this.metaEnd = metaEnd; + this.canColor = canColor; + } + + public static EnumPipeType get(int meta) + { + for (EnumPipeType type : EnumPipeType.values()) + { + if (meta >= type.metaStart && meta <= type.metaEnd) + { + return type; + } + } + return null; + } + + public static boolean canColor(int meta) + { + EnumPipeType type = get(meta); + if (type != null) + { + return type.canColor; + } + return false; + } + + public static int getUpdatedID(int pipeID, ColorCode newColor) + { + if (pipeID == 0) + { + return 1 + newColor.ordinal(); + } + return pipeID; + } + + public static ColorCode getColorCode(int meta) + { + EnumPipeType type = get(meta); + if (type != null) + { + return type.getColor(meta); + } + return ColorCode.UNKOWN; + } + + @Override + public ColorCode getColor(int meta) + { + if (type != null) + { + return type.getColor(meta); + } + return ColorCode.UNKOWN; + } + + public String getName(int pipeID) + { + if (type != null) + { + return type.getName(pipeID); + } + return ""; + } +} diff --git a/FM/src/dark/fluid/common/pipes/IPipeType.java b/FM/src/dark/fluid/common/pipes/IPipeType.java new file mode 100644 index 000000000..a674f95b6 --- /dev/null +++ b/FM/src/dark/fluid/common/pipes/IPipeType.java @@ -0,0 +1,8 @@ +package dark.fluid.common.pipes; + +import dark.api.ColorCode.IColoredId; + +public interface IPipeType extends IColoredId +{ + public String getName(int pipeID); +} diff --git a/FM/src/dark/fluid/common/pipes/ItemBlockPipe.java b/FM/src/dark/fluid/common/pipes/ItemBlockPipe.java new file mode 100644 index 000000000..3026b4e05 --- /dev/null +++ b/FM/src/dark/fluid/common/pipes/ItemBlockPipe.java @@ -0,0 +1,123 @@ +package dark.fluid.common.pipes; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import universalelectricity.core.vector.Vector3; +import dark.fluid.common.FMRecipeLoader; +import dark.fluid.common.FluidPartsMaterial; +import dark.fluid.common.machines.TileEntityTank; +import dark.fluid.common.prefab.TileEntityFluidNetworkTile; + +public class ItemBlockPipe extends ItemBlock +{ + + public ItemBlockPipe(int id) + { + super(id); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + @Override + public int getMetadata(int damage) + { + return 0; + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) + { + if (stack.getTagCompound() != null && stack.getTagCompound().hasKey("fluid")) + { + FluidStack fluid = FluidStack.loadFluidStackFromNBT(stack.getTagCompound().getCompoundTag("fluid")); + if (fluid != null) + { + list.add("Fluid: " + fluid.getFluid().getName()); + list.add("Vol: " + fluid.amount); + } + } + } + + public static ItemStack getWrenchedItem(World world, Vector3 vec) + { + TileEntity entity = vec.getTileEntity(world); + if (entity instanceof TileEntityTank && ((TileEntityTank) entity).getTankInfo() != null && ((TileEntityTank) entity).getTankInfo()[0] != null) + { + ItemStack itemStack = new ItemStack(FMRecipeLoader.blockTank); + FluidStack stack = ((TileEntityTank) entity).getTankInfo()[0].fluid; + + if (itemStack.getTagCompound() == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + if (stack != null) + { + ((TileEntityTank) entity).drain(ForgeDirection.UNKNOWN, stack.amount, true); + itemStack.getTagCompound().setCompoundTag("fluid", stack.writeToNBT(new NBTTagCompound())); + } + return itemStack; + } + return null; + } + + @Override + public void onUpdate(ItemStack itemStack, World par2World, Entity entity, int par4, boolean par5) + { + if (entity instanceof EntityPlayer) + { + EntityPlayer player = (EntityPlayer) entity; + + if (itemStack.getTagCompound() != null && !player.capabilities.isCreativeMode && itemStack.getTagCompound().hasKey("fluid")) + { + player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 5, 0)); + } + } + } + + @Override + public int getItemStackLimit(ItemStack stack) + { + if (stack.getTagCompound() != null && stack.getTagCompound().hasKey("fluid")) + { + return 1; + } + return this.getItemStackLimit(); + } + + @Override + public String getUnlocalizedName(ItemStack itemStack) + { + return Block.blocksList[this.getBlockID()].getUnlocalizedName() + "." + itemStack.getItemDamage(); + } + + @Override + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) + { + if (super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, (stack.getItemDamage() / FluidPartsMaterial.spacing))) + { + TileEntity tile = world.getBlockTileEntity(x, y, z); + if (tile instanceof TileEntityFluidNetworkTile) + { + ((TileEntityFluidNetworkTile) tile).setSubID(stack.getItemDamage()); + if (stack.getTagCompound() != null && stack.getTagCompound().hasKey("fluid")) + { + ((TileEntityFluidNetworkTile) tile).fill(ForgeDirection.UNKNOWN, FluidStack.loadFluidStackFromNBT(stack.getTagCompound().getCompoundTag("fluid")), true); + } + } + return true; + } + return false; + } +} diff --git a/FM/src/dark/fluid/common/pipes/ThreadFluidNetwork.java b/FM/src/dark/fluid/common/pipes/ThreadFluidNetwork.java new file mode 100644 index 000000000..5b636fad1 --- /dev/null +++ b/FM/src/dark/fluid/common/pipes/ThreadFluidNetwork.java @@ -0,0 +1,36 @@ +package dark.fluid.common.pipes; + +import java.util.ArrayList; +import java.util.List; + +import com.builtbroken.common.Pair; + +import dark.core.prefab.tilenetwork.fluid.NetworkFluidTiles; + +public class ThreadFluidNetwork extends Thread +{ + protected static List> storageCalcList = new ArrayList(); + + //TODO create a thread to off load tile network calculation to reduce strain on the main thread. Things to include are fluid container updates, path finding, and fill target finding. + /** Makes a request that this thread calculate the liquid storage locations in the network for + * the entire network's volume + * + * @even - each tile will get the same fluid level. If false physics will be used to calculate + * were the fluid is */ + public static void calculateStorage(NetworkFluidTiles network, boolean even) + { + + } + + public static void sendUpdateToClient(NetworkFluidTiles network) + { + + } + + @Override + public void run() + { + + } + +} diff --git a/FM/src/dark/fluid/common/pipes/TileEntityPipe.java b/FM/src/dark/fluid/common/pipes/TileEntityPipe.java new file mode 100644 index 000000000..6bc805d9f --- /dev/null +++ b/FM/src/dark/fluid/common/pipes/TileEntityPipe.java @@ -0,0 +1,176 @@ +package dark.fluid.common.pipes; + +import com.dark.tilenetwork.ITileConnector; +import com.dark.tilenetwork.ITileNetwork; + +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; +import universalelectricity.core.vector.Vector3; +import dark.api.ColorCode; +import dark.api.ColorCode.IColorCoded; +import dark.api.fluid.INetworkPipe; +import dark.core.prefab.tilenetwork.fluid.NetworkPipes; +import dark.fluid.common.FluidPartsMaterial; +import dark.fluid.common.prefab.TileEntityFluidNetworkTile; + +public class TileEntityPipe extends TileEntityFluidNetworkTile implements IColorCoded, INetworkPipe +{ + /** gets the current color mark of the pipe */ + @Override + public ColorCode getColor() + { + return EnumPipeType.getColorCode(this.subID); + } + + /** sets the current color mark of the pipe */ + @Override + public boolean setColor(Object cc) + { + if (!worldObj.isRemote) + { + int p = this.subID; + this.subID = EnumPipeType.getUpdatedID(subID, ColorCode.get(cc)); + return p != this.subID; + } + return false; + } + + @Override + public void validateConnectionSide(TileEntity tileEntity, ForgeDirection side) + { + super.validateConnectionSide(tileEntity, side); + + if (tileEntity instanceof TileEntityPipe) + { + int meta = new Vector3(this).getBlockMetadata(this.worldObj); + int metaOther = new Vector3(tileEntity).getBlockMetadata(this.worldObj); + if (meta < FluidPartsMaterial.values().length && metaOther < FluidPartsMaterial.values().length) + { + FluidPartsMaterial pipeMat = FluidPartsMaterial.values()[meta]; + FluidPartsMaterial pipeMatOther = FluidPartsMaterial.values()[metaOther]; + //Same pipe types can connect + if (pipeMat == pipeMatOther) + { + this.getTileNetwork().mergeNetwork(((INetworkPipe) tileEntity).getTileNetwork(), this); + connectedBlocks.add(tileEntity); + this.renderConnection[side.ordinal()] = true; + }//Wood and stone pipes can connect to each other but not other pipe types since they are more like a trough than a pipe + else if ((pipeMat == FluidPartsMaterial.WOOD || pipeMat == FluidPartsMaterial.STONE) && (pipeMatOther == FluidPartsMaterial.WOOD || pipeMatOther == FluidPartsMaterial.STONE)) + { + this.getTileNetwork().mergeNetwork(((INetworkPipe) tileEntity).getTileNetwork(), this); + connectedBlocks.add(tileEntity); + this.renderConnection[side.ordinal()] = true; + }//Any other pipe can connect to each other as long as the color matches except for glass which only works with itself at the moment + else if (pipeMat != FluidPartsMaterial.WOOD && pipeMat != FluidPartsMaterial.STONE && pipeMatOther != FluidPartsMaterial.WOOD && pipeMatOther != FluidPartsMaterial.STONE && pipeMat != FluidPartsMaterial.GLASS && pipeMatOther != FluidPartsMaterial.GLASS) + { + this.getTileNetwork().mergeNetwork(((INetworkPipe) tileEntity).getTileNetwork(), this); + connectedBlocks.add(tileEntity); + this.renderConnection[side.ordinal()] = true; + } + } + } + else if (tileEntity instanceof IFluidHandler) + { + connectedBlocks.add(tileEntity); + this.renderConnection[side.ordinal()] = true; + this.getTileNetwork().addTank(side.getOpposite(), (IFluidHandler) tileEntity); + } + else if (tileEntity instanceof ITileConnector && ((ITileConnector) tileEntity).canTileConnect(Connection.FLUIDS, side.getOpposite())) + { + connectedBlocks.add(tileEntity); + this.renderConnection[side.ordinal()] = true; + } + + } + + @Override + public boolean onPassThrew(FluidStack fluid, ForgeDirection from, ForgeDirection to) + { + //TODO do checks for molten pipe so that fluids like water turn into steam, oils and fuels burn + return super.onPassThrew(fluid, from, to); + } + + @Override + public double getMaxPressure(ForgeDirection side) + { + int meta = this.worldObj.getBlockMetadata(xCoord, yCoord, zCoord); + if (meta < FluidPartsMaterial.values().length) + { + return FluidPartsMaterial.values()[meta].maxPressure; + } + return 350; + } + + @Override + public NetworkPipes getTileNetwork() + { + if (!(this.network instanceof NetworkPipes)) + { + this.setTileNetwork(new NetworkPipes(this)); + } + return (NetworkPipes) this.network; + } + + @Override + public void setTileNetwork(ITileNetwork network) + { + if (network instanceof NetworkPipes) + { + this.network = (NetworkPipes) network; + } + } + + @Override + public int getMaxFlowRate(FluidStack stack, ForgeDirection side) + { + if (stack != null) + { + return this.calculateFlowRate(stack, 40, 20); + } + return BlockPipe.waterFlowRate; + } + + /** Calculates flow rate based on viscosity & temp of the fluid as all other factors are know + * + * @param fluid - fluidStack + * @param temp = tempature of the fluid + * @param pressure - pressure difference of were the fluid is flowing too. + * @return flow rate in mili-Buckets */ + public int calculateFlowRate(FluidStack fluid, float pressure, float temp) + { + //TODO recalculate this based on pipe material for friction + if (fluid != null & fluid.getFluid() != null) + { + float f = .012772f * pressure; + f = f / (8 * (fluid.getFluid().getViscosity() / 1000)); + return (int) (f * 1000); + } + return BlockPipe.waterFlowRate; + } + + @Override + public boolean onOverPressure(Boolean damageAllowed) + { + if (damageAllowed) + { + worldObj.setBlockMetadataWithNotify(xCoord, yCoord, yCoord, 0, 0); + return true; + } + return false; + } + + @Override + public void sendTankUpdate(int index) + { + //TODO only send tank update for pipes that need to visually render the fluid, eg glass, stone, wood + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + return false; + } +} diff --git a/FM/src/dark/fluid/common/pipes/tele/INetworkConnector.java b/FM/src/dark/fluid/common/pipes/tele/INetworkConnector.java new file mode 100644 index 000000000..ba6a2a43e --- /dev/null +++ b/FM/src/dark/fluid/common/pipes/tele/INetworkConnector.java @@ -0,0 +1,18 @@ +package dark.fluid.common.pipes.tele; + +import dark.api.fluid.INetworkPipe; + +/** Used by IFluidNetworkPart to signal this block is remotely connected to another network. It will + * cause that network to seak out all other connected network and try to merge them */ +public interface INetworkConnector extends INetworkPipe +{ + /** gets the pipes frequency */ + public int getFrequency(); + + public void setFrequency(int id); + + /** gets the pipes owner */ + public String getOwner(); + + public void setOwner(String username); +} diff --git a/FM/src/dark/fluid/common/prefab/TileEntityFluidDevice.java b/FM/src/dark/fluid/common/prefab/TileEntityFluidDevice.java new file mode 100644 index 000000000..82adda48d --- /dev/null +++ b/FM/src/dark/fluid/common/prefab/TileEntityFluidDevice.java @@ -0,0 +1,33 @@ +package dark.fluid.common.prefab; + +import java.util.Random; + +import com.dark.tilenetwork.ITileConnector; +import com.dark.tilenetwork.prefab.NetworkTileEntities; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.common.ForgeDirection; +import universalelectricity.prefab.tile.TileEntityAdvanced; +import dark.api.IToolReadOut; + +public abstract class TileEntityFluidDevice extends TileEntityAdvanced implements IToolReadOut, ITileConnector +{ + public Random random = new Random(); + + @Override + public void invalidate() + { + super.invalidate(); + NetworkTileEntities.invalidate(this); + } + + @Override + public String getMeterReading(EntityPlayer user, ForgeDirection side, EnumTools tool) + { + if (tool != null && tool == EnumTools.PIPE_GUAGE) + { + return " IndirectlyPower:" + this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord); + } + return null; + } +} diff --git a/FM/src/dark/fluid/common/prefab/TileEntityFluidNetworkTile.java b/FM/src/dark/fluid/common/prefab/TileEntityFluidNetworkTile.java new file mode 100644 index 000000000..bd823fba1 --- /dev/null +++ b/FM/src/dark/fluid/common/prefab/TileEntityFluidNetworkTile.java @@ -0,0 +1,490 @@ +package dark.fluid.common.prefab; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.packet.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; + +import org.bouncycastle.util.Arrays; + +import universalelectricity.core.vector.Vector3; + +import com.dark.network.ISimplePacketReceiver; +import com.dark.network.PacketHandler; +import com.dark.tilenetwork.INetworkPart; +import com.dark.tilenetwork.ITileNetwork; +import com.google.common.io.ByteArrayDataInput; + +import cpw.mods.fml.common.network.Player; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.api.FluidMasterList; +import dark.api.fluid.INetworkFluidPart; +import dark.core.prefab.tilenetwork.fluid.NetworkFluidTiles; +import dark.fluid.common.FluidPartsMaterial; +import dark.machines.CoreMachine; + +public abstract class TileEntityFluidNetworkTile extends TileEntityFluidDevice implements INetworkFluidPart, ISimplePacketReceiver +{ + private int updateTick = 1; + public static int refreshRate = 10; + protected FluidTank tank; + protected FluidTankInfo[] internalTanksInfo = new FluidTankInfo[1]; + protected List connectedBlocks = new ArrayList(); + public boolean[] renderConnection = new boolean[6]; + protected int heat = 0, maxHeat = 20000; + protected int damage = 0, maxDamage = 1000; + protected int subID = 0; + protected int tankCap; + protected FluidStack prevStack = null; + + protected NetworkFluidTiles network; + + public TileEntityFluidNetworkTile() + { + this(1); + } + + public TileEntityFluidNetworkTile(int tankCap) + { + if (tankCap <= 0) + { + tankCap = 1; + } + this.tankCap = tankCap; + this.tank = new FluidTank(this.tankCap * FluidContainerRegistry.BUCKET_VOLUME); + this.internalTanksInfo[0] = this.tank.getInfo(); + } + + public FluidTank getTank() + { + if (tank == null) + { + this.tank = new FluidTank(this.tankCap * FluidContainerRegistry.BUCKET_VOLUME); + this.internalTanksInfo[0] = this.tank.getInfo(); + } + return tank; + } + + @Override + public void updateEntity() + { + super.updateEntity(); + if (!worldObj.isRemote) + { + if (ticks % this.updateTick == 0) + { + this.updateTick = this.worldObj.rand.nextInt(5) * 40 + 20; + this.refresh(); + } + if (ticks % TileEntityFluidNetworkTile.refreshRate == 0) + { + if (this.getTank().getFluid() == null && this.prevStack == null) + { + //Do nothing + } + else if ((this.getTank().getFluid() == null && this.prevStack != null) || (this.getTank().getFluid() != null && this.prevStack == null) || (this.getTank().getFluid().amount != this.prevStack.amount)) + { + this.sendTankUpdate(0); + } + this.prevStack = this.tank.getFluid(); + } + } + } + + @Override + public void invalidate() + { + this.getTileNetwork().splitNetwork(this); + super.invalidate(); + } + + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + if (this.getTileNetwork() != null && resource != null) + { + return this.getTileNetwork().fillNetworkTank(this, resource, doFill); + } + return 0; + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + if (this.getTileNetwork() != null && resource != null) + { + if (this.getTileNetwork().getNetworkTank() != null && this.getTileNetwork().getNetworkTank().getFluid() != null && this.getTileNetwork().getNetworkTank().getFluid().isFluidEqual(resource)) + { + return this.getTileNetwork().drainNetworkTank(this.worldObj, resource.amount, doDrain); + } + + } + return null; + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) + { + if (this.getTileNetwork() != null) + { + return this.getTileNetwork().drainNetworkTank(this.worldObj, maxDrain, doDrain); + } + return null; + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) + { + return new FluidTankInfo[] { this.getTileNetwork().getNetworkTankInfo() }; + } + + @Override + public List getNetworkConnections() + { + return this.connectedBlocks; + } + + @Override + public void refresh() + { + if (this.worldObj != null && !this.worldObj.isRemote) + { + boolean[] previousConnections = this.renderConnection.clone(); + this.connectedBlocks.clear(); + this.renderConnection = new boolean[6]; + + for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) + { + this.validateConnectionSide(new Vector3(this).modifyPositionFromSide(dir).getTileEntity(this.worldObj), dir); + + } + /** Only send packet updates if visuallyConnected changed. */ + if (!Arrays.areEqual(previousConnections, this.renderConnection)) + { + this.sendRenderUpdate(); + } + } + + } + + /** Checks to make sure the connection is valid to the tileEntity + * + * @param tileEntity - the tileEntity being checked + * @param side - side the connection is too */ + public void validateConnectionSide(TileEntity tileEntity, ForgeDirection side) + { + if (!this.worldObj.isRemote) + { + if (tileEntity instanceof INetworkFluidPart) + { + if (this.canTileConnect(Connection.NETWORK, side.getOpposite())) + { + this.getTileNetwork().mergeNetwork(((INetworkFluidPart) tileEntity).getTileNetwork(), (INetworkPart) tileEntity); + this.renderConnection[side.ordinal()] = true; + connectedBlocks.add(tileEntity); + } + } + } + } + + @Override + public NetworkFluidTiles getTileNetwork() + { + if (!(this.network instanceof NetworkFluidTiles)) + { + this.network = new NetworkFluidTiles(this); + } + return this.network; + } + + @Override + public void setTileNetwork(ITileNetwork fluidNetwork) + { + if (fluidNetwork instanceof NetworkFluidTiles) + { + this.network = (NetworkFluidTiles) fluidNetwork; + } + + } + + @Override + public FluidTankInfo[] getTankInfo() + { + if (this.internalTanksInfo == null) + { + this.internalTanksInfo = new FluidTankInfo[] { this.getTank().getInfo() }; + } + return this.internalTanksInfo; + } + + @Override + public int fillTankContent(int index, FluidStack stack, boolean doFill) + { + if (index == 0) + { + int p = this.getTank().getFluid() != null ? this.getTank().getFluid().amount : 0; + int fill = this.getTank().fill(stack, doFill); + if (p != fill && doFill) + { + this.internalTanksInfo[index] = this.getTank().getInfo(); + } + return fill; + } + return 0; + } + + @Override + public FluidStack drainTankContent(int index, int volume, boolean doDrain) + { + if (index == 0) + { + FluidStack prev = this.getTank().getFluid(); + FluidStack stack = this.getTank().drain(volume, doDrain); + if (prev != null && (stack == null || prev.amount != stack.amount) && doDrain) + { + this.internalTanksInfo[index] = this.getTank().getInfo(); + } + return stack; + } + return null; + } + + @Override + public boolean canTileConnect(Connection type, ForgeDirection dir) + { + if (this.damage >= this.maxDamage) + { + return false; + } + return type == Connection.FLUIDS || type == Connection.NETWORK; + } + + @Override + public boolean canPassThrew(FluidStack fluid, ForgeDirection from, ForgeDirection to) + { + return this.connectedBlocks.get(from.ordinal()) != null && this.connectedBlocks.get(to.ordinal()) != null && this.damage < this.maxDamage; + } + + @Override + public boolean onPassThrew(FluidStack fluid, ForgeDirection from, ForgeDirection to) + { + FluidPartsMaterial mat = FluidPartsMaterial.get(this.getBlockMetadata()); + if (fluid != null && fluid.getFluid() != null && mat != null) + { + if (fluid.getFluid().isGaseous(fluid) && !mat.canSupportGas) + { + //TODO lose 25% of the gas, and render the escaping gas as a particle effect + this.getTileNetwork().drainNetworkTank(this.worldObj, (int) (fluid.amount * .25), true); + } + else if (FluidMasterList.isMolten(fluid.getFluid()) && !mat.canSupportMoltenFluids) + { + //TODO start to heat up the pipe to melting point. When it hits melting point turn the pipe to its molten metal equal + //TODO also once it reaches a set heat level start burning up blocks around the pipe such as wood + this.heat += FluidMasterList.getHeatPerPass(fluid.getFluid()); + if (heat >= this.maxHeat) + { + this.worldObj.setBlock(xCoord, yCoord, zCoord, Block.lavaStill.blockID); + return true; + } + } + else if (!fluid.getFluid().isGaseous(fluid) && !mat.canSupportFluids) + { + this.damage += 1; + if (this.damage >= this.maxDamage) + { + //TODO test this and make sure its right, as well black fluid block in some cases + this.getBlockType().dropBlockAsItem(worldObj, xCoord, yCoord, zCoord, 0, 0); + this.worldObj.setBlock(xCoord, yCoord, zCoord, 0); + return true; + } + } + } + return false; + } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + this.damage = nbt.getInteger("damage"); + this.heat = nbt.getInteger("heat"); + this.subID = nbt.getInteger("subID"); + if (nbt.hasKey("stored")) + { + NBTTagCompound tag = nbt.getCompoundTag("stored"); + String name = tag.getString("LiquidName"); + int amount = nbt.getInteger("Amount"); + Fluid fluid = FluidRegistry.getFluid(name); + if (fluid != null) + { + FluidStack liquid = new FluidStack(fluid, amount); + this.getTank().setFluid(liquid); + internalTanksInfo[0] = this.getTank().getInfo(); + } + } + else + { + this.getTank().readFromNBT(nbt.getCompoundTag("FluidTank")); + internalTanksInfo[0] = this.getTank().getInfo(); + } + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + nbt.setInteger("damage", this.damage); + nbt.setInteger("heat", this.heat); + nbt.setInteger("subID", this.subID); + nbt.setCompoundTag("FluidTank", this.getTank().writeToNBT(new NBTTagCompound())); + } + + @Override + public boolean simplePacket(String id, ByteArrayDataInput data, Player player) + { + try + { + if (this.worldObj.isRemote) + { + if (id.equalsIgnoreCase("DescriptionPacket")) + { + this.subID = data.readInt(); + this.renderConnection[0] = data.readBoolean(); + this.renderConnection[1] = data.readBoolean(); + this.renderConnection[2] = data.readBoolean(); + this.renderConnection[3] = data.readBoolean(); + this.renderConnection[4] = data.readBoolean(); + this.renderConnection[5] = data.readBoolean(); + this.tank = new FluidTank(data.readInt()); + this.getTank().readFromNBT(PacketHandler.instance().readNBTTagCompound(data)); + this.internalTanksInfo[0] = this.getTank().getInfo(); + return true; + } + else if (id.equalsIgnoreCase("RenderPacket")) + { + this.subID = data.readInt(); + this.renderConnection[0] = data.readBoolean(); + this.renderConnection[1] = data.readBoolean(); + this.renderConnection[2] = data.readBoolean(); + this.renderConnection[3] = data.readBoolean(); + this.renderConnection[4] = data.readBoolean(); + this.renderConnection[5] = data.readBoolean(); + return true; + } + else if (id.equalsIgnoreCase("SingleTank")) + { + this.tank = new FluidTank(data.readInt()); + this.getTank().readFromNBT(PacketHandler.instance().readNBTTagCompound(data)); + this.internalTanksInfo[0] = this.getTank().getInfo(); + return true; + } + } + } + catch (IOException e) + { + System.out.println("// Fluid Mechanics Tank packet read error"); + e.printStackTrace(); + return true; + } + return false; + } + + @Override + public Packet getDescriptionPacket() + { + Object[] data = new Object[10]; + data[0] = "DescriptionPacket"; + data[1] = this.subID; + data[2] = this.renderConnection[0]; + data[3] = this.renderConnection[1]; + data[4] = this.renderConnection[2]; + data[5] = this.renderConnection[3]; + data[6] = this.renderConnection[4]; + data[7] = this.renderConnection[5]; + data[8] = this.getTank().getCapacity(); + data[9] = this.getTank().writeToNBT(new NBTTagCompound()); + return PacketHandler.instance().getTilePacket(CoreMachine.CHANNEL, this, data); + } + + public void sendRenderUpdate() + { + Object[] data = new Object[8]; + data[0] = "RenderPacket"; + data[1] = this.subID; + data[2] = this.renderConnection[0]; + data[3] = this.renderConnection[1]; + data[4] = this.renderConnection[2]; + data[5] = this.renderConnection[3]; + data[6] = this.renderConnection[4]; + data[7] = this.renderConnection[5]; + PacketHandler.instance().sendPacketToClients(PacketHandler.instance().getTilePacket(CoreMachine.CHANNEL, this, data)); + } + + public void sendTankUpdate(int index) + { + if (this.getTank() != null && index == 0) + { + PacketHandler.instance().sendPacketToClients(PacketHandler.instance().getTilePacket(CoreMachine.CHANNEL, this, "SingleTank", this.getTank().getCapacity(), this.getTank().writeToNBT(new NBTTagCompound())), this.worldObj, new Vector3(this), 60); + } + } + + @Override + public String getMeterReading(EntityPlayer user, ForgeDirection side, EnumTools tool) + { + if (tool == EnumTools.PIPE_GUAGE) + { + String out = "Debug: " + this.getTileNetwork().toString(); + out += " "; + for (boolean b : this.renderConnection) + { + out += "|" + (b ? "T" : "F"); + } + return out + " Vol: " + this.getTileNetwork().getNetworkTank().getFluidAmount(); + } + return null; + } + + @Override + @SideOnly(Side.CLIENT) + public AxisAlignedBB getRenderBoundingBox() + { + return AxisAlignedBB.getAABBPool().getAABB(this.xCoord, this.yCoord, this.zCoord, this.xCoord + 1, this.yCoord + 1, this.zCoord + 1); + } + + public int getSubID() + { + return this.subID; + } + + public void setSubID(int id) + { + this.subID = id; + } + +} diff --git a/FM/src/dark/fluid/common/prefab/TileEntityFluidStorage.java b/FM/src/dark/fluid/common/prefab/TileEntityFluidStorage.java new file mode 100644 index 000000000..741f3d24d --- /dev/null +++ b/FM/src/dark/fluid/common/prefab/TileEntityFluidStorage.java @@ -0,0 +1,136 @@ +package dark.fluid.common.prefab; + +import com.dark.fluid.FluidHelper; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; +import dark.api.ColorCode.IColorCoded; + +public abstract class TileEntityFluidStorage extends TileEntityFluidDevice implements IFluidHandler, IColorCoded +{ + + public FluidTank fluidTank; + + @Override + public String getMeterReading(EntityPlayer user, ForgeDirection side, EnumTools tool) + { + if (tool != EnumTools.PIPE_GUAGE) + { + return null; + } + if (this.getTank().getFluid() == null) + { + return "Empty"; + } + return String.format("%d/%d %S Stored", getTank().getFluid().amount / FluidContainerRegistry.BUCKET_VOLUME, this.getTank().getCapacity() / FluidContainerRegistry.BUCKET_VOLUME, getTank().getFluid().getFluid().getLocalizedName()); + } + + @Override + public boolean canTileConnect(Connection type, ForgeDirection dir) + { + return type == Connection.FLUIDS; + } + + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + if (resource == null || resource.getFluid() == null) + { + return 0; + } + else if (this.getTank().getFluid() != null && !resource.isFluidEqual(this.getTank().getFluid())) + { + return 0; + } + return this.getTank().fill(resource, doFill); + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) + { + if (this.getTank().getFluid() == null) + { + return null; + } + FluidStack stack = this.getTank().getFluid(); + if (maxDrain < stack.amount) + { + stack = FluidHelper.getStack(stack, maxDrain); + } + return this.getTank().drain(maxDrain, doDrain); + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) + { + if (this.getTank() != null) + { + return new FluidTankInfo[] { new FluidTankInfo(this.getTank()) }; + } + return new FluidTankInfo[1]; + } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + if (nbt.hasKey("stored")) + { + NBTTagCompound tag = nbt.getCompoundTag("stored"); + String name = tag.getString("LiquidName"); + int amount = nbt.getInteger("Amount"); + Fluid fluid = FluidRegistry.getFluid(name); + if (fluid != null) + { + FluidStack liquid = new FluidStack(fluid, amount); + getTank().setFluid(liquid); + } + } + else + { + //System.out.println("Loading fluid tank"); + getTank().readFromNBT(nbt.getCompoundTag("FluidTank")); + //System.out.println("Tank: "+ (getTank().getFluid() != null ? getTank().getFluid().fluidID +"@"+getTank().getFluid().amount+"mb" : "Empty")); + + } + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + if (this.getTank() != null) + { + //System.out.println("Saving fluid tank"); + //System.out.println("Tank: "+ (getTank().getFluid() != null ? getTank().getFluid().fluidID +"@"+getTank().getFluid().amount+"mb" : "Empty")); + nbt.setCompoundTag("FluidTank", this.getTank().writeToNBT(new NBTTagCompound())); + } + } + + /** Is the internal tank full */ + public boolean isFull() + { + return this.getTank().getFluidAmount() >= this.getTank().getCapacity(); + } + + public FluidTank getTank() + { + if (this.fluidTank == null) + { + this.fluidTank = new FluidTank(this.getTankSize()); + } + return this.fluidTank; + } + + /** gets the max storage limit of the tank */ + public abstract int getTankSize(); + +} diff --git a/FM/src/dark/fluid/common/pump/BlockConstructionPump.java b/FM/src/dark/fluid/common/pump/BlockConstructionPump.java new file mode 100644 index 000000000..999fba4ac --- /dev/null +++ b/FM/src/dark/fluid/common/pump/BlockConstructionPump.java @@ -0,0 +1,157 @@ +package dark.fluid.common.pump; + +import java.util.List; +import java.util.Set; + +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Icon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeDirection; + +import com.builtbroken.common.Pair; +import com.dark.tilenetwork.prefab.NetworkTileEntities; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.client.render.BlockRenderHelper; +import dark.fluid.common.FMRecipeLoader; +import dark.fluid.common.FluidMech; +import dark.fluid.common.machines.BlockFM; + +public class BlockConstructionPump extends BlockFM +{ + Icon inputIcon; + Icon outputIcon; + + public BlockConstructionPump() + { + super("ConstructionPump", Material.iron); + this.setHardness(1f); + this.setResistance(5f); + + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon(FluidMech.instance.PREFIX + "ironMachineSide"); + this.inputIcon = par1IconRegister.registerIcon(FluidMech.instance.PREFIX + "inputMachineSide"); + this.outputIcon = par1IconRegister.registerIcon(FluidMech.instance.PREFIX + "outputMachineSide"); + } + + @Override + @SideOnly(Side.CLIENT) + public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int side) + { + TileEntity entity = world.getBlockTileEntity(x, y, z); + ForgeDirection dir = ForgeDirection.getOrientation(side); + if (entity instanceof TileEntityConstructionPump) + { + + if (dir == ((TileEntityConstructionPump) entity).getFacing(false)) + { + return this.outputIcon; + } + if (dir == ((TileEntityConstructionPump) entity).getFacing(true)) + { + return this.inputIcon; + } + } + return this.blockIcon; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public int damageDropped(int meta) + { + return 0; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderType() + { + return BlockRenderHelper.renderID; + } + + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) + { + return new ItemStack(FMRecipeLoader.blockConPump, 1, 0); + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase p, ItemStack itemStack) + { + } + + @Override + public TileEntity createNewTileEntity(World var1) + { + return new TileEntityConstructionPump(); + } + + @Override + public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) + { + par3List.add(new ItemStack(par1, 1, 0)); + } + + @Override + public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) + { + if (!world.isRemote) + { + int meta = world.getBlockMetadata(x, y, z); + int angle = MathHelper.floor_double((entityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + + TileEntity entity = world.getBlockTileEntity(x, y, z); + if (entity instanceof TileEntityConstructionPump) + { + NetworkTileEntities.invalidate(entity); + } + + if (meta == 3) + { + world.setBlockMetadataWithNotify(x, y, z, 0, 3); + } + else + { + world.setBlockMetadataWithNotify(x, y, z, meta + 1, 3); + } + + return true; + } + return this.onUseWrench(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ); + } + + @Override + public void getTileEntities(int blockID, Set>> list) + { + list.add(new Pair>("ConstructionPump", TileEntityConstructionPump.class)); + + } + +} diff --git a/FM/src/dark/fluid/common/pump/BlockDrain.java b/FM/src/dark/fluid/common/pump/BlockDrain.java new file mode 100644 index 000000000..6527108ff --- /dev/null +++ b/FM/src/dark/fluid/common/pump/BlockDrain.java @@ -0,0 +1,135 @@ +package dark.fluid.common.pump; + +import java.util.Set; + +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatMessageComponent; +import net.minecraft.util.Icon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeDirection; + +import com.builtbroken.common.Pair; + +import dark.fluid.common.FluidMech; +import dark.fluid.common.machines.BlockFM; + +public class BlockDrain extends BlockFM +{ + private Icon blockIcon; + private Icon drainIcon; + private Icon fillIcon; + + public BlockDrain() + { + super("FluidDrain", Material.iron); + } + + @Override + public TileEntity createNewTileEntity(World var1) + { + return new TileEntityDrain(); + } + + @Override + public void registerIcons(IconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon(FluidMech.instance.PREFIX + "ironMachineSide"); + this.drainIcon = par1IconRegister.registerIcon(FluidMech.instance.PREFIX + "drain"); + this.fillIcon = par1IconRegister.registerIcon(FluidMech.instance.PREFIX + "drain2"); + } + + @Override + public Icon getIcon(int par1, int par2) + { + return par1 != 1 && par1 != 0 ? this.blockIcon : this.drainIcon; + } + + @Override + public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int side) + { + TileEntity entity = world.getBlockTileEntity(x, y, z); + ForgeDirection dir = ForgeDirection.getOrientation(side); + if (entity instanceof TileEntityDrain) + { + + if (dir == ((TileEntityDrain) entity).getDirection()) + { + if (((TileEntityDrain) entity).canDrain()) + { + return this.drainIcon; + } + else + { + return this.fillIcon; + } + + } + } + return this.blockIcon; + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase p, ItemStack itemStack) + { + int angle = MathHelper.floor_double((p.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + world.setBlockMetadataWithNotify(x, y, z, angle, 3); + TileEntity entity = world.getBlockTileEntity(x, y, z); + } + + @Override + public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) + { + if (!world.isRemote) + { + int meta = world.getBlockMetadata(x, y, z); + if (world.getBlockMetadata(x, y, z) < 6) + { + meta += 6; + } + else + { + meta -= 6; + } + world.setBlockMetadataWithNotify(x, y, z, meta, 3); + TileEntity entity = world.getBlockTileEntity(x, y, z); + if (entity instanceof TileEntityDrain) + { + entityPlayer.sendChatToPlayer(ChatMessageComponent.createFromText("Draining Sources? " + ((TileEntityDrain) entity).canDrain())); + + } + return true; + } + return true; + } + + @Override + public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) + { + if (!world.isRemote) + { + int meta = side; + if (world.getBlockMetadata(x, y, z) > 5) + { + meta += 6; + } + world.setBlockMetadataWithNotify(x, y, z, meta, 3); + return true; + } + return true; + } + + @Override + public void getTileEntities(int blockID, Set>> list) + { + list.add(new Pair>("FluidDrain", TileEntityDrain.class)); + + } + +} diff --git a/FM/src/dark/fluid/common/pump/BlockPumpMachine.java b/FM/src/dark/fluid/common/pump/BlockPumpMachine.java new file mode 100644 index 000000000..80764fafb --- /dev/null +++ b/FM/src/dark/fluid/common/pump/BlockPumpMachine.java @@ -0,0 +1,96 @@ +package dark.fluid.common.pump; + +import java.util.List; +import java.util.Set; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeDirection; + +import com.builtbroken.common.Pair; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.client.render.BlockRenderHelper; +import dark.fluid.common.FMRecipeLoader; +import dark.fluid.common.machines.BlockFM; + +public class BlockPumpMachine extends BlockFM +{ + + public BlockPumpMachine() + { + super("StarterPump", Material.iron); + this.setHardness(1f); + this.setResistance(5f); + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderType() + { + return BlockRenderHelper.renderID; + } + + @Override + public int damageDropped(int meta) + { + return 0; + } + + @Override + public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side) + { + return side != ForgeDirection.DOWN; + } + + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + TileEntity ent = world.getBlockTileEntity(x, y, z); + + if (meta < 4) + { + return new ItemStack(FMRecipeLoader.blockPumpMachine, 1, 0); + } + + return null; + } + + @Override + public TileEntity createNewTileEntity(World world) + { + return new TileEntityStarterPump(); + } + + @Override + public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) + { + par3List.add(new ItemStack(par1, 1, 0)); + } + + @Override + public void getTileEntities(int blockID, Set>> list) + { + list.add(new Pair>("starterPump", TileEntityStarterPump.class)); + + } +} diff --git a/FM/src/dark/fluid/common/pump/LiquidPathFinder.java b/FM/src/dark/fluid/common/pump/LiquidPathFinder.java new file mode 100644 index 000000000..658d19a36 --- /dev/null +++ b/FM/src/dark/fluid/common/pump/LiquidPathFinder.java @@ -0,0 +1,337 @@ +package dark.fluid.common.pump; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import com.dark.fluid.FluidHelper; + +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.common.ForgeDirection; +import universalelectricity.core.vector.Vector2; +import universalelectricity.core.vector.Vector3; + +/** A simpler path Finder used to find drainable or fillable tiles + * + * @author DarkGuardsman */ +public class LiquidPathFinder +{ + /** Curent world this pathfinder will operate in */ + private World world; + /** List of all nodes traveled by the path finder */ + public Set nodeList = new HashSet(); + /** List of all nodes that match the search parms */ + public Set results = new HashSet(); + /** Are we looking for liquid fillable blocks */ + private boolean fill = false; + /** priority search direction either up or down only */ + private ForgeDirection priority; + /** Limit on the searched nodes per run */ + private int resultLimit = 200; + private int resultsFound = 0; + private int resultRun = resultLimit; + private int runs = 0; + /** Start location of the pathfinder used for range calculations */ + private Vector3 Start; + /** Range to limit the search to */ + private double range; + /** List of forgeDirection to use that are shuffled to prevent strait lines */ + List shuffledDirections = new ArrayList(); + + public LiquidPathFinder(final World world, final int resultLimit, final double range) + { + this.range = range; + this.world = world; + if (fill) + { + priority = ForgeDirection.DOWN; + } + else + { + priority = ForgeDirection.UP; + } + this.resultLimit = resultLimit; + this.reset(); + shuffledDirections.add(ForgeDirection.EAST); + shuffledDirections.add(ForgeDirection.WEST); + shuffledDirections.add(ForgeDirection.NORTH); + shuffledDirections.add(ForgeDirection.SOUTH); + } + + public void addNode(Vector3 vec) + { + if (!this.nodeList.contains(vec)) + { + this.nodeList.add(vec); + } + } + + public void addResult(Vector3 vec) + { + if (!this.results.contains(vec)) + { + this.resultsFound++; + this.results.add(vec); + } + } + + /** Searches for nodes attached to the given node + * + * @return True on success finding, false on failure. */ + public boolean findNodes(Vector3 node) + { + if (node == null) + { + return false; + } + try + { + this.addNode(node); + + if (this.isValidResult(node)) + { + this.addResult(node); + } + + if (this.isDone(node.clone())) + { + return false; + } + + if (find(this.priority, node.clone())) + { + return true; + } + + Collections.shuffle(shuffledDirections); + Collections.shuffle(shuffledDirections); + + for (ForgeDirection direction : shuffledDirections) + { + if (find(direction, node.clone())) + { + return true; + } + } + + if (find(this.priority.getOpposite(), node.clone())) + { + return true; + } + } + catch (Exception e) + { + e.printStackTrace(); + } + + return false; + } + + /** Find all node attached to the origin mode in the given direction + * + * Note: Calls findNode if the next code is valid */ + public boolean find(ForgeDirection direction, Vector3 origin) + { + this.runs++; + Vector3 vec = origin.clone().modifyPositionFromSide(direction); + double distance = vec.toVector2().distanceTo(this.Start.toVector2()); + if (distance <= this.range && this.isValidNode(vec)) + { + if (this.fill && FluidHelper.drainBlock(world, vec, false) != null || FluidHelper.isFillableFluid(world, vec)) + { + for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) + { + Vector3 veb = vec.clone().modifyPositionFromSide(dir); + if (FluidHelper.isFillableBlock(world, veb)) + { + this.addNode(veb); + if (this.isValidResult(veb)) + { + this.addResult(veb); + } + } + } + } + if (this.findNodes(vec)) + { + return true; + } + } + return false; + } + + /** Checks to see if this node is valid to path find threw */ + public boolean isValidNode(Vector3 pos) + { + if (pos == null) + { + return false; + } + /* Check if the chunk is loaded to prevent action outside of the loaded area */ + Chunk chunk = this.world.getChunkFromBlockCoords(pos.intX(), pos.intZ()); + if (chunk == null || !chunk.isChunkLoaded) + { + return false; + } + return FluidHelper.drainBlock(world, pos, false) != null || FluidHelper.isFillableFluid(world, pos); + } + + public boolean isValidResult(Vector3 node) + { + if (this.fill) + { + return FluidHelper.isFillableBlock(world, node) || FluidHelper.isFillableFluid(world, node); + } + else + { + return FluidHelper.drainBlock(world, node, false) != null; + } + } + + /** Checks to see if we are done pathfinding */ + public boolean isDone(Vector3 vec) + { + if (this.runs > 1000) + { + return true; + } + if (this.resultsFound >= this.resultRun) + if (this.results.size() >= this.resultLimit || this.nodeList.size() >= 10000) + { + return true; + } + return false; + } + + /** Called to execute the pathfinding operation. */ + public LiquidPathFinder start(final Vector3 startNode, int runCount, final boolean fill) + { + this.Start = startNode; + this.fill = fill; + this.runs = 0; + this.resultsFound = 0; + this.resultRun = runCount; + this.find(ForgeDirection.UNKNOWN, startNode); + + this.refresh(); + this.sortBlockList(Start, results, !fill, fill); + return this; + } + + public LiquidPathFinder reset() + { + this.nodeList.clear(); + this.results.clear(); + return this; + } + + public LiquidPathFinder refresh() + { + Iterator it = this.nodeList.iterator(); + while (it.hasNext()) + { + Vector3 vec = it.next(); + if (!this.isValidNode(vec)) + { + it.remove(); + } + if (this.isValidResult(vec)) + { + this.addResult(vec); + } + } + it = this.results.iterator(); + while (it.hasNext()) + { + Vector3 vec = it.next(); + if (!this.isValidResult(vec)) + { + it.remove(); + } + if (this.isValidNode(vec)) + { + this.addNode(vec); + } + } + return this; + } + + /** Used to sort a list of vector3 locations using the vector3's distance from one point and + * elevation in the y axis + * + * @param start - start location to measure distance from + * @param results2 - list of vectors to sort + * @param closest - sort closest distance to the top + * @param highest - sort highest y value to the top. + * + * Note: highest takes priority over closest */ + public void sortBlockList(final Vector3 start, final Set set, final boolean closest, final boolean highest) + { + try + { + List list = new ArrayList(); + list.addAll(set); + Collections.sort(list, new Comparator() + { + @Override + public int compare(Vector3 vecA, Vector3 vecB) + { + //Though unlikely always return zero for equal vectors + if (vecA.equals(vecB)) + { + return 0; + } + //Check y value fist as this is the primary search area + if (Integer.compare(vecA.intY(), vecB.intY()) != 0) + { + if (highest) + { + return vecA.intY() > vecB.intY() ? -1 : 1; + } + else + { + return vecA.intY() > vecB.intY() ? 1 : -1; + } + } + //Check distance after that + double distanceA = Vector2.distance(vecA.toVector2(), start.toVector2()); + double distanceB = Vector2.distance(vecB.toVector2(), start.toVector2()); + if (Double.compare(distanceA, distanceB) != 0) + { + if (closest) + { + return distanceA > distanceB ? 1 : -1; + } + else + { + return distanceA > distanceB ? -1 : 1; + } + } + return Double.compare(distanceA, distanceB); + } + }); + set.clear(); + set.addAll(list); + } + catch (Exception e) + { + System.out.println("FluidMech>>>BlockDrain>>FillArea>>Error>>CollectionSorter"); + e.printStackTrace(); + } + } + + public LiquidPathFinder setWorld(World world2) + { + if (world2 != this.world) + { + this.reset(); + this.world = world2; + } + return this; + } +} diff --git a/FM/src/dark/fluid/common/pump/TileEntityConstructionPump.java b/FM/src/dark/fluid/common/pump/TileEntityConstructionPump.java new file mode 100644 index 000000000..20dbb2206 --- /dev/null +++ b/FM/src/dark/fluid/common/pump/TileEntityConstructionPump.java @@ -0,0 +1,191 @@ +package dark.fluid.common.pump; + +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; +import java.util.Map.Entry; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; +import universalelectricity.core.vector.Vector3; +import universalelectricity.core.vector.VectorHelper; + +import com.builtbroken.common.Pair; +import com.dark.tilenetwork.ITileConnector; + +import dark.api.fluid.IDrain; +import dark.api.fluid.INetworkPipe; +import dark.core.prefab.tilenetwork.fluid.NetworkFluidTiles; + +public class TileEntityConstructionPump extends TileEntityStarterPump implements IFluidHandler, ITileConnector +{ + /* LIQUID FLOW CONNECTION SIDES */ + /** Internal tank for interaction but not real storage */ + private FluidTank fakeTank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME); + + List drainsUsed = new ArrayList(); + + public TileEntityConstructionPump() + { + super(.05f/*50W/t */, .05f/* 5W/drain*/, 30); + } + + /** Gets the facing direction + * + * @param input true for input side, false for output side + * @return */ + public ForgeDirection getFacing(boolean input) + { + + return input ? this.getDirection() : this.getDirection().getOpposite(); + } + + @Override + public Pair getDrainOrigin() + { + TileEntity inputTile = VectorHelper.getTileEntityFromSide(worldObj, new Vector3(this), getFacing(true)); + TileEntity outputTile = VectorHelper.getTileEntityFromSide(worldObj, new Vector3(this), getFacing(false)); + IDrain drain = this.getNextDrain(inputTile, outputTile, drainsUsed); + if (drain == null) + { + this.drainsUsed.clear(); + drain = this.getNextDrain(inputTile, outputTile, drainsUsed); + } + + if (drain instanceof TileEntity) + { + this.drainsUsed.add(drain); + return new Pair(((TileEntity) drain).worldObj, new Vector3(((TileEntity) drain))); + } + return null; + } + + /** Gets the nextDrain in the list + * + * @param inputTile - input tile must be an instance of INetworkPipe + * @param outputTile - output tile must be an instance of IFluidHandler + * @param ignoreList - list of drains to ignore so that the next one is selected + * @return the next drain it finds or null if it went threw the entire list. Its suggested to + * clear the ignoreList after getting null */ + public IDrain getNextDrain(TileEntity inputTile, TileEntity outputTile, List ignoreList) + { + IDrain drain = null; + if (ignoreList == null) + { + ignoreList = new ArrayList(); + } + + if (inputTile instanceof INetworkPipe && ((INetworkPipe) inputTile).getTileNetwork() instanceof NetworkFluidTiles) + { + if (outputTile instanceof IFluidHandler) + { + for (Entry> entry : ((NetworkFluidTiles) ((INetworkPipe) inputTile).getTileNetwork()).connctedFluidHandlers.entrySet()) + { + + if (entry.getKey() instanceof IDrain && !ignoreList.contains(entry.getKey())) + { + drain = (IDrain) entry.getKey(); + break; + } + } + } + } + return drain; + } + + @Override + public boolean canConnect(ForgeDirection direction) + { + return direction != getFacing(true) && direction != getFacing(false); + } + + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + TileEntity entity = VectorHelper.getTileEntityFromSide(this.worldObj, new Vector3(this), getFacing(false)); + if (entity instanceof IFluidHandler) + { + return ((IFluidHandler) entity).fill(getFacing(false).getOpposite(), resource, doFill); + } + return 0; + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) + { + return null; + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection direction) + { + if (direction == this.getFacing(false) && this.fakeTank != null) + { + return new FluidTankInfo[] { new FluidTankInfo(fakeTank.getFluid(), fakeTank.getCapacity()) }; + } + return null; + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) + { + return from != getFacing(true); + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + return false; + } + + @Override + public boolean canTileConnect(Connection type, ForgeDirection dir) + { + TileEntity entity = new Vector3(this).modifyPositionFromSide(dir).getTileEntity(this.worldObj); + return entity instanceof IFluidHandler && (dir == this.getFacing(false) || dir == this.getFacing(true)); + } + + @Override + public void invalidate() + { + super.invalidate(); + } + + @Override + public String getMeterReading(EntityPlayer user, ForgeDirection side, EnumTools tool) + { + if (tool == EnumTools.PIPE_GUAGE) + { + TileEntity inputTile = VectorHelper.getTileEntityFromSide(worldObj, new Vector3(this), getFacing(true)); + if (inputTile instanceof INetworkPipe && ((INetworkPipe) inputTile).getTileNetwork() instanceof NetworkFluidTiles) + { + int count = 0; + for (Entry> entry : ((NetworkFluidTiles) ((INetworkPipe) inputTile).getTileNetwork()).connctedFluidHandlers.entrySet()) + { + if (entry.getKey() instanceof IDrain) + { + count++; + } + } + return "Drains conencted to input : " + count; + } + } + return null; + } + +} diff --git a/FM/src/dark/fluid/common/pump/TileEntityDrain.java b/FM/src/dark/fluid/common/pump/TileEntityDrain.java new file mode 100644 index 000000000..2496b9586 --- /dev/null +++ b/FM/src/dark/fluid/common/pump/TileEntityDrain.java @@ -0,0 +1,287 @@ +package dark.fluid.common.pump; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; +import universalelectricity.core.vector.Vector3; + +import com.builtbroken.common.Pair; +import com.dark.fluid.FluidHelper; + +import dark.api.fluid.IDrain; +import dark.fluid.common.prefab.TileEntityFluidDevice; + +public class TileEntityDrain extends TileEntityFluidDevice implements IFluidHandler, IDrain +{ + /* MAX BLOCKS DRAINED PER 1/2 SECOND */ + public static int MAX_WORLD_EDITS_PER_PROCESS = 50; + private int currentWorldEdits = 0; + + /* LIST OF PUMPS AND THERE REQUESTS FOR THIS DRAIN */ + private HashMap> requestMap = new HashMap>(); + + private List updateQue = new ArrayList(); + private LiquidPathFinder pathDrain; + private LiquidPathFinder pathFill; + + public boolean canDrain() + { + return this.getBlockMetadata() < 6; + } + + public LiquidPathFinder getFillFinder() + { + if (pathFill == null) + { + pathFill = new LiquidPathFinder(this.worldObj, 100, 100); + } + return pathFill; + } + + @Override + public Set getFillList() + { + return this.getFillFinder().refresh().results; + } + + public LiquidPathFinder getLiquidFinder() + { + if (pathDrain == null) + { + pathDrain = new LiquidPathFinder(this.worldObj, 1000, 100); + } + return pathDrain; + } + + @Override + public Set getFluidList() + { + return this.getLiquidFinder().refresh().results; + } + + @Override + public void updateEntity() + { + super.updateEntity(); + + /* MAIN LOGIC PATH FOR DRAINING BODIES OF LIQUID */ + if (!this.worldObj.isRemote && this.ticks % 20 == 0 && !this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) + { + this.currentWorldEdits = 0; + + /* ONLY FIND NEW SOURCES IF OUR CURRENT LIST RUNS DRY */ + if (this.getLiquidFinder().results.size() < TileEntityDrain.MAX_WORLD_EDITS_PER_PROCESS + 10) + { + this.getLiquidFinder().refresh().start(new Vector3(this).modifyPositionFromSide(this.getDirection()), TileEntityDrain.MAX_WORLD_EDITS_PER_PROCESS, false); + } + + if (this.getFillFinder().results.size() < TileEntityDrain.MAX_WORLD_EDITS_PER_PROCESS + 10) + { + this.getFillFinder().refresh().start(new Vector3(this).modifyPositionFromSide(this.getDirection()), TileEntityDrain.MAX_WORLD_EDITS_PER_PROCESS, true); + } + + } + } + + public int fillArea(FluidStack resource, boolean doFill) + { + int fillVolume = 0; + + if (this.currentWorldEdits < MAX_WORLD_EDITS_PER_PROCESS) + { + /* ID LIQUID BLOCK AND SET VARS FOR BLOCK PLACEMENT */ + if (resource == null || resource.amount < FluidContainerRegistry.BUCKET_VOLUME) + { + return 0; + } + + fillVolume = resource.amount; + + //System.out.println("Drain>>FillArea>>Targets>> " + getFillFinder().results.size()); + + List fluids = new ArrayList(); + List blocks = new ArrayList(); + List filled = new ArrayList(); + /* Sort results out into two groups and clear the rest out of the result list */ + Iterator it = this.getFillFinder().refresh().results.iterator(); + while (it.hasNext()) + { + Vector3 vec = it.next(); + if (FluidHelper.isFillableFluid(worldObj, vec) && !fluids.contains(vec) && !blocks.contains(vec)) + { + fluids.add(vec); + } + else if (FluidHelper.isFillableBlock(worldObj, vec) && !blocks.contains(vec) && !fluids.contains(vec)) + { + blocks.add(vec); + } + else + { + it.remove(); + } + } + /* Fill non-full fluids first */ + for (Vector3 loc : fluids) + { + if (fillVolume <= 0) + { + break; + } + if (FluidHelper.isFillableFluid(worldObj, loc)) + { + + fillVolume -= FluidHelper.fillBlock(worldObj, loc, FluidHelper.getStack(resource, fillVolume), doFill); + //System.out.println("Drain>>FillArea>>Filling>>" + (doFill ? "" : "Sim>>") + ">>Fluid>" + loc.toString()); + + if (doFill) + { + filled.add(loc); + this.currentWorldEdits++; + if (!this.updateQue.contains(loc)) + { + this.updateQue.add(loc); + } + } + + } + + } + /* Fill air or replaceable blocks after non-full fluids */ + for (Vector3 loc : blocks) + { + if (fillVolume <= 0) + { + break; + } + if (FluidHelper.isFillableBlock(worldObj, loc)) + { + fillVolume -= FluidHelper.fillBlock(worldObj, loc, FluidHelper.getStack(resource, fillVolume), doFill); + System.out.println("Drain>>FillArea>>Filling>>" + (doFill ? "" : "Sim>>") + ">>Block>" + loc.toString()); + + if (doFill) + { + filled.add(loc); + this.currentWorldEdits++; + if (!this.updateQue.contains(loc)) + { + this.updateQue.add(loc); + } + } + + } + } + this.getLiquidFinder().results.removeAll(filled); + //System.out.println("Drain>>FillArea>>Filling>>Filled>>" + (doFill ? "" : "Sim>>") + (resource.amount - fillVolume) + "mb"); + return Math.max(resource.amount - fillVolume, 0); + } + return 0; + } + + @Override + public boolean canTileConnect(Connection type, ForgeDirection dir) + { + return dir != this.getDirection(); + } + + @Override + public ForgeDirection getDirection() + { + int meta = 0; + if (worldObj != null) + { + meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord) % 6; + } + return ForgeDirection.getOrientation(meta); + } + + @Override + public void setDirection(ForgeDirection direction) + { + if (direction != null && direction != this.getDirection()) + { + this.worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, direction.ordinal(), 3); + } + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) + { + return this.getDirection() != from && !this.canDrain(); + } + + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + if (resource == null || this.canDrain()) + { + return 0; + } + return this.fillArea(resource, doFill); + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + return false; + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) + { + return null; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) + { + return new FluidTankInfo[] { new FluidTank(this.getLiquidFinder().results.size() * FluidContainerRegistry.BUCKET_VOLUME).getInfo() }; + } + + @Override + public boolean canDrain(ForgeDirection direction) + { + return direction == this.getDirection() && !this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord) && this.canDrain(); + } + + @Override + public boolean canFill(ForgeDirection direction) + { + return direction == this.getDirection() && !this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord) && !this.canDrain(); + } + + @Override + public void onUse(Vector3 vec) + { + this.currentWorldEdits++; + } + + @Override + public String getMeterReading(EntityPlayer user, ForgeDirection side, EnumTools tool) + { + if (tool != null && tool == EnumTools.PIPE_GUAGE) + { + return " F:" + this.getFillList().size() + " D:" + this.getFluidList().size(); + } + return super.getMeterReading(user, side, tool); + } + +} diff --git a/FM/src/dark/fluid/common/pump/TileEntityStarterPump.java b/FM/src/dark/fluid/common/pump/TileEntityStarterPump.java new file mode 100644 index 000000000..0654c37e9 --- /dev/null +++ b/FM/src/dark/fluid/common/pump/TileEntityStarterPump.java @@ -0,0 +1,223 @@ +package dark.fluid.common.pump; + +import java.util.Iterator; +import java.util.Set; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; +import universalelectricity.core.vector.Vector3; + +import com.builtbroken.common.Pair; +import com.dark.fluid.FluidHelper; +import com.dark.prefab.TileEntityEnergyMachine; +import com.dark.tilenetwork.ITileConnector; + +import dark.api.IToolReadOut; +import dark.api.fluid.IDrain; + +public class TileEntityStarterPump extends TileEntityEnergyMachine implements IToolReadOut, ITileConnector +{ + private int currentWorldEdits, MAX_WORLD_EDITS_PER_PROCESS; + + public float ENERGY_PER_DRAIN = 5; + + private LiquidPathFinder pathLiquid; + private Vector3 lastDrainOrigin; + + public int rotation = 0; + + public TileEntityStarterPump() + { + this(.01f/*10W/t */, .05f/* 50W/drain */, 5); + } + + /** @param wattTick - cost in watts per tick to run the tile + * @param wattDrain - cost in watts to drain or fill one block + * @param maxEdits - max world edits per update (1/2 second) */ + public TileEntityStarterPump(float wattTick, float wattDrain, int maxEdits) + { + //Power calculation for max power (worldEdits * watts per edit) + (watts per tick * one second) + super(wattTick, (maxEdits * wattDrain) + (wattTick * 20)); + this.MAX_WORLD_EDITS_PER_PROCESS = maxEdits; + this.ENERGY_PER_DRAIN = wattDrain; + } + + /** Liquid path finder used by this tile. Retrieve the path finder if using IDrain block */ + public LiquidPathFinder getLiquidFinder() + { + if (pathLiquid == null) + { + pathLiquid = new LiquidPathFinder(this.worldObj, 100, 20); + } + return pathLiquid; + } + + @Override + public void updateEntity() + { + super.updateEntity(); + + if (this.ticks % 10 == 0) + { + this.currentWorldEdits = 0; + + if (this.isFunctioning()) + { + this.rotation = Math.max(Math.min(this.rotation + 1, 7), 0); + + if (!this.worldObj.isRemote) + { + Pair pair = this.getDrainOrigin(); + if (pair != null && pair.left() != null && pair.right() != null) + { + this.drainAroundArea(pair.left(), pair.right(), 3); + } + } + } + + } + + } + + /** Gets the origin the path finder starts on */ + public Pair getDrainOrigin() + { + //TODO change this to lower by the amount of air between the pump and bottom + return new Pair(this.worldObj, new Vector3(this).modifyPositionFromSide(ForgeDirection.DOWN)); + } + + /** Drains an area starting at the given location + * + * @param world - world to drain in, most cases will be the TileEntities world + * @param loc - origin to start the path finder with. If this is an instance of IDrain this + * method will act different */ + public void drainAroundArea(World world, Vector3 vec, int update) + { + Vector3 origin = vec.clone(); + if (origin == null) + { + return; + } + + /* Update last drain origin to prevent failed path finding */ + if (this.lastDrainOrigin == null || !this.lastDrainOrigin.equals(origin)) + { + this.lastDrainOrigin = origin.clone(); + this.getLiquidFinder().reset(); + } + + TileEntity drain = vec.clone().getTileEntity(world); + TileEntity entity = null; + + Set drainList = null; + if (drain instanceof IDrain) + { + if (!((IDrain) drain).canDrain(((IDrain) drain).getDirection())) + { + return; + } + origin = vec.modifyPositionFromSide(((IDrain) drain).getDirection()); + entity = origin.getTileEntity(world); + if (entity instanceof IFluidHandler) + { + FluidStack draStack = ((IFluidHandler) entity).drain(ForgeDirection.UP, MAX_WORLD_EDITS_PER_PROCESS * FluidContainerRegistry.BUCKET_VOLUME, false); + + if (draStack != null && FluidHelper.fillTanksAllSides(worldObj, new Vector3(this), draStack, false, ForgeDirection.DOWN) > 0) + { + ((IFluidHandler) entity).drain(ForgeDirection.UP, FluidHelper.fillTanksAllSides(worldObj, new Vector3(this), draStack, true, ForgeDirection.DOWN), true); + + } + return;//TODO check why return is here + } + else + { + drainList = ((IDrain) drain).getFluidList(); + } + } + + if (drainList == null) + { + if (this.getLiquidFinder().results.size() < MAX_WORLD_EDITS_PER_PROCESS + 10) + { + this.getLiquidFinder().setWorld(world).refresh().start(origin, MAX_WORLD_EDITS_PER_PROCESS, false); + } + drainList = this.getLiquidFinder().refresh().results; + } + + if (entity == null && drainList != null && drainList.size() > 0) + { + //System.out.println("StartPump>>DrainArea>>Targets>" + this.getLiquidFinder().results.size()); + + Iterator fluidList = drainList.iterator(); + + while (fluidList.hasNext() && this.consumePower(ENERGY_PER_DRAIN, false)) + { + if (this.currentWorldEdits >= MAX_WORLD_EDITS_PER_PROCESS) + { + break; + } + + Vector3 drainLocation = fluidList.next(); + FluidStack drainStack = FluidHelper.drainBlock(world, drainLocation, false, 3); + //System.out.println("StartPump>>DrainArea>>Draining>>NextFluidBlock>" + (drainStack == null ? "Null" : drainStack.amount + "mb of " + drainStack.getFluid().getName())); + + //int fillV = FluidHelper.fillTanksAllSides(worldObj, new Vector3(this), drainStack, false, ForgeDirection.DOWN); + //System.out.println("StartPump>>DrainArea>>Draining>>NextFluidBlock>Filled>" + fillV + "mb"); + + if (drainStack != null && this.fill(drainStack, false) >= drainStack.amount && this.consumePower(ENERGY_PER_DRAIN, true)) + { + //System.out.println("StartPump>>DrainArea>>Draining>>Fluid>" + drainLocation.toString()); + /* REMOVE BLOCK */ + FluidHelper.drainBlock(this.worldObj, drainLocation, true, update); + this.fill(drainStack, true); + this.currentWorldEdits++; + fluidList.remove(); + + if (drain instanceof IDrain) + { + ((IDrain) drain).onUse(drainLocation); + } + } + } + } + } + + public int fill(FluidStack stack, boolean doFill) + { + return FluidHelper.fillTanksAllSides(worldObj, new Vector3(this), stack, doFill, ForgeDirection.DOWN); + } + + @Override + public boolean canFunction() + { + return super.canFunction() && worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord); + } + + @Override + public String getMeterReading(EntityPlayer user, ForgeDirection side, EnumTools tool) + { + if (tool == EnumTools.PIPE_GUAGE) + { + return "Source Blocks: " + this.getLiquidFinder().results.size(); + } + return null; + } + + @Override + public boolean canConnect(ForgeDirection direction) + { + return direction != ForgeDirection.DOWN; + } + + @Override + public boolean canTileConnect(Connection type, ForgeDirection direction) + { + return direction != ForgeDirection.DOWN; + } + +} diff --git a/FM/src/dark/mech/client/model/ModelGearRod.java b/FM/src/dark/mech/client/model/ModelGearRod.java new file mode 100644 index 000000000..953dde01c --- /dev/null +++ b/FM/src/dark/mech/client/model/ModelGearRod.java @@ -0,0 +1,139 @@ +// Date: 9/25/2012 4:29:17 PM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package dark.mech.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelGearRod extends ModelBase +{ + // fields + ModelRenderer Rod; + ModelRenderer front; + ModelRenderer back; + ModelRenderer f2; + ModelRenderer b2; + ModelRenderer b3; + ModelRenderer b4; + ModelRenderer b1; + ModelRenderer f1; + ModelRenderer f4; + ModelRenderer f3; + ModelRenderer Rod2; + + public ModelGearRod() + { + textureWidth = 64; + textureHeight = 32; + + Rod = new ModelRenderer(this, 0, 0); + Rod.addBox(-1.5F, -1.5F, 0F, 3, 3, 12); + Rod.setRotationPoint(0F, 16F, -6F); + Rod.setTextureSize(64, 32); + Rod.mirror = true; + setRotation(Rod, 0F, 0F, 0F); + front = new ModelRenderer(this, 35, 0); + front.addBox(-2F, -2F, -2F, 4, 4, 2); + front.setRotationPoint(0F, 16F, -6F); + front.setTextureSize(64, 32); + front.mirror = true; + setRotation(front, 0F, 0F, 0F); + back = new ModelRenderer(this, 35, 0); + back.addBox(-2F, -2F, 0F, 4, 4, 2); + back.setRotationPoint(0F, 16F, 6F); + back.setTextureSize(64, 32); + back.mirror = true; + setRotation(back, 0F, 0F, 0.7853982F); + f2 = new ModelRenderer(this, 0, 17); + f2.addBox(0F, 0F, 0F, 1, 1, 2); + f2.setRotationPoint(1F, 17F, -10F); + f2.setTextureSize(64, 32); + f2.mirror = true; + setRotation(f2, 0F, 0F, 0F); + b2 = new ModelRenderer(this, 0, 17); + b2.addBox(-0.5F, -0.5F, 0F, 1, 1, 2); + b2.setRotationPoint(0F, 18F, 8F); + b2.setTextureSize(64, 32); + b2.mirror = true; + setRotation(b2, 0F, 0F, 0.7853982F); + b3 = new ModelRenderer(this, 0, 17); + b3.addBox(-0.5F, -0.5F, 0F, 1, 1, 2); + b3.setRotationPoint(-2F, 16F, 8F); + b3.setTextureSize(64, 32); + b3.mirror = true; + setRotation(b3, 0F, 0F, 0.7853982F); + b4 = new ModelRenderer(this, 0, 17); + b4.addBox(-0.5F, -0.5F, 0F, 1, 1, 2); + b4.setRotationPoint(2F, 16F, 8F); + b4.setTextureSize(64, 32); + b4.mirror = true; + setRotation(b4, 0F, 0F, 0.7853982F); + b1 = new ModelRenderer(this, 0, 17); + b1.addBox(-0.5F, -0.5F, 0F, 1, 1, 2); + b1.setRotationPoint(0F, 14F, 8F); + b1.setTextureSize(64, 32); + b1.mirror = true; + setRotation(b1, 0F, 0F, 0.7853982F); + f1 = new ModelRenderer(this, 0, 17); + f1.addBox(0F, 0F, 0F, 1, 1, 2); + f1.setRotationPoint(1F, 14F, -10F); + f1.setTextureSize(64, 32); + f1.mirror = true; + setRotation(f1, 0F, 0F, 0F); + f4 = new ModelRenderer(this, 0, 17); + f4.addBox(0F, 0F, 0F, 1, 1, 2); + f4.setRotationPoint(-2F, 17F, -10F); + f4.setTextureSize(64, 32); + f4.mirror = true; + setRotation(f4, 0F, 0F, 0F); + f3 = new ModelRenderer(this, 0, 17); + f3.addBox(0F, 0F, 0F, 1, 1, 2); + f3.setRotationPoint(-2F, 14F, -10F); + f3.setTextureSize(64, 32); + f3.mirror = true; + setRotation(f3, 0F, 0F, 0F); + Rod2 = new ModelRenderer(this, 0, 0); + Rod2.addBox(-1.5F, -1.5F, 0F, 3, 3, 12); + Rod2.setRotationPoint(0F, 16F, -6F); + Rod2.setTextureSize(64, 32); + Rod2.mirror = true; + setRotation(Rod2, 0F, 0F, 0.7853982F); + } + + public void render(float f5, int pos) + { + + //Rod.rotateAngleZ = 45 * tileEntity; + Rod2.rotateAngleZ = Rod.rotateAngleZ + 45; + + Rod.render(f5); + Rod2.render(f5); + // TODO add rotation to rods + front.render(f5); + back.render(f5); + f2.render(f5); + b2.render(f5); + b3.render(f5); + b4.render(f5); + b1.render(f5); + f1.render(f5); + f4.render(f5); + f3.render(f5); + + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/FM/src/dark/mech/client/model/ModelGenerator.java b/FM/src/dark/mech/client/model/ModelGenerator.java new file mode 100644 index 000000000..3d9673729 --- /dev/null +++ b/FM/src/dark/mech/client/model/ModelGenerator.java @@ -0,0 +1,193 @@ +// Date: 12/23/2012 8:44:55 PM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package dark.mech.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.tileentity.TileEntity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelGenerator extends ModelBase +{ + // fields + ModelRenderer Bottom; + ModelRenderer Left; + ModelRenderer CenterRod; + ModelRenderer Right; + ModelRenderer RightTopCorner; + ModelRenderer LeftTopCorner; + ModelRenderer LeftBottomCorner; + ModelRenderer RightBottomCorner; + ModelRenderer BottomCase; + ModelRenderer TopCase; + ModelRenderer LeftBrace; + ModelRenderer RightBrace; + ModelRenderer BackBracer; + ModelRenderer FrontBracer; + ModelRenderer FrontDisc; + ModelRenderer FrontDisc2; + ModelRenderer BackDisc; + ModelRenderer BackDisc2; + + public ModelGenerator() + { + textureWidth = 128; + textureHeight = 128; + + Bottom = new ModelRenderer(this, 0, 74); + Bottom.addBox(-7F, -1F, -7F, 14, 2, 14); + Bottom.setRotationPoint(0F, 23F, 0F); + Bottom.setTextureSize(128, 128); + Bottom.mirror = true; + setRotation(Bottom, 0F, 0F, 0F); + Left = new ModelRenderer(this, 17, 49); + Left.addBox(-1F, -4F, -3F, 2, 8, 6); + Left.setRotationPoint(7F, 15F, 0F); + Left.setTextureSize(128, 128); + Left.mirror = true; + setRotation(Left, 0F, 0F, 0F); + CenterRod = new ModelRenderer(this, 62, 0); + CenterRod.addBox(-1.5F, -1.5F, -8F, 3, 3, 16); + CenterRod.setRotationPoint(0F, 15F, 0F); + CenterRod.setTextureSize(128, 128); + CenterRod.mirror = true; + setRotation(CenterRod, 0F, 0F, 0F); + Right = new ModelRenderer(this, 0, 49); + Right.addBox(-1F, -4F, -3F, 2, 8, 6); + Right.setRotationPoint(-7F, 15F, 0F); + Right.setTextureSize(128, 128); + Right.mirror = true; + setRotation(Right, 0F, 0F, 0F); + RightTopCorner = new ModelRenderer(this, 0, 35); + RightTopCorner.addBox(-2F, -6F, -3F, 2, 6, 6); + RightTopCorner.setRotationPoint(-7F, 13F, 0F); + RightTopCorner.setTextureSize(128, 128); + RightTopCorner.mirror = true; + setRotation(RightTopCorner, 0F, 0F, 1.047198F); + LeftTopCorner = new ModelRenderer(this, 17, 35); + LeftTopCorner.addBox(0F, -6F, -3F, 2, 6, 6); + LeftTopCorner.setRotationPoint(7F, 13F, 0F); + LeftTopCorner.setTextureSize(128, 128); + LeftTopCorner.mirror = true; + setRotation(LeftTopCorner, 0F, 0F, -1.047198F); + LeftBottomCorner = new ModelRenderer(this, 17, 91); + LeftBottomCorner.addBox(0F, 0F, -3F, 2, 6, 6); + LeftBottomCorner.setRotationPoint(7F, 17F, 0F); + LeftBottomCorner.setTextureSize(128, 128); + LeftBottomCorner.mirror = true; + setRotation(LeftBottomCorner, 0F, 0F, 1.047198F); + RightBottomCorner = new ModelRenderer(this, 0, 91); + RightBottomCorner.addBox(-2F, 0F, -3F, 2, 6, 6); + RightBottomCorner.setRotationPoint(-7F, 17F, 0F); + RightBottomCorner.setTextureSize(128, 128); + RightBottomCorner.mirror = true; + setRotation(RightBottomCorner, 0F, 0F, -1.047198F); + BottomCase = new ModelRenderer(this, 3, 64); + BottomCase.addBox(0F, 0F, -3F, 6, 2, 6); + BottomCase.setRotationPoint(-3F, 20F, 0F); + BottomCase.setTextureSize(128, 128); + BottomCase.mirror = true; + setRotation(BottomCase, 0F, 0F, 0F); + TopCase = new ModelRenderer(this, 3, 26); + TopCase.addBox(0F, 0F, -3F, 6, 2, 6); + TopCase.setRotationPoint(-3F, 8F, 0F); + TopCase.setTextureSize(128, 128); + TopCase.mirror = true; + setRotation(TopCase, 0F, 0F, 0F); + LeftBrace = new ModelRenderer(this, 44, 64); + LeftBrace.addBox(0F, 0F, -1.5F, 3, 6, 3); + LeftBrace.setRotationPoint(3F, 17F, 0F); + LeftBrace.setTextureSize(128, 128); + LeftBrace.mirror = true; + setRotation(LeftBrace, 0F, 0F, 0F); + RightBrace = new ModelRenderer(this, 31, 64); + RightBrace.addBox(0F, 0F, -1.5F, 3, 6, 3); + RightBrace.setRotationPoint(-6F, 17F, 0F); + RightBrace.setTextureSize(128, 128); + RightBrace.mirror = true; + setRotation(RightBrace, 0F, 0F, 0F); + BackBracer = new ModelRenderer(this, 50, 0); + BackBracer.addBox(-2F, -3F, 5F, 4, 10, 1); + BackBracer.setRotationPoint(0F, 15F, 0F); + BackBracer.setTextureSize(128, 128); + BackBracer.mirror = true; + setRotation(BackBracer, 0F, 0F, 0F); + FrontBracer = new ModelRenderer(this, 50, 0); + FrontBracer.addBox(-2F, -3F, -6F, 4, 10, 1); + FrontBracer.setRotationPoint(0F, 15F, 0F); + FrontBracer.setTextureSize(128, 128); + FrontBracer.mirror = true; + setRotation(FrontBracer, 0F, 0F, 0F); + FrontDisc = new ModelRenderer(this, 65, 25); + FrontDisc.addBox(-5F, -5F, -5F, 10, 10, 2); + FrontDisc.setRotationPoint(0F, 15F, 0F); + FrontDisc.setTextureSize(128, 128); + FrontDisc.mirror = true; + setRotation(FrontDisc, 0F, 0F, 0.7853982F); + FrontDisc2 = new ModelRenderer(this, 65, 25); + FrontDisc2.addBox(-5F, -5F, -5F, 10, 10, 2); + FrontDisc2.setRotationPoint(0F, 15F, 0F); + FrontDisc2.setTextureSize(128, 128); + FrontDisc2.mirror = true; + setRotation(FrontDisc2, 0F, 0F, 0F); + BackDisc = new ModelRenderer(this, 65, 25); + BackDisc.addBox(-5F, -5F, 3F, 10, 10, 2); + BackDisc.setRotationPoint(0F, 15F, 0F); + BackDisc.setTextureSize(128, 128); + BackDisc.mirror = true; + setRotation(BackDisc, 0F, 0F, 0.7853982F); + BackDisc2 = new ModelRenderer(this, 65, 25); + BackDisc2.addBox(-5F, -5F, 3F, 10, 10, 2); + BackDisc2.setRotationPoint(0F, 15F, 0F); + BackDisc2.setTextureSize(128, 128); + BackDisc2.mirror = true; + setRotation(BackDisc2, 0F, 0F, 0F); + } + + public void render(TileEntity ent) + { + float f5 = 0.0625F; + // noMoving renderParts + Bottom.render(f5); + Left.render(f5); + CenterRod.render(f5); + Right.render(f5); + RightTopCorner.render(f5); + LeftTopCorner.render(f5); + LeftBottomCorner.render(f5); + RightBottomCorner.render(f5); + BottomCase.render(f5); + TopCase.render(f5); + LeftBrace.render(f5); + RightBrace.render(f5); + BackBracer.render(f5); + FrontBracer.render(f5); + // Moving parts + float pos = 0; + + // change + FrontDisc.rotateAngleZ = (float) Math.toRadians(pos); + FrontDisc2.rotateAngleZ = (float) Math.toRadians(pos + 45); + BackDisc.rotateAngleZ = (float) Math.toRadians(pos); + BackDisc2.rotateAngleZ = (float) Math.toRadians(pos + 45); + + FrontDisc.render(f5); + FrontDisc2.render(f5); + BackDisc.render(f5); + BackDisc2.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/FM/src/dark/mech/client/render/RenderGearRod.java b/FM/src/dark/mech/client/render/RenderGearRod.java new file mode 100644 index 000000000..91bda005d --- /dev/null +++ b/FM/src/dark/mech/client/render/RenderGearRod.java @@ -0,0 +1,73 @@ +package dark.mech.client.render; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.mech.client.model.ModelGearRod; + +@SideOnly(Side.CLIENT) +public class RenderGearRod extends TileEntitySpecialRenderer +{ + private ModelGearRod model; + + public RenderGearRod() + { + model = new ModelGearRod(); + } + + public void renderAModelAt(TileEntity tileEntity, double d, double d1, double d2, float f) + { + //bindTextureByName(FluidMech.MODEL_TEXTURE_DIRECTORY + "mechanical/GearRod.png"); + GL11.glPushMatrix(); + + int meta = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); + if (meta == 0) + { + GL11.glTranslatef((float) d + 0.5F, (float) d1 + 0.5F, (float) d2 + 1.5F); + } + else if (meta == 1) + { + GL11.glTranslatef((float) d + 0.5F, (float) d1 + 0.5F, (float) d2 - 0.5F); + } + else + { + GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); + } + GL11.glScalef(1.0F, -1F, -1F); + switch (meta) + { + case 0: + GL11.glRotatef(90f, 1f, 0f, 0f); + break; + case 1: + GL11.glRotatef(-90f, 1f, 0f, 0f); + break; + case 2: + GL11.glRotatef(0f, 0f, 1f, 0f); + break; + case 5: + GL11.glRotatef(90f, 0f, 1f, 0f); + break; + case 3: + GL11.glRotatef(180f, 0f, 1f, 0f); + break; + case 4: + GL11.glRotatef(270f, 0f, 1f, 0f); + break; + } + model.render(0.0625F, 0); + GL11.glPopMatrix(); + + } + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) + { + this.renderAModelAt(tileEntity, var2, var4, var6, var8); + } + +} \ No newline at end of file diff --git a/FM/src/dark/mech/client/render/RenderGenerator.java b/FM/src/dark/mech/client/render/RenderGenerator.java new file mode 100644 index 000000000..94a83a75a --- /dev/null +++ b/FM/src/dark/mech/client/render/RenderGenerator.java @@ -0,0 +1,50 @@ +package dark.mech.client.render; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.mech.client.model.ModelGenerator; + +@SideOnly(Side.CLIENT) +public class RenderGenerator extends TileEntitySpecialRenderer +{ + int type = 0; + private ModelGenerator model; + + public RenderGenerator() + { + model = new ModelGenerator(); + } + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float d3) + { + //bindTextureByName(FluidMech.MODEL_TEXTURE_DIRECTORY + "mechanical/Generator.png"); + GL11.glPushMatrix(); + GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.45F, (float) d2 + 0.5F); + GL11.glScalef(1.0F, -1F, -1F); + int meta = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); + switch (meta) + { + case 0: + GL11.glRotatef(0f, 0f, 1f, 0f); + break; + case 1: + GL11.glRotatef(90f, 0f, 1f, 0f); + break; + case 2: + GL11.glRotatef(180f, 0f, 1f, 0f); + break; + case 3: + GL11.glRotatef(270f, 0f, 1f, 0f); + break; + } + model.render(tileEntity); + GL11.glPopMatrix(); + } + +} \ No newline at end of file diff --git a/FM/src/dark/mech/common/machines/BlockMechanicalGenerator.java b/FM/src/dark/mech/common/machines/BlockMechanicalGenerator.java new file mode 100644 index 000000000..e447a08d1 --- /dev/null +++ b/FM/src/dark/mech/common/machines/BlockMechanicalGenerator.java @@ -0,0 +1,109 @@ +package dark.mech.common.machines; + +import java.util.ArrayList; +import java.util.Set; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +import com.builtbroken.common.Pair; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.client.render.BlockRenderHelper; +import dark.fluid.common.FMRecipeLoader; +import dark.fluid.common.machines.BlockFM; + +public class BlockMechanicalGenerator extends BlockFM +{ + + public BlockMechanicalGenerator() + { + super("MechanicalGenerator", Material.iron); + this.setHardness(1f); + this.setResistance(5f); + } + + @Override + public void addCreativeItems(ArrayList itemList) + { + itemList.add(new ItemStack(this, 1, 0)); + } + + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) + { + + return new ItemStack(FMRecipeLoader.blockGenerator, 1); + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase par5EntityLiving, ItemStack stack) + { + int angle = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + world.setBlockMetadataWithNotify(x, y, z, blockID, angle); + } + + @Override + public boolean onUseWrench(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) + { + int angle = MathHelper.floor_double((par5EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + int metadata = par1World.getBlockMetadata(x, y, z); + if (metadata < 3) + { + par1World.setBlockMetadataWithNotify(x, y, z, blockID, metadata + angle); + } + else + { + par1World.setBlockMetadataWithNotify(x, y, z, blockID, 0); + } + return true; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderType() + { + return BlockRenderHelper.renderID; + } + + @Override + public void onNeighborBlockChange(World par1World, int x, int y, int z, int side) + { + super.onNeighborBlockChange(par1World, x, y, z, side); + + } + + @Override + public TileEntity createNewTileEntity(World world) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public void getTileEntities(int blockID, Set>> list) + { + // TODO Auto-generated method stub + + } +} diff --git a/FM/src/dark/mech/common/machines/BlockRod.java b/FM/src/dark/mech/common/machines/BlockRod.java new file mode 100644 index 000000000..23426c856 --- /dev/null +++ b/FM/src/dark/mech/common/machines/BlockRod.java @@ -0,0 +1,124 @@ +package dark.mech.common.machines; + +import java.util.Set; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeDirection; + +import com.builtbroken.common.Pair; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.client.render.BlockRenderHelper; +import dark.fluid.common.FMRecipeLoader; +import dark.fluid.common.machines.BlockFM; + +public class BlockRod extends BlockFM +{ + + public BlockRod() + { + super("MechanicalRod", Material.iron); + this.setHardness(1f); + this.setResistance(5f); + } + + @Override + public int damageDropped(int metadata) + { + return 0; + } + + @Override + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase player, ItemStack stack) + { + int angle = MathHelper.floor_double((player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + int meta = 0; + ForgeDirection idr; + int dZ = 0; + int dX = 0; + switch (angle) + { + case 0: + meta = 2; + dZ--; + break; + case 1: + meta = 5; + dX--; + break; + case 2: + meta = 3; + dZ++; + break; + case 3: + meta = 4; + dX++; + break; + } + world.setBlockMetadataWithNotify(i, j, k, blockID, meta); + } + + @Override + public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) + { + int meta = world.getBlockMetadata(x, y, z); + if (meta >= 5) + { + world.setBlockMetadataWithNotify(x, y, z, 0, 3); + } + else + { + world.setBlockMetadataWithNotify(x, y, z, meta + 1, 3); + } + return true; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) + { + return new ItemStack(FMRecipeLoader.blockRod, 1, 0); + } + + @Override + @SideOnly(Side.CLIENT) + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderType() + { + return BlockRenderHelper.renderID; + } + + @Override + public TileEntity createNewTileEntity(World world) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public void getTileEntities(int blockID, Set>> list) + { + // TODO Auto-generated method stub + + } + +} diff --git a/FM/src/dark/mech/common/machines/BlockSteamPiston.java b/FM/src/dark/mech/common/machines/BlockSteamPiston.java new file mode 100644 index 000000000..b828ba8d5 --- /dev/null +++ b/FM/src/dark/mech/common/machines/BlockSteamPiston.java @@ -0,0 +1,90 @@ +package dark.mech.common.machines; + +import java.util.Random; +import java.util.Set; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +import com.builtbroken.common.Pair; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.fluid.common.machines.BlockFM; + +public class BlockSteamPiston extends BlockFM +{ + + public BlockSteamPiston() + { + super("SteamEngine", Material.iron); + + } + + @Override + public boolean onUseWrench(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) + { + int angle = MathHelper.floor_double((par5EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + int metadata = par1World.getBlockMetadata(x, y, z); + if (metadata < 3) + { + par1World.setBlock(x, y, z, blockID, metadata + angle, 3); + } + else + { + par1World.setBlock(x, y, z, blockID, 0, 3); + } + return true; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderType() + { + return -1; + } + + @Override + public TileEntity createNewTileEntity(World world) + { + return new TileEntitySteamPiston(); + + } + + @Override + public int idDropped(int par1, Random par2Random, int par3) + { + return this.blockID; + } + + @Override + public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) + { + int var5 = par1World.getBlockId(par2, par3, par4); + int var6 = par1World.getBlockId(par2, par3 + 1, par4); + return (var5 == 0 || blocksList[var5].blockMaterial.isReplaceable()) && (var6 == 0 || blocksList[var6].blockMaterial.isReplaceable()); + } + + @Override + public void getTileEntities(int blockID, Set>> list) + { + list.add(new Pair>("FMSteamPiston", TileEntitySteamPiston.class)); + + } +} diff --git a/FM/src/dark/mech/common/machines/TileEntitySteamPiston.java b/FM/src/dark/mech/common/machines/TileEntitySteamPiston.java new file mode 100644 index 000000000..51804f842 --- /dev/null +++ b/FM/src/dark/mech/common/machines/TileEntitySteamPiston.java @@ -0,0 +1,8 @@ +package dark.mech.common.machines; + +import com.dark.prefab.TileEntityEnergyMachine; + +public class TileEntitySteamPiston extends TileEntityEnergyMachine +{ + +} diff --git a/FM/tools/blockSorterTest/README.txt b/FM/tools/blockSorterTest/README.txt new file mode 100644 index 000000000..b38100287 --- /dev/null +++ b/FM/tools/blockSorterTest/README.txt @@ -0,0 +1,15 @@ +This segment of code was used to test the ability of the collection sorter used by the drain block to correctly sort blocks. + +30 tests per setting group were used and found to generate correct results +Input data was randomized on start and was not recorded. + +To test the the method yourself load up the main.class and change some of the varables. You will +need to load this up with minecraft and UE api as the vector3 class is from UE api that needs minecraft + +Changable vars +int listSize - changes the number of elements used for testing. Higher this number the more + vectors will be generated to read threw +int maxChangeY - changes the max amount that the y value can change from the origin +int maxChangeD - changes the max distance that the x&z can change from the origin + +Start vector can be changed but is coded in the main method to randomly generate in a range of 10 \ No newline at end of file diff --git a/FM/tools/blockSorterTest/co/Main.java b/FM/tools/blockSorterTest/co/Main.java new file mode 100644 index 000000000..73cec6dc5 --- /dev/null +++ b/FM/tools/blockSorterTest/co/Main.java @@ -0,0 +1,115 @@ +package co; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Random; + +import universalelectricity.core.vector.Vector3; + +public class Main +{ + static List list = new ArrayList(); + static int listSize = 10; + static int maxChangeY = 3; + static int maxChangeD = 10; + static Random random = new Random(); + + public static void main(String[] args) + { + System.out.println("------ListSortingTest------"); + /* Randomly generate starting point */ + Vector3 start = new Vector3(random.nextInt(10), random.nextInt(10), random.nextInt(10)); + /* Randomly generate list of vectors to sort */ + for (int l = 0; l < listSize; l++) + { + list.add(start.clone().add(new Vector3(random.nextInt(maxChangeD * 2) - maxChangeD, random.nextInt(maxChangeY * 2) - maxChangeY, random.nextInt(maxChangeD * 2) - maxChangeD))); + } + /* shuffle list to prevent the starting list looking like the ending list */ + Collections.shuffle(list); + Collections.shuffle(list); + System.out.println("List Added and randomized\n"); + /* Output randomly generated and shuffled list for comarasion */ + System.out.println("--List Content--"); + int i = 0; + for (Vector3 vec : list) + { + System.out.format("Entry%d: %s D:%.3f Y:%d \n", i, vec.toString(), vec.distanceTo(start), vec.intY()); + } + System.out.println("--List End--\n"); + /* sort list by settings */ + System.out.print("Sorting list..."); + sortBlockList(start, list, false, false); + System.out.print(" Done\n"); + /* Output sorted list for comparision */ + System.out.println("--List Content--\n"); + i = 0; + for (Vector3 vec : list) + { + System.out.format("Entry%d: %s D:%.3f Y:%d \n", i, vec.toString(), vec.distanceTo(start), vec.intY()); + } + System.out.println("--List End--\n"); + + } + + /** Used to sort a list of vector3 locations using the vector3's distance from one point and + * elevation in the y axis + * + * @param start - start location to measure distance from + * @param locations - list of vectors to sort + * @param closest - sort closest distance to the top + * @param highest - sort highest y value to the top. + * + * Note: highest takes priority over closest */ + public static void sortBlockList(final Vector3 start, final List locations, final boolean closest, final boolean highest) + { + try + { + Collections.sort(locations, new Comparator() + { + @Override + public int compare(Vector3 vecA, Vector3 vecB) + { + //Though unlikely always return zero for equal vectors + if (vecA.equals(vecB)) + { + return 0; + } + //Check y value fist as this is the primary search area + if (Integer.compare(vecA.intY(), vecB.intY()) != 0) + { + if (highest) + { + return vecA.intY() > vecB.intY() ? -1 : 1; + } + else + { + return vecA.intY() > vecB.intY() ? 1 : -1; + } + } + //Check distance after that + double distanceA = Vector3.distance(vecA, start); + double distanceB = Vector3.distance(vecB, start); + if (Double.compare(distanceA, distanceB) != 0) + { + if (closest) + { + return distanceA > distanceB ? 1 : -1; + } + else + { + return distanceA > distanceB ? -1 : 1; + } + } + return Double.compare(distanceA, distanceB); + } + }); + } + catch (Exception e) + { + System.out.println("FluidMech>>>BlockDrain>>FillArea>>Error>>CollectionSorter"); + e.printStackTrace(); + } + } +}