Girdert of here!

- New Metal Girder block
- Experimental Girder renderer for track curves
This commit is contained in:
simibubi 2022-02-08 01:49:35 +01:00
parent 0cd56e67f2
commit 380104a850
47 changed files with 863 additions and 56 deletions

View file

@ -290,6 +290,7 @@ debef0f5dde74103aaf4422de4bc90e4099b0c47 assets/create/blockstates/mechanical_pl
b7c4a0ff0c6f16e14d71fc0fb7fc66d032b65cf3 assets/create/blockstates/mechanical_pump.json
264d72320ee0f1e014319f7d99dcc1fa953a4ad4 assets/create/blockstates/mechanical_saw.json
94bbcb7e622471dbf418d78f9200ad321c7168de assets/create/blockstates/metal_bracket.json
c253a827d9f0b0e29f67dfd19d65b259d3d4f045 assets/create/blockstates/metal_girder.json
4e48ad0936647065c2322390e7c0fe115c853a98 assets/create/blockstates/millstone.json
468202df0802e17c75fcad0993daf1bc5300ca91 assets/create/blockstates/minecart_anchor.json
b1126c191877cff86b4e2de83e1fcbd151451cb7 assets/create/blockstates/mysterious_cuckoo_clock.json
@ -535,22 +536,22 @@ bf2b0310500213ff853c748c236eb5d01f61658e assets/create/blockstates/yellow_toolbo
6801fa1f466f172700e573e5b8ee8ee5f9ca4583 assets/create/blockstates/yellow_valve_handle.json
7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json
b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json
9ffe5b3f8a39fa3c3a97a3c534bd82402177e82e assets/create/lang/en_ud.json
8a5aec9b50def31d67404d0bfe4b44e36f4b92fe assets/create/lang/en_us.json
d9daa020e298d6ab1420c31347e34d1c44b1754b assets/create/lang/unfinished/de_de.json
fb68c11749892f4548065b5a2c9c06d8ea191675 assets/create/lang/unfinished/es_cl.json
2c3dd3ce3babc836ca5d7cf7b6674bc82dacab75 assets/create/lang/unfinished/es_es.json
031fa6be3a6fa11c6f14dc71c96c75e3bfa29172 assets/create/lang/unfinished/fr_fr.json
e683bf4fb4acfb4ba4a545427c9d793905272572 assets/create/lang/unfinished/it_it.json
641d5b5066086679364cbf882722ca75b7a1578c assets/create/lang/unfinished/ja_jp.json
8260c7075f6e9fdb8a97618636854555a0dc2b72 assets/create/lang/unfinished/ko_kr.json
fb7df57cc05f3cf95715b4c1dcf7274beb332c4f assets/create/lang/unfinished/nl_nl.json
697fb5eb49f7316c9932fab43346717695c5e0c5 assets/create/lang/unfinished/pl_pl.json
e007d6c626a1fca61382838f413d0e40ca702017 assets/create/lang/unfinished/pt_br.json
c4b8a2bd6331dd0c703bc70204f9dce24be08cc2 assets/create/lang/unfinished/pt_pt.json
b8acd477bf9bef586fe10e58a4120064581ecabc assets/create/lang/unfinished/ru_ru.json
44e398366683e2d92ebdbbcdf7b6510b7ee62889 assets/create/lang/unfinished/zh_cn.json
0d0016f17bea0cece7b89de092db5517ddfb899e assets/create/lang/unfinished/zh_tw.json
d32ac672a6e85015edc0f49157405da81a9d82fd assets/create/lang/en_ud.json
907936101b5a6cc3fc9db47aec2617f836b773bb assets/create/lang/en_us.json
c265dd98de3faa80affe8f5a6f171f7a0f9d1027 assets/create/lang/unfinished/de_de.json
4f41bf7eece8eb6463b307390d721348018cf91d assets/create/lang/unfinished/es_cl.json
93e8b2b6d7f029c362029393c1329045cfb35033 assets/create/lang/unfinished/es_es.json
4cfe7446bb05c23c9a49fe3bccddb1e597050c1c assets/create/lang/unfinished/fr_fr.json
2a495ea4df9330bc69bcb05291b8210fa644bfdc assets/create/lang/unfinished/it_it.json
62d1aec8ba91731d99480e60dd6cb29489b6c887 assets/create/lang/unfinished/ja_jp.json
aa79bb52d87c6d5251231dd4f577dd334793e903 assets/create/lang/unfinished/ko_kr.json
a8f003508a946f9c1144bf14aff2321feccc507b assets/create/lang/unfinished/nl_nl.json
43f5043560fda8799718c262fa72111101be31db assets/create/lang/unfinished/pl_pl.json
cae2ce1a697c0660ff66b23020dd0209ae9258c6 assets/create/lang/unfinished/pt_br.json
e3d4a36a5f9b7b37cf52affadc9018ff3106a0d8 assets/create/lang/unfinished/pt_pt.json
c2986f67a7dcf94db04107f4126ab3601f5065ee assets/create/lang/unfinished/ru_ru.json
40cd4b06703e51b8779b36e45fd42bf836737971 assets/create/lang/unfinished/zh_cn.json
48c4e96bfd4de2cd466911a18035d7bba98645a4 assets/create/lang/unfinished/zh_tw.json
487a511a01b2a4531fb672f917922312db78f958 assets/create/models/block/acacia_window.json
b48060cba1a382f373a05bf0039054053eccf076 assets/create/models/block/acacia_window_pane_noside.json
3066db1bf03cffa1a9c7fbacf47ae586632f4eb3 assets/create/models/block/acacia_window_pane_noside_alt.json
@ -1877,6 +1878,7 @@ f8d0d4b2a890ea7a69ab0c390947b48fe0478d3f assets/create/models/item/mechanical_pi
4e363477e3e8059dd7b2bad04046521b31923d1b assets/create/models/item/mechanical_pump.json
3fc1fcb2016d2782c3667c21575423122b66705a assets/create/models/item/mechanical_saw.json
3afa723a8ba4160a4bd8778a56e1880e7ff53ed9 assets/create/models/item/metal_bracket.json
56494f6d8743241836f7e68122ad9cc83f77658a assets/create/models/item/metal_girder.json
0eb5726c8c0de462f432411c210d6132b2c446a4 assets/create/models/item/millstone.json
363c5a2b8ac945b676c838cdf7b0494c3ab13599 assets/create/models/item/minecart_contraption.json
01e3fda31e549a3b6a1e5e615b59478e8f06f16a assets/create/models/item/minecart_coupling.json
@ -2135,7 +2137,7 @@ d080b1b25e5bc8baf5aee68691b08c7f12ece3b0 assets/create/models/item/windmill_bear
a80fb25a0b655e76be986b5b49fcb0f03461a1ab assets/create/models/item/zinc_nugget.json
b1689617190c05ef34bd18456b0c7ae09bb3210f assets/create/models/item/zinc_ore.json
5049f72c327a88f175f6f9425909e098fc711100 assets/create/sounds.json
0f1b4b980afba9bf2caf583b88e261bba8b10313 data/create/advancements/aesthetics.json
5d0cc4c0255dc241e61c173b31ddca70c88d08e4 data/create/advancements/aesthetics.json
613e64b44bed959da899fdd54c1cacb227fb33f2 data/create/advancements/andesite_alloy.json
81885c6bfb85792c88aaa7c9b70f58832945d31f data/create/advancements/andesite_casing.json
83c046bd200623933545c9e4326f782fb02c87fa data/create/advancements/arm_blaze_burner.json
@ -3571,6 +3573,7 @@ ff55d31ae8f7a8943f1e9fcc330d18e246566997 data/create/loot_tables/blocks/mechanic
8f885b8cec8f1ef9e35bd9b93a64a0f6e14c31b0 data/create/loot_tables/blocks/mechanical_pump.json
6c88dd3f096f2a7572573158f8e6d9f4b3dedae0 data/create/loot_tables/blocks/mechanical_saw.json
fcd800d7abf5dc5ce50b6fff6f2fc934b3d47b4b data/create/loot_tables/blocks/metal_bracket.json
afdff197c9d1a6940e988c00435135f9705fd0e5 data/create/loot_tables/blocks/metal_girder.json
b83a90fbe83906b171fc0de6bdc2d9aa3a8c542e data/create/loot_tables/blocks/millstone.json
5c1df8443043b3fe3b665dba348e2ff188bcbe31 data/create/loot_tables/blocks/minecart_anchor.json
1e73d28fdd2e54910074aeadbe5617425a8ae656 data/create/loot_tables/blocks/mysterious_cuckoo_clock.json
@ -5274,7 +5277,7 @@ ff1900963bc4cd8ceffa78d58ef1952ceacb2fb7 data/forge/tags/items/storage_blocks/br
69f596fcb065e26b02ce246760432b5174191b76 data/minecraft/tags/blocks/impermeable.json
2db7759fe036160c14c6ed19a68604ca16f4de60 data/minecraft/tags/blocks/lush_ground_replaceable.json
02f7a9df2f9e154749266e7ac59c37aa076a3390 data/minecraft/tags/blocks/mineable/axe.json
b52748d3d434dd40ba10db8e97fa2102d7acb638 data/minecraft/tags/blocks/mineable/pickaxe.json
fa964df81a193d6854ef23fc6061a02d52743f60 data/minecraft/tags/blocks/mineable/pickaxe.json
2db7759fe036160c14c6ed19a68604ca16f4de60 data/minecraft/tags/blocks/moss_replaceable.json
e157c1d3af30e409e34bbefbe15a037e6e1c8daa data/minecraft/tags/blocks/needs_iron_tool.json
a08f67865337f62601c5e333b4011382d10020e4 data/minecraft/tags/blocks/needs_stone_tool.json

