Added Redstone Kiln (block only)
parent
0a7f40b29f
commit
894754b028
|
@ -0,0 +1,101 @@
|
|||
package net.einsteinsci.betterbeginnings.blocks;
|
||||
|
||||
import net.einsteinsci.betterbeginnings.ModMain;
|
||||
import net.einsteinsci.betterbeginnings.gui.BBGuiHandler;
|
||||
import net.einsteinsci.betterbeginnings.register.RegisterBlocks;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockRedstoneKiln extends BlockSpecializedFurnace
|
||||
{
|
||||
public BlockRedstoneKiln(boolean lit)
|
||||
{
|
||||
super(Material.rock);
|
||||
|
||||
if (lit)
|
||||
{
|
||||
setLightLevel(0.875F);
|
||||
}
|
||||
else
|
||||
{
|
||||
setLightLevel(0F);
|
||||
setCreativeTab(ModMain.tabBetterBeginnings);
|
||||
}
|
||||
|
||||
setUnlocalizedName(getName());
|
||||
|
||||
setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
|
||||
setHardness(2.0f);
|
||||
setResistance(10.0f);
|
||||
|
||||
isLit = lit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return isLit ? "redstoneKilnLit" : "redstoneKiln";
|
||||
}
|
||||
|
||||
public static void updateBlockState(boolean lit, World world, BlockPos pos)
|
||||
{
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
TileEntity tileEntity = world.getTileEntity(pos);
|
||||
|
||||
if (lit)
|
||||
{
|
||||
world.setBlockState(pos, RegisterBlocks.redstoneKilnLit.getDefaultState()
|
||||
.withProperty(FACING, state.getValue(FACING)), 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
world.setBlockState(pos, RegisterBlocks.redstoneKiln.getDefaultState()
|
||||
.withProperty(FACING, state.getValue(FACING)), 3);
|
||||
}
|
||||
|
||||
if (tileEntity != null)
|
||||
{
|
||||
tileEntity.validate();
|
||||
world.setTileEntity(pos, tileEntity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random rand, int par3)
|
||||
{
|
||||
return Item.getItemFromBlock(RegisterBlocks.redstoneKiln);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side,
|
||||
float clickX, float clickY, float clickZ)
|
||||
{
|
||||
//player.openGui(ModMain.modInstance, BBGuiHandler.OBSIDIANKILN_ID, world, pos.getX(), pos.getY(), pos.getZ());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, BlockPos pos)
|
||||
{
|
||||
return Item.getItemFromBlock(RegisterBlocks.redstoneKiln);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int par2)
|
||||
{
|
||||
//return new TileEntityObsidianKiln();
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -40,6 +40,7 @@ public class NEIConfig implements IConfigureNEI
|
|||
API.hideItem(new ItemStack(RegisterBlocks.obsidianKilnLit));
|
||||
API.hideItem(new ItemStack(RegisterBlocks.netherBrickOvenLit));
|
||||
API.hideItem(new ItemStack(RegisterBlocks.enderSmelterLit));
|
||||
API.hideItem(new ItemStack(RegisterBlocks.redstoneKilnLit));
|
||||
|
||||
API.hideItem(new ItemStack(RegisterBlocks.campfireLit));
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@ public class RegisterBlocks
|
|||
public static final BlockNetherBrickOven netherBrickOvenLit = new BlockNetherBrickOven(true);
|
||||
public static final BlockEnderSmelter enderSmelter = new BlockEnderSmelter(false);
|
||||
public static final BlockEnderSmelter enderSmelterLit = new BlockEnderSmelter(true);
|
||||
public static final BlockRedstoneKiln redstoneKiln = new BlockRedstoneKiln(false);
|
||||
public static final BlockRedstoneKiln redstoneKilnLit = new BlockRedstoneKiln(true);
|
||||
|
||||
public static final List<Block> allBlocks = new ArrayList<>();
|
||||
|
||||
|
@ -56,6 +58,9 @@ public class RegisterBlocks
|
|||
RegisterHelper.registerBlock(enderSmelter);
|
||||
RegisterHelper.registerBlock(enderSmelterLit);
|
||||
|
||||
RegisterHelper.registerBlock(redstoneKiln);
|
||||
RegisterHelper.registerBlock(redstoneKilnLit);
|
||||
|
||||
oreDictionary();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"variants": {
|
||||
"facing=north": {
|
||||
"model": "betterbeginnings:redstoneKiln"
|
||||
},
|
||||
"facing=south": {
|
||||
"model": "betterbeginnings:redstoneKiln",
|
||||
"y": 180
|
||||
},
|
||||
"facing=west": {
|
||||
"model": "betterbeginnings:redstoneKiln",
|
||||
"y": 270
|
||||
},
|
||||
"facing=east": {
|
||||
"model": "betterbeginnings:redstoneKiln",
|
||||
"y": 90
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"variants": {
|
||||
"facing=north": {
|
||||
"model": "betterbeginnings:redstoneKilnLit"
|
||||
},
|
||||
"facing=south": {
|
||||
"model": "betterbeginnings:redstoneKilnLit",
|
||||
"y": 180
|
||||
},
|
||||
"facing=west": {
|
||||
"model": "betterbeginnings:redstoneKilnLit",
|
||||
"y": 270
|
||||
},
|
||||
"facing=east": {
|
||||
"model": "betterbeginnings:redstoneKilnLit",
|
||||
"y": 90
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,6 +13,8 @@ tile.netherBrickOven.name=Nether Brick Oven
|
|||
tile.netherBrickOvenLit.name=Nether Brick Oven (Lit)
|
||||
tile.enderSmelter.name=Ender Smelter
|
||||
tile.enderSmelterLit.name=Ender Smelter (Lit)
|
||||
tile.redstoneKiln.name=Redstone Kiln
|
||||
tile.redstoneKilnLit.name=Redstone Kiln (Lit)
|
||||
tile.campfire.name=Campfire
|
||||
tile.campfireLit.name=Campfire (Lit)
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"parent": "block/orientable",
|
||||
"textures": {
|
||||
"top": "betterbeginnings:blocks/redstoneKilnTop",
|
||||
"front": "betterbeginnings:blocks/redstoneKilnUnlit",
|
||||
"side": "betterbeginnings:blocks/redstoneKilnSide"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"parent": "block/orientable",
|
||||
"textures": {
|
||||
"top": "betterbeginnings:blocks/redstoneKilnTop",
|
||||
"front": "betterbeginnings:blocks/redstoneKilnLit",
|
||||
"side": "betterbeginnings:blocks/redstoneKilnSide"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"parent": "betterbeginnings:block/redstoneKiln",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [
|
||||
10,
|
||||
-45,
|
||||
170
|
||||
],
|
||||
"translation": [
|
||||
0,
|
||||
1.5,
|
||||
-2.75
|
||||
],
|
||||
"scale": [
|
||||
0.375,
|
||||
0.375,
|
||||
0.375
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"parent": "betterbeginnings:block/redstoneKilnLit",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [
|
||||
10,
|
||||
-45,
|
||||
170
|
||||
],
|
||||
"translation": [
|
||||
0,
|
||||
1.5,
|
||||
-2.75
|
||||
],
|
||||
"scale": [
|
||||
0.375,
|
||||
0.375,
|
||||
0.375
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 799 B |
Binary file not shown.
After Width: | Height: | Size: 612 B |
Binary file not shown.
After Width: | Height: | Size: 574 B |
Binary file not shown.
After Width: | Height: | Size: 527 B |
Loading…
Reference in New Issue