updated the blockstate
This commit is contained in:
@@ -9,6 +9,7 @@ import net.minecraft.entity.EntityLivingBase;
|
|||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumBlockRenderType;
|
import net.minecraft.util.EnumBlockRenderType;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
@@ -159,10 +160,12 @@ public class NBTCrucible extends BlockContainer implements ITileEntityProvider,
|
|||||||
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
|
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
|
||||||
{
|
{
|
||||||
TileEntity tileentity = world.getTileEntity(pos);
|
TileEntity tileentity = world.getTileEntity(pos);
|
||||||
//world.setBlockState(pos, state.withProperty(PrimalAPI.States.ACTIVE, Boolean.valueOf(false)), 2);
|
|
||||||
if (tileentity instanceof TileNBTCrucible)
|
if (tileentity instanceof TileNBTCrucible)
|
||||||
{
|
{
|
||||||
getActualState(state, world, pos);
|
TileNBTCrucible tile = (TileNBTCrucible) world.getTileEntity(pos);
|
||||||
|
NBTTagCompound tag = stack.getSubCompound("BlockEntityTag").copy();
|
||||||
|
//tile.writeNBT(tag);
|
||||||
|
tile.setHot(tag.getBoolean("hot"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,10 +176,12 @@ public class NBTCrucible extends BlockContainer implements ITileEntityProvider,
|
|||||||
if (tile != null && tile instanceof TileNBTCrucible) {
|
if (tile != null && tile instanceof TileNBTCrucible) {
|
||||||
System.out.println("Hot:" + tile.getHot() + " Status: " + tile.getStatus());
|
System.out.println("Hot:" + tile.getHot() + " Status: " + tile.getStatus());
|
||||||
if(tile.getHot()){
|
if(tile.getHot()){
|
||||||
|
System.out.println("Should Be Red");
|
||||||
return state.withProperty(PrimalAPI.States.ACTIVE, true);
|
return state.withProperty(PrimalAPI.States.ACTIVE, true);
|
||||||
}
|
}
|
||||||
if(!tile.getHot()){
|
if(!tile.getHot()){
|
||||||
return state.withProperty(PrimalAPI.States.ACTIVE, true);
|
System.out.println("Should Be Brown");
|
||||||
|
return state.withProperty(PrimalAPI.States.ACTIVE, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
{
|
{
|
||||||
"forge_marker":1,
|
"forge_marker":1,
|
||||||
|
|
||||||
"variants": {
|
"variants": {
|
||||||
"normal": { "model": "forgecraft:crucibleshut" },
|
"active": {
|
||||||
"active=false": {
|
"true": {
|
||||||
"textures": {
|
"textures": {
|
||||||
"particle": "forgecraft:blocks/stone_slab",
|
"particle": "forgecraft:blocks/stone_slab_hot",
|
||||||
"texture": "forgecraft:blocks/stone_slab"
|
"texture": "forgecraft:blocks/stone_slab_hot"
|
||||||
}
|
},
|
||||||
},
|
"model": "forgecraft:crucibleshut"
|
||||||
"active=true": {
|
},
|
||||||
"textures": {
|
"false": {
|
||||||
"particle": "forgecraft:blocks/stone_slab_hot",
|
"textures": {
|
||||||
"texture": "forgecraft:blocks/stone_slab_hot"
|
"particle": "forgecraft:blocks/stone_slab",
|
||||||
|
"texture": "forgecraft:blocks/stone_slab"
|
||||||
|
},
|
||||||
|
"model": "forgecraft:crucibleshut"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user