From 6a91757791689ee52dfeaa463a5f6c398b5e7625 Mon Sep 17 00:00:00 2001 From: Ayutac Date: Thu, 5 May 2022 11:04:36 +0200 Subject: [PATCH] Added storage buffer, textures thanks to Spearkiller. Thanks to Ayutac Tested a bit, but I would like additional testing by someone else. --- .../blocks/storage/item/StorageUnitBlock.java | 2 +- src/main/java/techreborn/init/TRContent.java | 8 +++-- .../blockstates/storage_buffer.json | 8 +++++ .../assets/techreborn/lang/en_us.json | 1 + .../tier0_machines/storage_buffer.json | 9 +++++ .../models/item/storage_buffer.json | 4 +++ .../tier0_machines/storage_buffer_bottom.png | Bin 0 -> 454 bytes .../tier0_machines/storage_buffer_front.png | Bin 0 -> 1108 bytes .../tier0_machines/storage_buffer_side.png | Bin 0 -> 588 bytes .../tier0_machines/storage_buffer_top.png | Bin 0 -> 454 bytes .../unit/storage/storage_buffer.json | 32 ++++++++++++++++++ .../loot_tables/blocks/storage_buffer.json | 19 +++++++++++ .../unit/storage/storage_buffer.json | 19 +++++++++++ 13 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 src/main/resources/assets/techreborn/blockstates/storage_buffer.json create mode 100644 src/main/resources/assets/techreborn/models/block/machines/tier0_machines/storage_buffer.json create mode 100644 src/main/resources/assets/techreborn/models/item/storage_buffer.json create mode 100644 src/main/resources/assets/techreborn/textures/block/machines/tier0_machines/storage_buffer_bottom.png create mode 100644 src/main/resources/assets/techreborn/textures/block/machines/tier0_machines/storage_buffer_front.png create mode 100644 src/main/resources/assets/techreborn/textures/block/machines/tier0_machines/storage_buffer_side.png create mode 100644 src/main/resources/assets/techreborn/textures/block/machines/tier0_machines/storage_buffer_top.png create mode 100644 src/main/resources/data/techreborn/advancements/recipes/crafting_table/unit/storage/storage_buffer.json create mode 100644 src/main/resources/data/techreborn/loot_tables/blocks/storage_buffer.json create mode 100644 src/main/resources/data/techreborn/recipes/crafting_table/unit/storage/storage_buffer.json diff --git a/src/main/java/techreborn/blocks/storage/item/StorageUnitBlock.java b/src/main/java/techreborn/blocks/storage/item/StorageUnitBlock.java index 1d2e6ce59..c65633b6f 100644 --- a/src/main/java/techreborn/blocks/storage/item/StorageUnitBlock.java +++ b/src/main/java/techreborn/blocks/storage/item/StorageUnitBlock.java @@ -50,7 +50,7 @@ public class StorageUnitBlock extends BlockMachineBase { public final TRContent.StorageUnit unitType; public StorageUnitBlock(TRContent.StorageUnit unitType) { - super((Settings.of(unitType.name.equals("crude") ? Material.WOOD : Material.METAL).strength(2.0F, 2.0F))); + super((Settings.of(unitType.name.equals("buffer") || unitType.name.equals("crude") ? Material.WOOD : Material.METAL).strength(2.0F, 2.0F))); this.unitType = unitType; } diff --git a/src/main/java/techreborn/init/TRContent.java b/src/main/java/techreborn/init/TRContent.java index d0c279496..40d3156ea 100644 --- a/src/main/java/techreborn/init/TRContent.java +++ b/src/main/java/techreborn/init/TRContent.java @@ -302,6 +302,7 @@ public class TRContent { } public enum StorageUnit implements ItemConvertible { + BUFFER(1), CRUDE(TechRebornConfig.crudeStorageUnitMaxStorage), BASIC(TechRebornConfig.basicStorageUnitMaxStorage), ADVANCED(TechRebornConfig.advancedStorageUnitMaxStorage), @@ -312,7 +313,7 @@ public class TRContent { public final String name; public final Block block; - // How many blocks it can hold + // How many items it can hold public int capacity; @@ -321,7 +322,10 @@ public class TRContent { block = new StorageUnitBlock(this); this.capacity = capacity; - InitUtils.setup(block, name + "_storage_unit"); + if (name.equals("buffer")) + InitUtils.setup(block, "storage_buffer"); + else + InitUtils.setup(block, name + "_storage_unit"); } @Override diff --git a/src/main/resources/assets/techreborn/blockstates/storage_buffer.json b/src/main/resources/assets/techreborn/blockstates/storage_buffer.json new file mode 100644 index 000000000..4625ea979 --- /dev/null +++ b/src/main/resources/assets/techreborn/blockstates/storage_buffer.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "techreborn:block/machines/tier0_machines/storage_buffer" }, + "facing=south": { "model": "techreborn:block/machines/tier0_machines/storage_buffer", "y": 180 }, + "facing=west": { "model": "techreborn:block/machines/tier0_machines/storage_buffer", "y": 270 }, + "facing=east": { "model": "techreborn:block/machines/tier0_machines/storage_buffer", "y": 90 } + } +} diff --git a/src/main/resources/assets/techreborn/lang/en_us.json b/src/main/resources/assets/techreborn/lang/en_us.json index 0379689dc..5c8fad24a 100644 --- a/src/main/resources/assets/techreborn/lang/en_us.json +++ b/src/main/resources/assets/techreborn/lang/en_us.json @@ -7,6 +7,7 @@ "block.techreborn.gas_turbine": "Gas Turbine", "block.techreborn.thermal_generator": "Thermal Generator", + "block.techreborn.storage_buffer": "Storage Buffer", "block.techreborn.crude_storage_unit": "Crude Storage Unit", "block.techreborn.basic_storage_unit": "Basic Storage Unit", "block.techreborn.advanced_storage_unit": "Advanced Storage Unit", diff --git a/src/main/resources/assets/techreborn/models/block/machines/tier0_machines/storage_buffer.json b/src/main/resources/assets/techreborn/models/block/machines/tier0_machines/storage_buffer.json new file mode 100644 index 000000000..d30604875 --- /dev/null +++ b/src/main/resources/assets/techreborn/models/block/machines/tier0_machines/storage_buffer.json @@ -0,0 +1,9 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "top": "techreborn:block/machines/tier0_machines/storage_buffer_top", + "front": "techreborn:block/machines/tier0_machines/storage_buffer_front", + "bottom": "techreborn:block/machines/tier0_machines/storage_buffer_bottom", + "side": "techreborn:block/machines/tier0_machines/storage_buffer_side" + } +} diff --git a/src/main/resources/assets/techreborn/models/item/storage_buffer.json b/src/main/resources/assets/techreborn/models/item/storage_buffer.json new file mode 100644 index 000000000..3966c863e --- /dev/null +++ b/src/main/resources/assets/techreborn/models/item/storage_buffer.json @@ -0,0 +1,4 @@ +{ + "parent": "techreborn:block/machines/tier0_machines/storage_buffer" +} + diff --git a/src/main/resources/assets/techreborn/textures/block/machines/tier0_machines/storage_buffer_bottom.png b/src/main/resources/assets/techreborn/textures/block/machines/tier0_machines/storage_buffer_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..dcb218f48fa3de7928921485f110923498ca270c GIT binary patch literal 454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