Added storage buffer, textures thanks to Spearkiller. Thanks to Ayutac

Tested a bit, but I would like additional testing by someone else.
This commit is contained in:
Ayutac 2022-05-05 11:04:36 +02:00 committed by GitHub
parent 0cbcc3a93a
commit 6a91757791
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 99 additions and 3 deletions

View file

@ -50,7 +50,7 @@ public class StorageUnitBlock extends BlockMachineBase {
public final TRContent.StorageUnit unitType; public final TRContent.StorageUnit unitType;
public StorageUnitBlock(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; this.unitType = unitType;
} }

View file

@ -302,6 +302,7 @@ public class TRContent {
} }
public enum StorageUnit implements ItemConvertible { public enum StorageUnit implements ItemConvertible {
BUFFER(1),
CRUDE(TechRebornConfig.crudeStorageUnitMaxStorage), CRUDE(TechRebornConfig.crudeStorageUnitMaxStorage),
BASIC(TechRebornConfig.basicStorageUnitMaxStorage), BASIC(TechRebornConfig.basicStorageUnitMaxStorage),
ADVANCED(TechRebornConfig.advancedStorageUnitMaxStorage), ADVANCED(TechRebornConfig.advancedStorageUnitMaxStorage),
@ -312,7 +313,7 @@ public class TRContent {
public final String name; public final String name;
public final Block block; public final Block block;
// How many blocks it can hold // How many items it can hold
public int capacity; public int capacity;
@ -321,7 +322,10 @@ public class TRContent {
block = new StorageUnitBlock(this); block = new StorageUnitBlock(this);
this.capacity = capacity; 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 @Override

View file

@ -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 }
}
}

View file

@ -7,6 +7,7 @@
"block.techreborn.gas_turbine": "Gas Turbine", "block.techreborn.gas_turbine": "Gas Turbine",
"block.techreborn.thermal_generator": "Thermal Generator", "block.techreborn.thermal_generator": "Thermal Generator",
"block.techreborn.storage_buffer": "Storage Buffer",
"block.techreborn.crude_storage_unit": "Crude Storage Unit", "block.techreborn.crude_storage_unit": "Crude Storage Unit",
"block.techreborn.basic_storage_unit": "Basic Storage Unit", "block.techreborn.basic_storage_unit": "Basic Storage Unit",
"block.techreborn.advanced_storage_unit": "Advanced Storage Unit", "block.techreborn.advanced_storage_unit": "Advanced Storage Unit",

View file

@ -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"
}
}

View file

@ -0,0 +1,4 @@
{
"parent": "techreborn:block/machines/tier0_machines/storage_buffer"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"techreborn:crafting_table/unit/storage/storage_buffer"
]
},
"criteria": {
"has_wood_plate": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "c:wood_plates"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "techreborn:crafting_table/unit/storage/storage_buffer"
}
}
},
"requirements": [
[
"has_wood_plate",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,19 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "techreborn:storage_buffer"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View file

@ -0,0 +1,19 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"WWW",
"WPW",
"WWW"
],
"key": {
"P": {
"item": "minecraft:paper"
},
"W": {
"tag": "c:wood_plates"
}
},
"result": {
"item": "techreborn:storage_buffer"
}
}