View file

@ -0,0 +1,78 @@
{
"multipart": [
{
"when": {
"x": "false",
"z": "false"
},
"apply": {
"model": "create:block/metal_girder/block_pole"
}
},
{
"when": {
"x": "true"
},
"apply": {
"model": "create:block/metal_girder/block_x"
}
},
{
"when": {
"z": "true"
},
"apply": {
"model": "create:block/metal_girder/block_z"
}
},
{
"when": {
"top": "true",
"x": "true",
"z": "false"
},
"apply": {
"model": "create:block/metal_girder/block_top"
}
},
{
"when": {
"bottom": "true",
"x": "true",
"z": "false"
},
"apply": {
"model": "create:block/metal_girder/block_bottom"
}
},
{
"when": {
"top": "true",
"x": "false",
"z": "true"
},
"apply": {
"model": "create:block/metal_girder/block_top"
}
},
{
"when": {
"bottom": "true",
"x": "false",
"z": "true"
},
"apply": {
"model": "create:block/metal_girder/block_bottom"
}
},
{
"when": {
"x": "true",
"z": "true"
},
"apply": {
"model": "create:block/metal_girder/block_cross"
}
}
]
}

View file

@ -291,6 +291,7 @@
"block.create.mechanical_pump": "d\u026Fn\u0500 \u05DF\u0250\u0254\u0131u\u0250\u0265\u0254\u01DDW",
"block.create.mechanical_saw": "\u028D\u0250S \u05DF\u0250\u0254\u0131u\u0250\u0265\u0254\u01DDW",
"block.create.metal_bracket": "\u0287\u01DD\u029E\u0254\u0250\u0279\u15FA \u05DF\u0250\u0287\u01DDW",
"block.create.metal_girder": "\u0279\u01DDp\u0279\u0131\u2141 \u05DF\u0250\u0287\u01DDW",
"block.create.millstone": "\u01DDuo\u0287s\u05DF\u05DF\u0131W",
"block.create.minecart_anchor": "\u0279o\u0265\u0254u\u2C6F \u0287\u0279\u0250\u0254\u01DDu\u0131W",
"block.create.mysterious_cuckoo_clock": "\u029E\u0254o\u05DF\u0186 oo\u029E\u0254n\u0186",

View file

@ -294,6 +294,7 @@
"block.create.mechanical_pump": "Mechanical Pump",
"block.create.mechanical_saw": "Mechanical Saw",
"block.create.metal_bracket": "Metal Bracket",
"block.create.metal_girder": "Metal Girder",
"block.create.millstone": "Millstone",
"block.create.minecart_anchor": "Minecart Anchor",
"block.create.mysterious_cuckoo_clock": "Cuckoo Clock",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1429",
"_": "Missing Localizations: 1430",
"_": "->------------------------] Game Elements [------------------------<-",
@ -295,6 +295,7 @@
"block.create.mechanical_pump": "Mechanische Pumpe",
"block.create.mechanical_saw": "Mechanische Säge",
"block.create.metal_bracket": "Metallhalterung",
"block.create.metal_girder": "UNLOCALIZED: Metal Girder",
"block.create.millstone": "Mahlstein",
"block.create.minecart_anchor": "Lorenanker",
"block.create.mysterious_cuckoo_clock": "Kuckucksuhr",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 440",
"_": "Missing Localizations: 441",
"_": "->------------------------] Game Elements [------------------------<-",
@ -295,6 +295,7 @@
"block.create.mechanical_pump": "Bomba Mecánica",
"block.create.mechanical_saw": "Sierra Mecánica",
"block.create.metal_bracket": "Soporte Metálico",
"block.create.metal_girder": "UNLOCALIZED: Metal Girder",
"block.create.millstone": "Piedra de Molino",
"block.create.minecart_anchor": "Ancla de Vagoneta",
"block.create.mysterious_cuckoo_clock": "Reloj Cu-Cú",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 440",
"_": "Missing Localizations: 441",
"_": "->------------------------] Game Elements [------------------------<-",
@ -295,6 +295,7 @@
"block.create.mechanical_pump": "Bomba mecánica",
"block.create.mechanical_saw": "Sierra mecánica",
"block.create.metal_bracket": "Soporte de metal para ejes",
"block.create.metal_girder": "UNLOCALIZED: Metal Girder",
"block.create.millstone": "Piedra de molino",
"block.create.minecart_anchor": "Ancla de vagonetas",
"block.create.mysterious_cuckoo_clock": "Reloj de cuco",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1691",
"_": "Missing Localizations: 1692",
"_": "->------------------------] Game Elements [------------------------<-",
@ -295,6 +295,7 @@
"block.create.mechanical_pump": "UNLOCALIZED: Mechanical Pump",
"block.create.mechanical_saw": "Scie mécanique",
"block.create.metal_bracket": "UNLOCALIZED: Metal Bracket",
"block.create.metal_girder": "UNLOCALIZED: Metal Girder",
"block.create.millstone": "UNLOCALIZED: Millstone",
"block.create.minecart_anchor": "UNLOCALIZED: Minecart Anchor",
"block.create.mysterious_cuckoo_clock": "UNLOCALIZED: Cuckoo Clock",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1380",
"_": "Missing Localizations: 1381",
"_": "->------------------------] Game Elements [------------------------<-",
@ -295,6 +295,7 @@
"block.create.mechanical_pump": "Pompa meccanica",
"block.create.mechanical_saw": "Sega meccanica",
"block.create.metal_bracket": "Supporto di metallo",
"block.create.metal_girder": "UNLOCALIZED: Metal Girder",
"block.create.millstone": "Macina",
"block.create.minecart_anchor": "Ancora per carrello da miniera",
"block.create.mysterious_cuckoo_clock": "Orologio a cucù misterioso",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 110",
"_": "Missing Localizations: 111",
"_": "->------------------------] Game Elements [------------------------<-",
@ -295,6 +295,7 @@
"block.create.mechanical_pump": "メカニカルポンプ",
"block.create.mechanical_saw": "メカニカルソー",
"block.create.metal_bracket": "金属ブラケット",
"block.create.metal_girder": "UNLOCALIZED: Metal Girder",
"block.create.millstone": "石臼",
"block.create.minecart_anchor": "トロッコアンカー",
"block.create.mysterious_cuckoo_clock": "鳩時計",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 112",
"_": "Missing Localizations: 113",
"_": "->------------------------] Game Elements [------------------------<-",
@ -295,6 +295,7 @@
"block.create.mechanical_pump": "펌프",
"block.create.mechanical_saw": "톱",
"block.create.metal_bracket": "금속 지지대",
"block.create.metal_girder": "UNLOCALIZED: Metal Girder",
"block.create.millstone": "맷돌",
"block.create.minecart_anchor": "광산 수레 정박기",
"block.create.mysterious_cuckoo_clock": "뻐꾸기 시계?",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 2044",
"_": "Missing Localizations: 2045",
"_": "->------------------------] Game Elements [------------------------<-",
@ -295,6 +295,7 @@
"block.create.mechanical_pump": "UNLOCALIZED: Mechanical Pump",
"block.create.mechanical_saw": "Mechanische Zaag",
"block.create.metal_bracket": "UNLOCALIZED: Metal Bracket",
"block.create.metal_girder": "UNLOCALIZED: Metal Girder",
"block.create.millstone": "UNLOCALIZED: Millstone",
"block.create.minecart_anchor": "UNLOCALIZED: Minecart Anchor",
"block.create.mysterious_cuckoo_clock": "UNLOCALIZED: Cuckoo Clock",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 479",
"_": "Missing Localizations: 480",
"_": "->------------------------] Game Elements [------------------------<-",
@ -295,6 +295,7 @@
"block.create.mechanical_pump": "Mechaniczna pompa",
"block.create.mechanical_saw": "Mechaniczna piła",
"block.create.metal_bracket": "Metalowy wspornik",
"block.create.metal_girder": "UNLOCALIZED: Metal Girder",
"block.create.millstone": "Młynek",
"block.create.minecart_anchor": "Kotwica wagonikowa",
"block.create.mysterious_cuckoo_clock": "Zegar z kukułką",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1663",
"_": "Missing Localizations: 1664",
"_": "->------------------------] Game Elements [------------------------<-",
@ -295,6 +295,7 @@
"block.create.mechanical_pump": "Bomba Mecânica",
"block.create.mechanical_saw": "Serra Mecânica",
"block.create.metal_bracket": "Suporte de metal",
"block.create.metal_girder": "UNLOCALIZED: Metal Girder",
"block.create.millstone": "Pedra de Moer",
"block.create.minecart_anchor": "Ancóra de carrinho de Mina",
"block.create.mysterious_cuckoo_clock": "Relógio cuckoo",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1663",
"_": "Missing Localizations: 1664",
"_": "->------------------------] Game Elements [------------------------<-",
@ -295,6 +295,7 @@
"block.create.mechanical_pump": "Bomba Mecânica",
"block.create.mechanical_saw": "Serra Mecânica",
"block.create.metal_bracket": "Suporte de metal",
"block.create.metal_girder": "UNLOCALIZED: Metal Girder",
"block.create.millstone": "Pedra de Moer",
"block.create.minecart_anchor": "Ancóra de carrinho de Mina",
"block.create.mysterious_cuckoo_clock": "Relógio cuckoo",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 484",
"_": "Missing Localizations: 485",
"_": "->------------------------] Game Elements [------------------------<-",
@ -295,6 +295,7 @@
"block.create.mechanical_pump": "Механическая помпа",
"block.create.mechanical_saw": "Механическая пила",
"block.create.metal_bracket": "Металлическая скоба",
"block.create.metal_girder": "UNLOCALIZED: Metal Girder",
"block.create.millstone": "Жернов",
"block.create.minecart_anchor": "Вагонеточный якорь",
"block.create.mysterious_cuckoo_clock": "Часы с кукушкой",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 110",
"_": "Missing Localizations: 111",
"_": "->------------------------] Game Elements [------------------------<-",
@ -295,6 +295,7 @@
"block.create.mechanical_pump": "动力泵",
"block.create.mechanical_saw": "动力锯",
"block.create.metal_bracket": "金属支架",
"block.create.metal_girder": "UNLOCALIZED: Metal Girder",
"block.create.millstone": "石磨",
"block.create.minecart_anchor": "矿车锚",
"block.create.mysterious_cuckoo_clock": "布谷鸟闹钟",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 498",
"_": "Missing Localizations: 499",
"_": "->------------------------] Game Elements [------------------------<-",
@ -295,6 +295,7 @@
"block.create.mechanical_pump": "機械幫浦",
"block.create.mechanical_saw": "機械切割機",
"block.create.metal_bracket": "金屬支架",
"block.create.metal_girder": "UNLOCALIZED: Metal Girder",
"block.create.millstone": "石磨",
"block.create.minecart_anchor": "礦車錨",
"block.create.mysterious_cuckoo_clock": "神秘布穀鳥鐘",

