diff --git a/src/generated/resources/assets/naturesaura/blockstates/item_distributor.json b/src/generated/resources/assets/naturesaura/blockstates/item_distributor.json new file mode 100644 index 00000000..620230fa --- /dev/null +++ b/src/generated/resources/assets/naturesaura/blockstates/item_distributor.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "naturesaura:block/item_distributor" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/item_distributor.json b/src/generated/resources/assets/naturesaura/models/block/item_distributor.json new file mode 100644 index 00000000..239f3257 --- /dev/null +++ b/src/generated/resources/assets/naturesaura/models/block/item_distributor.json @@ -0,0 +1,8 @@ +{ + "parent": "block/cube_bottom_top", + "textures": { + "side": "naturesaura:block/item_distributor", + "bottom": "naturesaura:block/item_distributor_bottom", + "top": "naturesaura:block/item_distributor_top" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/item/item_distributor.json b/src/generated/resources/assets/naturesaura/models/item/item_distributor.json new file mode 100644 index 00000000..108ca2be --- /dev/null +++ b/src/generated/resources/assets/naturesaura/models/item/item_distributor.json @@ -0,0 +1,3 @@ +{ + "parent": "naturesaura:block/item_distributor" +} \ No newline at end of file diff --git a/src/generated/resources/data/naturesaura/loot_tables/blocks/item_distributor.json b/src/generated/resources/data/naturesaura/loot_tables/blocks/item_distributor.json new file mode 100644 index 00000000..7eb11852 --- /dev/null +++ b/src/generated/resources/data/naturesaura/loot_tables/blocks/item_distributor.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "naturesaura:item_distributor" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockItemDistributor.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockItemDistributor.java index 5a67519d..33d0957b 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockItemDistributor.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockItemDistributor.java @@ -1,6 +1,8 @@ package de.ellpeck.naturesaura.blocks; import de.ellpeck.naturesaura.blocks.tiles.TileEntityItemDistributor; +import de.ellpeck.naturesaura.data.BlockStateGenerator; +import de.ellpeck.naturesaura.reg.ICustomBlockState; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.entity.player.PlayerEntity; @@ -11,7 +13,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.world.World; -public class BlockItemDistributor extends BlockContainerImpl { +public class BlockItemDistributor extends BlockContainerImpl implements ICustomBlockState { public BlockItemDistributor() { super("item_distributor", TileEntityItemDistributor::new, ModBlocks.prop(Blocks.FURNACE)); @@ -31,4 +33,12 @@ public class BlockItemDistributor extends BlockContainerImpl { } return ActionResultType.SUCCESS; } + + @Override + public void generateCustomBlockState(BlockStateGenerator generator) { + generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(), + generator.modLoc("block/" + this.getBaseName()), + generator.modLoc("block/" + this.getBaseName() + "_bottom"), + generator.modLoc("block/" + this.getBaseName() + "_top"))); + } } diff --git a/src/main/resources/assets/naturesaura/lang/en_us.json b/src/main/resources/assets/naturesaura/lang/en_us.json index af4208a2..bd7226a5 100644 --- a/src/main/resources/assets/naturesaura/lang/en_us.json +++ b/src/main/resources/assets/naturesaura/lang/en_us.json @@ -57,6 +57,7 @@ "block.naturesaura.nether_wart_mushroom": "Nether Wart Mushroom", "block.naturesaura.animal_container": "Corporeal Eye", "block.naturesaura.snow_creator": "Winter's Calling", + "block.naturesaura.item_distributor": "Item Distributor", "item.naturesaura.eye": "Environmental Eye", "item.naturesaura.eye_improved": "Environmental Ocular", "item.naturesaura.gold_fiber": "Brilliant Fiber", diff --git a/src/main/resources/assets/naturesaura/textures/block/item_distributor.png b/src/main/resources/assets/naturesaura/textures/block/item_distributor.png new file mode 100644 index 00000000..8e7139e3 Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/block/item_distributor.png differ diff --git a/src/main/resources/assets/naturesaura/textures/block/item_distributor_bottom.png b/src/main/resources/assets/naturesaura/textures/block/item_distributor_bottom.png new file mode 100644 index 00000000..da42ca0c Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/block/item_distributor_bottom.png differ diff --git a/src/main/resources/assets/naturesaura/textures/block/item_distributor_top.png b/src/main/resources/assets/naturesaura/textures/block/item_distributor_top.png new file mode 100644 index 00000000..d6334287 Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/block/item_distributor_top.png differ diff --git a/src/main/resources/data/naturesaura/patchouli_books/book/en_us/entries/devices/item_distributor.json b/src/main/resources/data/naturesaura/patchouli_books/book/en_us/entries/devices/item_distributor.json new file mode 100644 index 00000000..6acbf821 --- /dev/null +++ b/src/main/resources/data/naturesaura/patchouli_books/book/en_us/entries/devices/item_distributor.json @@ -0,0 +1,21 @@ +{ + "name": "Item Distributor", + "icon": "naturesaura:item_distributor", + "category": "devices", + "advancement": "naturesaura:infused_materials", + "pages": [ + { + "type": "text", + "text": "In a time long past, non-botanic scientists had created an actual addition to the world: The $(item)Item Distributor$(). Yet back in the day, its state was far less than functioning, but $(aura) turned this around by infusing the materials with the required power to move items by a designated pattern.$(br)The $(item)Item Distributor$() will take any items from containers that are placed $(thing)on top$() of it and" + }, + { + "type": "text", + "text": "distribute them $(thing)equally$() throughout all of the containers that are placed $(thing)on the sides$() of it. Additionally, when having an $(l:items/eye)Environmental Eye$() equipped, the distributor is able to be switched into $(thing)random mode$() simply by sneaking and interacting with it. Following this action, items will not be distributed into the inventories equally, but randomly. This can be useful, for example, for redstone contraptions that require randomness." + }, + { + "type": "crafting", + "text": "Creating the $(item)Item Distributor$()", + "recipe": "naturesaura:item_distributor" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/item_distributor.json b/src/main/resources/data/naturesaura/recipes/item_distributor.json new file mode 100644 index 00000000..29e715df --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/item_distributor.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "SSS", + "I I", + "SSS" + ], + "key": { + "S": { + "item": "naturesaura:infused_stone" + }, + "I": { + "item": "naturesaura:infused_iron" + } + }, + "result": { + "item": "naturesaura:item_distributor" + } +} \ No newline at end of file