diff --git a/src/datagen/java/ca/teamdman/sfm/datagen/SFMBlockStatesAndModels.java b/src/datagen/java/ca/teamdman/sfm/datagen/SFMBlockStatesAndModels.java index fe939cc38..bdb09ae70 100644 --- a/src/datagen/java/ca/teamdman/sfm/datagen/SFMBlockStatesAndModels.java +++ b/src/datagen/java/ca/teamdman/sfm/datagen/SFMBlockStatesAndModels.java @@ -1,13 +1,14 @@ package ca.teamdman.sfm.datagen; import ca.teamdman.sfm.SFM; +import ca.teamdman.sfm.common.block.FancyCableBlock; import ca.teamdman.sfm.common.block.WaterTankBlock; import ca.teamdman.sfm.common.registry.SFMBlocks; import net.minecraft.core.Direction; -import net.minecraft.data.PackOutput; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraftforge.client.model.generators.BlockStateProvider; import net.minecraftforge.client.model.generators.ConfiguredModel; +import net.minecraftforge.client.model.generators.ModelBuilder; import net.minecraftforge.client.model.generators.ModelFile; import net.minecraftforge.data.event.GatherDataEvent; @@ -18,16 +19,25 @@ public SFMBlockStatesAndModels(GatherDataEvent event) { @Override protected void registerStatesAndModels() { + /* simpleBlock(SFMBlocks.MANAGER_BLOCK.get(), models().cubeBottomTop( SFMBlocks.MANAGER_BLOCK.getId().getPath(), modLoc("block/manager_side"), modLoc("block/manager_bot"), modLoc("block/manager_top") ).texture("particle", "#top")); + */ + + horizontalBlock(SFMBlocks.MANAGER_BLOCK.get(), models().cubeBottomTop( + SFMBlocks.MANAGER_BLOCK.getId().getPath(), + modLoc("block/manager_side"), + modLoc("block/manager_bot"), + modLoc("block/manager_top") + ).texture("particle","#top")); simpleBlock(SFMBlocks.CABLE_BLOCK.get()); simpleBlock(SFMBlocks.PRINTING_PRESS_BLOCK.get(), models().getExistingFile(modLoc("block/printing_press"))); - + registerFancyCableBlock(); ModelFile waterIntakeModelActive = models() .cubeAll( @@ -95,4 +105,140 @@ protected void registerStatesAndModels() { }); } } + + private void registerFancyCableBlock() { + var coreModel = models().withExistingParent(modLoc("block/fancy_cable_core").getPath(), "block/block") + .element() + .from(4, 4, 4) + .to(12, 12, 12) + .shade(false) + .allFaces((direction, faceBuilder) -> faceBuilder.uvs(5, 0, 13, 8).texture("#cable")) + .end() + .texture("cable", modLoc("block/fancy_cable")) + .texture("particle", modLoc("block/fancy_cable")); + var innerConnectionModel = models().withExistingParent(modLoc("block/fancy_cable_cable_connection").getPath(), "block/block") + .element() + .from(4, 4, 0) + .to(12, 12, 4) + .shade(false) + .allFaces((direction, faceBuilder) -> { + switch (direction) { + case NORTH: + case SOUTH: { + faceBuilder.uvs(5, 0, 13, 8); + break; + } + case EAST: + case WEST: { + faceBuilder.uvs(0, 0, 4, 8); + break; + } + case UP: + case DOWN: { + faceBuilder.uvs(0, 0, 4, 8) + .rotation(ModelBuilder.FaceRotation.CLOCKWISE_90); + break; + } + } + faceBuilder.texture("#cable"); + }) + .end() + .texture("cable", modLoc("block/fancy_cable")); + + var outerConnectionModel = models().withExistingParent(modLoc("block/fancy_cable_inv_connection").getPath(), "block/block") + .element() + .from(4, 4, 1) + .to(12, 12, 4) + .shade(false) + .allFaces((direction, faceBuilder) -> { + switch (direction) { + case NORTH: + case SOUTH: { + faceBuilder.uvs(5, 0, 13, 8); + break; + } + case EAST: + case WEST: { + faceBuilder.uvs(0, 0, 3, 8); + break; + } + case UP: + case DOWN: { + faceBuilder.uvs(0, 0, 3, 8) + .rotation(ModelBuilder.FaceRotation.CLOCKWISE_90); + break; + } + } + faceBuilder.texture("#cable"); + }) + .end() + .element() + .from(11,11,0) + .to(5,5,1) + .shade(false) + .allFaces((direction, faceBuilder) -> { + switch (direction) { + case NORTH, SOUTH: + faceBuilder.uvs(6,10,11,15); + break; + case EAST: + faceBuilder.uvs(0, 10, 1, 15); + break; + case WEST: + faceBuilder.uvs(1, 10, 2, 15); + break; + case UP: + faceBuilder.uvs(2, 10, 3, 15) + .rotation(ModelBuilder.FaceRotation.CLOCKWISE_90); + break; + case DOWN: + faceBuilder.uvs(3, 10, 4, 15) + .rotation(ModelBuilder.FaceRotation.CLOCKWISE_90); + break; + } + faceBuilder.texture("#cable"); + }) + .end() + .texture("cable", modLoc("block/fancy_cable")); + + var multipartBuilder1 = getMultipartBuilder(SFMBlocks.FANCY_CABLE_BLOCK.get()); + + // Core + multipartBuilder1.part() + .modelFile(coreModel) + .addModel() + .end(); + + // Parts (connections) + for (Direction direction: Direction.values()) { + var rotX = 0; + var rotY = 0; + + switch (direction) { + case SOUTH -> rotY = 180; + case EAST -> rotY = 90; + case WEST -> rotY = 270; + case UP -> rotX = 270; + case DOWN -> rotX = 90; + } + + multipartBuilder1.part() + .modelFile(innerConnectionModel) + .rotationX(rotX) + .rotationY(rotY) + .uvLock(false) + .addModel() + .condition(FancyCableBlock.DIRECTION_PROPERTIES.get(direction), FancyCableBlock.CABLE_CONNECTION_TYPE.CABLE) + .end(); + + multipartBuilder1.part() + .modelFile(outerConnectionModel) + .rotationX(rotX) + .rotationY(rotY) + .uvLock(false) + .addModel() + .condition(FancyCableBlock.DIRECTION_PROPERTIES.get(direction), FancyCableBlock.CABLE_CONNECTION_TYPE.INV) + .end(); + } + } } diff --git a/src/datagen/java/ca/teamdman/sfm/datagen/SFMItemModels.java b/src/datagen/java/ca/teamdman/sfm/datagen/SFMItemModels.java index 849151719..6f82fb9a0 100644 --- a/src/datagen/java/ca/teamdman/sfm/datagen/SFMItemModels.java +++ b/src/datagen/java/ca/teamdman/sfm/datagen/SFMItemModels.java @@ -4,8 +4,6 @@ import ca.teamdman.sfm.common.registry.SFMBlocks; import ca.teamdman.sfm.common.registry.SFMItems; import net.minecraft.client.renderer.block.model.BlockModel; -import net.minecraft.data.DataGenerator; -import net.minecraft.data.PackOutput; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraftforge.client.model.generators.ItemModelProvider; @@ -24,10 +22,11 @@ public SFMItemModels( protected void registerModels() { justParent(SFMItems.MANAGER_ITEM, SFMBlocks.MANAGER_BLOCK); justParent(SFMItems.CABLE_ITEM, SFMBlocks.CABLE_BLOCK); + justParent(SFMItems.FANCY_CABLE_ITEM, SFMBlocks.FANCY_CABLE_BLOCK, "_core"); justParent(SFMItems.PRINTING_PRESS_ITEM, SFMBlocks.PRINTING_PRESS_BLOCK); justParent(SFMItems.WATER_TANK_ITEM, SFMBlocks.WATER_TANK_BLOCK, "_active"); basicItem(SFMItems.DISK_ITEM); - basicItem(SFMItems.LABEL_GUN_ITEM); + //basicItem(SFMItems.LABEL_GUN_ITEM); Using custom 3D texture basicItem(SFMItems.EXPERIENCE_GOOP_ITEM); basicItem(SFMItems.EXPERIENCE_SHARD_ITEM); basicItem(SFMItems.NETWORK_TOOL_ITEM); diff --git a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d index c9b5a9160..637f1b02e 100644 --- a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d +++ b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d @@ -1,4 +1,4 @@ -// 1.20.1 2023-10-27T20:13:47.6813886 Loot Tables +// 1.20.1 2025-01-10T16:04:27.8304554 Loot Tables dc0c30a0ed7751f530455b82cf95c8c24a8e62cb data/sfm/loot_tables/blocks/cable.json 200ad3ab7d9eeaa149bddb76b7e9aee0de5e8951 data/sfm/loot_tables/blocks/manager.json 169fff021b621f8267af0ff10757b8abffd5087f data/sfm/loot_tables/blocks/printing_press.json diff --git a/src/generated/resources/.cache/726a4eaaa226cb50028c5f3f85d691417b67903b b/src/generated/resources/.cache/726a4eaaa226cb50028c5f3f85d691417b67903b index fe034da7f..4470352b2 100644 --- a/src/generated/resources/.cache/726a4eaaa226cb50028c5f3f85d691417b67903b +++ b/src/generated/resources/.cache/726a4eaaa226cb50028c5f3f85d691417b67903b @@ -1,9 +1,9 @@ -// 1.20.1 2023-11-08T14:25:16.9491105 Item Models: sfm +// 1.20.1 2025-01-10T16:04:27.8314603 Item Models: sfm 8518af52bb22ef1d984719f3534ff29e08cca857 assets/sfm/models/item/cable.json bee75adb2bb431a6b671015aa9bac0d68a98f5fb assets/sfm/models/item/disk.json +3b5be3966b540f1e99a3d6fd8836ad39bf937e96 assets/sfm/models/item/fancy_cable.json 2c8c32d785bfc59bf23083eff8838054ee580570 assets/sfm/models/item/form.json a74b029bcf88d674c6a4c4eaece9426cfd9c4533 assets/sfm/models/item/form_base.json -a70b1032681b30f1066fdfb8b28870e87e51c261 assets/sfm/models/item/labelgun.json e945e739059a159bb1d4de5af118d412b50aae6c assets/sfm/models/item/manager.json d35a3dbb1180878d85e94f3f00812e5f34a4b2da assets/sfm/models/item/network_tool.json cd81e93f92577f247bb4bd12e01494d83e0733ce assets/sfm/models/item/printing_press.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 6dd5ba7cb..4f3d6a018 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,4 +1,4 @@ -// 1.20.1 2024-06-25T00:20:02.132182 Recipes +// 1.20.1 2025-01-10T16:04:27.8304554 Recipes 21ddf44d8958739f46e499c9445d01a6b7965013 data/minecraft/recipes/disk_reset.json 69ef243b9636e55ed67ae7ed4ec0cad1015864c2 data/sfm/advancements/recipes/misc/printing_press.json 05c1f9108d84b90c935b8dd532ded8690e533957 data/sfm/advancements/recipes/misc/xp_goop.json diff --git a/src/generated/resources/.cache/bf0ffec7956ce36aba0a993095f41e47d655813b b/src/generated/resources/.cache/bf0ffec7956ce36aba0a993095f41e47d655813b index a24c121a4..bb1596e12 100644 --- a/src/generated/resources/.cache/bf0ffec7956ce36aba0a993095f41e47d655813b +++ b/src/generated/resources/.cache/bf0ffec7956ce36aba0a993095f41e47d655813b @@ -1,10 +1,14 @@ -// 1.20.1 2023-10-27T20:13:47.6794382 Block States: sfm +// 1.20.1 2025-01-11T04:43:39.3793221 Block States: sfm f303dc233cde263e111cfdb2e2cbc48b93521724 assets/sfm/blockstates/cable.json -01e9d7d54169b7f6bbd287f4b896629f66f25305 assets/sfm/blockstates/manager.json +88f55b076e7631ab6387348c3b35fa18f40f27f3 assets/sfm/blockstates/fancy_cable.json +9740ff64e9b3387980b393367d97c509bb6da3fd assets/sfm/blockstates/manager.json a351025a2054b6ce2ddc21dc14734cc8b5b635bc assets/sfm/blockstates/printing_press.json 9be344941a18ad0d8dccbcd6536d52bf7295c1c8 assets/sfm/blockstates/test_barrel.json f3c25839c6554e631061f91277bc687aebc38fd7 assets/sfm/blockstates/water_tank.json a76567fd4e65d191d69cf166b98776786d47a8e2 assets/sfm/models/block/cable.json +1d0fd8fecf2a046a04c54891a11ca0c1f8577068 assets/sfm/models/block/fancy_cable_cable_connection.json +93f1a088e6274b2a1dd04c889830cd074d04fc16 assets/sfm/models/block/fancy_cable_core.json +b7ee664dec7c158cb7e09b33f1a163c1d2ec265e assets/sfm/models/block/fancy_cable_inv_connection.json 953313d31931040aa2bd9a8742d4a54a2c632b8d assets/sfm/models/block/manager.json 220cea2f958589873eff05d62905d9e088c08951 assets/sfm/models/block/water_tank_active.json 5c39779ee6f051e682c82c8534c2fae85779747d assets/sfm/models/block/water_tank_inactive.json diff --git a/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 b/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 index 9cf687d3f..35bb0b1b7 100644 --- a/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 +++ b/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 @@ -1,2 +1,2 @@ -// 1.20.1 2024-07-31T15:48:00.2975938 Languages: en_us -2ef5800dd8e0ea4d5c661969042e283cacd19197 assets/sfm/lang/en_us.json +// 1.20.1 2025-01-10T16:04:27.8314603 Languages: en_us +dd8835e768e2b995c50bd11ab5e703fe6d452990 assets/sfm/lang/en_us.json diff --git a/src/generated/resources/.cache/f4efe97b9c0e18af8c4c973c0a85409bb5676e69 b/src/generated/resources/.cache/f4efe97b9c0e18af8c4c973c0a85409bb5676e69 index 3a76f4101..9cc0fd5c3 100644 --- a/src/generated/resources/.cache/f4efe97b9c0e18af8c4c973c0a85409bb5676e69 +++ b/src/generated/resources/.cache/f4efe97b9c0e18af8c4c973c0a85409bb5676e69 @@ -1,3 +1,3 @@ -// 1.20.1 2023-10-27T20:13:47.6804141 SuperFactoryManager Tags +// 1.20.1 2025-01-10T16:04:27.8289514 SuperFactoryManager Tags 22c0d1933af00895b3b1fad66a738923e2f3b362 data/minecraft/tags/blocks/mineable/axe.json 6a266217a8ee3eb78aa4f2a383432144a0c97c14 data/minecraft/tags/blocks/mineable/pickaxe.json diff --git a/src/generated/resources/assets/sfm/blockstates/fancy_cable.json b/src/generated/resources/assets/sfm/blockstates/fancy_cable.json new file mode 100644 index 000000000..41a25141e --- /dev/null +++ b/src/generated/resources/assets/sfm/blockstates/fancy_cable.json @@ -0,0 +1,115 @@ +{ + "multipart": [ + { + "apply": { + "model": "sfm:block/fancy_cable_core" + } + }, + { + "apply": { + "model": "sfm:block/fancy_cable_cable_connection", + "x": 90 + }, + "when": { + "down": "cable" + } + }, + { + "apply": { + "model": "sfm:block/fancy_cable_inv_connection", + "x": 90 + }, + "when": { + "down": "inv" + } + }, + { + "apply": { + "model": "sfm:block/fancy_cable_cable_connection", + "x": 270 + }, + "when": { + "up": "cable" + } + }, + { + "apply": { + "model": "sfm:block/fancy_cable_inv_connection", + "x": 270 + }, + "when": { + "up": "inv" + } + }, + { + "apply": { + "model": "sfm:block/fancy_cable_cable_connection" + }, + "when": { + "north": "cable" + } + }, + { + "apply": { + "model": "sfm:block/fancy_cable_inv_connection" + }, + "when": { + "north": "inv" + } + }, + { + "apply": { + "model": "sfm:block/fancy_cable_cable_connection", + "y": 180 + }, + "when": { + "south": "cable" + } + }, + { + "apply": { + "model": "sfm:block/fancy_cable_inv_connection", + "y": 180 + }, + "when": { + "south": "inv" + } + }, + { + "apply": { + "model": "sfm:block/fancy_cable_cable_connection", + "y": 270 + }, + "when": { + "west": "cable" + } + }, + { + "apply": { + "model": "sfm:block/fancy_cable_inv_connection", + "y": 270 + }, + "when": { + "west": "inv" + } + }, + { + "apply": { + "model": "sfm:block/fancy_cable_cable_connection", + "y": 90 + }, + "when": { + "east": "cable" + } + }, + { + "apply": { + "model": "sfm:block/fancy_cable_inv_connection", + "y": 90 + }, + "when": { + "east": "inv" + } + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/assets/sfm/blockstates/manager.json b/src/generated/resources/assets/sfm/blockstates/manager.json index f571e3fb0..f4f0d7ed0 100644 --- a/src/generated/resources/assets/sfm/blockstates/manager.json +++ b/src/generated/resources/assets/sfm/blockstates/manager.json @@ -1,7 +1,34 @@ { "variants": { - "": { + "facing=east,triggered=false": { + "model": "sfm:block/manager", + "y": 90 + }, + "facing=east,triggered=true": { + "model": "sfm:block/manager", + "y": 90 + }, + "facing=north,triggered=false": { "model": "sfm:block/manager" + }, + "facing=north,triggered=true": { + "model": "sfm:block/manager" + }, + "facing=south,triggered=false": { + "model": "sfm:block/manager", + "y": 180 + }, + "facing=south,triggered=true": { + "model": "sfm:block/manager", + "y": 180 + }, + "facing=west,triggered=false": { + "model": "sfm:block/manager", + "y": 270 + }, + "facing=west,triggered=true": { + "model": "sfm:block/manager", + "y": 270 } } } \ No newline at end of file diff --git a/src/generated/resources/assets/sfm/lang/en_us.json b/src/generated/resources/assets/sfm/lang/en_us.json index 874634b77..ee5d84273 100644 --- a/src/generated/resources/assets/sfm/lang/en_us.json +++ b/src/generated/resources/assets/sfm/lang/en_us.json @@ -1,6 +1,7 @@ { "block.sfm.battery": "Battery (WIP)", "block.sfm.cable": "Inventory Cable", + "block.sfm.fancy_cable": "Fancy Inventory Cable", "block.sfm.manager": "Factory Manager", "block.sfm.printing_press": "Printing Press", "block.sfm.printing_press.tooltip": "Place with an air gap below a downward facing piston. Extend the piston to use.", diff --git a/src/generated/resources/assets/sfm/models/block/fancy_cable_cable_connection.json b/src/generated/resources/assets/sfm/models/block/fancy_cable_cable_connection.json new file mode 100644 index 000000000..e9dfba892 --- /dev/null +++ b/src/generated/resources/assets/sfm/models/block/fancy_cable_cable_connection.json @@ -0,0 +1,79 @@ +{ + "parent": "minecraft:block/block", + "elements": [ + { + "faces": { + "down": { + "rotation": 90, + "texture": "#cable", + "uv": [ + 0.0, + 0.0, + 4.0, + 8.0 + ] + }, + "east": { + "texture": "#cable", + "uv": [ + 0.0, + 0.0, + 4.0, + 8.0 + ] + }, + "north": { + "texture": "#cable", + "uv": [ + 5.0, + 0.0, + 13.0, + 8.0 + ] + }, + "south": { + "texture": "#cable", + "uv": [ + 5.0, + 0.0, + 13.0, + 8.0 + ] + }, + "up": { + "rotation": 90, + "texture": "#cable", + "uv": [ + 0.0, + 0.0, + 4.0, + 8.0 + ] + }, + "west": { + "texture": "#cable", + "uv": [ + 0.0, + 0.0, + 4.0, + 8.0 + ] + } + }, + "from": [ + 4, + 4, + 0 + ], + "shade": false, + "to": [ + 12, + 12, + 4 + ] + } + ], + "textures": { + "cable": "sfm:block/fancy_cable" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/sfm/models/block/fancy_cable_core.json b/src/generated/resources/assets/sfm/models/block/fancy_cable_core.json new file mode 100644 index 000000000..dae5d6a38 --- /dev/null +++ b/src/generated/resources/assets/sfm/models/block/fancy_cable_core.json @@ -0,0 +1,78 @@ +{ + "parent": "minecraft:block/block", + "elements": [ + { + "faces": { + "down": { + "texture": "#cable", + "uv": [ + 5.0, + 0.0, + 13.0, + 8.0 + ] + }, + "east": { + "texture": "#cable", + "uv": [ + 5.0, + 0.0, + 13.0, + 8.0 + ] + }, + "north": { + "texture": "#cable", + "uv": [ + 5.0, + 0.0, + 13.0, + 8.0 + ] + }, + "south": { + "texture": "#cable", + "uv": [ + 5.0, + 0.0, + 13.0, + 8.0 + ] + }, + "up": { + "texture": "#cable", + "uv": [ + 5.0, + 0.0, + 13.0, + 8.0 + ] + }, + "west": { + "texture": "#cable", + "uv": [ + 5.0, + 0.0, + 13.0, + 8.0 + ] + } + }, + "from": [ + 4, + 4, + 4 + ], + "shade": false, + "to": [ + 12, + 12, + 12 + ] + } + ], + "textures": { + "cable": "sfm:block/fancy_cable", + "particle": "sfm:block/fancy_cable" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/sfm/models/block/fancy_cable_inv_connection.json b/src/generated/resources/assets/sfm/models/block/fancy_cable_inv_connection.json new file mode 100644 index 000000000..1b9cfb4e4 --- /dev/null +++ b/src/generated/resources/assets/sfm/models/block/fancy_cable_inv_connection.json @@ -0,0 +1,150 @@ +{ + "parent": "minecraft:block/block", + "elements": [ + { + "faces": { + "down": { + "rotation": 90, + "texture": "#cable", + "uv": [ + 0.0, + 0.0, + 3.0, + 8.0 + ] + }, + "east": { + "texture": "#cable", + "uv": [ + 0.0, + 0.0, + 3.0, + 8.0 + ] + }, + "north": { + "texture": "#cable", + "uv": [ + 5.0, + 0.0, + 13.0, + 8.0 + ] + }, + "south": { + "texture": "#cable", + "uv": [ + 5.0, + 0.0, + 13.0, + 8.0 + ] + }, + "up": { + "rotation": 90, + "texture": "#cable", + "uv": [ + 0.0, + 0.0, + 3.0, + 8.0 + ] + }, + "west": { + "texture": "#cable", + "uv": [ + 0.0, + 0.0, + 3.0, + 8.0 + ] + } + }, + "from": [ + 4, + 4, + 1 + ], + "shade": false, + "to": [ + 12, + 12, + 4 + ] + }, + { + "faces": { + "down": { + "rotation": 90, + "texture": "#cable", + "uv": [ + 3.0, + 10.0, + 4.0, + 15.0 + ] + }, + "east": { + "texture": "#cable", + "uv": [ + 0.0, + 10.0, + 1.0, + 15.0 + ] + }, + "north": { + "texture": "#cable", + "uv": [ + 6.0, + 10.0, + 11.0, + 15.0 + ] + }, + "south": { + "texture": "#cable", + "uv": [ + 6.0, + 10.0, + 11.0, + 15.0 + ] + }, + "up": { + "rotation": 90, + "texture": "#cable", + "uv": [ + 2.0, + 10.0, + 3.0, + 15.0 + ] + }, + "west": { + "texture": "#cable", + "uv": [ + 1.0, + 10.0, + 2.0, + 15.0 + ] + } + }, + "from": [ + 11, + 11, + 0 + ], + "shade": false, + "to": [ + 5, + 5, + 1 + ] + } + ], + "textures": { + "cable": "sfm:block/fancy_cable" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/sfm/models/item/fancy_cable.json b/src/generated/resources/assets/sfm/models/item/fancy_cable.json new file mode 100644 index 000000000..dfcc423fe --- /dev/null +++ b/src/generated/resources/assets/sfm/models/item/fancy_cable.json @@ -0,0 +1,3 @@ +{ + "parent": "sfm:block/fancy_cable_core" +} \ No newline at end of file diff --git a/src/generated/resources/assets/sfm/models/item/labelgun.json b/src/generated/resources/assets/sfm/models/item/labelgun.json deleted file mode 100644 index 83c9f7da3..000000000 --- a/src/generated/resources/assets/sfm/models/item/labelgun.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "sfm:item/labelgun" - } -} \ No newline at end of file diff --git a/src/main/java/ca/teamdman/sfm/common/block/FancyCableBlock.java b/src/main/java/ca/teamdman/sfm/common/block/FancyCableBlock.java new file mode 100644 index 000000000..398661ce2 --- /dev/null +++ b/src/main/java/ca/teamdman/sfm/common/block/FancyCableBlock.java @@ -0,0 +1,205 @@ +package ca.teamdman.sfm.common.block; + +import ca.teamdman.sfm.common.cablenetwork.ICableBlock; +import com.google.common.collect.ImmutableMap; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.util.StringRepresentable; +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.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.EnumProperty; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; +import net.minecraftforge.common.capabilities.ForgeCapabilities; +import org.jetbrains.annotations.Nullable; + +import java.util.Map; +import java.util.function.Supplier; + +public class FancyCableBlock extends CableBlock { + public static final EnumProperty NORTH = EnumProperty.create("north",CABLE_CONNECTION_TYPE.class); + public static final EnumProperty SOUTH = EnumProperty.create("south",CABLE_CONNECTION_TYPE.class); + public static final EnumProperty EAST = EnumProperty.create("east",CABLE_CONNECTION_TYPE.class); + public static final EnumProperty WEST = EnumProperty.create("west",CABLE_CONNECTION_TYPE.class); + public static final EnumProperty UP = EnumProperty.create("up",CABLE_CONNECTION_TYPE.class); + public static final EnumProperty DOWN = EnumProperty.create("down",CABLE_CONNECTION_TYPE.class); + + public static final VoxelShape SHAPE_CORE = Block.box(5, 5, 5, 11, 11, 11); + public static final VoxelShape SHAPE_NORTH = Block.box(5, 5, 0, 11, 11, 5); + public static final VoxelShape SHAPE_SOUTH = Block.box(5, 5, 11, 11, 11, 16); + public static final VoxelShape SHAPE_EAST = Block.box(11, 5, 5, 16, 11, 11); + public static final VoxelShape SHAPE_WEST = Block.box(0, 5, 5, 5, 11, 11); + public static final VoxelShape SHAPE_UP = Block.box(5, 11, 5, 11, 16, 11); + public static final VoxelShape SHAPE_DOWN = Block.box(5, 0, 5, 11, 5, 11); + + public static final Map> DIRECTION_PROPERTIES = ImmutableMap.of( + Direction.NORTH, NORTH, + Direction.SOUTH, SOUTH, + Direction.EAST, EAST, + Direction.WEST, WEST, + Direction.UP, UP, + Direction.DOWN, DOWN + ); + + public FancyCableBlock() { + super(); + registerDefaultState( + defaultBlockState() + .setValue(NORTH, CABLE_CONNECTION_TYPE.AIR) + .setValue(SOUTH, CABLE_CONNECTION_TYPE.AIR) + .setValue(EAST, CABLE_CONNECTION_TYPE.AIR) + .setValue(WEST, CABLE_CONNECTION_TYPE.AIR) + .setValue(UP, CABLE_CONNECTION_TYPE.AIR) + .setValue(DOWN, CABLE_CONNECTION_TYPE.AIR) + ); + } + + @Override + public @Nullable BlockState getStateForPlacement(BlockPlaceContext ctx) { + return getState(defaultBlockState(), ctx.getLevel(), ctx.getClickedPos()); + } + + @SuppressWarnings("deprecation") + @Override + public void neighborChanged( + BlockState state, + Level level, + BlockPos pos, + Block block, + BlockPos fromPos, + boolean isMoving + ) { + super.neighborChanged(state, level, pos, block, fromPos, isMoving); + + level.setBlockAndUpdate(pos, getState(level.getBlockState(pos), level, pos)); + } + + @SuppressWarnings("deprecation") + @Override + public VoxelShape getShape( + BlockState state, + BlockGetter world, + BlockPos pos, + CollisionContext ctx + ) { + return ShapeCache.getOrCompute(state, FancyCableBlock::getShape); + } + + @Override + @SuppressWarnings("deprecation") + public BlockState updateShape( + BlockState state, + Direction dir, + BlockState facingState, + LevelAccessor world, + BlockPos pos, + BlockPos facingPos + ) { + return getState(state, world, pos); + } + + protected static VoxelShape getShape(BlockState state) { + var shape = SHAPE_CORE; + + shape = combineShapes(shape, SHAPE_NORTH, () -> state.getValue(NORTH) != CABLE_CONNECTION_TYPE.AIR); + shape = combineShapes(shape, SHAPE_SOUTH, () -> state.getValue(SOUTH) != CABLE_CONNECTION_TYPE.AIR); + shape = combineShapes(shape, SHAPE_EAST, () -> state.getValue(EAST) != CABLE_CONNECTION_TYPE.AIR); + shape = combineShapes(shape, SHAPE_WEST, () -> state.getValue(WEST) != CABLE_CONNECTION_TYPE.AIR); + shape = combineShapes(shape, SHAPE_UP, () -> state.getValue(UP) != CABLE_CONNECTION_TYPE.AIR); + shape = combineShapes(shape, SHAPE_DOWN, () -> state.getValue(DOWN) != CABLE_CONNECTION_TYPE.AIR); + + return shape; + } + + protected static VoxelShape combineShapes( + VoxelShape shape1, + VoxelShape shape2, + Supplier condition + ) { + return condition.get() ? Shapes.or(shape1, shape2) : shape1; + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + super.createBlockStateDefinition(builder); + builder.add(NORTH, SOUTH, EAST, WEST, UP, DOWN); + } + + protected BlockState getState( + BlockState currentState, + LevelAccessor level, + BlockPos pos + ) { + CABLE_CONNECTION_TYPE north = getConnection(level, pos, Direction.NORTH); + CABLE_CONNECTION_TYPE south = getConnection(level, pos, Direction.SOUTH); + CABLE_CONNECTION_TYPE east = getConnection(level, pos, Direction.EAST); + CABLE_CONNECTION_TYPE west = getConnection(level, pos, Direction.WEST); + CABLE_CONNECTION_TYPE up = getConnection(level, pos, Direction.UP); + CABLE_CONNECTION_TYPE down = getConnection(level, pos, Direction.DOWN); + + return currentState + .setValue(NORTH, north) + .setValue(SOUTH, south) + .setValue(EAST, east) + .setValue(WEST, west) + .setValue(UP, up) + .setValue(DOWN, down); + } + + protected boolean hasConnection( + LevelAccessor level, + BlockPos pos, + Direction direction + ) { + // Directly connect to other cables + BlockPos relative = pos.relative(direction); + if (level.getBlockState(relative).getBlock() instanceof ICableBlock) { + return true; + } + + BlockEntity blockEntity = level.getBlockEntity(relative); + if (blockEntity == null) { + return false; + } + + return blockEntity.getCapability(ForgeCapabilities.ITEM_HANDLER, direction.getOpposite()).isPresent(); + } + + protected CABLE_CONNECTION_TYPE getConnection( + LevelAccessor level, + BlockPos pos, + Direction direction + ) { + // Directly connect to other cables + BlockPos relative = pos.relative(direction); + if (level.getBlockState(relative).getBlock() instanceof CableBlock) { + return CABLE_CONNECTION_TYPE.CABLE; + } + + BlockEntity blockEntity = level.getBlockEntity(relative); + if (blockEntity == null) { + return CABLE_CONNECTION_TYPE.AIR; + } else if (blockEntity.getCapability(ForgeCapabilities.ITEM_HANDLER, direction.getOpposite()).isPresent()){ + return CABLE_CONNECTION_TYPE.INV; + } + return CABLE_CONNECTION_TYPE.AIR; + } + + public enum CABLE_CONNECTION_TYPE implements StringRepresentable{ + AIR, + CABLE, + INV; + + @Override + public String getSerializedName() { + return this.name().toLowerCase(); + } + } +} diff --git a/src/main/java/ca/teamdman/sfm/common/block/ManagerBlock.java b/src/main/java/ca/teamdman/sfm/common/block/ManagerBlock.java index 0bc548f93..5d0d5126c 100644 --- a/src/main/java/ca/teamdman/sfm/common/block/ManagerBlock.java +++ b/src/main/java/ca/teamdman/sfm/common/block/ManagerBlock.java @@ -9,6 +9,7 @@ import ca.teamdman.sfm.common.program.ProgramLinter; import ca.teamdman.sfm.common.registry.SFMBlockEntities; import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.Container; @@ -16,6 +17,7 @@ import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.entity.BlockEntity; @@ -26,6 +28,7 @@ import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; import net.minecraft.world.phys.BlockHitResult; import net.minecraftforge.network.NetworkHooks; @@ -33,17 +36,19 @@ public class ManagerBlock extends BaseEntityBlock implements EntityBlock, ICableBlock { public static final BooleanProperty TRIGGERED = BlockStateProperties.TRIGGERED; + public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING; //Rotation Property (cosmetics only) public ManagerBlock() { super(BlockBehaviour.Properties.of() .destroyTime(2) .sound(SoundType.METAL)); - registerDefaultState(getStateDefinition().any().setValue(TRIGGERED, false)); + registerDefaultState(getStateDefinition().any().setValue(TRIGGERED, false).setValue(FACING,Direction.NORTH)); } @Override protected void createBlockStateDefinition(StateDefinition.Builder builder) { builder.add(TRIGGERED); + builder.add(FACING); } @SuppressWarnings("deprecation") @@ -51,6 +56,11 @@ public RenderShape getRenderShape(BlockState state) { return RenderShape.MODEL; } + @org.jetbrains.annotations.Nullable + @Override + public BlockState getStateForPlacement(BlockPlaceContext pContext) { + return this.defaultBlockState().setValue(FACING,pContext.getHorizontalDirection()); + } @Override @SuppressWarnings("deprecation") diff --git a/src/main/java/ca/teamdman/sfm/common/block/ShapeCache.java b/src/main/java/ca/teamdman/sfm/common/block/ShapeCache.java new file mode 100644 index 000000000..3ba371159 --- /dev/null +++ b/src/main/java/ca/teamdman/sfm/common/block/ShapeCache.java @@ -0,0 +1,19 @@ +package ca.teamdman.sfm.common.block; + +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.shapes.VoxelShape; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; + +public final class ShapeCache { + private static final Map STORAGE = new HashMap<>(); + + private ShapeCache() { + } + + public static VoxelShape getOrCompute(BlockState state, Function computeFunction) { + return STORAGE.computeIfAbsent(state, computeFunction); + } +} diff --git a/src/main/java/ca/teamdman/sfm/common/localization/LocalizationKeys.java b/src/main/java/ca/teamdman/sfm/common/localization/LocalizationKeys.java index d3434a25b..e67501ee2 100644 --- a/src/main/java/ca/teamdman/sfm/common/localization/LocalizationKeys.java +++ b/src/main/java/ca/teamdman/sfm/common/localization/LocalizationKeys.java @@ -96,6 +96,12 @@ public final class LocalizationKeys { () -> "Inventory Cable" ); + @SuppressWarnings("unused") // used by minecraft without us having to directly reference + public static LocalizationEntry FANCY_CABLE_BLOCK = new LocalizationEntry( + () -> SFMBlocks.FANCY_CABLE_BLOCK.get().getDescriptionId(), + () -> "Fancy Inventory Cable" + ); + @SuppressWarnings("unused") // used by minecraft without us having to directly reference public static LocalizationEntry MANAGER_BLOCK = new LocalizationEntry( () -> SFMBlocks.MANAGER_BLOCK.get().getDescriptionId(), diff --git a/src/main/java/ca/teamdman/sfm/common/registry/SFMBlocks.java b/src/main/java/ca/teamdman/sfm/common/registry/SFMBlocks.java index 318b6d8cf..fbc9682b4 100644 --- a/src/main/java/ca/teamdman/sfm/common/registry/SFMBlocks.java +++ b/src/main/java/ca/teamdman/sfm/common/registry/SFMBlocks.java @@ -18,6 +18,7 @@ public class SFMBlocks { ); public static final RegistryObject WATER_TANK_BLOCK = BLOCKS.register("water_tank", WaterTankBlock::new); public static final RegistryObject CABLE_BLOCK = BLOCKS.register("cable", CableBlock::new); + public static final RegistryObject FANCY_CABLE_BLOCK = BLOCKS.register("fancy_cable", FancyCableBlock::new); public static final RegistryObject BATTERY_BLOCK = BLOCKS.register("battery", BatteryBlock::new); diff --git a/src/main/java/ca/teamdman/sfm/common/registry/SFMItems.java b/src/main/java/ca/teamdman/sfm/common/registry/SFMItems.java index 74cc06a97..f2b7a963f 100644 --- a/src/main/java/ca/teamdman/sfm/common/registry/SFMItems.java +++ b/src/main/java/ca/teamdman/sfm/common/registry/SFMItems.java @@ -19,6 +19,7 @@ public class SFMItems { private static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, SFM.MOD_ID); public static final RegistryObject MANAGER_ITEM = register("manager", SFMBlocks.MANAGER_BLOCK); public static final RegistryObject CABLE_ITEM = register("cable", SFMBlocks.CABLE_BLOCK); + public static final RegistryObject FANCY_CABLE_ITEM = register("fancy_cable", SFMBlocks.FANCY_CABLE_BLOCK); // public static final RegistryObject BATTERY_ITEM = register("battery", SFMBlocks.BATTERY_BLOCK); public static final RegistryObject WATER_TANK_ITEM = register("water_tank", SFMBlocks.WATER_TANK_BLOCK); public static final RegistryObject DISK_ITEM = ITEMS.register("disk", DiskItem::new); diff --git a/src/main/resources/assets/sfm/models/block/fancy_cable_example.json b/src/main/resources/assets/sfm/models/block/fancy_cable_example.json new file mode 100644 index 000000000..fd8ab00b0 --- /dev/null +++ b/src/main/resources/assets/sfm/models/block/fancy_cable_example.json @@ -0,0 +1,48 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "sfm:block/fancy_cable", + "particle": "sfm:block/fancy_cable" + }, + "elements": [ + { + "from": [6, 6, 6], + "to": [10, 10, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 7, 7]}, + "faces": { + "north": {"uv": [12, 0, 16, 4], "texture": "#0"}, + "east": {"uv": [12, 0, 16, 4], "texture": "#0"}, + "south": {"uv": [12, 0, 16, 4], "texture": "#0"}, + "west": {"uv": [12, 0, 16, 4], "texture": "#0"}, + "up": {"uv": [12, 0, 16, 4], "texture": "#0"}, + "down": {"uv": [12, 0, 16, 4], "texture": "#0"} + } + }, + { + "from": [6, 6, 1], + "to": [10, 10, 6], + "rotation": {"angle": 0, "axis": "y", "origin": [9, 7, 4]}, + "faces": { + "north": {"uv": [5, 0, 9, 4], "texture": "#0"}, + "east": {"uv": [0, 0, 5, 4], "texture": "#0"}, + "south": {"uv": [5, 0, 9, 4], "texture": "#0"}, + "west": {"uv": [0, 0, 5, 4], "texture": "#0"}, + "up": {"uv": [0, 0, 5, 4], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 0, 5, 4], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [5, 5, 0], + "to": [11, 11, 1], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 0]}, + "faces": { + "north": {"uv": [0, 10, 6, 16], "texture": "#0"}, + "east": {"uv": [8, 10, 9, 16], "texture": "#0"}, + "south": {"uv": [10, 10, 16, 16], "texture": "#0"}, + "west": {"uv": [6, 10, 7, 16], "texture": "#0"}, + "up": {"uv": [9, 10, 10, 16], "rotation": 90, "texture": "#0"}, + "down": {"uv": [7, 10, 8, 16], "rotation": 270, "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/sfm/models/item/labelgun.json b/src/main/resources/assets/sfm/models/item/labelgun.json new file mode 100644 index 000000000..8cd2d72e9 --- /dev/null +++ b/src/main/resources/assets/sfm/models/item/labelgun.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:item/handheld", + "loader": "forge:separate_transforms", + "base": { + "parent": "sfm:item/labelgun3d" + }, + "perspectives": { + "gui": { + "parent": "sfm:item/labelgun2d" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/sfm/models/item/labelgun2d.json b/src/main/resources/assets/sfm/models/item/labelgun2d.json new file mode 100644 index 000000000..bcf6403b3 --- /dev/null +++ b/src/main/resources/assets/sfm/models/item/labelgun2d.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "sfm:item/labelgun2d" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/sfm/models/item/labelgun3d.json b/src/main/resources/assets/sfm/models/item/labelgun3d.json new file mode 100644 index 000000000..f220c8743 --- /dev/null +++ b/src/main/resources/assets/sfm/models/item/labelgun3d.json @@ -0,0 +1,317 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "sfm:item/labelgun3d", + "particle": "sfm:item/labelgun3d" + }, + "elements": [ + { + "from": [6, 8, 4], + "to": [10, 9, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 6, 3]}, + "faces": { + "north": {"uv": [0, 6, 2, 7.5], "texture": "#0"}, + "east": {"uv": [5, 10, 9, 10.5], "texture": "#0"}, + "south": {"uv": [0, 4.5, 2, 6], "texture": "#0"}, + "west": {"uv": [12, 10, 16, 10.5], "texture": "#0"}, + "up": {"uv": [11.5, 9.5, 9.5, 5.5], "texture": "#0"}, + "down": {"uv": [7, 12, 5, 16], "texture": "#0"} + } + }, + { + "from": [6.125, 7, 4], + "to": [9.875, 8, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [5, 5, 3]}, + "faces": { + "north": {"uv": [6, 4, 10, 5], "texture": "#0"}, + "east": {"uv": [5, 10.5, 9, 11], "texture": "#0"}, + "south": {"uv": [6, 4, 10, 5], "texture": "#0"}, + "west": {"uv": [12, 10.5, 16, 11], "texture": "#0"}, + "up": {"uv": [4, 4, 2, 0], "texture": "#0"}, + "down": {"uv": [8, 0, 6, 4], "texture": "#0"} + } + }, + { + "from": [6, 6, 4], + "to": [10, 7, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 4, 3]}, + "faces": { + "north": {"uv": [0, 6, 2, 7.5], "texture": "#0"}, + "east": {"uv": [5, 11, 9, 11.5], "texture": "#0"}, + "south": {"uv": [0, 4, 2, 4.5], "texture": "#0"}, + "west": {"uv": [12, 11, 16, 11.5], "texture": "#0"}, + "up": {"uv": [5, 16, 3, 12], "texture": "#0"}, + "down": {"uv": [9, 5, 9.5, 6], "texture": "#0"} + } + }, + { + "from": [6, 5, 4], + "to": [10, 6, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 5, 4]}, + "faces": { + "north": {"uv": [9.5, 11.5, 11.5, 12], "texture": "#0"}, + "east": {"uv": [5, 11.5, 9, 12], "texture": "#0"}, + "south": {"uv": [9.5, 5, 11.5, 5.5], "texture": "#0"}, + "west": {"uv": [12, 11.5, 16, 12], "texture": "#0"}, + "up": {"uv": [4, 0, 6, 4], "texture": "#0"}, + "down": {"uv": [9.5, 12, 11.5, 16], "texture": "#0"} + } + }, + { + "from": [5.5, 8, 10], + "to": [10.5, 10, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [5.5, 8, 10]}, + "faces": { + "north": {"uv": [13, 2, 15.5, 3], "texture": "#0"}, + "east": {"uv": [12.5, 3, 13, 4], "texture": "#0"}, + "south": {"uv": [4, 9, 7, 10], "texture": "#0"}, + "west": {"uv": [11, 1, 11.5, 2], "texture": "#0"}, + "up": {"uv": [13, 1.5, 15.5, 2], "texture": "#0"}, + "down": {"uv": [13, 3, 15.5, 3.5], "texture": "#0"} + } + }, + { + "from": [5.5, 8, 13], + "to": [10.5, 10, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [5.5, 8, 13]}, + "faces": { + "north": {"uv": [4, 8, 7, 9], "texture": "#0"}, + "east": {"uv": [11, 3, 11.5, 4], "texture": "#0"}, + "south": {"uv": [13, 6, 15.5, 7], "texture": "#0"}, + "west": {"uv": [12.5, 1, 13, 2], "texture": "#0"}, + "up": {"uv": [13, 7, 15.5, 7.5], "texture": "#0"}, + "down": {"uv": [13, 5.5, 15.5, 6], "texture": "#0"} + } + }, + { + "from": [5.5, 10, 11], + "to": [10.5, 11, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [5.5, 10, 11]}, + "faces": { + "north": {"uv": [13, 1, 15.5, 1.5], "texture": "#0"}, + "east": {"uv": [11.5, 2.5, 12.5, 3], "texture": "#0"}, + "south": {"uv": [13, 7.5, 15.5, 8], "texture": "#0"}, + "west": {"uv": [11.5, 0.5, 12.5, 1], "texture": "#0"}, + "up": {"uv": [13, 0, 15.5, 1], "texture": "#0"}, + "down": {"uv": [4, 7, 7, 8], "texture": "#0"} + } + }, + { + "from": [5.5, 7, 11], + "to": [10.5, 8, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [5.5, 7, 11]}, + "faces": { + "north": {"uv": [13, 3.5, 15.5, 4], "texture": "#0"}, + "east": {"uv": [11.5, 4, 12.5, 4.5], "texture": "#0"}, + "south": {"uv": [13, 5, 15.5, 5.5], "texture": "#0"}, + "west": {"uv": [11.5, 2, 12.5, 2.5], "texture": "#0"}, + "up": {"uv": [4, 6, 7, 7], "texture": "#0"}, + "down": {"uv": [13, 4, 15.5, 5], "texture": "#0"} + } + }, + { + "from": [7, 1, 4], + "to": [9, 5, 4], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 3, 4]}, + "faces": { + "north": {"uv": [0, 11.5, 1, 13.5], "texture": "#0"}, + "east": {"uv": [2.5, 11.5, 3, 13.5], "texture": "#0"}, + "south": {"uv": [1.5, 11.5, 2.5, 13.5], "texture": "#0"}, + "west": {"uv": [1, 11.5, 1.5, 13.5], "texture": "#0"}, + "up": {"uv": [7.5, 7, 8.5, 6.5], "texture": "#0"}, + "down": {"uv": [3, 10.5, 4, 11], "texture": "#0"} + } + }, + { + "from": [7, 0, 5], + "to": [9, 1.414, 5], + "rotation": {"angle": -45, "axis": "x", "origin": [8, 0, 5]}, + "faces": { + "north": {"uv": [0, 13.5, 1, 14], "texture": "#0"}, + "east": {"uv": [2.5, 11.5, 3, 13.5], "texture": "#0"}, + "south": {"uv": [1.5, 13.5, 2.5, 14], "texture": "#0"}, + "west": {"uv": [1, 11.5, 1.5, 13.5], "texture": "#0"}, + "up": {"uv": [7.5, 7, 8.5, 6.5], "texture": "#0"}, + "down": {"uv": [3, 10.5, 4, 11], "texture": "#0"} + } + }, + { + "from": [7, 0, 5], + "to": [9, 0, 8], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 1, 7]}, + "faces": { + "north": {"uv": [3, 10, 4, 10.5], "rotation": 180, "texture": "#0"}, + "east": {"uv": [2.5, 10, 3, 11.5], "rotation": 270, "texture": "#0"}, + "south": {"uv": [7.5, 7, 8.5, 6.5], "texture": "#0"}, + "west": {"uv": [1, 10, 1.5, 11.5], "rotation": 90, "texture": "#0"}, + "up": {"uv": [0, 10, 1, 11.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [1.5, 10, 2.5, 11.5], "texture": "#0"} + } + }, + { + "from": [7, 0, 8], + "to": [9, 0, 9.1], + "rotation": {"angle": -22.5, "axis": "x", "origin": [8, 0, 8]}, + "faces": { + "north": {"uv": [3, 10, 4, 10.5], "rotation": 180, "texture": "#0"}, + "east": {"uv": [2.5, 10, 3, 11.5], "rotation": 270, "texture": "#0"}, + "south": {"uv": [7.5, 7, 8.5, 6.5], "texture": "#0"}, + "west": {"uv": [1, 10, 1.5, 11.5], "rotation": 90, "texture": "#0"}, + "up": {"uv": [0, 14, 1, 14.5], "rotation": 180, "texture": "#0"}, + "down": {"uv": [1.5, 14, 2.5, 14.5], "texture": "#0"} + } + }, + { + "from": [7, 0, 9], + "to": [9, 5, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 3, 8]}, + "faces": { + "north": {"uv": [12, 12.5, 13, 15], "texture": "#0"}, + "east": {"uv": [15, 12.5, 16, 15], "texture": "#0"}, + "south": {"uv": [14, 12.5, 15, 15], "texture": "#0"}, + "west": {"uv": [13, 12.5, 14, 15], "texture": "#0"}, + "up": {"uv": [14, 16, 13, 15], "texture": "#0"}, + "down": {"uv": [13, 15, 12, 16], "texture": "#0"} + } + }, + { + "from": [7, 9.5, 6], + "to": [9, 9.5, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 7.5, 6]}, + "faces": { + "north": {"uv": [0, 8, 1, 8.5], "texture": "#0"}, + "east": {"uv": [0, 7.5, 2, 8], "texture": "#0"}, + "south": {"uv": [1, 8, 2, 8.5], "texture": "#0"}, + "west": {"uv": [0, 8.5, 2, 9], "texture": "#0"}, + "up": {"uv": [8.5, 7, 9.5, 9], "texture": "#0"}, + "down": {"uv": [7.5, 7, 8.5, 9], "texture": "#0"} + } + }, + { + "from": [7, 9.5, 4.5], + "to": [9, 9.5, 6], + "rotation": {"angle": -22.5, "axis": "x", "origin": [8, 9.5, 6]}, + "faces": { + "north": {"uv": [0, 8, 1, 8.5], "texture": "#0"}, + "east": {"uv": [0, 7.5, 2, 8], "texture": "#0"}, + "south": {"uv": [1, 8, 2, 8.5], "texture": "#0"}, + "west": {"uv": [0, 8.5, 2, 9], "texture": "#0"}, + "up": {"uv": [8.5, 9, 9.5, 9.5], "texture": "#0"}, + "down": {"uv": [7.5, 9, 8.5, 9.5], "texture": "#0"} + } + }, + { + "from": [5.75, 8, 11], + "to": [10.25, 10, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 8, 11]}, + "faces": { + "north": {"uv": [8.5, 0, 10.75, 1], "texture": "#0"}, + "east": {"uv": [11.5, 3, 12.5, 4], "texture": "#0"}, + "south": {"uv": [8.5, 1, 10.75, 2], "texture": "#0"}, + "west": {"uv": [11.5, 1, 12.5, 2], "texture": "#0"}, + "up": {"uv": [8.5, 0, 10.75, 1], "texture": "#0"}, + "down": {"uv": [8.5, 1, 10.75, 2], "texture": "#0"} + } + }, + { + "from": [6.0001, 8.5, 2.919], + "to": [9.9991, 9, 3.999], + "rotation": {"angle": -22.5, "axis": "x", "origin": [8, 9, 4]}, + "faces": { + "north": {"uv": [0, 0, 1.9995, 0.25], "texture": "#0"}, + "east": {"uv": [9, 9.7375, 9.5, 9.5], "texture": "#0"}, + "south": {"uv": [0, 0, 1.9995, 0.25], "texture": "#0"}, + "west": {"uv": [11.5, 9.5, 12, 9.75], "texture": "#0"}, + "up": {"uv": [9.5, 9.5, 11.4995, 10], "texture": "#0"}, + "down": {"uv": [9.5, 9.5, 11.4995, 10.04], "texture": "#0"} + } + }, + { + "from": [7.0001, 4.3, 9], + "to": [8.9991, 5.3, 10], + "rotation": {"angle": -45, "axis": "x", "origin": [8, 4.3, 9]}, + "faces": { + "north": {"uv": [7.5, 12, 8.4995, 12.5], "texture": "#0"}, + "east": {"uv": [7, 12, 7.5, 12.5], "texture": "#0"}, + "south": {"uv": [7.5, 13, 8.4995, 12.5], "texture": "#0"}, + "west": {"uv": [8.5, 12, 9, 12.5], "texture": "#0"}, + "up": {"uv": [0, 0, 0.9995, 0.5], "texture": "#0"}, + "down": {"uv": [0, 0, 0.9995, 0.5], "texture": "#0"} + } + }, + { + "from": [6, 6, 3], + "to": [10, 7, 4], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 5, 2]}, + "faces": { + "north": {"uv": [9.5, 11, 11.5, 11.5], "texture": "#0"}, + "east": {"uv": [9, 11, 9.5, 11.5], "texture": "#0"}, + "south": {"uv": [0, 3, 2, 3.5], "texture": "#0"}, + "west": {"uv": [11.5, 11, 12, 11.5], "texture": "#0"}, + "up": {"uv": [7, 15.5, 9, 16], "texture": "#0"}, + "down": {"uv": [4, 5.5, 6, 6], "texture": "#0"} + } + }, + { + "from": [6.125, 7, 3.125], + "to": [9.875, 8, 4], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 6, 2]}, + "faces": { + "north": {"uv": [9.5, 10.5, 11.5, 11], "texture": "#0"}, + "east": {"uv": [9, 10.5, 9.5, 11], "texture": "#0"}, + "south": {"uv": [4, 5, 5.875, 5.5], "texture": "#0"}, + "west": {"uv": [11.5, 10.5, 12, 11], "texture": "#0"}, + "up": {"uv": [4, 4, 5.875, 4.4375], "texture": "#0"}, + "down": {"uv": [4, 4.5, 5.875, 4.9375], "texture": "#0"} + } + }, + { + "from": [6, 8, 3], + "to": [10, 8.585, 4], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 7, 2]}, + "faces": { + "north": {"uv": [9.5, 10, 11.5, 10.2925], "texture": "#0"}, + "east": {"uv": [9, 10, 9.5, 10.2925], "texture": "#0"}, + "south": {"uv": [0, 0, 2, 0.2925], "texture": "#0"}, + "west": {"uv": [11.5, 10, 12, 10.2925], "texture": "#0"}, + "up": {"uv": [0, 3.5, 2, 4], "texture": "#0"}, + "down": {"uv": [7, 15, 9, 15.5], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [0, 3.25, 0] + }, + "thirdperson_lefthand": { + "translation": [0, 3.25, 0] + }, + "firstperson_righthand": { + "rotation": [0, 5, 0], + "translation": [-0.25, 4.25, 0] + }, + "firstperson_lefthand": { + "rotation": [0, 5, 0], + "translation": [-0.25, 4.25, 0] + }, + "ground": { + "rotation": [0, -39.5, 90], + "translation": [-1.25, -1.25, -1.5] + }, + "gui": { + "rotation": [180, -61.75, 178], + "translation": [0.5, 3.25, 0], + "scale": [1.3, 1.3, 1.3] + }, + "head": { + "rotation": [0, 0, 90], + "translation": [-3, 10.5, 0.25], + "scale": [2, 2, 2] + }, + "fixed": { + "rotation": [0, 90, 0], + "translation": [0, 3.5, 1], + "scale": [1.5, 1.5, 1.5] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/sfm/textures/block/fancy_cable.png b/src/main/resources/assets/sfm/textures/block/fancy_cable.png new file mode 100644 index 000000000..0592101eb Binary files /dev/null and b/src/main/resources/assets/sfm/textures/block/fancy_cable.png differ diff --git a/src/main/resources/assets/sfm/textures/block/fancy_cable.png.mcmeta b/src/main/resources/assets/sfm/textures/block/fancy_cable.png.mcmeta new file mode 100644 index 000000000..5b0125970 --- /dev/null +++ b/src/main/resources/assets/sfm/textures/block/fancy_cable.png.mcmeta @@ -0,0 +1,16 @@ +{ + "animation": { + "frametime": 16, + "interpolate": true, + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/sfm/textures/block/manager_bot.png b/src/main/resources/assets/sfm/textures/block/manager_bot.png index b51305916..3d367b067 100644 Binary files a/src/main/resources/assets/sfm/textures/block/manager_bot.png and b/src/main/resources/assets/sfm/textures/block/manager_bot.png differ diff --git a/src/main/resources/assets/sfm/textures/block/manager_bot.png.mcmeta b/src/main/resources/assets/sfm/textures/block/manager_bot.png.mcmeta new file mode 100644 index 000000000..f2d051654 --- /dev/null +++ b/src/main/resources/assets/sfm/textures/block/manager_bot.png.mcmeta @@ -0,0 +1,20 @@ +{ + "animation": { + "frametime": 2, + "interpolate": false, + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/sfm/textures/block/manager_side.png b/src/main/resources/assets/sfm/textures/block/manager_side.png index 4b210518f..3d367b067 100644 Binary files a/src/main/resources/assets/sfm/textures/block/manager_side.png and b/src/main/resources/assets/sfm/textures/block/manager_side.png differ diff --git a/src/main/resources/assets/sfm/textures/block/manager_side.png.mcmeta b/src/main/resources/assets/sfm/textures/block/manager_side.png.mcmeta new file mode 100644 index 000000000..f2d051654 --- /dev/null +++ b/src/main/resources/assets/sfm/textures/block/manager_side.png.mcmeta @@ -0,0 +1,20 @@ +{ + "animation": { + "frametime": 2, + "interpolate": false, + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/sfm/textures/block/manager_top.png b/src/main/resources/assets/sfm/textures/block/manager_top.png index c710ffa9c..7a8e75eca 100644 Binary files a/src/main/resources/assets/sfm/textures/block/manager_top.png and b/src/main/resources/assets/sfm/textures/block/manager_top.png differ diff --git a/src/main/resources/assets/sfm/textures/block/manager_top.png.mcmeta b/src/main/resources/assets/sfm/textures/block/manager_top.png.mcmeta new file mode 100644 index 000000000..b91f8711b --- /dev/null +++ b/src/main/resources/assets/sfm/textures/block/manager_top.png.mcmeta @@ -0,0 +1,10 @@ +{ + "animation": { + "frametime": 8, + "interpolate": false, + "frames": [ + 0, + 1 + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/sfm/textures/item/disk.png b/src/main/resources/assets/sfm/textures/item/disk.png index 373f0f3a7..0147cb0c1 100644 Binary files a/src/main/resources/assets/sfm/textures/item/disk.png and b/src/main/resources/assets/sfm/textures/item/disk.png differ diff --git a/src/main/resources/assets/sfm/textures/item/labelgun.png b/src/main/resources/assets/sfm/textures/item/labelgun.png deleted file mode 100644 index ae4799238..000000000 Binary files a/src/main/resources/assets/sfm/textures/item/labelgun.png and /dev/null differ diff --git a/src/main/resources/assets/sfm/textures/item/labelgun2d.png b/src/main/resources/assets/sfm/textures/item/labelgun2d.png new file mode 100644 index 000000000..3d94362c4 Binary files /dev/null and b/src/main/resources/assets/sfm/textures/item/labelgun2d.png differ diff --git a/src/main/resources/assets/sfm/textures/item/labelgun3d.png b/src/main/resources/assets/sfm/textures/item/labelgun3d.png new file mode 100644 index 000000000..60f192320 Binary files /dev/null and b/src/main/resources/assets/sfm/textures/item/labelgun3d.png differ