View file

@ -0,0 +1,3 @@
{
"parent": "create:block/metal_girder/item"
}

View file

@ -28,8 +28,8 @@
"trigger": "create:bracket_apply",
"conditions": {
"accepted_entries": [
"create:cogwheel",
"create:large_cogwheel"
"create:large_cogwheel",
"create:cogwheel"
]
}
},

View file

@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"name": "create:metal_girder"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View file

@ -41,6 +41,7 @@
"create:stressometer",
"create:wooden_bracket",
"create:metal_bracket",
"create:metal_girder",
"create:fluid_pipe",
"create:encased_fluid_pipe",
"create:glass_fluid_pipe",

View file

@ -114,6 +114,8 @@ public class AllBlockPartials {
TRACK_SEGMENT_LEFT = block("track/segment_left"),
TRACK_SEGMENT_RIGHT = block("track/segment_right"),
TRACK_TIE = block("track/tie"),
GIRDER_SEGMENT = block("metal_girder/segment"),
GIRDER_SEGMENT_2 = block("metal_girder/segment2"),
TRACK_STATION_OVERLAY = block("track/station_overlay"),
TRACK_STATION_OVERLAY_DIAGONAL = block("track/station_overlay_diagonal"),

View file

@ -127,6 +127,8 @@ import com.simibubi.create.content.curiosities.armor.CopperBacktankBlock;
import com.simibubi.create.content.curiosities.bell.HauntedBellBlock;
import com.simibubi.create.content.curiosities.bell.HauntedBellMovementBehaviour;
import com.simibubi.create.content.curiosities.bell.PeculiarBellBlock;
import com.simibubi.create.content.curiosities.girder.GirderBlock;
import com.simibubi.create.content.curiosities.girder.GirderBlockStateGenerator;
import com.simibubi.create.content.curiosities.toolbox.ToolboxBlock;
import com.simibubi.create.content.logistics.block.belts.tunnel.BeltTunnelBlock;
import com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelBlock;
@ -665,6 +667,14 @@ public class AllBlocks {
.transform(BracketGenerator.itemModel("metal"))
.register();
public static final BlockEntry<GirderBlock> METAL_GIRDER = REGISTRATE.block("metal_girder", GirderBlock::new)
.blockstate(GirderBlockStateGenerator::blockState)
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.transform(pickaxeOnly())
.item()
.transform(customItemModel())
.register();
// Fluids
public static final BlockEntry<FluidPipeBlock> FLUID_PIPE = REGISTRATE.block("fluid_pipe", FluidPipeBlock::new)

View file

@ -28,10 +28,9 @@ public class AllShapes {
CASING_13PX = shape(0, 0, 0, 16, 13, 16).forDirectional(),
CASING_12PX = shape(0, 0, 0, 16, 12, 16).forDirectional(),
CASING_11PX = shape(0, 0, 0, 16, 11, 16).forDirectional(),
MOTOR_BLOCK = shape(3, 0, 3, 13, 14, 13).forDirectional(),
TRACK = shape(0, 0, 0, 16, 4, 16).forDirectional(),
MOTOR_BLOCK = shape(3, 0, 3, 13, 14, 13).forDirectional(), TRACK = shape(0, 0, 0, 16, 4, 16).forDirectional(),
FOUR_VOXEL_POLE = shape(6, 0, 6, 10, 16, 10).forAxis(), SIX_VOXEL_POLE = shape(5, 0, 5, 11, 16, 11).forAxis(),
EIGHT_VOXEL_POLE = shape(4, 0, 4, 12, 16, 12).forAxis(),
EIGHT_VOXEL_POLE = shape(4, 0, 4, 12, 16, 12).forAxis(), TEN_VOXEL_POLE = shape(3, 0, 3, 13, 16, 13).forAxis(),
FURNACE_ENGINE = shape(1, 1, 0, 15, 15, 16).add(0, 0, 9, 16, 16, 14)
.forHorizontal(Direction.SOUTH),
PORTABLE_STORAGE_INTERFACE = shape(0, 0, 0, 16, 14, 16).forDirectional(),
@ -121,6 +120,8 @@ public class AllShapes {
BELL_CEILING = shape(0, 5, 5, 16, 16, 11).add(3, 1, 3, 13, 13, 13)
.forHorizontal(SOUTH),
GIRDER_BEAM = shape(4, 2, 0, 12, 14, 16).forHorizontalAxis(),
STATION = shape(0, 0, 0, 16, 5, 16).add(2, 4, 0, 14, 16, 4)
.forHorizontal(NORTH),
CONTROLS = shape(0, 0, 4, 16, 4, 16).add(0, 0, 6, 16, 14, 16)
@ -157,6 +158,9 @@ public class AllShapes {
BASIN_COLLISION_SHAPE = shape(0, 2, 0, 16, 13, 16).erase(2, 5, 2, 14, 16, 14)
.add(2, 0, 2, 14, 2, 14)
.build(),
GIRDER_CROSS = shape(TEN_VOXEL_POLE.get(Axis.Y)).add(GIRDER_BEAM.get(Axis.X))
.add(GIRDER_BEAM.get(Axis.Z))
.build(),
BACKTANK = shape(3, 0, 3, 13, 12, 13).add(SIX_VOXEL_POLE.get(Axis.Y))
.build(),
SPEED_CONTROLLER = shape(0, 0, 0, 16, 4, 16).add(1, 1, 1, 15, 13, 15)

View file

@ -0,0 +1,130 @@
package com.simibubi.create.content.curiosities.girder;
import static net.minecraft.world.level.block.state.properties.BlockStateProperties.WATERLOGGED;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllShapes;
import com.simibubi.create.content.contraptions.wrench.IWrenchable;
import com.simibubi.create.content.logistics.trains.track.TrackBlock;
import com.simibubi.create.content.logistics.trains.track.TrackBlock.TrackShape;
import com.simibubi.create.foundation.utility.Iterate;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Direction.Axis;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SimpleWaterloggedBlock;
import net.minecraft.world.level.block.WallBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition.Builder;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.Property;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.pathfinder.PathComputationType;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
public class GirderBlock extends Block implements SimpleWaterloggedBlock, IWrenchable {
public static final BooleanProperty X = BooleanProperty.create("x");
public static final BooleanProperty Z = BooleanProperty.create("z");
public static final BooleanProperty TOP = BooleanProperty.create("top");
public static final BooleanProperty BOTTOM = BooleanProperty.create("bottom");
public GirderBlock(Properties p_49795_) {
super(p_49795_);
registerDefaultState(defaultBlockState().setValue(WATERLOGGED, false)
.setValue(TOP, false)
.setValue(BOTTOM, false)
.setValue(X, false)
.setValue(Z, false));
}
@Override
protected void createBlockStateDefinition(Builder<Block, BlockState> pBuilder) {
super.createBlockStateDefinition(pBuilder.add(X, Z, TOP, BOTTOM, WATERLOGGED));
}
@Override
public FluidState getFluidState(BlockState state) {
return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : Fluids.EMPTY.defaultFluidState();
}
@Override
public BlockState updateShape(BlockState state, Direction direction, BlockState neighbourState, LevelAccessor world,
BlockPos pos, BlockPos neighbourPos) {
if (state.getValue(WATERLOGGED))
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
Axis axis = direction.getAxis();
Property<Boolean> updateProperty =
axis == Axis.X ? X : axis == Axis.Z ? Z : direction == Direction.UP ? TOP : BOTTOM;
state = state.setValue(updateProperty, false);
for (Direction d : Iterate.directionsInAxis(axis))
state = updateState(world, pos, state, d);
return state;
}
@Override
public BlockState getStateForPlacement(BlockPlaceContext context) {
Level level = context.getLevel();
BlockPos pos = context.getClickedPos();
Direction face = context.getClickedFace();
FluidState ifluidstate = level.getFluidState(pos);
BlockState state = super.getStateForPlacement(context);
state = state.setValue(X, face.getAxis() == Axis.X);
state = state.setValue(Z, face.getAxis() == Axis.Z);
for (Direction d : Iterate.directions)
state = updateState(level, pos, state, d);
return state.setValue(WATERLOGGED, Boolean.valueOf(ifluidstate.getType() == Fluids.WATER));
}
public static BlockState updateState(LevelAccessor level, BlockPos pos, BlockState state, Direction d) {
Axis axis = d.getAxis();
Property<Boolean> updateProperty = axis == Axis.X ? X : axis == Axis.Z ? Z : d == Direction.UP ? TOP : BOTTOM;
BlockState sideState = level.getBlockState(pos.relative(d));
if (axis.isVertical()) {
if (sideState.getBlock() == state.getBlock() && sideState.getValue(X) == sideState.getValue(Z))
state = state.setValue(updateProperty, true);
else if (sideState.hasProperty(WallBlock.UP) && sideState.getValue(WallBlock.UP))
state = state.setValue(updateProperty, true);
return state;
}
if (sideState.getBlock() == state.getBlock() && sideState.getValue(updateProperty))
state = state.setValue(updateProperty, true);
for (Direction d2 : Iterate.directionsInAxis(axis == Axis.X ? Axis.Z : Axis.X)) {
BlockState above = level.getBlockState(pos.above()
.relative(d2));
if (AllBlocks.TRACK.has(above)) {
TrackShape shape = above.getValue(TrackBlock.SHAPE);
if (shape == (axis == Axis.X ? TrackShape.XO : TrackShape.ZO))
state = state.setValue(updateProperty, true);
}
}
return state;
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) {
boolean x = state.getValue(GirderBlock.X);
boolean z = state.getValue(GirderBlock.Z);
return x ? z ? AllShapes.GIRDER_CROSS : AllShapes.GIRDER_BEAM.get(Axis.X)
: z ? AllShapes.GIRDER_BEAM.get(Axis.Z) : AllShapes.EIGHT_VOXEL_POLE.get(Axis.Y);
}
@Override
public boolean isPathfindable(BlockState state, BlockGetter reader, BlockPos pos, PathComputationType type) {
return false;
}
}

View file

@ -0,0 +1,60 @@
package com.simibubi.create.content.curiosities.girder;
import com.simibubi.create.foundation.data.AssetLookup;
import com.simibubi.create.foundation.utility.Iterate;
import com.tterrag.registrate.providers.DataGenContext;
import com.tterrag.registrate.providers.RegistrateBlockstateProvider;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.client.model.generators.MultiPartBlockStateBuilder;
public class GirderBlockStateGenerator {
public static void blockState(DataGenContext<Block, GirderBlock> c, RegistrateBlockstateProvider p) {
MultiPartBlockStateBuilder builder = p.getMultipartBuilder(c.get());
builder.part()
.modelFile(AssetLookup.partialBaseModel(c, p, "pole"))
.addModel()
.condition(GirderBlock.X, false)
.condition(GirderBlock.Z, false)
.end();
builder.part()
.modelFile(AssetLookup.partialBaseModel(c, p, "x"))
.addModel()
.condition(GirderBlock.X, true)
.end();
builder.part()
.modelFile(AssetLookup.partialBaseModel(c, p, "z"))
.addModel()
.condition(GirderBlock.Z, true)
.end();
for (boolean x : Iterate.trueAndFalse)
builder.part()
.modelFile(AssetLookup.partialBaseModel(c, p, "top"))
.addModel()
.condition(GirderBlock.TOP, true)
.condition(GirderBlock.X, x)
.condition(GirderBlock.Z, !x)
.end()
.part()
.modelFile(AssetLookup.partialBaseModel(c, p, "bottom"))
.addModel()
.condition(GirderBlock.BOTTOM, true)
.condition(GirderBlock.X, x)
.condition(GirderBlock.Z, !x)
.end();
builder.part()
.modelFile(AssetLookup.partialBaseModel(c, p, "cross"))
.addModel()
.condition(GirderBlock.X, true)
.condition(GirderBlock.Z, true)
.end();
}
}

View file

@ -23,6 +23,7 @@ public class BezierConnection implements Iterable<BezierConnection.Segment> {
public Couple<Vec3> axes;
public Couple<Vec3> normals;
public boolean primary;
public boolean hasGirder;
// runtime
@ -37,19 +38,20 @@ public class BezierConnection implements Iterable<BezierConnection.Segment> {
private double handleLength;
public BezierConnection(Couple<BlockPos> positions, Couple<Vec3> starts, Couple<Vec3> axes, Couple<Vec3> normals,
Couple<Boolean> targets, boolean primary) {
Couple<Boolean> targets, boolean primary, boolean girder) {
tePositions = positions;
this.starts = starts;
this.axes = axes;
this.normals = normals;
this.trackEnds = targets;
this.primary = primary;
this.hasGirder = girder;
resolved = false;
}
public BezierConnection secondary() {
return new BezierConnection(tePositions.swap(), starts.swap(), axes.swap(), normals.swap(), trackEnds.swap(),
false);
false, hasGirder);
}
public BezierConnection(CompoundTag compound) {
@ -58,11 +60,12 @@ public class BezierConnection implements Iterable<BezierConnection.Segment> {
Couple.deserializeEach(compound.getList("Axes", Tag.TAG_COMPOUND), VecHelper::readNBTCompound),
Couple.deserializeEach(compound.getList("Normals", Tag.TAG_COMPOUND), VecHelper::readNBTCompound),
Couple.create(compound.getBoolean("TrackEnd1"), compound.getBoolean("TrackEnd2")),
compound.getBoolean("Primary"));
compound.getBoolean("Primary"), compound.getBoolean("Girder"));
}
public CompoundTag write() {
CompoundTag compound = new CompoundTag();
compound.putBoolean("Girder", hasGirder);
compound.putBoolean("Primary", primary);
compound.putBoolean("TrackEnd1", trackEnds.getFirst());
compound.putBoolean("TrackEnd2", trackEnds.getSecond());
@ -76,7 +79,7 @@ public class BezierConnection implements Iterable<BezierConnection.Segment> {
public BezierConnection(FriendlyByteBuf buffer) {
this(Couple.create(buffer::readBlockPos), Couple.create(() -> VecHelper.read(buffer)),
Couple.create(() -> VecHelper.read(buffer)), Couple.create(() -> VecHelper.read(buffer)),
Couple.create(buffer::readBoolean), buffer.readBoolean());
Couple.create(buffer::readBoolean), buffer.readBoolean(), buffer.readBoolean());
}
public void write(FriendlyByteBuf buffer) {
@ -86,6 +89,7 @@ public class BezierConnection implements Iterable<BezierConnection.Segment> {
normals.forEach(v -> VecHelper.write(v, buffer));
trackEnds.forEach(buffer::writeBoolean);
buffer.writeBoolean(primary);
buffer.writeBoolean(hasGirder);
}
public BlockPos getKey() {

View file

@ -25,6 +25,7 @@ import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition.Builder;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.pathfinder.PathComputationType;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
@ -102,4 +103,9 @@ public class StationBlock extends HorizontalDirectionalBlock implements ITE<Stat
return AllTileEntities.TRACK_STATION.get();
}
@Override
public boolean isPathfindable(BlockState state, BlockGetter reader, BlockPos pos, PathComputationType type) {
return false;
}
}

View file

@ -1,5 +1,6 @@
package com.simibubi.create.content.logistics.trains.track;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.logistics.trains.ITrackBlock;
import com.simibubi.create.content.logistics.trains.track.TrackPlacement.PlacementInfo;
import com.simibubi.create.foundation.utility.Iterate;
@ -63,7 +64,9 @@ public class TrackBlockItem extends BlockItem {
return InteractionResult.FAIL;
}
PlacementInfo info = TrackPlacement.tryConnect(level, pos, state, lookAngle, stack);
ItemStack offhandItem = player.getOffhandItem();
PlacementInfo info =
TrackPlacement.tryConnect(level, pos, state, lookAngle, stack, AllBlocks.METAL_GIRDER.isIn(offhandItem));
if (info.message != null && !level.isClientSide)
player.displayClientMessage(Lang.translate(info.message), true);
@ -75,7 +78,6 @@ public class TrackBlockItem extends BlockItem {
if (level.isClientSide)
return InteractionResult.SUCCESS;
ItemStack offhandItem = player.getOffhandItem();
if (offhandItem.getItem()instanceof BlockItem blockItem) {
Block block = blockItem.getBlock();
if (block == null)

View file

@ -8,6 +8,7 @@ import java.util.Set;
import org.apache.commons.lang3.tuple.Pair;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.content.logistics.trains.BezierConnection;
import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.VecHelper;
@ -17,6 +18,7 @@ import net.minecraft.util.Mth;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SlabBlock;
import net.minecraft.world.level.block.WallBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.SlabType;
import net.minecraft.world.phys.Vec3;
@ -33,14 +35,17 @@ public class TrackPaver {
Vec3 mainNormal = direction.cross(new Vec3(0, 1, 0));
Vec3 normalizedNormal = mainNormal.normalize();
Vec3 normalizedDirection = direction.normalize();
boolean wallLike = isWallLike(defaultBlockState);
float diagFiller = 0.45f;
for (int i = 0; i < extent; i++) {
Vec3 offset = direction.scale(i);
Vec3 mainPos = start.add(offset.x, offset.y, offset.z);
toPlaceOn.add(new BlockPos(mainPos));
toPlaceOn.add(new BlockPos(mainPos.add(mainNormal)));
toPlaceOn.add(new BlockPos(mainPos.subtract(mainNormal)));
if (wallLike)
continue;
toPlaceOn.add(new BlockPos(mainPos));
if (i < extent - 1)
for (int x : Iterate.positiveAndNegative)
toPlaceOn.add(new BlockPos(mainPos.add(normalizedNormal.scale(x * diagFiller))
@ -55,6 +60,10 @@ public class TrackPaver {
toPlaceOn.forEach(p -> placeBlockIfFree(level, p, state));
}
private static boolean isWallLike(BlockState defaultBlockState) {
return defaultBlockState.getBlock() instanceof WallBlock || AllBlocks.METAL_GIRDER.has(defaultBlockState);
}
private static void placeBlockIfFree(Level level, BlockPos pos, BlockState state) {
BlockState stateAtPos = level.getBlockState(pos);
if (stateAtPos.getBlock() != state.getBlock() && stateAtPos.getMaterial()
@ -68,6 +77,8 @@ public class TrackPaver {
boolean slab = defaultBlockState.hasProperty(SlabBlock.TYPE);
if (slab)
defaultBlockState = defaultBlockState.setValue(SlabBlock.TYPE, SlabType.DOUBLE);
if (isWallLike(defaultBlockState))
return;
Map<Pair<Integer, Integer>, Double> yLevels = new HashMap<>();
BlockPos tePosition = bc.tePositions.getFirst();

View file

@ -71,8 +71,8 @@ public class TrackPlacement {
static BlockPos hoveringPos;
static ItemStack lastItem;
public static PlacementInfo tryConnect(Level level, BlockPos pos2, BlockState state2, Vec3 lookVec,
ItemStack stack) {
public static PlacementInfo tryConnect(Level level, BlockPos pos2, BlockState state2, Vec3 lookVec, ItemStack stack,
boolean girder) {
if (cached != null && pos2.equals(hoveringPos) && stack.equals(lastItem))
return cached;
@ -161,7 +161,7 @@ public class TrackPlacement {
BlockPos targetPos2 = pos2.offset(offset2.x, offset2.y, offset2.z);
info.curve = new BezierConnection(Couple.create(targetPos1, targetPos2),
Couple.create(end1.add(offset1), end2.add(offset2)), Couple.create(normedAxis1, normedAxis2),
Couple.create(normal1, normal2), Couple.create(front1, front2), true);
Couple.create(normal1, normal2), Couple.create(front1, front2), true, girder);
}
// S curve or Straight
@ -249,10 +249,11 @@ public class TrackPlacement {
int hDistance = info.end1Extent;
if (axis1.y == 0 || !Mth.equal(absAscend + 1, dist / axis1.length())) {
info.end1Extent = 0;
if (hDistance < absAscend * 3)
double minHDistance = Math.max(absAscend < 4 ? absAscend * 4 : absAscend * 3, 6);
if (hDistance < minHDistance)
return info.withMessage("too_steep");
if (hDistance > absAscend * 4) {
int correction = (int) (hDistance - absAscend * 4);
if (hDistance > minHDistance) {
int correction = (int) (hDistance - minHDistance);
info.end1Extent = correction / 2 + (correction % 2);
info.end2Extent = correction / 2;
}
@ -311,7 +312,7 @@ public class TrackPlacement {
info.curve = skipCurve ? null
: new BezierConnection(Couple.create(targetPos1, targetPos2),
Couple.create(end1.add(offset1), end2.add(offset2)), Couple.create(normedAxis1, normedAxis2),
Couple.create(normal1, normal2), Couple.create(front1, front2), true);
Couple.create(normal1, normal2), Couple.create(front1, front2), true, girder);
info.valid = true;
@ -397,7 +398,7 @@ public class TrackPlacement {
if (!(hitState.getBlock() instanceof TrackBlock))
return;
PlacementInfo info = tryConnect(level, pos, hitState, player.getLookAngle(), stack);
PlacementInfo info = tryConnect(level, pos, hitState, player.getLookAngle(), stack, false);
if (info.valid)
player.displayClientMessage(Lang.translate("track.valid_connection")
.withStyle(ChatFormatting.GREEN), true);

View file

@ -32,7 +32,8 @@ public class TrackRenderer extends SafeTileEntityRenderer<TrackTileEntity> {
@Override
protected void renderSafe(TrackTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light,
int overlay) {
if (Backend.isOn()) return;
if (Backend.isOn())
return;
VertexConsumer vb = buffer.getBuffer(RenderType.solid());
te.connections.forEach(map -> map.values()
@ -47,7 +48,10 @@ public class TrackRenderer extends SafeTileEntityRenderer<TrackTileEntity> {
BlockPos tePosition = bc.tePositions.getFirst();
TransformStack.cast(ms)
.nudge((int) tePosition.asLong());
.nudge((int) tePosition.asLong());
if (bc.hasGirder)
renderGirder(bc, ms, vb, tePosition);
Vec3 previous1 = null;
Vec3 previous2 = null;
@ -57,6 +61,8 @@ public class TrackRenderer extends SafeTileEntityRenderer<TrackTileEntity> {
Vec3 rail2 = segment.position.subtract(segment.normal.scale(.965f));
if (previous1 != null) {
int centralLight = 0;
{
// Tie
Vec3 railMiddle = rail1.add(rail2)
@ -66,6 +72,9 @@ public class TrackRenderer extends SafeTileEntityRenderer<TrackTileEntity> {
Vec3 diff = railMiddle.subtract(prevMiddle);
Vec3 angles = getModelAngles(segment.normal, diff);
centralLight = LevelRenderer.getLightColor(Minecraft.getInstance().level,
new BlockPos(railMiddle).offset(tePosition));
SuperByteBuffer sbb =
CachedBufferer.partial(AllBlockPartials.TRACK_TIE, Blocks.AIR.defaultBlockState());
@ -75,8 +84,7 @@ public class TrackRenderer extends SafeTileEntityRenderer<TrackTileEntity> {
.rotateZRadians(angles.z)
.translate(-1 / 2f, -2 / 16f - 1 / 1024f, 0);
sbb.light(LevelRenderer.getLightColor(Minecraft.getInstance().level,
new BlockPos(railMiddle).offset(tePosition)));
sbb.light(centralLight);
sbb.renderInto(ms, vb);
}
@ -111,6 +119,88 @@ public class TrackRenderer extends SafeTileEntityRenderer<TrackTileEntity> {
ms.popPose();
}
private static void renderGirder(BezierConnection bc, PoseStack ms, VertexConsumer vb, BlockPos tePosition) {
Vec3 previousG11 = null;
Vec3 previousG21 = null;
Vec3 previousG12 = null;
Vec3 previousG22 = null;
for (BezierConnection.Segment segment : bc) {
Vec3 rail1 = segment.position.add(segment.normal.scale(.965f));
Vec3 rail2 = segment.position.subtract(segment.normal.scale(.965f));
Vec3 upNormal = segment.derivative.normalize()
.cross(segment.normal);
Vec3 firstGirderOffset = upNormal.scale(-8 / 16f);
Vec3 secondGirderOffset = upNormal.scale(-10 / 16f);
Vec3 g11 = segment.position.add(segment.normal.scale(1))
.add(firstGirderOffset);
Vec3 g12 = segment.position.subtract(segment.normal.scale(1))
.add(firstGirderOffset);
Vec3 g21 = g11.add(secondGirderOffset);
Vec3 g22 = g12.add(secondGirderOffset);
if (previousG11 != null) {
Vec3 railMiddle = rail1.add(rail2)
.scale(.5);
int centralLight = LevelRenderer.getLightColor(Minecraft.getInstance().level,
new BlockPos(railMiddle).offset(tePosition));
Vec3 normal = segment.normal;
float l = 2.2f;
for (boolean first : Iterate.trueAndFalse) {
for (boolean top : Iterate.trueAndFalse) {
Vec3 railI = top ? first ? g11 : g12 : first ? g21 : g22;
Vec3 prevI = top ? first ? previousG11 : previousG12 : first ? previousG21 : previousG22;
Vec3 diff = railI.subtract(prevI);
Vec3 angles = getModelAngles(normal, diff);
SuperByteBuffer sbb2 =
CachedBufferer.partial(AllBlockPartials.GIRDER_SEGMENT, Blocks.AIR.defaultBlockState());
sbb2.translate(prevI)
.rotateYRadians(angles.y)
.rotateXRadians(angles.x)
.rotateZRadians(angles.z)
.translate(0, 2 / 16f + (segment.index % 2 == 0 ? 1 : -1) / 2048f - 1 / 1024f, 0)
.rotateZ(top ? 0 : 180)
.scale(1, 1, (float) diff.length() * l);
sbb2.light(centralLight);
sbb2.renderInto(ms, vb);
}
{
Vec3 railI = (first ? g11 : g12).add(first ? g21 : g22)
.scale(.5);
Vec3 prevI = (first ? previousG11 : previousG12).add(first ? previousG21 : previousG22)
.scale(.5);
Vec3 diff = railI.subtract(prevI);
Vec3 angles = getModelAngles(normal, diff);
SuperByteBuffer sbb2 = CachedBufferer.partial(AllBlockPartials.GIRDER_SEGMENT_2,
Blocks.AIR.defaultBlockState());
sbb2.translate(prevI)
.rotateYRadians(angles.y)
.rotateXRadians(angles.x)
.rotateZRadians(angles.z)
.translate(0, 2 / 16f + (segment.index % 2 == 0 ? 1 : -1) / 2048f - 1 / 1024f, 0)
.scale(1, 1, (float) diff.length() * l);
sbb2.light(centralLight);
sbb2.renderInto(ms, vb);
}
}
}
previousG11 = g11;
previousG12 = g12;
previousG21 = g21;
previousG22 = g22;
}
}
public static Vec3 getModelAngles(Vec3 normal, Vec3 diff) {
double diffX = diff.x();
double diffY = diff.y();

View file

@ -0,0 +1 @@
{"meta":{"format_version":"4.0","creation_time":1644273873,"model_format":"java_block","box_uv":false},"name":"segment2","parent":"","ambientocclusion":true,"front_gui_light":false,"visible_box":[1,1,0],"variable_placeholders":"","resolution":{"width":16,"height":16},"elements":[{"name":"cube","rescale":false,"locked":false,"from":[-2,-4,0],"to":[2,4,8],"autouv":0,"color":4,"origin":[8,8,8],"faces":{"north":{"uv":[8,1,12,3],"rotation":270,"texture":0},"east":{"uv":[0,5,4,9],"texture":0},"south":{"uv":[8,1,12,3],"rotation":270,"texture":0},"west":{"uv":[0,5,4,9],"texture":0},"up":{"uv":[0,0,4,16],"texture":null},"down":{"uv":[0,0,4,16],"texture":null}},"uuid":"3a05841c-acd9-87b3-84b6-52c43638a212"}],"outliner":["3a05841c-acd9-87b3-84b6-52c43638a212"],"textures":[{"path":"C:\\Users\\simon\\Desktop\\Modding\\Forge 18 Concealed\\Create\\src\\main\\resources\\assets\\create\\textures\\block\\girder.png","name":"girder.png","folder":"block","namespace":"create","id":"0","particle":false,"render_mode":"normal","visible":true,"mode":"bitmap","saved":true,"uuid":"ef4ef1c2-0c80-b18f-8f05-23e8a7be2c79","relative_path":"../../../../textures/block/girder.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA15JREFUWEe1V89rE0EUfmsxkERtE5KGpCmpNJYQaAtisS2tggQPIuRaDwV78s8Q+l94qtCDvQbEgxRBhVJRhNJLaQ9asAn5QdKoSUCple+1b51MN7vbJs5ld9978+ab7/2YWePRwsIxnY5mq0U+r1c+LZ+6TblSsbV3UhrZbPb45uQkfd7aYlsBgIXshsw5rP1wWsNWzwDEotFo8Kvf7z8zCTpd3ske8t+//hDYmZxIU6fNYLNGJpMxAbjZCkDIwrDHQpc9l9qmQtZsNlkWG4qY9pBjiD18mQB0x/q3rOAEQBZRAdgx3BaCTgxY0Q9btyGwY9YyCSVmnRIS8tTYGCdu10molqEdUr38rnm99L3V4kTrZhhPlpaO4Ugc4mk1dBv5/laqULlctpwTDodZNzQUZX1/f5Cf9XqVnwcHBXKVA3Y7DIVCVK2eONRHMBhkXbFQoK/7+1QsldgkMjhII4kERaJRMtLpiXOVob7IzMyUI4APm5uULxTapsaiUbo9PX0CwO/zmcrGaf1Cpr+LnSqfm5+jWq1myUAgEGDd6upzOjo6arPp6+ujxcXHZEzdmj7DABZQQXHJWcgg7xrA3Tv3GAAah++UCXl3kmFe8sb17kIAAGiN0lKlkwlfolPBQCdyNwBskxBngd7P1W8dmPRxkXs8HscyjMfjncvwvIeRnm2jw8PckGToXRRy6S3SuHCeoJu+WFszDDUEdvUulOuhicUGzbYsOvW0nJ+dpZ3dXVYBHO4RL1+95lMyl8sZro9juQtsb+/Q+HiKJ8MpWjkc7+19sawcAAyHQry43BOwGfgzAdQPf9ptnvoHrpiXkfxBkZLJEaZPBSByNRSQYW5PAeD0S40m6NnKCgOQG5UAkBzAbrExAY+Y5/Mls3oGAlf/MQCF3QCNEgI4RlyfLi+bAGQxMHMhAHCIxLAaDx/cp/cbG233QSy4vr5uhgBHMnarXr/gSxhwDAEY0FuvmdHNJqkMcFu2AGDlA+3bVRLq3U9nQrJW5MiDt+/emAzgdgSWrIarMnQLQEpQZUAuNBduRG47IZIQmY444/nx0yYz0O3gRgSa7CiUJBQAagh6AgDZKkex7hCnoNQyFkb9qiHoCQA3ThACAdBzBtwCkB+UnjOg/svpYBAaKcP/AeAvf7PKi3Z7paEAAAAASUVORK5CYII="},{"path":"C:\\Users\\simon\\Desktop\\Modding\\Forge 18 Concealed\\Create\\src\\main\\resources\\assets\\create\\textures\\block\\girder_pole.png","name":"girder_pole.png","folder":"block","namespace":"create","id":"1","particle":false,"render_mode":"normal","visible":true,"mode":"bitmap","saved":true,"uuid":"6e0346b1-88a8-d125-7920-cc325c435982","relative_path":"../../../../textures/block/girder_pole.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAATxJREFUOE+VU01Lw0AUnAgKSVCsVoV4UGrBXkpBFKRQBcm/NghVCOhBKb3opTdFD6aiJAGFRmbLhmfTdXVOIfsymY+3ThiGhe/78FwXK64L4j3PkeU50jTF1+cEq7VldU5wRp+/jT/gnJ6cFYtLCyAJwcHZj4fDe3Umsb5WQ7C9BYcKet0ubgeDUsVzkuCg08FVHGOjXsf1zR34gYTneQiCzamCLMsUm7ZBgqfHF+iheQR6Xikgs86Bz9JCa28H5/24oqAksGVAmSYLJK8oYMq0QLAFKtN22AbB9Ikyg99a4OCfa5Qh8u9EFEVOpUPxwmhBL1H/8uJ/BLMtWAlsLVgJbJtoyqDR2C/a7dbPTZR3QVdnUnB0eFw0m7vTPZBbKG8bgzQpoHW1SJTCi8K9l+D9eE3GGI0e5ragrX8DrJTpWQ0NmZIAAAAASUVORK5CYII="},{"path":"C:\\Users\\simon\\Desktop\\Modding\\Forge 18 Concealed\\Create\\src\\main\\resources\\assets\\create\\textures\\block\\chute_block.png","name":"chute_block.png","folder":"block","namespace":"create","id":"2","particle":true,"render_mode":"normal","visible":true,"mode":"bitmap","saved":true,"uuid":"06436a9e-8580-f22f-d11d-b911094407ec","relative_path":"../../../../textures/block/chute_block.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAATNJREFUOE+FU8FKw0AQnRVMyIaK/kchILb0IK30VE/5Y/HgQSot9EsUJRuSgitv4qyTuE3nMrC78+a9mbemLEtvs4wQV1lGn3XNufGeUmNCxr3cISNcXZN53Gz8Yj6n/eHAhxqMD34LpUDOiumU3nY7Mqvl2l8mF5TnORcDdQgiHTVIVVV0bL87BkmaCnCveEhZHqEJom2aPoB0lnmMSUAxgiVYm9ApFnoGIkGKnWs7BtIJIGMshLrQDwz0EAUMqxx21zMIQ4SE65tJb4XnQMAEMoKEmA9ig9QSbouCXrfb0z7Qrhz1wexu4a21nQSbBD/oreih8SZcy++cc+d9EOv+bwvrh/vwF5iJ+lwxM328fxFqnp5f/oyEhzEfjDHgLWAGnX5L8IMEPhd2Pcy4xyeCfsQP6j3lf7IDJssAAAAASUVORK5CYII="}]}

View file

@ -0,0 +1,30 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "create:block/girder",
"particle": "create:block/chute_block"
},
"elements": [
{
"from": [3, 0, 3],
"to": [13, 5, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2.5, 8]},
"faces": {
"north": {"uv": [13, 8, 15.5, 13], "rotation": 270, "texture": "#0"},
"east": {"uv": [13, 8, 15.5, 13], "rotation": 270, "texture": "#0"},
"south": {"uv": [13, 8, 15.5, 13], "rotation": 270, "texture": "#0"},
"west": {"uv": [13, 8, 15.5, 13], "rotation": 270, "texture": "#0"},
"up": {"uv": [8, 8, 13, 13], "rotation": 180, "texture": "#0"},
"down": {"uv": [8, 8, 13, 13], "texture": "#0"}
}
}
],
"groups": [
{
"name": "Brace",
"origin": [0, 0, 0],
"color": 0,
"children": [0]
}
]
}

View file

@ -0,0 +1,42 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "create:block/girder",
"particle": "create:block/chute_block"
},
"elements": [
{
"from": [3, 11, 3],
"to": [13, 16, 13],
"faces": {
"north": {"uv": [13, 8, 15.5, 13], "rotation": 90, "texture": "#0"},
"east": {"uv": [13, 8, 15.5, 13], "rotation": 90, "texture": "#0"},
"south": {"uv": [13, 8, 15.5, 13], "rotation": 90, "texture": "#0"},
"west": {"uv": [13, 8, 15.5, 13], "rotation": 90, "texture": "#0"},
"up": {"uv": [8, 8, 13, 13], "rotation": 180, "texture": "#0"},
"down": {"uv": [8, 8, 13, 13], "texture": "#0"}
}
},
{
"from": [3, 0, 3],
"to": [13, 5, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2.5, 8]},
"faces": {
"north": {"uv": [13, 8, 15.5, 13], "rotation": 270, "texture": "#0"},
"east": {"uv": [13, 8, 15.5, 13], "rotation": 270, "texture": "#0"},
"south": {"uv": [13, 8, 15.5, 13], "rotation": 270, "texture": "#0"},
"west": {"uv": [13, 8, 15.5, 13], "rotation": 270, "texture": "#0"},
"up": {"uv": [8, 8, 13, 13], "rotation": 180, "texture": "#0"},
"down": {"uv": [8, 8, 13, 13], "texture": "#0"}
}
}
],
"groups": [
{
"name": "Brace",
"origin": [0, 0, 0],
"color": 0,
"children": [0, 1]
}
]
}

View file

@ -0,0 +1,29 @@
{
"credit": "Made with Blockbench",
"textures": {
"1": "create:block/girder_pole",
"particle": "create:block/chute_block"
},
"elements": [
{
"from": [4, 0, 4],
"to": [12, 16, 12],
"faces": {
"north": {"uv": [0, 0, 8, 16], "texture": "#1"},
"east": {"uv": [0, 0, 8, 16], "texture": "#1"},
"south": {"uv": [0, 0, 8, 16], "texture": "#1"},
"west": {"uv": [0, 0, 8, 16], "texture": "#1"},
"up": {"uv": [8, 0, 16, 8], "texture": "#1"},
"down": {"uv": [8, 0, 16, 8], "texture": "#1"}
}
}
],
"groups": [
{
"name": "Beam Pole",
"origin": [0, 0, 0],
"color": 0,
"children": [0]
}
]
}

View file

@ -0,0 +1,29 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "create:block/girder",
"particle": "create:block/chute_block"
},
"elements": [
{
"from": [3, 11, 3],
"to": [13, 16, 13],
"faces": {
"north": {"uv": [13, 8, 15.5, 13], "rotation": 90, "texture": "#0"},
"east": {"uv": [13, 8, 15.5, 13], "rotation": 90, "texture": "#0"},
"south": {"uv": [13, 8, 15.5, 13], "rotation": 90, "texture": "#0"},
"west": {"uv": [13, 8, 15.5, 13], "rotation": 90, "texture": "#0"},
"up": {"uv": [8, 8, 13, 13], "rotation": 180, "texture": "#0"},
"down": {"uv": [8, 8, 13, 13], "texture": "#0"}
}
}
],
"groups": [
{
"name": "Brace",
"origin": [0, 0, 0],
"color": 0,
"children": [0]
}
]
}

View file

@ -0,0 +1,54 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "create:block/girder",
"particle": "create:block/chute_block"
},
"elements": [
{
"from": [0, 4, 6],
"to": [16, 12, 10],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [0, 5, 8, 9], "texture": "#0"},
"east": {"uv": [8, 1, 12, 3], "rotation": 270, "texture": "#0"},
"south": {"uv": [0, 5, 8, 9], "texture": "#0"},
"west": {"uv": [8, 1, 12, 3], "rotation": 270, "texture": "#0"}
}
},
{
"from": [0, 2, 4],
"to": [16, 4, 12],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [0, 4, 8, 5], "rotation": 180, "texture": "#0"},
"east": {"uv": [12, 2, 16, 3], "texture": "#0"},
"south": {"uv": [0, 4, 8, 5], "rotation": 180, "texture": "#0"},
"west": {"uv": [12, 2, 16, 3], "texture": "#0"},
"up": {"uv": [8, 0, 16, 4], "rotation": 180, "texture": "#0"},
"down": {"uv": [0, 0, 8, 4], "texture": "#0"}
}
},
{
"from": [0, 12, 4],
"to": [16, 14, 12],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [0, 4, 8, 5], "texture": "#0"},
"east": {"uv": [12, 1, 16, 2], "texture": "#0"},
"south": {"uv": [0, 4, 8, 5], "texture": "#0"},
"west": {"uv": [12, 1, 16, 2], "texture": "#0"},
"up": {"uv": [0, 0, 8, 4], "texture": "#0"},
"down": {"uv": [8, 0, 16, 4], "rotation": 180, "texture": "#0"}
}
}
],
"groups": [
{
"name": "Beam X",
"origin": [8, 13, 8],
"color": 0,
"children": [0, 1, 2]
}
]
}

View file

@ -0,0 +1,53 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "create:block/girder",
"particle": "create:block/chute_block"
},
"elements": [
{
"from": [6, 4, 0],
"to": [10, 12, 16],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [8, 1, 12, 3], "rotation": 270, "texture": "#0"},
"east": {"uv": [0, 5, 8, 9], "texture": "#0"},
"south": {"uv": [8, 1, 12, 3], "rotation": 270, "texture": "#0"},
"west": {"uv": [0, 5, 8, 9], "texture": "#0"}
}
},
{
"from": [4, 2, 0],
"to": [12, 4, 16],
"faces": {
"north": {"uv": [12, 2, 16, 3], "texture": "#0"},
"east": {"uv": [0, 4, 8, 5], "rotation": 180, "texture": "#0"},
"south": {"uv": [12, 2, 16, 3], "texture": "#0"},
"west": {"uv": [0, 4, 8, 5], "rotation": 180, "texture": "#0"},
"up": {"uv": [8, 0, 16, 4], "rotation": 90, "texture": "#0"},
"down": {"uv": [0, 0, 8, 4], "rotation": 90, "texture": "#0"}
}
},
{
"from": [4, 12, 0],
"to": [12, 14, 16],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 13, 8]},
"faces": {
"north": {"uv": [12, 1, 16, 2], "texture": "#0"},
"east": {"uv": [0, 4, 8, 5], "texture": "#0"},
"south": {"uv": [12, 1, 16, 2], "texture": "#0"},
"west": {"uv": [0, 4, 8, 5], "texture": "#0"},
"up": {"uv": [0, 0, 8, 4], "rotation": 270, "texture": "#0"},
"down": {"uv": [8, 0, 16, 4], "rotation": 270, "texture": "#0"}
}
}
],
"groups": [
{
"name": "Beam Z",
"origin": [8, 13, 8],
"color": 0,
"children": [0, 1, 2]
}
]
}

View file

@ -0,0 +1,86 @@
{
"parent": "block/block",
"credit": "Made with Blockbench",
"textures": {
"0": "create:block/girder",
"particle": "create:block/chute_block"
},
"elements": [
{
"from": [0, 4, 6],
"to": [16, 12, 10],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [0, 5, 8, 9], "texture": "#0"},
"east": {"uv": [8, 1, 12, 3], "rotation": 270, "texture": "#0"},
"south": {"uv": [0, 5, 8, 9], "texture": "#0"},
"west": {"uv": [8, 1, 12, 3], "rotation": 270, "texture": "#0"}
}
},
{
"from": [0, 2, 4],
"to": [16, 4, 12],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [0, 4, 8, 5], "rotation": 180, "texture": "#0"},
"east": {"uv": [12, 2, 16, 3], "texture": "#0"},
"south": {"uv": [0, 4, 8, 5], "rotation": 180, "texture": "#0"},
"west": {"uv": [12, 2, 16, 3], "texture": "#0"},
"up": {"uv": [8, 0, 16, 4], "rotation": 180, "texture": "#0"},
"down": {"uv": [0, 0, 8, 4], "texture": "#0"}
}
},
{
"from": [0, 12, 4],
"to": [16, 14, 12],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [0, 4, 8, 5], "texture": "#0"},
"east": {"uv": [12, 1, 16, 2], "texture": "#0"},
"south": {"uv": [0, 4, 8, 5], "texture": "#0"},
"west": {"uv": [12, 1, 16, 2], "texture": "#0"},
"up": {"uv": [0, 0, 8, 4], "texture": "#0"},
"down": {"uv": [8, 0, 16, 4], "rotation": 180, "texture": "#0"}
}
},
{
"from": [3, 11, 3],
"to": [13, 16, 13],
"faces": {
"north": {"uv": [13, 8, 15.5, 13], "rotation": 90, "texture": "#0"},
"east": {"uv": [13, 8, 15.5, 13], "rotation": 90, "texture": "#0"},
"south": {"uv": [13, 8, 15.5, 13], "rotation": 90, "texture": "#0"},
"west": {"uv": [13, 8, 15.5, 13], "rotation": 90, "texture": "#0"},
"up": {"uv": [8, 8, 13, 13], "rotation": 180, "texture": "#0"},
"down": {"uv": [8, 8, 13, 13], "texture": "#0"}
}
},
{
"from": [3, 0, 3],
"to": [13, 5, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2.5, 8]},
"faces": {
"north": {"uv": [13, 8, 15.5, 13], "rotation": 270, "texture": "#0"},
"east": {"uv": [13, 8, 15.5, 13], "rotation": 270, "texture": "#0"},
"south": {"uv": [13, 8, 15.5, 13], "rotation": 270, "texture": "#0"},
"west": {"uv": [13, 8, 15.5, 13], "rotation": 270, "texture": "#0"},
"up": {"uv": [8, 8, 13, 13], "rotation": 180, "texture": "#0"},
"down": {"uv": [8, 8, 13, 13], "texture": "#0"}
}
}
],
"groups": [
{
"name": "Beam X",
"origin": [8, 13, 8],
"color": 0,
"children": [0, 1, 2]
},
{
"name": "Brace",
"origin": [0, 0, 0],
"color": 0,
"children": [3, 4]
}
]
}

View file

@ -0,0 +1,22 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "create:block/girder",
"particle": "create:block/chute_block"
},
"elements": [
{
"from": [-4, -1, 0],
"to": [4, 1, 8],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 13, 8]},
"faces": {
"north": {"uv": [12, 1, 16, 2], "texture": "#0"},
"east": {"uv": [0, 4, 4, 5], "texture": "#0"},
"south": {"uv": [12, 1, 16, 2], "texture": "#0"},
"west": {"uv": [0, 4, 4, 5], "texture": "#0"},
"up": {"uv": [2, 0, 6, 4], "rotation": 270, "texture": "#0"},
"down": {"uv": [12, 0, 16, 4], "rotation": 270, "texture": "#0"}
}
}
]
}

View file

@ -0,0 +1,20 @@
{
"credit": "Made with Blockbench",
"textures": {
"0": "create:block/girder",
"particle": "create:block/chute_block"
},
"elements": [
{
"from": [-2, -4, 0],
"to": [2, 4, 8],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [8, 1, 12, 3], "rotation": 270, "texture": "#0"},
"east": {"uv": [0, 5, 4, 9], "texture": "#0"},
"south": {"uv": [8, 1, 12, 3], "rotation": 270, "texture": "#0"},
"west": {"uv": [0, 5, 4, 9], "texture": "#0"}
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 978 B

After

Width:  |  Height:  |  Size: 990 B