From b2192cc8626feb005d488910ba651dd1bb35afc0 Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 10 Jan 2019 09:44:31 +0200 Subject: [PATCH] Added sugar blocks --- .../com/minelittlepony/unicopia/UBlocks.java | 4 +++ .../com/minelittlepony/unicopia/UItems.java | 8 ++++- .../unicopia/block/BlockSugar.java | 34 ++++++++++++++++++ .../unicopia/blockstates/sugar_block.json | 5 +++ .../resources/assets/unicopia/lang/en_US.lang | 2 ++ .../unicopia/models/block/sugar_block.json | 6 ++++ .../unicopia/models/item/sugar_block.json | 3 ++ .../assets/unicopia/recipes/sugar.json | 14 ++++++++ .../assets/unicopia/recipes/sugar_block.json | 27 ++++++++++++++ .../assets/unicopia/recipes/sugar_cereal.json | 21 +++++++++++ .../unicopia/textures/blocks/sugar_block.png | Bin 0 -> 3240 bytes 11 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/minelittlepony/unicopia/block/BlockSugar.java create mode 100644 src/main/resources/assets/unicopia/blockstates/sugar_block.json create mode 100644 src/main/resources/assets/unicopia/models/block/sugar_block.json create mode 100644 src/main/resources/assets/unicopia/models/item/sugar_block.json create mode 100644 src/main/resources/assets/unicopia/recipes/sugar.json create mode 100644 src/main/resources/assets/unicopia/recipes/sugar_block.json create mode 100644 src/main/resources/assets/unicopia/recipes/sugar_cereal.json create mode 100644 src/main/resources/assets/unicopia/textures/blocks/sugar_block.png 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 0000000000000000000000000000000000000000..afefe287d6095601ed2039c8f6c012fb4dbfb05e GIT binary patch literal 3240 zcmV;Z3|I4sP)uJ@VVD_UC<6{NG_fI~0ue<-1QkJoA_k0xBC#Thg@9ne9*`iQ#9$Or zQF$}6R&?d%y_c8YA7_1QpS|}zXYYO1x&V;8{kgn!SPFnNo`4_X6{c}T{8k*B#$jdxfFg<9uYy1K45IaYvHg`_dOZM)Sy63ve6hvv z1)yUy0P^?0*fb9UASvow`@mQCp^4`uNg&9uGcn1|&Nk+9SjOUl{-OWr@Hh0;_l(8q z{wNRKos+;6rV8ldy0Owz(}jF`W(JeRp&R{qi2rfmU!TJ;gp(Kmm5I1s5m_f-n#TRsj}B0%?E`vOzxB2#P=n*a3EfYETOrKoe*ICqM@{4K9Go;5xVgZi5G4 z1dM~{UdP6d+Yd3o?MrAqM0Kc|iV92owdyL5UC#5<>aVCa44|hpM4E zs0sQWIt5*Tu0n&*J!lk~f_{hI!w5`*sjxDv4V%CW*ah~3!{C*0BD@;TgA3v9a1~q+ zAA{TB3-ERLHar49hi4Ih5D^-ph8Q6X#0?2VqLBoIkE}zAkxHZUgRb+f=nat zP#6>iMMoK->`~sRLq)(kHo*Vn{;LcG6+edD1=7D>9j^O?D{Qg|tCDK{ym)H7&wDr6*;uGTJg8GHjVbnL{!cWyUB7MT6o-VNo_w8Yq`2<5Ub)hw4L3rj}5@qxMs0 zWMyP6Wy582WNT#4$d1qunl{acmP#w5ouJ*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