Added sugar blocks

This commit is contained in:
Sollace 2019-01-10 09:44:31 +02:00
parent 5fac95002a
commit b2192cc862
11 changed files with 123 additions and 1 deletions

View file

@ -5,6 +5,7 @@ import com.minelittlepony.unicopia.block.BlockCloud;
import com.minelittlepony.unicopia.block.BlockCloudAnvil; import com.minelittlepony.unicopia.block.BlockCloudAnvil;
import com.minelittlepony.unicopia.block.BlockCloudSlab; import com.minelittlepony.unicopia.block.BlockCloudSlab;
import com.minelittlepony.unicopia.block.BlockCloudStairs; import com.minelittlepony.unicopia.block.BlockCloudStairs;
import com.minelittlepony.unicopia.block.BlockSugar;
import com.minelittlepony.unicopia.block.BlockTomatoPlant; import com.minelittlepony.unicopia.block.BlockTomatoPlant;
import com.minelittlepony.unicopia.block.BlockCloudDoor; import com.minelittlepony.unicopia.block.BlockCloudDoor;
import com.minelittlepony.unicopia.block.BlockCloudFarm; 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 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<Block> registry) { static void registerBlocks(IForgeRegistry<Block> registry) {
registry.registerAll(cloud, cloud_stairs, double_cloud_slab, cloud_slab, mist_door, anvil, cloud_farmland, registry.registerAll(cloud, cloud_stairs, double_cloud_slab, cloud_slab, mist_door, anvil, cloud_farmland,
sugar_block,
alfalfa, alfalfa,
tomato_plant); tomato_plant);
} }

View file

@ -22,6 +22,7 @@ import net.minecraft.init.Blocks;
import net.minecraft.init.Enchantments; import net.minecraft.init.Enchantments;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemDoor; import net.minecraft.item.ItemDoor;
import net.minecraft.item.ItemFood; import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemSeedFood; import net.minecraft.item.ItemSeedFood;
@ -76,6 +77,10 @@ public class UItems {
.setTranslationKey("mist_door") .setTranslationKey("mist_door")
.setRegistryName(Unicopia.MODID, "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) public static final Item cloud_slab = new UItemSlab(UBlocks.cloud_slab, UBlocks.cloud_slab, UBlocks.double_cloud_slab, INTERACT_WITH_CLOUDS)
.setTranslationKey("cloud_slab") .setTranslationKey("cloud_slab")
.setRegistryName(Unicopia.MODID, "cloud_slab"); .setRegistryName(Unicopia.MODID, "cloud_slab");
@ -116,7 +121,7 @@ public class UItems {
mist_door, anvil, mist_door, anvil,
bag_of_holding, spell, curse, bag_of_holding, spell, curse,
alfalfa_seeds, alfalfa_leaves, alfalfa_seeds, alfalfa_leaves,
cereal, sugar_cereal, cereal, sugar_cereal, sugar_block,
cloudsdale_tomato, tomato_seeds, tomato); cloudsdale_tomato, tomato_seeds, tomato);
@ -138,6 +143,7 @@ public class UItems {
registerAllVariants(alfalfa_leaves, "alfalfa_leaves"); registerAllVariants(alfalfa_leaves, "alfalfa_leaves");
registerAllVariants(cereal, "cereal"); registerAllVariants(cereal, "cereal");
registerAllVariants(sugar_cereal, "sugar_cereal"); registerAllVariants(sugar_cereal, "sugar_cereal");
registerAllVariants(sugar_block, "sugar_block");
registerAllVariants(tomato, "tomato", "rotten_tomato"); registerAllVariants(tomato, "tomato", "rotten_tomato");
registerAllVariants(cloudsdale_tomato, "cloudsdale_tomato", "rotten_cloudsdale_tomato"); registerAllVariants(cloudsdale_tomato, "cloudsdale_tomato", "rotten_cloudsdale_tomato");
registerAllVariants(tomato_seeds, "tomato_seeds"); registerAllVariants(tomato_seeds, "tomato_seeds");

View file

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

View file

@ -0,0 +1,5 @@
{
"variants": {
"variant=normal": { "model": "unicopia:sugar_block" }
}
}

View file

@ -9,6 +9,8 @@ tile.cloud_slab.enchanted.name=Enchanted Cloud Slab
tile.cloud_stairs.name=Cloud Stairs tile.cloud_stairs.name=Cloud Stairs
tile.cloud_farmland.name=Tilled Clouds tile.cloud_farmland.name=Tilled Clouds
tile.sugar_block.name=Block of Sugar
item.cloud_matter.name=Lump of Cloud item.cloud_matter.name=Lump of Cloud
item.cloud.small.name=Bucking Bronco item.cloud.small.name=Bucking Bronco
item.cloud.medium.name=Construction Cloud item.cloud.medium.name=Construction Cloud

View file

@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "unicopia:blocks/sugar_block"
}
}

View file

@ -0,0 +1,3 @@
{
"parent": "unicopia:block/sugar_block"
}

View file

@ -0,0 +1,14 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "unicopia:sugar_block",
"data": 0
}
],
"result": {
"item": "minecraft:sugar",
"count": 9,
"data": 0
}
}

View file

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

View file

@ -0,0 +1,21 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"###",
"###",
"###"
],
"key": {
"#": [
{
"item": "minecraft:sugar",
"data": 0
}
]
},
"result": {
"item": "unicopia:sugar_block",
"data": 0,
"count": 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB