{"action":"created","issue":{"url":"https://api.github.com/repos/alatyami/Growthcraft-1.7/issues/103","labels_url":"https://api.github.com/repos/alatyami/Growthcraft-1.7/issues/103/labels{/name}","comments_url":"https://api.github.com/repos/alatyami/Growthcraft-1.7/issues/103/comments","events_url":"https://api.github.com/repos/alatyami/Growthcraft-1.7/issues/103/events","html_url":"https://github.com/alatyami/Growthcraft-1.7/issues/103","id":110748235,"number":103,"title":"Pipes, do you want?","user":{"login":"IceDragon200","id":1649873,"avatar_url":"https://avatars.githubusercontent.com/u/1649873?v=3","gravatar_id":"","url":"https://api.github.com/users/IceDragon200","html_url":"https://github.com/IceDragon200","followers_url":"https://api.github.com/users/IceDragon200/followers","following_url":"https://api.github.com/users/IceDragon200/following{/other_user}","gists_url":"https://api.github.com/users/IceDragon200/gists{/gist_id}","starred_url":"https://api.github.com/users/IceDragon200/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IceDragon200/subscriptions","organizations_url":"https://api.github.com/users/IceDragon200/orgs","repos_url":"https://api.github.com/users/IceDragon200/repos","events_url":"https://api.github.com/users/IceDragon200/events{/privacy}","received_events_url":"https://api.github.com/users/IceDragon200/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/alatyami/Growthcraft-1.7/labels/feature","name":"feature","color":"84b6eb"},{"url":"https://api.github.com/repos/alatyami/Growthcraft-1.7/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-10-09T22:46:14Z","updated_at":"2015-10-09T23:53:37Z","closed_at":null,"body":"# Pipes, do you want?\r\ntl;dr\r\n[Screenshots](https://www.dropbox.com/sh/pqsl4ziigvotqls/AAD3AjzP22TaK10XAtEzbPYja?dl=0)\r\n> You may notice a buildcraft wrench in my hand, I've also taken to adding wrench support to our blocks.\r\n\r\n## Downloads\r\n### Latest\r\n[Build 1](https://dl.dropboxusercontent.com/u/72618186/minecraft/mods/growthcraft/2.2.2/growthcraft-1.7.10-2.2.2-complete_pipes-module-build1.jar)\r\n\r\n### Old\r\n[Build 0](https://dl.dropboxusercontent.com/u/72618186/minecraft/mods/growthcraft/2.2.2/growthcraft-1.7.10-2.2.2-complete_pipes-module-build0.jar)\r\n\r\n## Synopsis\r\nI've implemented liquid pipes for Growthcraft, so we don't need any fancy smancy tech mods (hi Ender IO, Buildcraft, Thermal Expansion, Extra Utilities, and friends), we have our own simple liquid pipes (which are buggy because I suck at coding these things, help is welcome :+1:)\r\n\r\nIf you guys don't think its necessary I'll happily shelve the idea.\r\n\r\nBut if you are interested:\r\n## Pipes\r\n\r\n### The run down\r\nThere are currently 2 types of pipes, \r\n* Base Pipes (or Transfer Pipes) - These pipes can connect to other pipes or IFluidHandler's to transfer liquids, they will not drain adjacent tiles. All pipes push not pull (which leads us to...)\r\n* Vacuum Pipes - These will automatically drain an adjacent IFluidHandler tile and eject the contents into an adjacent `Base Pipe`. It will not extract liquids from `Base Pipe` (or not suppose to, you know buggy code), and it will not eject liquids into a pure IFluidHandler (I say pure, because pipes are also IFluidHandlers, also this is another case of `not suppose to`, but buggy code).\r\n\r\n### Gameplay\r\nPipes do dumb connection (you can't modify the connections upon placement, it will always connect to an available IFluidHandler), the only way to prevent them from connecting, is physical separation (place the pipe AWAY from the block)\r\n\r\n### Technical\r\nThe pipe model is made of roughly 20 parts (yup, that's a lot of parts, per pipe), the entire state is represented by a 14 bit flag (2 bits `short` of a `short int` or `unit16`, if that's your thing)\r\n```java\r\n// The first 6 bits mark the pipe as connected to another pipe (the bits correspond to the ForgeDirection.ordinal)\r\nflag = 1 << direction.oridinal();\r\n\r\n// The next 6 bits mark the pipe as connected to a IFluidHandler (not a pipe)\r\nflag = 1 << (6 + direction.oridinal());\r\n\r\n// The 13th bit, marks the pipe as a base pipe (or just tells the renderer, HEY THIS USES A BASE CORE)\r\nflag = 1 << 13;\r\n\r\n// The 14th bit, marks the pipe as a Vacuum pipe (aka, USE THE VACUUM CORE MODEL)\r\nflag = 1 << 14;\r\n```\r\nI chose to use bit flags to reduce network data to a single integer, this has its limits however, since I only have 18 bits left (sounds like plenty though)\r\n\r\n## Items/Tools\r\nNo, I refuse to add YAT (Yet Another Tool), so I'll be abusing existing mod tools (hi Buildcraft)\r\n\r\n### player.Sneaking + Wrench (IToolWrench)\r\n#### Drops as item\r\n* Ferment Barrels\r\n* Fruit Presses\r\n* Brew Kettles \r\n* Pipes\r\n\r\n### Wrench (IToolWrench)\r\n#### Rotates \r\n* Ferment Barrels\r\n* Fruit Presses\r\n* does nothing to pipes currently (since they don't need to be rotated to work, could be used to toggle Vacuum pipes)\r\n\r\n### Dye\r\nI think I'll add color to the pipes, so using dye on a pipe will color it and prevent it from connecting with non matching pipes. \r\n\r\nThere is that one gotcha, rendering, I'll need to look how other mods do it for a better idea, I was thinking of just switching the texture to the color mask and re-rendering it.\r\n> that should tick a seasoned graphics programmers off `YOU'RE SWITCHING TEXTURES MIDWAY IN RENDERING` yeah, so (⌐■_■) Deal With It™\r\n\r\nThus ends my rant, share you comments, suggestions, ideas?\r\n\r\nI'll be adding support for existing mods a little later (after I finally get some \"me\" time and play minecraft as a player and not a developer). So we'll restore Thaumcraft, Forestry and anything on your wish list, one mod at a time"},"comment":{"url":"https://api.github.com/repos/alatyami/Growthcraft-1.7/issues/comments/147013307","html_url":"https://github.com/alatyami/Growthcraft-1.7/issues/103#issuecomment-147013307","issue_url":"https://api.github.com/repos/alatyami/Growthcraft-1.7/issues/103","id":147013307,"user":{"login":"spannerman79","id":7542384,"avatar_url":"https://avatars.githubusercontent.com/u/7542384?v=3","gravatar_id":"","url":"https://api.github.com/users/spannerman79","html_url":"https://github.com/spannerman79","followers_url":"https://api.github.com/users/spannerman79/followers","following_url":"https://api.github.com/users/spannerman79/following{/other_user}","gists_url":"https://api.github.com/users/spannerman79/gists{/gist_id}","starred_url":"https://api.github.com/users/spannerman79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spannerman79/subscriptions","organizations_url":"https://api.github.com/users/spannerman79/orgs","repos_url":"https://api.github.com/users/spannerman79/repos","events_url":"https://api.github.com/users/spannerman79/events{/privacy}","received_events_url":"https://api.github.com/users/spannerman79/received_events","type":"User","site_admin":false},"created_at":"2015-10-09T23:53:37Z","updated_at":"2015-10-09T23:53:37Z","body":"lol @ Amazing Stick. Yeah that can work. I was only thinking of a stick to;\r\n\r\n1) Keep item ID's down and use vanilla items. Highly unlikely that a stick would change minecraft wise\r\n\r\n2) Most other mods I've come across will auto fallback to a vanilla item when item X from mod/s Y cannot be found\r\n\r\nIf all your doing is adding lore NBT data on use of stick then ignore this entire comment :P"}}