|
@@ -1,6 +1,5 @@
|
|
package me.km.blocks;
|
|
package me.km.blocks;
|
|
|
|
|
|
-import me.km.KajetansMod;
|
|
|
|
import me.km.blocks.cookingpot.BlockCookingPot;
|
|
import me.km.blocks.cookingpot.BlockCookingPot;
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.block.Block.Properties;
|
|
import net.minecraft.block.Block.Properties;
|
|
@@ -9,14 +8,11 @@ import net.minecraft.block.material.Material;
|
|
import net.minecraft.block.material.MaterialColor;
|
|
import net.minecraft.block.material.MaterialColor;
|
|
import net.minecraft.block.BlockState;
|
|
import net.minecraft.block.BlockState;
|
|
import net.minecraft.block.Blocks;
|
|
import net.minecraft.block.Blocks;
|
|
|
|
+import net.minecraft.block.FireBlock;
|
|
import net.minecraft.block.LeavesBlock;
|
|
import net.minecraft.block.LeavesBlock;
|
|
-import net.minecraft.fluid.FlowingFluid;
|
|
|
|
-import net.minecraft.fluid.Fluid;
|
|
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.item.BlockItem;
|
|
import net.minecraft.item.BlockItem;
|
|
import net.minecraft.item.ItemGroup;
|
|
import net.minecraft.item.ItemGroup;
|
|
-import net.minecraft.potion.Effect;
|
|
|
|
-import net.minecraft.potion.Effects;
|
|
|
|
import net.minecraftforge.registries.IForgeRegistry;
|
|
import net.minecraftforge.registries.IForgeRegistry;
|
|
|
|
|
|
public class ModBlocks
|
|
public class ModBlocks
|
|
@@ -73,6 +69,13 @@ public class ModBlocks
|
|
public static Block pearSapling;
|
|
public static Block pearSapling;
|
|
public static Block plumSapling;
|
|
public static Block plumSapling;
|
|
|
|
|
|
|
|
+ // bookshelves
|
|
|
|
+ public static Block bookshelfAcacia;
|
|
|
|
+ public static Block bookshelfBirch;
|
|
|
|
+ public static Block bookshelfDarkOak;
|
|
|
|
+ public static Block bookshelfJungle;
|
|
|
|
+ public static Block bookshelfSpruce;
|
|
|
|
+
|
|
private static Block create(String registry, Material m, float hardness, float resistance)
|
|
private static Block create(String registry, Material m, float hardness, float resistance)
|
|
{
|
|
{
|
|
Block b = new Block(Properties.create(m).hardnessAndResistance(hardness, resistance));
|
|
Block b = new Block(Properties.create(m).hardnessAndResistance(hardness, resistance));
|
|
@@ -117,6 +120,13 @@ public class ModBlocks
|
|
return b;
|
|
return b;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private static Block createBookshelf(String registry)
|
|
|
|
+ {
|
|
|
|
+ Block b = new BlockBookshelf();
|
|
|
|
+ b.setRegistryName(registry);
|
|
|
|
+ return b;
|
|
|
|
+ }
|
|
|
|
+
|
|
public static void initBlocks(IForgeRegistry<Block> r)
|
|
public static void initBlocks(IForgeRegistry<Block> r)
|
|
{
|
|
{
|
|
// ores + blocks
|
|
// ores + blocks
|
|
@@ -169,6 +179,31 @@ public class ModBlocks
|
|
apricotSapling = register(r, createSapling("apricot_sapling", Blocks.OAK_LOG.getDefaultState(), apricotLeaves.getDefaultState()));
|
|
apricotSapling = register(r, createSapling("apricot_sapling", Blocks.OAK_LOG.getDefaultState(), apricotLeaves.getDefaultState()));
|
|
pearSapling = register(r, createSapling("pear_sapling", Blocks.OAK_LOG.getDefaultState(), pearLeaves.getDefaultState()));
|
|
pearSapling = register(r, createSapling("pear_sapling", Blocks.OAK_LOG.getDefaultState(), pearLeaves.getDefaultState()));
|
|
plumSapling = register(r, createSapling("plum_sapling", Blocks.OAK_LOG.getDefaultState(), plumLeaves.getDefaultState()));
|
|
plumSapling = register(r, createSapling("plum_sapling", Blocks.OAK_LOG.getDefaultState(), plumLeaves.getDefaultState()));
|
|
|
|
+
|
|
|
|
+ // bookshelves
|
|
|
|
+ bookshelfAcacia = register(r, createBookshelf("bookshelf_acacia"));
|
|
|
|
+ bookshelfBirch = register(r, createBookshelf("bookshelf_birch"));
|
|
|
|
+ bookshelfDarkOak = register(r, createBookshelf("bookshelf_dark_oak"));
|
|
|
|
+ bookshelfJungle = register(r, createBookshelf("bookshelf_jungle"));
|
|
|
|
+ bookshelfSpruce = register(r, createBookshelf("bookshelf_spruce"));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ FireBlock fireblock = (FireBlock)Blocks.FIRE;
|
|
|
|
+ fireblock.setFireInfo(bookshelfAcacia, 30, 20);
|
|
|
|
+ fireblock.setFireInfo(bookshelfBirch, 30, 20);
|
|
|
|
+ fireblock.setFireInfo(bookshelfDarkOak, 30, 20);
|
|
|
|
+ fireblock.setFireInfo(bookshelfJungle, 30, 20);
|
|
|
|
+ fireblock.setFireInfo(bookshelfSpruce, 30, 20);
|
|
|
|
+ fireblock.setFireInfo(cherryLeaves, 30, 60);
|
|
|
|
+ fireblock.setFireInfo(apricotLeaves, 30, 60);
|
|
|
|
+ fireblock.setFireInfo(pearLeaves, 30, 60);
|
|
|
|
+ fireblock.setFireInfo(plumLeaves, 30, 60);
|
|
|
|
+ fireblock.setFireInfo(crateAcacia, 5, 5);
|
|
|
|
+ fireblock.setFireInfo(crateBigOak, 5, 5);
|
|
|
|
+ fireblock.setFireInfo(crateBirch, 5, 5);
|
|
|
|
+ fireblock.setFireInfo(crateJungle, 5, 5);
|
|
|
|
+ fireblock.setFireInfo(crateOak, 5, 5);
|
|
|
|
+ fireblock.setFireInfo(crateSpruce, 5, 5);
|
|
}
|
|
}
|
|
|
|
|
|
public static void initItemBlocks(IForgeRegistry<Item> r)
|
|
public static void initItemBlocks(IForgeRegistry<Item> r)
|
|
@@ -223,6 +258,13 @@ public class ModBlocks
|
|
register(r, apricotSapling, getItemBlock(apricotSapling, ItemGroup.BUILDING_BLOCKS));
|
|
register(r, apricotSapling, getItemBlock(apricotSapling, ItemGroup.BUILDING_BLOCKS));
|
|
register(r, pearSapling, getItemBlock(pearSapling, ItemGroup.BUILDING_BLOCKS));
|
|
register(r, pearSapling, getItemBlock(pearSapling, ItemGroup.BUILDING_BLOCKS));
|
|
register(r, plumSapling, getItemBlock(plumSapling, ItemGroup.BUILDING_BLOCKS));
|
|
register(r, plumSapling, getItemBlock(plumSapling, ItemGroup.BUILDING_BLOCKS));
|
|
|
|
+
|
|
|
|
+ // bookshelves
|
|
|
|
+ register(r, bookshelfAcacia, getItemBlock(bookshelfAcacia, ItemGroup.BUILDING_BLOCKS));
|
|
|
|
+ register(r, bookshelfBirch, getItemBlock(bookshelfBirch, ItemGroup.BUILDING_BLOCKS));
|
|
|
|
+ register(r, bookshelfDarkOak, getItemBlock(bookshelfDarkOak, ItemGroup.BUILDING_BLOCKS));
|
|
|
|
+ register(r, bookshelfJungle, getItemBlock(bookshelfJungle, ItemGroup.BUILDING_BLOCKS));
|
|
|
|
+ register(r, bookshelfSpruce, getItemBlock(bookshelfSpruce, ItemGroup.BUILDING_BLOCKS));
|
|
}
|
|
}
|
|
|
|
|
|
private static void register(IForgeRegistry<Item> r, Block block, Item itemBlock)
|
|
private static void register(IForgeRegistry<Item> r, Block block, Item itemBlock)
|