fixed rendering issue with placing crucible again aslo it wont change color
This commit is contained in:
@@ -120,7 +120,7 @@ public class ModBlocks {
|
||||
|
||||
public static void init() {
|
||||
//FISH_TRAP = RegistryHelper.addBlock("fish_trap", new FishTrap(), ItemFishTraps::new, "fishtrap");
|
||||
nbtCrucible = new NBTCrucible(Material.ROCK, "nbtCrucible");
|
||||
nbtCrucible = new NBTCrucible(Material.ROCK, "nbtcrucible");
|
||||
forge_brick = new Forge(Material.ROCK, "forge_brick", 5000);
|
||||
forge_adobe = new Forge(Material.ROCK, "forge_adobe", 5000);
|
||||
bloomery_brick = new BloomeryBase(Material.ROCK, "bloomery_brick", 5000);
|
||||
@@ -513,7 +513,7 @@ public class ModBlocks {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void registerRenders() {
|
||||
registerRender(nbtCrucible);
|
||||
//registerRender(nbtCrucible);
|
||||
registerRender(forge_brick);
|
||||
registerRender(forge_adobe);
|
||||
registerRender(castingform);
|
||||
|
||||
@@ -5,6 +5,8 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.IItemPropertyGetter;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -20,14 +22,15 @@ import javax.annotation.Nullable;
|
||||
/**
|
||||
* Created by mminaie on 2/7/18.
|
||||
*/
|
||||
public class ItemNBTCrucible extends AbstractItemBlock {
|
||||
public class ItemNBTCrucible extends ItemBlock {
|
||||
public ItemNBTCrucible(String name, Block block) {
|
||||
super(block);
|
||||
//super();
|
||||
this.setUnlocalizedName(name);
|
||||
this.setRegistryName(name);
|
||||
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
|
||||
|
||||
/*this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
|
||||
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn)
|
||||
@@ -37,24 +40,23 @@ public class ItemNBTCrucible extends AbstractItemBlock {
|
||||
if (getStatus(item)){
|
||||
return 0.1f;
|
||||
}
|
||||
} else if (item.hasTagCompound()) {
|
||||
if (!getStatus(item)){
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return 0.0F;
|
||||
}
|
||||
return 0.0F;
|
||||
|
||||
}
|
||||
});
|
||||
"overrides": [
|
||||
{"predicate": {"type": 0.0},"model": "forgecraft:item/nbtcrucible/nbtcrucible_0"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/nbtcrucible/nbtcrucible_1"}
|
||||
]
|
||||
*/
|
||||
}
|
||||
|
||||
public boolean getStatus(ItemStack stack) {
|
||||
if(!stack.isEmpty()) {
|
||||
if (stack.hasTagCompound()) {
|
||||
if (stack.getSubCompound("tags") != null) {
|
||||
return stack.getSubCompound("BlockEntityTag").getBoolean("status");
|
||||
}
|
||||
return stack.getSubCompound("BlockEntityTag").getBoolean("hot");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -63,13 +65,13 @@ public class ItemNBTCrucible extends AbstractItemBlock {
|
||||
@Override
|
||||
public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) {
|
||||
if(!world.isRemote) {
|
||||
System.out.println("We doin it?");
|
||||
if (!item.hasTagCompound()) {
|
||||
//System.out.println("We doin it?");
|
||||
if (item.hasTagCompound()) {
|
||||
//item.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound tag = item.getSubCompound("BlockEntityTag");
|
||||
|
||||
//item.getTagCompound().setTag("BlockEntityTag", tags);
|
||||
System.out.println(tag);
|
||||
System.out.println(tag.getBoolean("hot"));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -84,6 +84,7 @@ public class TileNBTCrucible extends BaseTile implements ITickable {
|
||||
this.setHot(false);
|
||||
CrucibleCrafting recipe = CrucibleCrafting.getRecipe(ingList.get(0), ingList.get(1), ingList.get(2), ingList.get(3), ingList.get(4));
|
||||
this.setDrops(recipe.getDropsCooked());
|
||||
this.setStatus(false);
|
||||
System.out.println("Ready to harvest: " + this.getDrops());
|
||||
}
|
||||
//CrucibleCrafting recipe = CrucibleCrafting.getRecipe(ingList.get(0), ingList.get(1), ingList.get(2), ingList.get(3), ingList.get(4));
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
}
|
||||
},
|
||||
"variants": {
|
||||
"normal": { "model": "forgecraft:crucibleshut" },
|
||||
"inventory": { "model": "forgecraft:item/itemnbtcrucible" }
|
||||
"normal": { "model": "forgecraft:crucibleshut" }
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,13 @@
|
||||
{
|
||||
"forge_marker":1,
|
||||
"parent": "forgecraft:block/crucibleshut",
|
||||
"textures": {
|
||||
"particle": "forgecraft:blocks/stone_slab",
|
||||
"texture": "forgecraft:blocks/stone_slab"
|
||||
},
|
||||
"parent": "forgecraft:block/crucibleshut"
|
||||
}
|
||||
"overrides": [
|
||||
{"predicate": {"type": 0.0},"model": "forgecraft:item/nbtcrucible/nbtcrucible_0"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/nbtcrucible/nbtcrucible_1"}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user