diff --git a/src/main/java/com/minelittlepony/unicopia/UBlocks.java b/src/main/java/com/minelittlepony/unicopia/UBlocks.java index 1365904d..8b91b0a9 100644 --- a/src/main/java/com/minelittlepony/unicopia/UBlocks.java +++ b/src/main/java/com/minelittlepony/unicopia/UBlocks.java @@ -5,6 +5,7 @@ import com.minelittlepony.unicopia.block.BlockCloud; import com.minelittlepony.unicopia.block.BlockCloudAnvil; import com.minelittlepony.unicopia.block.BlockCloudSlab; import com.minelittlepony.unicopia.block.BlockCloudStairs; +import com.minelittlepony.unicopia.block.BlockSugar; import com.minelittlepony.unicopia.block.BlockTomatoPlant; import com.minelittlepony.unicopia.block.BlockCloudDoor; import com.minelittlepony.unicopia.block.BlockCloudFarm; @@ -30,8 +31,11 @@ public class UBlocks { public static final BlockCloudFarm cloud_farmland = new BlockCloudFarm(Unicopia.MODID, "cloud_farmland"); + public static final Block sugar_block = new BlockSugar(Unicopia.MODID, "sugar_block"); + static void registerBlocks(IForgeRegistry registry) { registry.registerAll(cloud, cloud_stairs, double_cloud_slab, cloud_slab, mist_door, anvil, cloud_farmland, + sugar_block, alfalfa, tomato_plant); } diff --git a/src/main/java/com/minelittlepony/unicopia/UItems.java b/src/main/java/com/minelittlepony/unicopia/UItems.java index 7bfc7b88..e52babff 100644 --- a/src/main/java/com/minelittlepony/unicopia/UItems.java +++ b/src/main/java/com/minelittlepony/unicopia/UItems.java @@ -22,6 +22,7 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Enchantments; import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemDoor; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemSeedFood; @@ -76,6 +77,10 @@ public class UItems { .setTranslationKey("mist_door") .setRegistryName(Unicopia.MODID, "mist_door"); + public static final Item sugar_block = new ItemBlock(UBlocks.sugar_block) + .setTranslationKey("sugar_block") + .setRegistryName(Unicopia.MODID, "sugar_block"); + public static final Item cloud_slab = new UItemSlab(UBlocks.cloud_slab, UBlocks.cloud_slab, UBlocks.double_cloud_slab, INTERACT_WITH_CLOUDS) .setTranslationKey("cloud_slab") .setRegistryName(Unicopia.MODID, "cloud_slab"); @@ -116,7 +121,7 @@ public class UItems { mist_door, anvil, bag_of_holding, spell, curse, alfalfa_seeds, alfalfa_leaves, - cereal, sugar_cereal, + cereal, sugar_cereal, sugar_block, cloudsdale_tomato, tomato_seeds, tomato); @@ -138,6 +143,7 @@ public class UItems { registerAllVariants(alfalfa_leaves, "alfalfa_leaves"); registerAllVariants(cereal, "cereal"); registerAllVariants(sugar_cereal, "sugar_cereal"); + registerAllVariants(sugar_block, "sugar_block"); registerAllVariants(tomato, "tomato", "rotten_tomato"); registerAllVariants(cloudsdale_tomato, "cloudsdale_tomato", "rotten_cloudsdale_tomato"); registerAllVariants(tomato_seeds, "tomato_seeds"); diff --git a/src/main/java/com/minelittlepony/unicopia/block/BlockSugar.java b/src/main/java/com/minelittlepony/unicopia/block/BlockSugar.java new file mode 100644 index 00000000..c085c5b3 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/block/BlockSugar.java @@ -0,0 +1,34 @@ +package com.minelittlepony.unicopia.block; + +import java.util.Random; + +import net.minecraft.block.BlockFalling; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; + +public class BlockSugar extends BlockFalling { + + public BlockSugar(String domain, String name) { + super(Material.SAND); + setTranslationKey(name); + setRegistryName(domain, name); + + setSoundType(SoundType.SAND); + setCreativeTab(CreativeTabs.MATERIALS); + setHardness(0.7F); + } + + @Override + public int quantityDropped(Random random) { + return 9; + } + + @Override + public Item getItemDropped(IBlockState state, Random rand, int fortune) { + return Items.SUGAR; + } +} diff --git a/src/main/resources/assets/unicopia/blockstates/sugar_block.json b/src/main/resources/assets/unicopia/blockstates/sugar_block.json new file mode 100644 index 00000000..123e8309 --- /dev/null +++ b/src/main/resources/assets/unicopia/blockstates/sugar_block.json @@ -0,0 +1,5 @@ +{ + "variants": { + "variant=normal": { "model": "unicopia:sugar_block" } + } +} diff --git a/src/main/resources/assets/unicopia/lang/en_US.lang b/src/main/resources/assets/unicopia/lang/en_US.lang index f9cf89a7..ac6986ee 100644 --- a/src/main/resources/assets/unicopia/lang/en_US.lang +++ b/src/main/resources/assets/unicopia/lang/en_US.lang @@ -9,6 +9,8 @@ tile.cloud_slab.enchanted.name=Enchanted Cloud Slab tile.cloud_stairs.name=Cloud Stairs tile.cloud_farmland.name=Tilled Clouds +tile.sugar_block.name=Block of Sugar + item.cloud_matter.name=Lump of Cloud item.cloud.small.name=Bucking Bronco item.cloud.medium.name=Construction Cloud diff --git a/src/main/resources/assets/unicopia/models/block/sugar_block.json b/src/main/resources/assets/unicopia/models/block/sugar_block.json new file mode 100644 index 00000000..fa4597e9 --- /dev/null +++ b/src/main/resources/assets/unicopia/models/block/sugar_block.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "unicopia:blocks/sugar_block" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/models/item/sugar_block.json b/src/main/resources/assets/unicopia/models/item/sugar_block.json new file mode 100644 index 00000000..d39df35c --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/sugar_block.json @@ -0,0 +1,3 @@ +{ + "parent": "unicopia:block/sugar_block" +} diff --git a/src/main/resources/assets/unicopia/recipes/sugar.json b/src/main/resources/assets/unicopia/recipes/sugar.json new file mode 100644 index 00000000..3fee84c0 --- /dev/null +++ b/src/main/resources/assets/unicopia/recipes/sugar.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "unicopia:sugar_block", + "data": 0 + } + ], + "result": { + "item": "minecraft:sugar", + "count": 9, + "data": 0 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/unicopia/recipes/sugar_block.json b/src/main/resources/assets/unicopia/recipes/sugar_block.json new file mode 100644 index 00000000..c6c0c274 --- /dev/null +++ b/src/main/resources/assets/unicopia/recipes/sugar_block.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "###", + "#*#", + "###" + ], + "key": { + "#": [ + { + "item": "unicopia:sugar_block", + "data": 0 + } + ], + "*": [ + { + "item": "unicopia:cereal", + "data": 0 + } + ] + }, + "result": { + "item": "unicopia:sugar_cereal", + "data": 0, + "count": 1 + } +} diff --git a/src/main/resources/assets/unicopia/recipes/sugar_cereal.json b/src/main/resources/assets/unicopia/recipes/sugar_cereal.json new file mode 100644 index 00000000..ec276693 --- /dev/null +++ b/src/main/resources/assets/unicopia/recipes/sugar_cereal.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "###", + "###", + "###" + ], + "key": { + "#": [ + { + "item": "minecraft:sugar", + "data": 0 + } + ] + }, + "result": { + "item": "unicopia:sugar_block", + "data": 0, + "count": 1 + } +} diff --git a/src/main/resources/assets/unicopia/textures/blocks/sugar_block.png b/src/main/resources/assets/unicopia/textures/blocks/sugar_block.png new file mode 100644 index 00000000..afefe287 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/blocks/sugar_block.png differ