diff --git a/bbmodel/beaker.bbmodel b/bbmodel/beaker.bbmodel new file mode 100644 index 00000000..72de4c85 --- /dev/null +++ b/bbmodel/beaker.bbmodel @@ -0,0 +1 @@ +{"meta":{"format_version":"4.10","model_format":"java_block","box_uv":false},"name":"beaker","parent":"","ambientocclusion":true,"front_gui_light":false,"visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"unhandled_root_fields":{},"resolution":{"width":32,"height":32},"elements":[{"name":"neck","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[7.499999999999998,4,7.499999999999998],"to":[8.499999999999998,5,8.499999999999998],"autouv":0,"color":2,"origin":[7.499999999999998,3,7.499999999999998],"uv_offset":[4,2],"faces":{"north":{"uv":[2,8,4,10],"texture":0},"east":{"uv":[0,8,2,10],"texture":0},"south":{"uv":[6,8,8,10],"texture":0},"west":{"uv":[4,8,6,10],"texture":0},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[0,0,0,0],"texture":null}},"type":"cube","uuid":"40afdf58-4bb1-49aa-47c4-af933150f4f4"},{"name":"lip","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6.999999999999998,5.000000000000002,7],"to":[8.999999999999998,5.500000000000002,9],"autouv":0,"color":2,"origin":[7.499999999999998,3.4999999999999996,7.499999999999998],"uv_offset":[8,2],"faces":{"north":{"uv":[4,4,8,6],"texture":0},"east":{"uv":[0,4,4,6],"texture":0},"south":{"uv":[12,4,16,6],"texture":0},"west":{"uv":[8,4,12,6],"texture":0},"up":{"uv":[6,4,2,0],"texture":0},"down":{"uv":[10,0,6,4],"texture":0}},"type":"cube","uuid":"7b0c7bfc-341d-da8d-876d-6ac010a506e2"},{"name":"body_1","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6.999999999999998,3.6,7.099999999999998],"to":[8.999999999999998,4,8.899999999999999],"autouv":0,"color":2,"origin":[7.499999999999998,2,7.499999999999998],"uv_offset":[4,5],"faces":{"north":{"uv":[20,13,24,14],"texture":0},"east":{"uv":[16,13,20,14],"texture":0},"south":{"uv":[28,13,32,14],"texture":0},"west":{"uv":[24,13,28,14],"texture":0},"up":{"uv":[24,13,20,9],"texture":0},"down":{"uv":[0,0,0,0],"texture":null}},"type":"cube","uuid":"1fb62261-9ce1-cc71-8c3f-f00d8f269292"},{"name":"body_3","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6.599999999999998,0.3999999999999999,6.599999999999998],"to":[9.399999999999999,3,9.399999999999997],"autouv":0,"color":2,"origin":[7.499999999999998,1,7.499999999999998],"uv_offset":[4,8],"faces":{"north":{"uv":[8,24,16,32],"texture":0},"east":{"uv":[0,24,8,32],"texture":0},"south":{"uv":[24,24,32,32],"texture":0},"west":{"uv":[16,24,24,32],"texture":0},"up":{"uv":[16,24,8,16],"texture":0},"down":{"uv":[24,16,16,24],"texture":0}},"type":"cube","uuid":"9b005c16-7b79-91b4-037f-525001d7d11d"},{"name":"body_2","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6.999999999999998,0,7],"to":[8.999999999999998,0.4,9],"autouv":0,"color":2,"origin":[7.499999999999998,-1,7.499999999999998],"uv_offset":[3,7],"faces":{"north":{"uv":[20,13,24,14],"texture":0},"east":{"uv":[16,13,20,14],"texture":0},"south":{"uv":[28,13,32,14],"texture":0},"west":{"uv":[24,13,28,14],"texture":0},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[28,9,24,13],"texture":0}},"type":"cube","uuid":"ae6f94c6-16cf-eeac-f8c9-e5a9b8105cd9"},{"name":"cork","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[7.5,5.100000000000001,7.5],"to":[8.5,6.100000000000001,8.5],"autouv":0,"color":0,"origin":[0,0,0],"uv_offset":[14,0],"faces":{"north":{"uv":[23,3,26,6],"texture":0},"east":{"uv":[20,3,23,6],"texture":0},"south":{"uv":[29,3,32,6],"texture":0},"west":{"uv":[26,3,29,6],"texture":0},"up":{"uv":[26,3,23,0],"texture":0},"down":{"uv":[29,0,26,3],"texture":0}},"type":"cube","uuid":"ff1a7f00-730b-2d34-2f52-f301b76b69f4"},{"name":"top","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[7.299999999999997,4.500000000000002,7.299999999999999],"to":[8.7,5.000000000000002,8.700000000000001],"autouv":0,"color":2,"origin":[7.499999999999998,3.4999999999999996,7.499999999999998],"uv_offset":[8,2],"faces":{"north":{"uv":[4,4,8,6],"texture":0},"east":{"uv":[0,4,4,6],"texture":0},"south":{"uv":[12,4,16,6],"texture":0},"west":{"uv":[8,4,12,6],"texture":0},"up":{"uv":[6,4,2,0],"texture":0},"down":{"uv":[10,0,6,4],"texture":0}},"type":"cube","uuid":"9b76085f-62fa-3ada-1c31-0bb49239f059"},{"name":"body_1","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6.799999999999998,2.9999999999999996,6.799999999999998],"to":[9.199999999999998,3.5999999999999996,9.2],"autouv":0,"color":2,"origin":[7.499999999999998,2,7.499999999999998],"uv_offset":[4,5],"faces":{"north":{"uv":[8,24,16,26],"texture":0},"east":{"uv":[0,24,8,26],"texture":0},"south":{"uv":[24,24,32,26],"texture":0},"west":{"uv":[16,24,24,26],"texture":0},"up":{"uv":[24,13,20,9],"texture":0},"down":{"uv":[0,0,0,0],"texture":null}},"type":"cube","uuid":"3a3f165e-8deb-bd61-67af-291dff997b0b"}],"outliner":["40afdf58-4bb1-49aa-47c4-af933150f4f4","7b0c7bfc-341d-da8d-876d-6ac010a506e2","9b76085f-62fa-3ada-1c31-0bb49239f059","1fb62261-9ce1-cc71-8c3f-f00d8f269292","3a3f165e-8deb-bd61-67af-291dff997b0b","ae6f94c6-16cf-eeac-f8c9-e5a9b8105cd9","9b005c16-7b79-91b4-037f-525001d7d11d","ff1a7f00-730b-2d34-2f52-f301b76b69f4"],"textures":[{"path":"/home/sollace/Documents/GitRepos/minecraft_mods/Psychedelicraft/bbmodel/beaker.png","name":"beaker.png","folder":"","namespace":"","id":"0","width":32,"height":32,"uv_width":32,"uv_height":32,"particle":true,"use_as_default":false,"layers_enabled":true,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"985154d1-50dd-96e9-2f7b-ad92c274d45b","layers":[{"name":"layer","offset":[0,0],"scale":[1,1],"opacity":100,"visible":true,"blend_mode":"default","width":32,"height":32,"data_url":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAlJJREFUWEftVzFLQ0EMTiY3EbEiuElXNxedRHAQdBD8ATq62FFcHFzEQVAXx/4BoYOCg1CcdHFzcSgKglBUVNycIjmSZxqu7/X1VQXxlr5rcu/7ki/3Locgg4iu9Vl+G3aOiIvOnjndXJ8ndhocHoKXx2d4e/+Agf4+2No5QV2cPAiBBTEcA0BDQYmo1g2BtdVZYkA7mMTB4dnPEOAMaNSWRFoGrF9XEsSiVgm8ZkwOI9pnautqY9zOlQCD3jYeguY6GHCsPJrUAz8zgVouROfsa2Nvd5kYmIeCW2BdrllJiqEIiSJrf5+A1AAX3D0AzEg0V/I7gYgtGheJNraWa6AJADcAcAcAc+LE81cAmETEkTyg8r5LXivrntKKtucSMAElTURVAJjgj5qQKPuMfgeBc0ScZkCzxX+UAJ8pDFiOau5qqnAGjOaMp6BJxEKC528iB//1lZE8BRbz5TSrrpryPPPCGSgaQCaBXp8VnnBHBNp9jDohl/Uh6xkBD+TroZ1U/wT+TgbaapxxmnaUgSJ7PXMXRLZS3fQFebHt2lLK4lM9+rUpTe4AcoqFe4A9zWzvp/cEu9X83UF6zXA2cBba2CcDAXHYQMRtZR15QcyuXZQPIPimBKD2ZuiITAOxhIhHhgQ3FBzBimTG28N1zupMRIlP7GPk7K0EBGQKES/keV8AKoaUtbcQIKLEZhsSczp6e1V7wkuncYgiJYXWXkfEio1M60j7A5HYZ4/vI6EGggRdFlHSgKQVqb3ouiIPEui1vJPtxz48tH2P7bQ0H49R+gR74uOGFGfVMwAAAABJRU5ErkJggg=="}],"relative_path":"beaker.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAlJJREFUWEftVzFLQ0EMTiY3EbEiuElXNxedRHAQdBD8ATq62FFcHFzEQVAXx/4BoYOCg1CcdHFzcSgKglBUVNycIjmSZxqu7/X1VQXxlr5rcu/7ki/3Locgg4iu9Vl+G3aOiIvOnjndXJ8ndhocHoKXx2d4e/+Agf4+2No5QV2cPAiBBTEcA0BDQYmo1g2BtdVZYkA7mMTB4dnPEOAMaNSWRFoGrF9XEsSiVgm8ZkwOI9pnautqY9zOlQCD3jYeguY6GHCsPJrUAz8zgVouROfsa2Nvd5kYmIeCW2BdrllJiqEIiSJrf5+A1AAX3D0AzEg0V/I7gYgtGheJNraWa6AJADcAcAcAc+LE81cAmETEkTyg8r5LXivrntKKtucSMAElTURVAJjgj5qQKPuMfgeBc0ScZkCzxX+UAJ8pDFiOau5qqnAGjOaMp6BJxEKC528iB//1lZE8BRbz5TSrrpryPPPCGSgaQCaBXp8VnnBHBNp9jDohl/Uh6xkBD+TroZ1U/wT+TgbaapxxmnaUgSJ7PXMXRLZS3fQFebHt2lLK4lM9+rUpTe4AcoqFe4A9zWzvp/cEu9X83UF6zXA2cBba2CcDAXHYQMRtZR15QcyuXZQPIPimBKD2ZuiITAOxhIhHhgQ3FBzBimTG28N1zupMRIlP7GPk7K0EBGQKES/keV8AKoaUtbcQIKLEZhsSczp6e1V7wkuncYgiJYXWXkfEio1M60j7A5HYZ4/vI6EGggRdFlHSgKQVqb3ouiIPEui1vJPtxz48tH2P7bQ0H49R+gR74uOGFGfVMwAAAABJRU5ErkJggg=="}]} \ No newline at end of file diff --git a/bbmodel/beaker.png b/bbmodel/beaker.png new file mode 100644 index 00000000..c9d67bf7 Binary files /dev/null and b/bbmodel/beaker.png differ diff --git a/bbmodel/glass_tubing.bbmodel b/bbmodel/glass_tubing.bbmodel new file mode 100644 index 00000000..668e0a6d --- /dev/null +++ b/bbmodel/glass_tubing.bbmodel @@ -0,0 +1 @@ +{"meta":{"format_version":"4.10","model_format":"java_block","box_uv":true},"name":"glass_tubing","parent":"","ambientocclusion":true,"front_gui_light":false,"visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"unhandled_root_fields":{},"resolution":{"width":32,"height":32},"elements":[{"name":"down","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[7.5,0.3999999999999999,7.599999999999998],"to":[8.5,8.4,8.599999999999998],"autouv":0,"color":2,"origin":[7.499999999999998,1,7.499999999999998],"uv_offset":[4,8],"faces":{"north":{"uv":[7,24,9,32],"texture":0},"east":{"uv":[15,24,17,32],"texture":0},"south":{"uv":[23,24,25,32],"texture":0},"west":{"uv":[15,24,17,32],"texture":0},"up":{"uv":[15,23,9,17],"texture":0},"down":{"uv":[23,17,17,23],"texture":0}},"type":"cube","uuid":"9b005c16-7b79-91b4-037f-525001d7d11d"},{"name":"north","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[7.5,7.9,0.09999999999999787],"to":[8.5,8.9,8.099999999999998],"autouv":0,"color":2,"origin":[8,8.4,8.099999999999998],"uv_offset":[4,8],"faces":{"north":{"uv":[23,17,17,23],"rotation":180,"texture":0},"east":{"uv":[15,24,17,32],"rotation":270,"texture":0},"south":{"uv":[15,23,9,17],"texture":0},"west":{"uv":[15,24,17,32],"rotation":90,"texture":0},"up":{"uv":[7,24,9,32],"rotation":180,"texture":0},"down":{"uv":[23,24,25,32],"texture":0}},"type":"cube","uuid":"c1f99e71-3d1a-f834-9481-7c2c83c6e572"},{"name":"east","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[8,7.9,7.599999999999998],"to":[16,8.9,8.599999999999998],"autouv":0,"color":2,"origin":[8,8.4,8.099999999999998],"uv_offset":[4,8],"faces":{"north":{"uv":[15,24,17,32],"rotation":90,"texture":0},"east":{"uv":[23,17,17,23],"rotation":180,"texture":0},"south":{"uv":[15,24,17,32],"rotation":270,"texture":0},"west":{"uv":[15,23,9,17],"texture":0},"up":{"uv":[7,24,9,32],"rotation":270,"texture":0},"down":{"uv":[23,24,25,32],"rotation":270,"texture":0}},"type":"cube","uuid":"2e524a37-0ab5-6c49-7cbe-06b14a290811"},{"name":"west","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[0,7.9,7.599999999999998],"to":[8,8.9,8.599999999999998],"autouv":0,"color":2,"origin":[8,8.4,8.099999999999998],"uv_offset":[4,8],"faces":{"north":{"uv":[15,24,17,32],"rotation":270,"texture":0},"east":{"uv":[15,23,9,17],"texture":0},"south":{"uv":[15,24,17,32],"rotation":90,"texture":0},"west":{"uv":[23,17,17,23],"rotation":180,"texture":0},"up":{"uv":[7,24,9,32],"rotation":90,"texture":0},"down":{"uv":[23,24,25,32],"rotation":90,"texture":0}},"type":"cube","uuid":"837d1b58-d8c5-6f50-5300-84fa71b3cf0e"},{"name":"south","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[7.5,7.9,8.099999999999998],"to":[8.5,8.9,16.099999999999994],"autouv":0,"color":2,"origin":[8,8.4,8.099999999999998],"uv_offset":[4,8],"faces":{"north":{"uv":[15,23,9,17],"rotation":180,"texture":0},"east":{"uv":[15,24,17,32],"rotation":90,"texture":0},"south":{"uv":[23,17,17,23],"texture":0},"west":{"uv":[15,24,17,32],"rotation":270,"texture":0},"up":{"uv":[23,24,25,32],"texture":0},"down":{"uv":[7,24,9,32],"rotation":180,"texture":0}},"type":"cube","uuid":"2c398fc4-106a-1c8e-817b-de67f826dcac"},{"name":"up","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[7.5,8.4,7.599999999999998],"to":[8.5,16.4,8.599999999999998],"autouv":0,"color":2,"origin":[8,8.4,8.099999999999998],"uv_offset":[4,8],"faces":{"north":{"uv":[23,24,25,32],"rotation":180,"texture":0},"east":{"uv":[15,24,17,32],"rotation":180,"texture":0},"south":{"uv":[7,24,9,32],"rotation":180,"texture":0},"west":{"uv":[15,24,17,32],"rotation":180,"texture":0},"up":{"uv":[23,17,17,23],"texture":0},"down":{"uv":[15,23,9,17],"texture":0}},"type":"cube","uuid":"77ec53fe-5634-dcfa-6654-c58d44d470c2"}],"outliner":["9b005c16-7b79-91b4-037f-525001d7d11d","c1f99e71-3d1a-f834-9481-7c2c83c6e572","2c398fc4-106a-1c8e-817b-de67f826dcac","77ec53fe-5634-dcfa-6654-c58d44d470c2","2e524a37-0ab5-6c49-7cbe-06b14a290811","837d1b58-d8c5-6f50-5300-84fa71b3cf0e"],"textures":[{"path":"/home/sollace/Documents/GitRepos/minecraft_mods/Psychedelicraft/bbmodel/placed_drinks/glass_bottle.png","name":"glass_bottle.png","folder":"","namespace":"","id":"0","width":32,"height":32,"uv_width":32,"uv_height":32,"particle":true,"use_as_default":false,"layers_enabled":true,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"985154d1-50dd-96e9-2f7b-ad92c274d45b","layers":[{"name":"layer","offset":[0,0],"scale":[1,1],"opacity":100,"visible":true,"blend_mode":"default","width":32,"height":32,"data_url":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAnVJREFUWEfVV79LXEEQnqnSBQm5ELCTK2N3zVmJEEGIYCD/wJVJ4QkWwcbCRmyES5Py/AMEiwRSBA6rXJMuTYojAUE4VJLDLtXILDMvc5N9P1bvTrLNe/tm3sw3883uziLIIKJv+i7PgZ0j4ksnh923L4i/PXryGH5dXMHo+g/MPXwAewcf0evmzTNFAbAuih8AYKBOiegkBmDz9XNih3YwiHfvP88GAGdAo7Yg7pIBaydKQSxqpcCnuUo2MMJ9IX3tN6vPOO3s9MfgPHCugx0u1OezeuD3re2jQjoYwEnVgmG9zmFrgx3zUOfWsdrSrJTRUblYUkCm6N4/AKkBLrgzAFgR9F/l2UDExZSIUnW5BoYA8B0AfgLAmhjg+W8AaCLi0xSjYq/P/8p/l25DGwto4hQwAAVNRF0AaPCmJiDqPqPTAHCKiMvs0CzxmQLgM4Ud1mPUTTwDhnP2p06ziAUEz0dCB3/6m5GUAovpcpo1Kk15ynziNZAaUPJZkOygZB/5JwOph1MZoLKNLArAc8hOvCEPNE/+fwKosn4nloGqnE+NgirruKzQiuTJNeCNVc1QHohSABEHPdMXpAZv/60V/PxJj37diLI7gJxi4R5gTzN7L9B7gt16/d1Bes1wNnAWcuTNAEAUdhBxX1FHDMTk2kX5AIJuQQAqH4aOyDQQrxDx2IDghoIjaElmvDxc5yzPRJTp+MPJ2wi+LQBRWELEL/LeEQdtA8rKxwAQUSazDYnZWb28qz1h33EcoihIoZX3ELFtI9c60v5AKPbZ4/tIqIFAwS2LKGtAiorUXnRdkQcK9FpeZfmxDg9t32MrrUjH+6jdAPme7q99H50MAAAAAElFTkSuQmCC"}],"relative_path":"../../../../../../../bbmodel/placed_drinks/glass_bottle.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAnVJREFUWEfVV79LXEEQnqnSBQm5ELCTK2N3zVmJEEGIYCD/wJVJ4QkWwcbCRmyES5Py/AMEiwRSBA6rXJMuTYojAUE4VJLDLtXILDMvc5N9P1bvTrLNe/tm3sw3883uziLIIKJv+i7PgZ0j4ksnh923L4i/PXryGH5dXMHo+g/MPXwAewcf0evmzTNFAbAuih8AYKBOiegkBmDz9XNih3YwiHfvP88GAGdAo7Yg7pIBaydKQSxqpcCnuUo2MMJ9IX3tN6vPOO3s9MfgPHCugx0u1OezeuD3re2jQjoYwEnVgmG9zmFrgx3zUOfWsdrSrJTRUblYUkCm6N4/AKkBLrgzAFgR9F/l2UDExZSIUnW5BoYA8B0AfgLAmhjg+W8AaCLi0xSjYq/P/8p/l25DGwto4hQwAAVNRF0AaPCmJiDqPqPTAHCKiMvs0CzxmQLgM4Ud1mPUTTwDhnP2p06ziAUEz0dCB3/6m5GUAovpcpo1Kk15ynziNZAaUPJZkOygZB/5JwOph1MZoLKNLArAc8hOvCEPNE/+fwKosn4nloGqnE+NgirruKzQiuTJNeCNVc1QHohSABEHPdMXpAZv/60V/PxJj37diLI7gJxi4R5gTzN7L9B7gt16/d1Bes1wNnAWcuTNAEAUdhBxX1FHDMTk2kX5AIJuQQAqH4aOyDQQrxDx2IDghoIjaElmvDxc5yzPRJTp+MPJ2wi+LQBRWELEL/LeEQdtA8rKxwAQUSazDYnZWb28qz1h33EcoihIoZX3ELFtI9c60v5AKPbZ4/tIqIFAwS2LKGtAiorUXnRdkQcK9FpeZfmxDg9t32MrrUjH+6jdAPme7q99H50MAAAAAElFTkSuQmCC"}]} \ No newline at end of file diff --git a/bbmodel/placed_drinks/glass_bottle.bbmodel b/bbmodel/placed_drinks/glass_bottle.bbmodel deleted file mode 100644 index 0a2ae444..00000000 --- a/bbmodel/placed_drinks/glass_bottle.bbmodel +++ /dev/null @@ -1 +0,0 @@ -{"meta":{"format_version":"4.10","model_format":"java_block","box_uv":true},"name":"glass_bottle","parent":"","ambientocclusion":true,"front_gui_light":false,"visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"unhandled_root_fields":{},"resolution":{"width":32,"height":32},"elements":[{"name":"neck","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[7.499999999999998,4,7.499999999999998],"to":[8.499999999999998,5,8.499999999999998],"autouv":0,"color":2,"origin":[7.499999999999998,3,7.499999999999998],"uv_offset":[4,2],"faces":{"north":{"uv":[2,8,4,10],"texture":0},"east":{"uv":[0,8,2,10],"texture":0},"south":{"uv":[6,8,8,10],"texture":0},"west":{"uv":[4,8,6,10],"texture":0},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[0,0,0,0],"texture":null}},"type":"cube","uuid":"40afdf58-4bb1-49aa-47c4-af933150f4f4"},{"name":"top","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6.999999999999998,5.5,7],"to":[8.999999999999998,6,9],"autouv":0,"color":2,"origin":[7.499999999999998,4,7.499999999999998],"uv_offset":[8,2],"faces":{"north":{"uv":[2,4,6,6],"texture":0},"east":{"uv":[0,4,2,6],"texture":0},"south":{"uv":[8,4,12,6],"texture":0},"west":{"uv":[6,4,8,6],"texture":0},"up":{"uv":[6,4,2,0],"texture":0},"down":{"uv":[10,0,6,4],"texture":0}},"type":"cube","uuid":"7b0c7bfc-341d-da8d-876d-6ac010a506e2"},{"name":"body_1","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6.999999999999998,3.6,7.099999999999998],"to":[8.999999999999998,4,8.899999999999999],"autouv":0,"color":2,"origin":[7.499999999999998,2,7.499999999999998],"uv_offset":[4,5],"faces":{"north":{"uv":[20,13,24,14],"texture":0},"east":{"uv":[16,13,20,14],"texture":0},"south":{"uv":[28,13,32,14],"texture":0},"west":{"uv":[24,13,28,14],"texture":0},"up":{"uv":[24,13,20,9],"texture":0},"down":{"uv":[0,0,0,0],"texture":null}},"type":"cube","uuid":"1fb62261-9ce1-cc71-8c3f-f00d8f269292"},{"name":"body_3","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6.599999999999998,0.7999999999999998,6.599999999999998],"to":[9.399999999999999,3,9.399999999999997],"autouv":0,"color":2,"origin":[7.499999999999998,1,7.499999999999998],"uv_offset":[4,8],"faces":{"north":{"uv":[8,24,16,32],"texture":0},"east":{"uv":[0,24,8,32],"texture":0},"south":{"uv":[24,24,32,32],"texture":0},"west":{"uv":[16,24,24,32],"texture":0},"up":{"uv":[16,24,8,16],"texture":0},"down":{"uv":[24,16,16,24],"texture":0}},"type":"cube","uuid":"9b005c16-7b79-91b4-037f-525001d7d11d"},{"name":"body_2","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6.999999999999998,0,7],"to":[8.999999999999998,0.4,9],"autouv":0,"color":2,"origin":[7.499999999999998,-1,7.499999999999998],"uv_offset":[3,7],"faces":{"north":{"uv":[20,13,24,14],"texture":0},"east":{"uv":[16,13,20,14],"texture":0},"south":{"uv":[28,13,32,14],"texture":0},"west":{"uv":[24,13,28,14],"texture":0},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[28,9,24,13],"texture":0}},"type":"cube","uuid":"ae6f94c6-16cf-eeac-f8c9-e5a9b8105cd9"},{"name":"cork","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[7.5,5.100000000000001,7.5],"to":[8.5,6.100000000000001,8.5],"autouv":0,"color":0,"origin":[0,0,0],"uv_offset":[14,0],"faces":{"north":{"uv":[15,3,18,6],"texture":0},"east":{"uv":[12,3,15,6],"texture":0},"south":{"uv":[21,3,24,6],"texture":0},"west":{"uv":[18,3,21,6],"texture":0},"up":{"uv":[18,3,15,0],"texture":0},"down":{"uv":[21,0,18,3],"texture":0}},"type":"cube","uuid":"ff1a7f00-730b-2d34-2f52-f301b76b69f4"},{"name":"top","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[7.299999999999998,5,7.299999999999999],"to":[8.7,5.5,8.700000000000001],"autouv":0,"color":2,"origin":[7.499999999999998,4,7.499999999999998],"uv_offset":[8,2],"faces":{"north":{"uv":[2,4,6,6],"texture":0},"east":{"uv":[0,4,2,6],"texture":0},"south":{"uv":[8,4,12,6],"texture":0},"west":{"uv":[6,4,8,6],"texture":0},"up":{"uv":[6,4,2,0],"texture":0},"down":{"uv":[10,0,6,4],"texture":0}},"type":"cube","uuid":"9b76085f-62fa-3ada-1c31-0bb49239f059"},{"name":"body_1","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6.799999999999998,2.9999999999999996,6.799999999999998],"to":[9.199999999999998,3.5999999999999996,9.2],"autouv":0,"color":2,"origin":[7.499999999999998,2,7.499999999999998],"uv_offset":[4,5],"faces":{"north":{"uv":[8,24,16,27],"texture":0},"east":{"uv":[0,24,8,27],"texture":0},"south":{"uv":[24,24,32,27],"texture":0},"west":{"uv":[16,24,24,27],"texture":0},"up":{"uv":[24,13,20,9],"texture":0},"down":{"uv":[0,0,0,0],"texture":null}},"type":"cube","uuid":"3a3f165e-8deb-bd61-67af-291dff997b0b"},{"name":"body_2","box_uv":false,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[6.799999999999999,0.4,6.799999999999999],"to":[9.199999999999998,0.8,9.200000000000001],"autouv":0,"color":2,"origin":[7.499999999999998,-1,7.499999999999998],"uv_offset":[3,7],"faces":{"north":{"uv":[20,13,24,14],"texture":0},"east":{"uv":[16,13,20,14],"texture":0},"south":{"uv":[28,13,32,14],"texture":0},"west":{"uv":[24,13,28,14],"texture":0},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[28,9,24,13],"texture":0}},"type":"cube","uuid":"4b6d999e-daa1-e337-163e-e5ecd26abd46"}],"outliner":["40afdf58-4bb1-49aa-47c4-af933150f4f4","7b0c7bfc-341d-da8d-876d-6ac010a506e2","9b76085f-62fa-3ada-1c31-0bb49239f059","1fb62261-9ce1-cc71-8c3f-f00d8f269292","3a3f165e-8deb-bd61-67af-291dff997b0b","ae6f94c6-16cf-eeac-f8c9-e5a9b8105cd9","4b6d999e-daa1-e337-163e-e5ecd26abd46","9b005c16-7b79-91b4-037f-525001d7d11d","ff1a7f00-730b-2d34-2f52-f301b76b69f4"],"textures":[{"path":"/home/sollace/Documents/GitRepos/minecraft_mods/Psychedelicraft/bbmodel/placed_drinks/glass_bottle.png","name":"glass_bottle.png","folder":"","namespace":"","id":"0","width":32,"height":32,"uv_width":32,"uv_height":32,"particle":true,"use_as_default":false,"layers_enabled":true,"sync_to_project":"","render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"internal":true,"saved":true,"uuid":"985154d1-50dd-96e9-2f7b-ad92c274d45b","layers":[{"name":"layer","offset":[0,0],"scale":[1,1],"opacity":100,"visible":true,"blend_mode":"default","width":32,"height":32,"data_url":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjpJREFUWEfVV71KA0EQnnmIgA+QUrs0sRI7wYCCL+ATpDQ2Bm3U0ifICwgpItgFK9PYaWEREKwCFvoGI7PMnpNxb38uRPCau72ZnflmvtnZXQR5iOjZf8t7rseIeGh1h4PeppnjhudXk5fQf/OvhYgbaIz2ZDwBgLl3SkRj9V0BTQFAxK0UkMYA2PjZyT7FMtAEgLYXpKDOaV2kF9d3VZAhHQxwH81aXdpXATBO8aTlw0HvoEQ/mYESY6zrMxbjN0fH+43yEwKXYzxHpwIgylxw7wCwK4IneXdspCU1k7UKiGgBAK8A8AYAe+KYx58A0OVmUUKT2JvxXJn3YRraUm8opiAFhgF40EQ0AoAONzWZ17ZZWQeAB0Tc0QX71wC4VXPE7WDjMe155Qwoztmfd1qlXEDw+Evo4F8/lKQ4Tcl5VXhe7fLLGa+cgRTAlLx4L0gZtPJUL/iVgZJGkwOmEQDLKTtKdcQ6+f8EkLN+LVWNM5DL+dooyFnHOcVWp1NcA9ZQboYaAwg4mKpzQWnwem4rMvneb/2+EVV3ANnF3D1AgYvKOc367uBt+L0hIu86AKJwioiXHjUbNAZCcn+KsgCdbiQAL18wAH2AOELEWwWCDxTchI4lKit3tyRdaERU6YTOhka+DECcbCPio3zfiIO+AqXlSwCIqJLpA4nqrFY+chkAgJm5fLooIinU8iki9nVkNTVgs8cUuxpwFDQsouoAYgLILWJHgb/t5iw/1uHHH99DKy2mY320vgHESuWvVNfxuQAAAABJRU5ErkJggg=="}],"relative_path":"glass_bottle.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjpJREFUWEfVV71KA0EQnnmIgA+QUrs0sRI7wYCCL+ATpDQ2Bm3U0ifICwgpItgFK9PYaWEREKwCFvoGI7PMnpNxb38uRPCau72ZnflmvtnZXQR5iOjZf8t7rseIeGh1h4PeppnjhudXk5fQf/OvhYgbaIz2ZDwBgLl3SkRj9V0BTQFAxK0UkMYA2PjZyT7FMtAEgLYXpKDOaV2kF9d3VZAhHQxwH81aXdpXATBO8aTlw0HvoEQ/mYESY6zrMxbjN0fH+43yEwKXYzxHpwIgylxw7wCwK4IneXdspCU1k7UKiGgBAK8A8AYAe+KYx58A0OVmUUKT2JvxXJn3YRraUm8opiAFhgF40EQ0AoAONzWZ17ZZWQeAB0Tc0QX71wC4VXPE7WDjMe155Qwoztmfd1qlXEDw+Evo4F8/lKQ4Tcl5VXhe7fLLGa+cgRTAlLx4L0gZtPJUL/iVgZJGkwOmEQDLKTtKdcQ6+f8EkLN+LVWNM5DL+dooyFnHOcVWp1NcA9ZQboYaAwg4mKpzQWnwem4rMvneb/2+EVV3ANnF3D1AgYvKOc367uBt+L0hIu86AKJwioiXHjUbNAZCcn+KsgCdbiQAL18wAH2AOELEWwWCDxTchI4lKit3tyRdaERU6YTOhka+DECcbCPio3zfiIO+AqXlSwCIqJLpA4nqrFY+chkAgJm5fLooIinU8iki9nVkNTVgs8cUuxpwFDQsouoAYgLILWJHgb/t5iw/1uHHH99DKy2mY320vgHESuWvVNfxuQAAAABJRU5ErkJggg=="}]} \ No newline at end of file diff --git a/bbmodel/placed_drinks/glass_bottle.png b/bbmodel/placed_drinks/glass_bottle.png deleted file mode 100644 index 3edef26f..00000000 Binary files a/bbmodel/placed_drinks/glass_bottle.png and /dev/null differ diff --git a/src/main/java/ivorius/psychedelicraft/block/BlockWithFluid.java b/src/main/java/ivorius/psychedelicraft/block/BlockWithFluid.java index d8b3fb4e..86e405e9 100644 --- a/src/main/java/ivorius/psychedelicraft/block/BlockWithFluid.java +++ b/src/main/java/ivorius/psychedelicraft/block/BlockWithFluid.java @@ -166,7 +166,6 @@ default Storage getFluidStorage(Direction side) { return getTankOnSide(side); } - @Override default Storage getItemStorage(@Nullable Direction side) { return InventoryStorage.of(this, side); diff --git a/src/main/java/ivorius/psychedelicraft/block/BurnerBlock.java b/src/main/java/ivorius/psychedelicraft/block/BurnerBlock.java index 5b012358..e5e6e44a 100644 --- a/src/main/java/ivorius/psychedelicraft/block/BurnerBlock.java +++ b/src/main/java/ivorius/psychedelicraft/block/BurnerBlock.java @@ -5,9 +5,17 @@ package ivorius.psychedelicraft.block; +import org.jetbrains.annotations.Nullable; + import com.mojang.serialization.MapCodec; +import ivorius.psychedelicraft.block.entity.BurnerBlockEntity; +import ivorius.psychedelicraft.block.entity.PSBlockEntities; +import ivorius.psychedelicraft.item.component.ItemFluids; import net.minecraft.block.*; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.block.entity.BlockEntityTicker; +import net.minecraft.block.entity.BlockEntityType; import net.minecraft.entity.Entity; import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.player.PlayerEntity; @@ -15,6 +23,8 @@ import net.minecraft.item.Items; import net.minecraft.particle.ParticleTypes; import net.minecraft.registry.tag.ItemTags; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.sound.BlockSoundGroup; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvents; @@ -25,12 +35,14 @@ import net.minecraft.util.ItemActionResult; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; import net.minecraft.util.math.random.Random; import net.minecraft.util.shape.VoxelShape; import net.minecraft.world.BlockView; import net.minecraft.world.World; +import net.minecraft.world.WorldAccess; -public class BurnerBlock extends Block { +public class BurnerBlock extends BlockWithEntity implements PipeInsertable { public static final MapCodec CODEC = createCodec(BurnerBlock::new); private static final VoxelShape SHAPE = ShapeUtil.createCenteredShape(5, 2, 5); @@ -87,6 +99,11 @@ protected ItemActionResult onUseWithItem(ItemStack stack, BlockState state, Worl return ItemActionResult.SUCCESS; } + if (world.getBlockEntity(pos, PSBlockEntities.BUNSEN_BURNER).filter(data -> data.interact(stack, player, hand, hit.getSide())).isPresent()) { + world.playSound(player, pos.up(), BlockSoundGroup.GLASS.getPlaceSound(), SoundCategory.BLOCKS, 1, world.random.nextFloat() * 0.4F + 0.8F); + return ItemActionResult.SUCCESS; + } + return ItemActionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; } @@ -99,10 +116,46 @@ protected void neighborUpdate(BlockState state, World world, BlockPos pos, Block } } + @Override + public boolean acceptsConnectionFrom(WorldAccess world, BlockState state, BlockPos pos, BlockState neighborState, BlockPos neighborPos, Direction direction, boolean input) { + return input && direction == Direction.UP && world.getBlockEntity(pos, PSBlockEntities.BUNSEN_BURNER).filter(data -> data.hasBottle()).isPresent(); + } + + @Override + public int tryInsert(ServerWorld world, BlockState state, BlockPos pos, Direction direction, ItemFluids fluids) { + if (direction != Direction.DOWN) { + return SPILL_STATUS; + } + return world.getBlockEntity(pos, PSBlockEntities.BUNSEN_BURNER).map(data -> { + if (data.hasBottle()) { + return data.getTankOnSide(Direction.UP).deposit(fluids); + } + return SPILL_STATUS; + }).orElse(SPILL_STATUS); + } + @Override protected void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) { if (state.get(LIT) && !entity.isSneaking() && entity.age % 10 == 0) { entity.damage(entity.getDamageSources().inFire(), 1); } } + + @Override + @Deprecated + public BlockRenderType getRenderType(BlockState state) { + return BlockRenderType.MODEL; + } + + @Override + public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { + return new BurnerBlockEntity(pos, state); + } + + @Override + @Nullable + public BlockEntityTicker getTicker(World world, BlockState state, BlockEntityType type) { + return world.isClient ? null : validateTicker(type, PSBlockEntities.BUNSEN_BURNER, (w, p, s, entity) -> entity.tick((ServerWorld)w)); + } + } diff --git a/src/main/java/ivorius/psychedelicraft/block/GlassTubeBlock.java b/src/main/java/ivorius/psychedelicraft/block/GlassTubeBlock.java new file mode 100644 index 00000000..cff20b4e --- /dev/null +++ b/src/main/java/ivorius/psychedelicraft/block/GlassTubeBlock.java @@ -0,0 +1,236 @@ +package ivorius.psychedelicraft.block; + +import java.util.Arrays; +import java.util.Locale; +import java.util.Map; +import java.util.Optional; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.jetbrains.annotations.Nullable; +import org.joml.Vector3f; + +import com.mojang.serialization.MapCodec; + +import ivorius.psychedelicraft.block.entity.PSBlockEntities; +import ivorius.psychedelicraft.fluid.container.Resovoir; +import ivorius.psychedelicraft.item.component.ItemFluids; +import ivorius.psychedelicraft.particle.FluidParticleEffect; +import ivorius.psychedelicraft.particle.PSParticles; +import net.minecraft.block.Block; +import net.minecraft.block.BlockRenderType; +import net.minecraft.block.BlockState; +import net.minecraft.block.BlockWithEntity; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.entity.ai.pathing.NavigationType; +import net.minecraft.fluid.Fluids; +import net.minecraft.item.ItemPlacementContext; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.particle.ParticleTypes; +import net.minecraft.registry.RegistryWrapper.WrapperLookup; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.state.StateManager; +import net.minecraft.state.property.EnumProperty; +import net.minecraft.util.StringIdentifiable; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.math.random.Random; +import net.minecraft.world.WorldAccess; + +public class GlassTubeBlock extends BlockWithEntity implements PipeInsertable { + public static final MapCodec CODEC = createCodec(GlassTubeBlock::new); + + public static final EnumProperty IN = EnumProperty.of("in", IODirection.class); + public static final EnumProperty OUT = EnumProperty.of("out", IODirection.class); + + protected GlassTubeBlock(Settings settings) { + super(settings); + setDefaultState(stateManager.getDefaultState() + .with(IN, IODirection.NONE) + .with(OUT, IODirection.NONE) + ); + } + + @Override + protected MapCodec getCodec() { + return CODEC; + } + + @Override + protected BlockRenderType getRenderType(BlockState state) { + return BlockRenderType.MODEL; + } + + @Override + protected void appendProperties(StateManager.Builder builder) { + builder.add(IN, OUT); + } + + @Override + public BlockState getPlacementState(ItemPlacementContext ctx) { + IODirection placedDir = IODirection.LOOKUP.get(ctx.getSide()); + BlockState state = super.getPlacementState(ctx); + IODirection out = getValidConnections(ctx.getWorld(), ctx.getBlockPos(), state, IN, placedDir).findFirst().orElse(placedDir); + IODirection in = getValidConnections(ctx.getWorld(), ctx.getBlockPos(), state.with(OUT, out), OUT, out).findFirst().orElse(out.getOpposite()); + return setDirection(state, in, out); + } + + @Override + protected BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { + return setDirection(state, + getConnectionStateForNeighborUpdate(pos, state, direction, neighborPos, neighborState, world, IN), + getConnectionStateForNeighborUpdate(pos, state, direction, neighborPos, neighborState, world, OUT) + ); + } + + private IODirection getConnectionStateForNeighborUpdate(BlockPos pos, BlockState state, Direction direction, BlockPos neighborPos, BlockState neighbor, WorldAccess world, EnumProperty property) { + IODirection current = state.get(property); + + if (PipeInsertable.canConnectWith(world, state, pos, neighbor, neighborPos, direction, property == IN)) { + if (current == IODirection.NONE || !PipeInsertable.canConnectWith(world, state, pos, world.getBlockState(pos.offset(current.direction)), pos.offset(current.direction), current.direction, property == IN)) { + return IODirection.LOOKUP.get(direction); + } + } else if (current.direction == direction) { + return IODirection.NONE; + } + return current; + } + + @Override + public boolean acceptsConnectionFrom(WorldAccess world, BlockState state, BlockPos pos, BlockState neighborState, BlockPos neighborPos, Direction direction, boolean input) { + return neighborState.isOf(this) && (state.get(input ? OUT : IN).direction == direction); + } + + static EnumProperty getInverseProperty(EnumProperty property) { + return property == IN ? OUT : IN; + } + + public BlockState setDirection(BlockState state, IODirection in, IODirection out) { + if (in != IODirection.NONE || out != IODirection.NONE) { + in = in == IODirection.NONE ? out.getOpposite() : in; + out = out == IODirection.NONE || in == out ? in.getOpposite() : out; + } + return state.with(IN, in).with(OUT, out); + } + + private static Stream getValidConnections(WorldAccess world, BlockPos pos, BlockState state, EnumProperty property, IODirection exclude) { + return IODirection.LOOKUP.entrySet().stream().filter(pair -> { + BlockPos nieghborPos = pos.offset(pair.getKey()); + BlockState neighborState = world.getBlockState(nieghborPos); + var ss = state; + IODirection dir = neighborState.getOrEmpty(property).orElse(null); + if (dir == null && PipeInsertable.canConnectWith(world, state, pos, neighborState, nieghborPos, pair.getKey(), property == OUT)) { + return true; + } + + return (dir == pair.getValue().getOpposite() || dir == IODirection.NONE) && (exclude != IODirection.NONE && dir != exclude); + }).map(Map.Entry::getValue); + } + + @Override + protected void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { + world.getBlockEntity(pos, PSBlockEntities.GLASS_TUBING).ifPresent(data -> { + if (data.tank.getContents().amount() > 0 && state.get(OUT) + .getDirection() + .map(direction -> PipeInsertable.tryInsert(world, pos.offset(direction), direction, data.tank)).orElse(SPILL_STATUS) == SPILL_STATUS) { + var fluid = data.tank.getContents().fluid(); + Direction outDirection = state.get(OUT).direction; + Vector3f outVec = outDirection == null ? new Vector3f() : outDirection.getUnitVector(); + world.spawnParticles( + fluid.getPhysical().isOf(Fluids.WATER) ? ParticleTypes.DRIPPING_WATER + : fluid.getPhysical().isOf(Fluids.LAVA) ? ParticleTypes.DRIPPING_LAVA + : new FluidParticleEffect(PSParticles.DRIPPING_FLUID, fluid), + pos.getX() + 0.5 + outVec.x * 0.5, + pos.getY() + 0.5 + outVec.y * 0.5 - 0.2, + pos.getZ() + 0.5 + outVec.z * 0.5, 1, 0, 0, 0, 0); + data.tank.drain(3); + } + if (data.tank.getContents().amount() > 0) { + world.scheduleBlockTick(pos, this, 3); + } + }); + } + + + @Override + protected boolean canPathfindThrough(BlockState state, NavigationType type) { + return false; + } + + @Override + public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { + return new Data(pos, state); + } + + enum IODirection implements StringIdentifiable { + NONE(null), + UP(Direction.UP), + DOWN(Direction.DOWN), + NORTH(Direction.NORTH), + SOUTH(Direction.SOUTH), + EAST(Direction.EAST), + WEST(Direction.WEST); + + static final Map LOOKUP = Arrays.stream(values()) + .filter(i -> i.getDirection().isPresent()) + .collect(Collectors.toMap(i -> i.getDirection().get(), Function.identity())); + + private final Direction direction; + private final String name = name().toLowerCase(Locale.ROOT); + + IODirection(@Nullable Direction direction) { + this.direction = direction; + } + + public IODirection getOpposite() { + return direction == null ? this : LOOKUP.getOrDefault(direction.getOpposite(), NONE); + } + + public Optional getDirection() { + return Optional.ofNullable(direction); + } + + @Override + public String asString() { + return name; + } + } + + @Override + public int tryInsert(ServerWorld world, BlockState state, BlockPos pos, Direction direction, ItemFluids fluids) { + if (state.get(IN).direction == direction.getOpposite()) { + return world.getBlockEntity(pos, PSBlockEntities.GLASS_TUBING).map(data -> { + return data.tank.deposit(fluids); + }).orElse(0); + } + + return SPILL_STATUS; + } + + public static class Data extends BlockEntity implements Resovoir.ChangeListener { + private final Resovoir tank = new Resovoir(3, this); + + public Data(BlockPos pos, BlockState state) { + super(PSBlockEntities.GLASS_TUBING, pos, state); + } + + @Override + public void onLevelChange(Resovoir tank, int change) { + if (tank.getAmount() > 0 && this.getWorld() instanceof ServerWorld sw) { + sw.scheduleBlockTick(getPos(), getCachedState().getBlock(), 3); + } + markDirty(); + } + + @Override + protected void writeNbt(NbtCompound nbt, WrapperLookup lookup) { + nbt.put("tank", tank.toNbt(lookup)); + } + + @Override + protected void readNbt(NbtCompound nbt, WrapperLookup lookup) { + tank.fromNbt(nbt.getCompound("tank"), lookup); + } + } +} diff --git a/src/main/java/ivorius/psychedelicraft/block/PSBlocks.java b/src/main/java/ivorius/psychedelicraft/block/PSBlocks.java index 84922b5f..5a0c044a 100644 --- a/src/main/java/ivorius/psychedelicraft/block/PSBlocks.java +++ b/src/main/java/ivorius/psychedelicraft/block/PSBlocks.java @@ -125,6 +125,11 @@ public interface PSBlocks { Block TRAY = register("tray", new TrayBlock(Settings.create().mapColor(MapColor.IRON_GRAY).hardness(0.7F).sounds(BlockSoundGroup.METAL).nonOpaque())); Block BUNSEN_BURNER = register("bunsen_burner", new BurnerBlock(Settings.create().mapColor(MapColor.IRON_GRAY).hardness(0.7F).sounds(BlockSoundGroup.METAL).nonOpaque())); + Block GLASS_TUBING = register("glass_tubing", new GlassTubeBlock(Settings.create().mapColor(MapColor.OFF_WHITE).strength(0.3F).sounds(BlockSoundGroup.GLASS).nonOpaque() + .allowsSpawning(Blocks::never) + .solidBlock(Blocks::never) + .suffocates(Blocks::never) + .blockVision(Blocks::never))); static T register(String name, T block) { return Registry.register(Registries.BLOCK, Psychedelicraft.id(name), block); diff --git a/src/main/java/ivorius/psychedelicraft/block/PipeInsertable.java b/src/main/java/ivorius/psychedelicraft/block/PipeInsertable.java new file mode 100644 index 00000000..f58c8cfc --- /dev/null +++ b/src/main/java/ivorius/psychedelicraft/block/PipeInsertable.java @@ -0,0 +1,46 @@ +package ivorius.psychedelicraft.block; + +import ivorius.psychedelicraft.fluid.container.Resovoir; +import ivorius.psychedelicraft.item.component.ItemFluids; +import net.minecraft.block.BlockState; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.WorldAccess; + +public interface PipeInsertable { + int SPILL_STATUS = -1; + + default boolean acceptsConnectionFrom(WorldAccess world, BlockState state, BlockPos pos, BlockState neighborState, BlockPos neighborPos, Direction direction, boolean input) { + return false; + } + + default int tryInsert(ServerWorld world, BlockState state, BlockPos pos, Direction direction, ItemFluids fluids) { + return SPILL_STATUS; + } + + static boolean canConnectWith(WorldAccess world, BlockState state, BlockPos pos, BlockState neighborState, BlockPos neighborPos, Direction direction, boolean input) { + return neighborState.getBlock() instanceof PipeInsertable pipe + && pipe.acceptsConnectionFrom(world, neighborState, neighborPos, state, pos, direction.getOpposite(), input); + } + + static int tryInsert(ServerWorld world, BlockPos pos, Direction direction, Resovoir tank) { + int amount = tryInsert(world, pos, direction, tank.getContents()); + if (amount > 0) { + tank.drain(amount); + } + return amount; + } + + @SuppressWarnings("deprecation") + static int tryInsert(ServerWorld world, BlockPos pos, Direction direction, ItemFluids fluids) { + if (!world.isChunkLoaded(pos)) { + return 0; + } + BlockState state = world.getBlockState(pos); + if (state.getBlock() instanceof PipeInsertable insertable) { + return insertable.tryInsert(world, state, pos, direction, fluids); + } + return SPILL_STATUS; + } +} diff --git a/src/main/java/ivorius/psychedelicraft/block/entity/BurnerBlockEntity.java b/src/main/java/ivorius/psychedelicraft/block/entity/BurnerBlockEntity.java new file mode 100644 index 00000000..e2cabf93 --- /dev/null +++ b/src/main/java/ivorius/psychedelicraft/block/entity/BurnerBlockEntity.java @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2014, Lukas Tenbrink. + * * http://lukas.axxim.net + */ + +package ivorius.psychedelicraft.block.entity; + +import ivorius.psychedelicraft.block.BlockWithFluid; +import ivorius.psychedelicraft.block.BurnerBlock; +import ivorius.psychedelicraft.block.GlassTubeBlock; +import ivorius.psychedelicraft.block.PipeInsertable; +import ivorius.psychedelicraft.fluid.FluidVolumes; +import ivorius.psychedelicraft.fluid.Processable; +import ivorius.psychedelicraft.fluid.Processable.ByProductConsumer; +import ivorius.psychedelicraft.fluid.Processable.ProcessType; +import ivorius.psychedelicraft.fluid.container.Resovoir; +import ivorius.psychedelicraft.item.PSItems; +import ivorius.psychedelicraft.item.component.ItemFluids; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.particle.ParticleTypes; +import net.minecraft.registry.RegistryWrapper.WrapperLookup; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvents; +import net.minecraft.util.Hand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.WorldEvents; + +public class BurnerBlockEntity extends FlaskBlockEntity implements BlockWithFluid.DirectionalFluidResovoir, Resovoir.ChangeListener { + + private int temperature; + private boolean hasBottle; + //private final Map ingredientTanks = new HashMap<>(); + + public BurnerBlockEntity(BlockPos pos, BlockState state) { + super(PSBlockEntities.BUNSEN_BURNER, pos, state, FluidVolumes.GLASS_BOTTLE); + } + + public void setHasBottle(boolean hasBottle) { + this.hasBottle = hasBottle; + markDirty(); + } + + @Override + public void markDirty() { + super.markDirty(); + if (getWorld() instanceof ServerWorld sw) { + sw.getChunkManager().markForUpdate(getPos()); + } + } + + @Override + public void onLevelChange(Resovoir resovoir, int change) { + super.onLevelChange(resovoir, change); + if (change > 0) { + getWorld().playSound(null, getPos(), SoundEvents.ITEM_BOTTLE_FILL, SoundCategory.BLOCKS); + } + } + + public boolean hasBottle() { + return hasBottle; + } + + public int getTemperature() { + return temperature; + } + + public boolean interact(ItemStack stack, PlayerEntity player, Hand hand, Direction side) { + + if (hasBottle() && stack.isEmpty()) { + Resovoir tank = getPrimaryTank(); + ItemFluids.Transaction t = ItemFluids.Transaction.begin(Items.GLASS_BOTTLE.getDefaultStack()); + tank.withdraw(t, FluidVolumes.GLASS_BOTTLE); + player.setStackInHand(hand, t.toItemStack()); + setHasBottle(false); + } + + ItemFluids fluid = ItemFluids.of(stack); + boolean consumeItem = false; + + if (!hasBottle() && (stack.isOf(Items.GLASS_BOTTLE) || stack.isOf(PSItems.FILLED_GLASS_BOTTLE) || stack.isOf(Items.POTION))) { + setHasBottle(true); + stack.decrementUnlessCreative(1, player); + consumeItem = true; + } + + if (hasBottle() && !fluid.isEmpty()) { + Resovoir tank = getTankOnSide(side); + if (consumeItem) { + tank.deposit(fluid); + return true; + } + + ItemFluids.Transaction t = ItemFluids.Transaction.begin(stack); + return tank.deposit(t, (int)tank.getCapacity()) > 0; + } + + return false; + } + + @Override + public void tick(ServerWorld world) { + if (hasBottle()) { + if (world.getTime() % 14 == 0) { + if (getCachedState().get(BurnerBlock.LIT)) { + if (temperature < (getPrimaryTank().getContents().isEmpty() ? 200 : 100)) { + temperature++; + markDirty(); + } + } else { + if (temperature > 0) { + temperature--; + markDirty(); + } + } + } + + if (temperature > 50 && world.getTime() % 5 == world.random.nextInt(3)) { + if (getPrimaryTank().getContents().isEmpty()) { + world.playSound(null, getPos(), SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.BLOCKS, 1.25F, 0.02F); + world.spawnParticles(ParticleTypes.SMOKE, + pos.getX() + world.getRandom().nextTriangular(0.5F, 0.1F), + pos.getY() + 0.6F, + pos.getZ() + world.getRandom().nextTriangular(0.5F, 0.1F), + 2, 0, 0, 0, 0); + + if (temperature > 180 && world.random.nextInt(3) == 0) { + world.playSound(null, getPos(), SoundEvents.BLOCK_GLASS_BREAK, SoundCategory.BLOCKS, 1.25F, 0.02F); + world.syncWorldEvent(WorldEvents.BLOCK_BROKEN, getPos(), Block.getRawIdFromState(Blocks.GLASS_PANE.getDefaultState())); + setHasBottle(false); + } + } else { + if (temperature > 100) { + temperature -= 2; + markDirty(); + } + world.playSound(null, getPos(), SoundEvents.BLOCK_CANDLE_EXTINGUISH, SoundCategory.BLOCKS, 1.25F, 0.02F); + BlockPos pipePos = getPos().up(); + Resovoir tank = getPrimaryTank(); + + if (tank.getContents().fluid() instanceof Processable processable) { + processable.process(tank, ProcessType.REACT, new ByProductConsumer() { + @Override + public void accept(ItemStack stack) { + Block.dropStack(world, getPos(), stack); + } + + @Override + public void accept(ItemFluids fluids) { + int amount = PipeInsertable.tryInsert(world, pipePos, Direction.UP, fluids); + if (amount < fluids.amount()) { + onFluidWasted(world); + } + } + + }); + } else { + if (PipeInsertable.tryInsert(world, pipePos, Direction.UP, getPrimaryTank()) == GlassTubeBlock.SPILL_STATUS) { + getPrimaryTank().drain(1); + onFluidWasted(world); + } + } + } + } + } + } + + private void onFluidWasted(ServerWorld world) { + world.spawnParticles(ParticleTypes.DUST_PLUME, + pos.getX() + world.getRandom().nextTriangular(0.5F, 0.1F), + pos.getY() + 0.6F, + pos.getZ() + world.getRandom().nextTriangular(0.5F, 0.1F), + 2, 0, 0, 0, 0); + } + + @Override + public Resovoir getTankOnSide(Direction direction) { + //if (direction == Direction.DOWN) { + return super.getTankOnSide(direction); + //} + //return ingredientTanks.computeIfAbsent(direction, d -> new Resovoir(FluidVolumes.BOTTLE, this)); + } + @Override + public void writeNbt(NbtCompound compound, WrapperLookup lookup) { + super.writeNbt(compound, lookup); + compound.putBoolean("hasBottle", hasBottle); + compound.putInt("temperature", temperature); + /*NbtCompound ingredientTanksNbt = new NbtCompound(); + ingredientTanks.forEach((direction, tank) -> { + ingredientTanksNbt.put(direction.asString(), tank.toNbt(lookup)); + }); + compound.put("ingredients", ingredientTanksNbt);*/ + } + + @Override + public void readNbt(NbtCompound compound, WrapperLookup lookup) { + super.readNbt(compound, lookup); + hasBottle = compound.getBoolean("hasBottle"); + temperature = compound.getInt("temperature"); + //ingredientTanks.clear(); + /*NbtCompound ingredients = compound.getCompound("ingredients"); + ingredients.getKeys().forEach(key -> { + Direction direction = Direction.byName(key); + if (direction != null) { + Resovoir tank = new Resovoir(FluidVolumes.BOTTLE, this); + tank.fromNbt(ingredients.getCompound(key), lookup); + ingredientTanks.put(direction, tank); + } + });*/ + } + +} diff --git a/src/main/java/ivorius/psychedelicraft/block/entity/PSBlockEntities.java b/src/main/java/ivorius/psychedelicraft/block/entity/PSBlockEntities.java index d1c85e6c..ea11267c 100644 --- a/src/main/java/ivorius/psychedelicraft/block/entity/PSBlockEntities.java +++ b/src/main/java/ivorius/psychedelicraft/block/entity/PSBlockEntities.java @@ -22,7 +22,9 @@ public interface PSBlockEntities { PSBlocks.BIRCH_BARREL, PSBlocks.JUNGLE_BARREL, PSBlocks.ACACIA_BARREL, PSBlocks.DARK_OAK_BARREL )); + BlockEntityType BUNSEN_BURNER = create("bunsen_burner", BlockEntityType.Builder.create(BurnerBlockEntity::new, PSBlocks.BUNSEN_BURNER)); BlockEntityType PLACED_DRINK = create("placed_drink", BlockEntityType.Builder.create(PlacedDrinksBlock.Data::new, PSBlocks.PLACED_DRINK)); + BlockEntityType GLASS_TUBING = create("glass_tubing", BlockEntityType.Builder.create(GlassTubeBlock.Data::new, PSBlocks.GLASS_TUBING)); static BlockEntityType create(String id, Builder builder) { return Registry.register(Registries.BLOCK_ENTITY_TYPE, Psychedelicraft.id(id), builder.build(null)); diff --git a/src/main/java/ivorius/psychedelicraft/client/render/PSRenderers.java b/src/main/java/ivorius/psychedelicraft/client/render/PSRenderers.java index 931afd36..e676028c 100644 --- a/src/main/java/ivorius/psychedelicraft/client/render/PSRenderers.java +++ b/src/main/java/ivorius/psychedelicraft/client/render/PSRenderers.java @@ -51,6 +51,7 @@ static void bootstrap() { BlockEntityRendererFactories.register(PSBlockEntities.BOTTLE_RACK, BottleRackBlockEntityRenderer::new); BlockEntityRendererFactories.register(PSBlockEntities.PEYOTE, PeyoteBlockEntityRenderer::new); BlockEntityRendererFactories.register(PSBlockEntities.PLACED_DRINK, DrinksBlockEntityRenderer::new); + BlockEntityRendererFactories.register(PSBlockEntities.BUNSEN_BURNER, BurnerBlockEntityRenderer::new); PreparableModelLoadingPlugin.register(PlacedDrinksModelProvider.INSTANCE, PlacedDrinksModelProvider.INSTANCE); diff --git a/src/main/java/ivorius/psychedelicraft/client/render/PlacedDrinksModelProvider.java b/src/main/java/ivorius/psychedelicraft/client/render/PlacedDrinksModelProvider.java index b06973b2..0dcd6821 100644 --- a/src/main/java/ivorius/psychedelicraft/client/render/PlacedDrinksModelProvider.java +++ b/src/main/java/ivorius/psychedelicraft/client/render/PlacedDrinksModelProvider.java @@ -16,6 +16,7 @@ import ivorius.psychedelicraft.Psychedelicraft; import ivorius.psychedelicraft.client.render.FluidBoxRenderer.FluidAppearance; +import ivorius.psychedelicraft.client.render.blocks.BurnerBlockEntityRenderer; import ivorius.psychedelicraft.item.component.FluidCapacity; import ivorius.psychedelicraft.item.component.ItemFluids; import ivorius.psychedelicraft.util.MathUtils; @@ -101,6 +102,7 @@ public void onInitializeModelLoader(Map { context.addModels(getGroundModelId(id), getGroundModelFluidId(id)); }); + context.addModels(BurnerBlockEntityRenderer.BEAKER_MODEL); } public Optional get(Item item) { diff --git a/src/main/java/ivorius/psychedelicraft/client/render/blocks/BurnerBlockEntityRenderer.java b/src/main/java/ivorius/psychedelicraft/client/render/blocks/BurnerBlockEntityRenderer.java new file mode 100644 index 00000000..cd46a270 --- /dev/null +++ b/src/main/java/ivorius/psychedelicraft/client/render/blocks/BurnerBlockEntityRenderer.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2014, Lukas Tenbrink. + * * http://lukas.axxim.net + */ + +package ivorius.psychedelicraft.client.render.blocks; + +import java.util.List; + +import ivorius.psychedelicraft.Psychedelicraft; +import ivorius.psychedelicraft.block.entity.BurnerBlockEntity; +import ivorius.psychedelicraft.util.MathUtils; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.render.RenderLayer; +import net.minecraft.client.render.VertexConsumer; +import net.minecraft.client.render.VertexConsumerProvider; +import net.minecraft.client.render.block.entity.BlockEntityRenderer; +import net.minecraft.client.render.block.entity.BlockEntityRendererFactory; +import net.minecraft.client.render.model.BakedModel; +import net.minecraft.client.render.model.BakedQuad; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.screen.PlayerScreenHandler; +import net.minecraft.util.Colors; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.Direction; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RotationAxis; +import net.minecraft.util.math.random.Random; + +public class BurnerBlockEntityRenderer implements BlockEntityRenderer { + public static final Identifier BEAKER_MODEL = Psychedelicraft.id("block/beaker"); + public static final Identifier BEAKER_TEXTURE = Psychedelicraft.id("textures/block/beaker.png"); + private static final Random RNG = Random.create(); + private static final long SEED = 42L; + + public BurnerBlockEntityRenderer(BlockEntityRendererFactory.Context context) { + + } + + @Override + public void render(BurnerBlockEntity entity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertices, int light, int overlay) { + if (entity.hasBottle()) { + BakedModel model = MinecraftClient.getInstance().getBakedModelManager().getModel(BEAKER_MODEL); + VertexConsumer buffer = vertices.getBuffer(RenderLayer.getEntityTranslucent(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE)); + matrices.push(); + + if (entity.getTemperature() >= 99) { + float ticks = MinecraftClient.getInstance().player.age + tickDelta; + float amplitude = 5;//1.65F; + matrices.translate(0.5, 0, 0.5); + + matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(MathHelper.sin(ticks) * amplitude)); + matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(MathHelper.sin(ticks + 9 + MathHelper.sin(ticks)) * amplitude)); + matrices.translate(-0.5, 0, -0.5); + } + matrices.translate(0, 0.12, 0); + renderBakedItemModel(model, matrices, buffer, light, overlay, Colors.WHITE); + matrices.pop(); + } + } + + private void renderBakedItemModel(BakedModel model, MatrixStack matrices, VertexConsumer vertices, int light, int overlay, int color) { + for (Direction direction : Direction.values()) { + RNG.setSeed(SEED); + renderBakedItemQuads(matrices, vertices, model.getQuads(null, direction, RNG), light, overlay, color); + } + RNG.setSeed(SEED); + renderBakedItemQuads(matrices, vertices, model.getQuads(null, null, RNG), light, overlay, color); + } + + private void renderBakedItemQuads(MatrixStack matrices, VertexConsumer vertices, List quads, int light, int overlay, int color) { + MatrixStack.Entry entry = matrices.peek(); + for (BakedQuad bakedQuad : quads) { + vertices.quad(entry, bakedQuad, MathUtils.r(color), MathUtils.g(color), MathUtils.b(color), MathUtils.a(color), light, overlay); + } + } + +} diff --git a/src/main/java/ivorius/psychedelicraft/fluid/container/Resovoir.java b/src/main/java/ivorius/psychedelicraft/fluid/container/Resovoir.java index 01cfbb08..98b9c739 100644 --- a/src/main/java/ivorius/psychedelicraft/fluid/container/Resovoir.java +++ b/src/main/java/ivorius/psychedelicraft/fluid/container/Resovoir.java @@ -16,14 +16,19 @@ * @since 3 Jan 2023 */ public class Resovoir implements NbtSerialisable, VariantMarshal.FabricResovoir { - private ItemFluids fluids = ItemFluids.EMPTY; + private ItemFluids fluids; private final int capacity; private final ChangeListener changeCallback; public Resovoir(int capacity, ChangeListener changeCallback) { + this(capacity, changeCallback, ItemFluids.EMPTY); + } + + public Resovoir(int capacity, ChangeListener changeCallback, ItemFluids fluids) { this.capacity = capacity; this.changeCallback = changeCallback; + this.fluids = fluids; } @Override @@ -143,7 +148,6 @@ public void clear() { } } - @Override public void toNbt(NbtCompound compound, WrapperLookup lookup) { compound.put("fluid", ItemFluids.CODEC.encodeStart(NbtOps.INSTANCE, fluids).getOrThrow()); diff --git a/src/main/java/ivorius/psychedelicraft/item/PSItems.java b/src/main/java/ivorius/psychedelicraft/item/PSItems.java index f7231943..b34442d4 100644 --- a/src/main/java/ivorius/psychedelicraft/item/PSItems.java +++ b/src/main/java/ivorius/psychedelicraft/item/PSItems.java @@ -270,6 +270,7 @@ public interface PSItems { Item TRAY = register("tray", PSBlocks.TRAY); Item BUNSEN_BURNER = register("bunsen_burner", PSBlocks.BUNSEN_BURNER); + Item GLASS_TUBING = register("glasss_tubing", PSBlocks.GLASS_TUBING); static Item register(String name, Block block) { return register(name, new BlockItem(block, new Settings())); diff --git a/src/main/resources/assets/psychedelicraft/blockstates/glass_tubing.json b/src/main/resources/assets/psychedelicraft/blockstates/glass_tubing.json new file mode 100644 index 00000000..3af31c31 --- /dev/null +++ b/src/main/resources/assets/psychedelicraft/blockstates/glass_tubing.json @@ -0,0 +1,54 @@ +{ + "multipart": [ + { + "apply": { "model": "psychedelicraft:block/glass_tubing_out", "x": 180, "y": 0 }, + "when": { "out": "up" } + }, + { + "apply": { "model": "psychedelicraft:block/glass_tubing_out", "x": 0, "y": 0 }, + "when": { "out": "down" } + }, + { + "apply": { "model": "psychedelicraft:block/glass_tubing_out", "x": 90, "y": -90 }, + "when": { "out": "east" } + }, + { + "apply": { "model": "psychedelicraft:block/glass_tubing_out", "x": 90, "y": 90 }, + "when": { "out": "west" } + }, + { + "apply": { "model": "psychedelicraft:block/glass_tubing_out", "x": 90, "y": 180 }, + "when": { "out": "north" } + }, + { + "apply": { "model": "psychedelicraft:block/glass_tubing_out", "x": 90, "y": 0 }, + "when": { "out": "south" } + }, + + + { + "apply": { "model": "psychedelicraft:block/glass_tubing_in", "x": 180, "y": 0 }, + "when": { "in": "up" } + }, + { + "apply": { "model": "psychedelicraft:block/glass_tubing_in", "x": 0, "y": 0 }, + "when": { "in": "down" } + }, + { + "apply": { "model": "psychedelicraft:block/glass_tubing_in", "x": 90, "y": -90 }, + "when": { "in": "east" } + }, + { + "apply": { "model": "psychedelicraft:block/glass_tubing_in", "x": 90, "y": 90 }, + "when": { "in": "west" } + }, + { + "apply": { "model": "psychedelicraft:block/glass_tubing_in", "x": 90, "y": 180 }, + "when": { "in": "north" } + }, + { + "apply": { "model": "psychedelicraft:block/glass_tubing_in", "x": 90, "y": 0 }, + "when": { "in": "south" } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/psychedelicraft/models/block/beaker.json b/src/main/resources/assets/psychedelicraft/models/block/beaker.json new file mode 100644 index 00000000..659401b5 --- /dev/null +++ b/src/main/resources/assets/psychedelicraft/models/block/beaker.json @@ -0,0 +1,115 @@ +{ + "texture_size": [32, 32], + "textures": { + "beaker": "psychedelicraft:block/beaker", + "particle": "#beaker" + }, + "elements": [ + { + "name": "neck", + "from": [7.5, 4, 7.5], + "to": [8.5, 5, 8.5], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 3, 7.5]}, + "faces": { + "north": {"uv": [1, 4, 2, 5], "texture": "#beaker"}, + "east": {"uv": [0, 4, 1, 5], "texture": "#beaker"}, + "south": {"uv": [3, 4, 4, 5], "texture": "#beaker"}, + "west": {"uv": [2, 4, 3, 5], "texture": "#beaker"} + } + }, + { + "name": "lip", + "from": [7, 5, 7], + "to": [9, 5.5, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 3.5, 7.5]}, + "faces": { + "north": {"uv": [2, 2, 4, 3], "texture": "#beaker"}, + "east": {"uv": [0, 2, 2, 3], "texture": "#beaker"}, + "south": {"uv": [6, 2, 8, 3], "texture": "#beaker"}, + "west": {"uv": [4, 2, 6, 3], "texture": "#beaker"}, + "up": {"uv": [3, 2, 1, 0], "texture": "#beaker"}, + "down": {"uv": [5, 0, 3, 2], "texture": "#beaker"} + } + }, + { + "name": "top", + "from": [7.3, 4.5, 7.3], + "to": [8.7, 5, 8.7], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 3.5, 7.5]}, + "faces": { + "north": {"uv": [2, 2, 4, 3], "texture": "#beaker"}, + "east": {"uv": [0, 2, 2, 3], "texture": "#beaker"}, + "south": {"uv": [6, 2, 8, 3], "texture": "#beaker"}, + "west": {"uv": [4, 2, 6, 3], "texture": "#beaker"}, + "up": {"uv": [3, 2, 1, 0], "texture": "#beaker"}, + "down": {"uv": [5, 0, 3, 2], "texture": "#beaker"} + } + }, + { + "name": "body_1", + "from": [7, 3.6, 7.1], + "to": [9, 4, 8.9], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 2, 7.5]}, + "faces": { + "north": {"uv": [10, 6.5, 12, 7], "texture": "#beaker"}, + "east": {"uv": [8, 6.5, 10, 7], "texture": "#beaker"}, + "south": {"uv": [14, 6.5, 16, 7], "texture": "#beaker"}, + "west": {"uv": [12, 6.5, 14, 7], "texture": "#beaker"}, + "up": {"uv": [12, 6.5, 10, 4.5], "texture": "#beaker"} + } + }, + { + "name": "body_1", + "from": [6.8, 3, 6.8], + "to": [9.2, 3.6, 9.2], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 2, 7.5]}, + "faces": { + "north": {"uv": [4, 12, 8, 13], "texture": "#beaker"}, + "east": {"uv": [0, 12, 4, 13], "texture": "#beaker"}, + "south": {"uv": [12, 12, 16, 13], "texture": "#beaker"}, + "west": {"uv": [8, 12, 12, 13], "texture": "#beaker"}, + "up": {"uv": [12, 6.5, 10, 4.5], "texture": "#beaker"} + } + }, + { + "name": "body_2", + "from": [7, 0, 7], + "to": [9, 0.4, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, -1, 7.5]}, + "faces": { + "north": {"uv": [10, 6.5, 12, 7], "texture": "#beaker"}, + "east": {"uv": [8, 6.5, 10, 7], "texture": "#beaker"}, + "south": {"uv": [14, 6.5, 16, 7], "texture": "#beaker"}, + "west": {"uv": [12, 6.5, 14, 7], "texture": "#beaker"}, + "down": {"uv": [14, 4.5, 12, 6.5], "texture": "#beaker"} + } + }, + { + "name": "body_3", + "from": [6.6, 0.4, 6.6], + "to": [9.4, 3, 9.4], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 1, 7.5]}, + "faces": { + "north": {"uv": [4, 12, 8, 16], "texture": "#beaker"}, + "east": {"uv": [0, 12, 4, 16], "texture": "#beaker"}, + "south": {"uv": [12, 12, 16, 16], "texture": "#beaker"}, + "west": {"uv": [8, 12, 12, 16], "texture": "#beaker"}, + "up": {"uv": [8, 12, 4, 8], "texture": "#beaker"}, + "down": {"uv": [12, 8, 8, 12], "texture": "#beaker"} + } + }, + { + "name": "cork", + "from": [7.5, 5.1, 7.5], + "to": [8.5, 6.1, 8.5], + "faces": { + "north": {"uv": [11.5, 1.5, 13, 3], "texture": "#beaker"}, + "east": {"uv": [10, 1.5, 11.5, 3], "texture": "#beaker"}, + "south": {"uv": [14.5, 1.5, 16, 3], "texture": "#beaker"}, + "west": {"uv": [13, 1.5, 14.5, 3], "texture": "#beaker"}, + "up": {"uv": [13, 1.5, 11.5, 0], "texture": "#beaker"}, + "down": {"uv": [14.5, 0, 13, 1.5], "texture": "#beaker"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/psychedelicraft/models/block/glass_bottle_on_ground.json b/src/main/resources/assets/psychedelicraft/models/block/glass_bottle_on_ground.json deleted file mode 100644 index 190136af..00000000 --- a/src/main/resources/assets/psychedelicraft/models/block/glass_bottle_on_ground.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "texture_size": [32, 32], - "textures": { - "texture": "psychedelicraft:item/glass_bottle_on_ground", - "particle": "#texture" - }, - "elements": [ - { - "name": "neck", - "from": [7.5, 4, 7.5], - "to": [8.5, 5, 8.5], - "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 3, 7.5]}, - "faces": { - "north": {"uv": [1, 4, 2, 5], "texture": "#texture"}, - "east": {"uv": [0, 4, 1, 5], "texture": "#texture"}, - "south": {"uv": [3, 4, 4, 5], "texture": "#texture"}, - "west": {"uv": [2, 4, 3, 5], "texture": "#texture"} - } - }, - { - "name": "top", - "from": [7, 5.5, 7], - "to": [9, 6, 9], - "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 4, 7.5]}, - "faces": { - "north": {"uv": [1, 2, 3, 3], "texture": "#texture"}, - "east": {"uv": [0, 2, 1, 3], "texture": "#texture"}, - "south": {"uv": [4, 2, 6, 3], "texture": "#texture"}, - "west": {"uv": [3, 2, 4, 3], "texture": "#texture"}, - "up": {"uv": [3, 2, 1, 0], "texture": "#texture"}, - "down": {"uv": [5, 0, 3, 2], "texture": "#texture"} - } - }, - { - "name": "top", - "from": [7.3, 5, 7.3], - "to": [8.7, 5.5, 8.7], - "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 4, 7.5]}, - "faces": { - "north": {"uv": [1, 2, 3, 3], "texture": "#texture"}, - "east": {"uv": [0, 2, 1, 3], "texture": "#texture"}, - "south": {"uv": [4, 2, 6, 3], "texture": "#texture"}, - "west": {"uv": [3, 2, 4, 3], "texture": "#texture"}, - "up": {"uv": [3, 2, 1, 0], "texture": "#texture"}, - "down": {"uv": [5, 0, 3, 2], "texture": "#texture"} - } - }, - { - "name": "body_1", - "from": [7, 3.6, 7.1], - "to": [9, 4, 8.9], - "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 2, 7.5]}, - "faces": { - "north": {"uv": [10, 6.5, 12, 7], "texture": "#texture"}, - "east": {"uv": [8, 6.5, 10, 7], "texture": "#texture"}, - "south": {"uv": [14, 6.5, 16, 7], "texture": "#texture"}, - "west": {"uv": [12, 6.5, 14, 7], "texture": "#texture"}, - "up": {"uv": [12, 6.5, 10, 4.5], "texture": "#texture"} - } - }, - { - "name": "body_1", - "from": [6.8, 3, 6.8], - "to": [9.2, 3.6, 9.2], - "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 2, 7.5]}, - "faces": { - "north": {"uv": [4, 12, 8, 13.5], "texture": "#texture"}, - "east": {"uv": [0, 12, 4, 13.5], "texture": "#texture"}, - "south": {"uv": [12, 12, 16, 13.5], "texture": "#texture"}, - "west": {"uv": [8, 12, 12, 13.5], "texture": "#texture"}, - "up": {"uv": [12, 6.5, 10, 4.5], "texture": "#texture"} - } - }, - { - "name": "body_2", - "from": [7, 0, 7], - "to": [9, 0.4, 9], - "rotation": {"angle": 0, "axis": "y", "origin": [7.5, -1, 7.5]}, - "faces": { - "north": {"uv": [10, 6.5, 12, 7], "texture": "#texture"}, - "east": {"uv": [8, 6.5, 10, 7], "texture": "#texture"}, - "south": {"uv": [14, 6.5, 16, 7], "texture": "#texture"}, - "west": {"uv": [12, 6.5, 14, 7], "texture": "#texture"}, - "down": {"uv": [14, 4.5, 12, 6.5], "texture": "#texture"} - } - }, - { - "name": "body_2", - "from": [6.8, 0.4, 6.8], - "to": [9.2, 0.8, 9.2], - "rotation": {"angle": 0, "axis": "y", "origin": [7.5, -1, 7.5]}, - "faces": { - "north": {"uv": [10, 6.5, 12, 7], "texture": "#texture"}, - "east": {"uv": [8, 6.5, 10, 7], "texture": "#texture"}, - "south": {"uv": [14, 6.5, 16, 7], "texture": "#texture"}, - "west": {"uv": [12, 6.5, 14, 7], "texture": "#texture"}, - "down": {"uv": [14, 4.5, 12, 6.5], "texture": "#texture"} - } - }, - { - "name": "body_3", - "from": [6.6, 0.8, 6.6], - "to": [9.4, 3, 9.4], - "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 1, 7.5]}, - "faces": { - "north": {"uv": [4, 12, 8, 16], "texture": "#texture"}, - "east": {"uv": [0, 12, 4, 16], "texture": "#texture"}, - "south": {"uv": [12, 12, 16, 16], "texture": "#texture"}, - "west": {"uv": [8, 12, 12, 16], "texture": "#texture"}, - "up": {"uv": [8, 12, 4, 8], "texture": "#texture"}, - "down": {"uv": [12, 8, 8, 12], "texture": "#texture"} - } - }, - { - "name": "cork", - "from": [7.5, 5.1, 7.5], - "to": [8.5, 6.1, 8.5], - "faces": { - "north": {"uv": [7.5, 1.5, 9, 3], "texture": "#texture"}, - "east": {"uv": [6, 1.5, 7.5, 3], "texture": "#texture"}, - "south": {"uv": [10.5, 1.5, 12, 3], "texture": "#texture"}, - "west": {"uv": [9, 1.5, 10.5, 3], "texture": "#texture"}, - "up": {"uv": [9, 1.5, 7.5, 0], "texture": "#texture"}, - "down": {"uv": [10.5, 0, 9, 1.5], "texture": "#texture"} - } - } - ] -} diff --git a/src/main/resources/assets/psychedelicraft/models/block/glass_tubing_all.json b/src/main/resources/assets/psychedelicraft/models/block/glass_tubing_all.json new file mode 100644 index 00000000..8ca6bc59 --- /dev/null +++ b/src/main/resources/assets/psychedelicraft/models/block/glass_tubing_all.json @@ -0,0 +1,93 @@ +{ + "texture_size": [32, 32], + "textures": { + "0": "glass_bottle", + "particle": "glass_bottle" + }, + "elements": [ + { + "name": "down", + "from": [7.5, 0.4, 7.6], + "to": [8.5, 8.4, 8.6], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 1, 7.5]}, + "faces": { + "north": {"uv": [3.5, 12, 4.5, 16], "texture": "#0"}, + "east": {"uv": [7.5, 12, 8.5, 16], "texture": "#0"}, + "south": {"uv": [11.5, 12, 12.5, 16], "texture": "#0"}, + "west": {"uv": [7.5, 12, 8.5, 16], "texture": "#0"}, + "up": {"uv": [7.5, 11.5, 4.5, 8.5], "texture": "#0"}, + "down": {"uv": [11.5, 8.5, 8.5, 11.5], "texture": "#0"} + } + }, + { + "name": "north", + "from": [7.5, 7.9, 0.1], + "to": [8.5, 8.9, 8.1], + "rotation": {"angle": 0, "axis": "x", "origin": [8, 8.4, 8.1]}, + "faces": { + "north": {"uv": [11.5, 8.5, 8.5, 11.5], "rotation": 180, "texture": "#0"}, + "east": {"uv": [7.5, 12, 8.5, 16], "rotation": 270, "texture": "#0"}, + "south": {"uv": [7.5, 11.5, 4.5, 8.5], "texture": "#0"}, + "west": {"uv": [7.5, 12, 8.5, 16], "rotation": 90, "texture": "#0"}, + "up": {"uv": [3.5, 12, 4.5, 16], "rotation": 180, "texture": "#0"}, + "down": {"uv": [11.5, 12, 12.5, 16], "texture": "#0"} + } + }, + { + "name": "south", + "from": [7.5, 7.9, 8.1], + "to": [8.5, 8.9, 16.1], + "rotation": {"angle": 0, "axis": "x", "origin": [8, 8.4, 8.1]}, + "faces": { + "north": {"uv": [7.5, 11.5, 4.5, 8.5], "rotation": 180, "texture": "#0"}, + "east": {"uv": [7.5, 12, 8.5, 16], "rotation": 90, "texture": "#0"}, + "south": {"uv": [11.5, 8.5, 8.5, 11.5], "texture": "#0"}, + "west": {"uv": [7.5, 12, 8.5, 16], "rotation": 270, "texture": "#0"}, + "up": {"uv": [11.5, 12, 12.5, 16], "texture": "#0"}, + "down": {"uv": [3.5, 12, 4.5, 16], "rotation": 180, "texture": "#0"} + } + }, + { + "name": "up", + "from": [7.5, 8.4, 7.6], + "to": [8.5, 16.4, 8.6], + "rotation": {"angle": 0, "axis": "x", "origin": [8, 8.4, 8.1]}, + "faces": { + "north": {"uv": [11.5, 12, 12.5, 16], "rotation": 180, "texture": "#0"}, + "east": {"uv": [7.5, 12, 8.5, 16], "rotation": 180, "texture": "#0"}, + "south": {"uv": [3.5, 12, 4.5, 16], "rotation": 180, "texture": "#0"}, + "west": {"uv": [7.5, 12, 8.5, 16], "rotation": 180, "texture": "#0"}, + "up": {"uv": [11.5, 8.5, 8.5, 11.5], "texture": "#0"}, + "down": {"uv": [7.5, 11.5, 4.5, 8.5], "texture": "#0"} + } + }, + { + "name": "east", + "from": [8, 7.9, 7.6], + "to": [16, 8.9, 8.6], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8.4, 8.1]}, + "faces": { + "north": {"uv": [7.5, 12, 8.5, 16], "rotation": 90, "texture": "#0"}, + "east": {"uv": [11.5, 8.5, 8.5, 11.5], "rotation": 180, "texture": "#0"}, + "south": {"uv": [7.5, 12, 8.5, 16], "rotation": 270, "texture": "#0"}, + "west": {"uv": [7.5, 11.5, 4.5, 8.5], "texture": "#0"}, + "up": {"uv": [3.5, 12, 4.5, 16], "rotation": 270, "texture": "#0"}, + "down": {"uv": [11.5, 12, 12.5, 16], "rotation": 270, "texture": "#0"} + } + }, + { + "name": "west", + "from": [0, 7.9, 7.6], + "to": [8, 8.9, 8.6], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8.4, 8.1]}, + "faces": { + "north": {"uv": [7.5, 12, 8.5, 16], "rotation": 270, "texture": "#0"}, + "east": {"uv": [7.5, 11.5, 4.5, 8.5], "texture": "#0"}, + "south": {"uv": [7.5, 12, 8.5, 16], "rotation": 90, "texture": "#0"}, + "west": {"uv": [11.5, 8.5, 8.5, 11.5], "rotation": 180, "texture": "#0"}, + "up": {"uv": [3.5, 12, 4.5, 16], "rotation": 90, "texture": "#0"}, + "down": {"uv": [11.5, 12, 12.5, 16], "rotation": 90, "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/psychedelicraft/models/block/glass_tubing_in.json b/src/main/resources/assets/psychedelicraft/models/block/glass_tubing_in.json new file mode 100644 index 00000000..725d1230 --- /dev/null +++ b/src/main/resources/assets/psychedelicraft/models/block/glass_tubing_in.json @@ -0,0 +1,21 @@ +{ + "texture_size": [32, 32], + "textures": { + "glass": "psychedelicraft:block/glass_tubing_in", + "particle": "#glass" + }, + "elements": [ + { + "from": [7.5, 0.4, 7.6], + "to": [8.5, 8.4, 8.6], + "faces": { + "north": {"uv": [3.5, 12, 4.5, 16], "texture": "#glass"}, + "east": {"uv": [7.5, 12, 8.5, 16], "texture": "#glass"}, + "south": {"uv": [11.5, 12, 12.5, 16], "texture": "#glass"}, + "west": {"uv": [7.5, 12, 8.5, 16], "texture": "#glass"}, + "up": {"uv": [7.5, 11.5, 4.5, 8.5], "texture": "#glass"}, + "down": {"uv": [11.5, 8.5, 8.5, 11.5], "texture": "#glass"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/psychedelicraft/models/block/glass_tubing_out.json b/src/main/resources/assets/psychedelicraft/models/block/glass_tubing_out.json new file mode 100644 index 00000000..5f3511dd --- /dev/null +++ b/src/main/resources/assets/psychedelicraft/models/block/glass_tubing_out.json @@ -0,0 +1,21 @@ +{ + "texture_size": [32, 32], + "textures": { + "glass": "psychedelicraft:block/beaker", + "particle": "#glass" + }, + "elements": [ + { + "from": [7.5, 0.4, 7.6], + "to": [8.5, 8.4, 8.6], + "faces": { + "north": {"uv": [3.5, 12, 4.5, 16], "texture": "#glass"}, + "east": {"uv": [7.5, 12, 8.5, 16], "texture": "#glass"}, + "south": {"uv": [11.5, 12, 12.5, 16], "texture": "#glass"}, + "west": {"uv": [7.5, 12, 8.5, 16], "texture": "#glass"}, + "up": {"uv": [7.5, 11.5, 4.5, 8.5], "texture": "#glass"}, + "down": {"uv": [11.5, 8.5, 8.5, 11.5], "texture": "#glass"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/psychedelicraft/textures/block/beaker.png b/src/main/resources/assets/psychedelicraft/textures/block/beaker.png new file mode 100644 index 00000000..0e502a98 Binary files /dev/null and b/src/main/resources/assets/psychedelicraft/textures/block/beaker.png differ