anvil rendering updates, anvil handler to reduce code localization, tong items now have IDs associated to the item registration to make matching them easier

This commit is contained in:
Mohammad-Ali Minaie
2017-06-11 01:44:30 -04:00
parent 7f6d9616ba
commit 981d117f3d
17 changed files with 1009 additions and 438 deletions

View File

@@ -5,17 +5,17 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent; import net.minecraftforge.fml.common.gameevent.PlayerEvent;
import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.items.parts.ToolPart; import nmd.primal.forgecraft.items.parts.ToolPart;
import nmd.primal.forgecraft.items.tools.CustomAxe; import nmd.primal.forgecraft.items.tools.CustomAxe;
import nmd.primal.forgecraft.items.tools.CustomHoe; import nmd.primal.forgecraft.items.tools.CustomHoe;
import nmd.primal.forgecraft.items.tools.CustomPickaxe; import nmd.primal.forgecraft.items.tools.CustomPickaxe;
import nmd.primal.forgecraft.items.tools.CustomShovel; import nmd.primal.forgecraft.items.tools.CustomShovel;
import nmd.primal.forgecraft.util.ToolNBT;
/** /**
* Created by mminaie on 3/15/17. * Created by mminaie on 3/15/17.
*/ */
public class CommonEvents implements ToolNBT{ public class CommonEvents implements ToolNBT {
@SubscribeEvent(priority= EventPriority.LOWEST, receiveCanceled=true) @SubscribeEvent(priority= EventPriority.LOWEST, receiveCanceled=true)

View File

@@ -0,0 +1,7 @@
package nmd.primal.forgecraft.blocks;
/**
* Created by mminaie on 6/10/17.
*/
public class AnvilIron {
}

View File

@@ -0,0 +1,7 @@
package nmd.primal.forgecraft.blocks;
/**
* Created by mminaie on 6/10/17.
*/
public class AnvilSteel {
}

View File

@@ -0,0 +1,239 @@
package nmd.primal.forgecraft.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.core.api.PrimalItems;
import nmd.primal.core.api.PrimalMaterials;
import nmd.primal.core.common.items.tools.WorkMallet;
import nmd.primal.forgecraft.CommonUtils;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.crafting.AnvilCrafting;
import nmd.primal.forgecraft.init.ModBlocks;
import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.items.BaseMultiItem;
import nmd.primal.forgecraft.items.ForgeHammer;
import nmd.primal.forgecraft.items.parts.ToolPart;
import nmd.primal.forgecraft.tiles.TileAnvil;
import nmd.primal.forgecraft.util.AnvilHandler;
import java.util.concurrent.ThreadLocalRandom;
/**
* Created by mminaie on 3/4/17.
*/
public class AnvilStone extends CustomContainerFacing implements AnvilHandler {
/*
double[] normalMin = {0.0625, 0.25, 0.4375, 0.625, 0.8125};
public double getNormalMin(Integer x) {
return normalMin[x];
}
double[] normalMax = {0.1875, 0.375, 0.5625, 0.75, 0.9375};
public double getNormalMax(Integer x) {
return normalMax[x];
}
double[] reverseMin = {0.8125, 0.625, 0.4375, 0.25, 0.0625};
public double getReverseMin(Integer x) {
return reverseMin[x];
}
double[] reverseMax = {0.9375, 0.75, 0.5625, 0.375, 0.1875};
public double getReverseMax(Integer x) {
return reverseMax[x];
}
*/
public AnvilStone(Material material, String registryName, Float hardness) {
super(material);
setUnlocalizedName(registryName);
setRegistryName(registryName);
setCreativeTab(ModInfo.TAB_FORGECRAFT);
setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
setHardness(hardness);
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitx, float hity, float hitz) {
/*if (!player.isSwingInProgress) {
player.swingArm(hand);
}*/
/******************************************************************************
Crafting AnvilStone Recipes
*****************************************************************************/
if (!world.isRemote) {
ItemStack pItem = player.inventory.getCurrentItem();
TileAnvil tile = (TileAnvil) world.getTileEntity(pos);
if (tile != null) {
if ((pItem.getItem() instanceof WorkMallet) || (pItem.getItem() == ModItems.forgehammer)) {
String[] tempArray = new String[25];
for (int i = 0; i < 25; i++) {
tempArray[i] = tile.getSlotStack(i).getItem().getRegistryName().toString();
}
for (int i = 0; i < 25; i++) {
if (tile.getSlotStack(i).getItem() instanceof BaseMultiItem) {
if (((BaseMultiItem) tile.getSlotStack(i).getItem()).getMaterial(tile.getSlotStack(i).getItem()) != PrimalMaterials.TOOL_WROUGHT_IRON) {
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(PrimalItems.ROCK_STONE, 3));
CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.ironball, 1));
this.breakBlock(world, pos, state);
}
}
}
doAnvilRecipe(pItem, tempArray, world, tile, pos, player);
return true;
}
doAnvilInventoryManager(pItem, world, tile, pos, hitx, hity, hitz, state, player);
return true;
}
}
return false;
}
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state)
{
if (!world.isRemote && world.getGameRules().getBoolean("doTileDrops"))
{
TileAnvil tile = (TileAnvil) world.getTileEntity(pos);
if (tile !=null)
{
for (ItemStack stack : tile.getSlotList())
{
if (stack != null) {
float offset = 0.7F;
double offsetX = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetY = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetZ = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
EntityItem item = new EntityItem(world, pos.getX() + offsetX, pos.getY() + offsetY, pos.getZ() + offsetZ, stack);
item.setDefaultPickupDelay();
world.spawnEntity(item);
}
}
}
}
super.breakBlock(world, pos, state);
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta)
{
return new TileAnvil();
}
@Override
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
{
//if(!worldIn.isRemote) {
worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()), 2);
//}
}
@Override
public int getMetaFromState(IBlockState state) {
int i = 0;
if( state.getValue(FACING) == EnumFacing.EAST) {
i = 0;
return i;
}
if( state.getValue(FACING) == EnumFacing.WEST) {
i = 1;
return i;
}
if( state.getValue(FACING) == EnumFacing.SOUTH){
i = 2;
return i;
}
if( state.getValue(FACING) == EnumFacing.NORTH){
i = 3;
return i;
}
return i;
}
@Override
public IBlockState getStateFromMeta(int meta)
{
IBlockState iblockstate = this.getDefaultState();
if (meta == 0){
iblockstate = iblockstate.withProperty(FACING, EnumFacing.EAST);
}
if (meta == 1) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.WEST);
}
if (meta == 2) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.SOUTH);
}
if (meta == 3) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.NORTH);
}
return iblockstate;
}
@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, new IProperty[] {FACING});
}
@Override
public boolean isFullCube(IBlockState state)
{
return false;
}
@Override
public boolean isFullyOpaque(IBlockState state)
{
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state)
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
return true;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.MODEL;
}
}

View File

@@ -142,7 +142,7 @@ public class ModBlocks {
if (pItem instanceof WorkMallet && world.getBlockState(belowPos).getBlock().equals(Blocks.STONE)) { if (pItem instanceof WorkMallet && world.getBlockState(belowPos).getBlock().equals(Blocks.STONE)) {
player.swingArm(hand); player.swingArm(hand);
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2); world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
world.setBlockState(belowPos, ModBlocks.stoneanvil.getDefaultState().withProperty(Anvil.FACING, player.getHorizontalFacing()), 2); world.setBlockState(belowPos, ModBlocks.stoneanvil.getDefaultState().withProperty(AnvilStone.FACING, player.getHorizontalFacing()), 2);
world.playEvent(1031, pos, 0); world.playEvent(1031, pos, 0);
//CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.stoneanvil, 1)); //CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.stoneanvil, 1));
return true; return true;
@@ -150,7 +150,7 @@ public class ModBlocks {
/*if (pItem instanceof ForgeHammer && world.getBlockState(belowPos).getBlock().equals(Blocks.IRON_BLOCK)) { /*if (pItem instanceof ForgeHammer && world.getBlockState(belowPos).getBlock().equals(Blocks.IRON_BLOCK)) {
player.swingArm(hand); player.swingArm(hand);
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2); world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
world.setBlockState(belowPos, ModBlocks.ironanvil.getDefaultState().withProperty(Anvil.FACING, player.getHorizontalFacing()), 2); world.setBlockState(belowPos, ModBlocks.ironanvil.getDefaultState().withProperty(AnvilStone.FACING, player.getHorizontalFacing()), 2);
world.playEvent(1031, pos, 0); world.playEvent(1031, pos, 0);
//CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.stoneanvil, 1)); //CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.stoneanvil, 1));
return true; return true;
@@ -203,13 +203,13 @@ public class ModBlocks {
if (pItem instanceof ForgeHammer && world.getBlockState(belowPos).getBlock().equals(Blocks.IRON_BLOCK)) { if (pItem instanceof ForgeHammer && world.getBlockState(belowPos).getBlock().equals(Blocks.IRON_BLOCK)) {
player.swingArm(hand); player.swingArm(hand);
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2); world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
world.setBlockState(belowPos, ModBlocks.ironanvil.getDefaultState().withProperty(Anvil.FACING, player.getHorizontalFacing()), 2); world.setBlockState(belowPos, ModBlocks.ironanvil.getDefaultState().withProperty(AnvilStone.FACING, player.getHorizontalFacing()), 2);
world.playEvent(1031, pos, 0); world.playEvent(1031, pos, 0);
//System.out.println("Activating"); //System.out.println("Activating");
return true; return true;
} }
if (pItem instanceof WorkMallet || pItem.equals(ModItems.forgehammer)) { if (pItem instanceof WorkMallet || pItem.equals(ModItems.forgehammer)) {
if(world.getBlockState(belowPos).getBlock() instanceof Anvil) { if(world.getBlockState(belowPos).getBlock() instanceof AnvilStone) {
TileAnvil tile = (TileAnvil) world.getTileEntity(belowPos); TileAnvil tile = (TileAnvil) world.getTileEntity(belowPos);
@@ -255,13 +255,13 @@ public class ModBlocks {
if (pItem instanceof ForgeHammer && world.getBlockState(belowPos).getBlock().equals(Blocks.IRON_BLOCK)) { if (pItem instanceof ForgeHammer && world.getBlockState(belowPos).getBlock().equals(Blocks.IRON_BLOCK)) {
player.swingArm(hand); player.swingArm(hand);
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2); world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
world.setBlockState(belowPos, ModBlocks.ironanvil.getDefaultState().withProperty(Anvil.FACING, player.getHorizontalFacing()), 2); world.setBlockState(belowPos, ModBlocks.ironanvil.getDefaultState().withProperty(AnvilStone.FACING, player.getHorizontalFacing()), 2);
world.playEvent(1031, pos, 0); world.playEvent(1031, pos, 0);
//CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.stoneanvil, 1)); //CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.stoneanvil, 1));
return true; return true;
} }
if (pItem instanceof WorkMallet || pItem.equals(ModItems.forgehammer)) { if (pItem instanceof WorkMallet || pItem.equals(ModItems.forgehammer)) {
if(world.getBlockState(belowPos).getBlock() instanceof Anvil) { if(world.getBlockState(belowPos).getBlock() instanceof AnvilStone) {
TileAnvil tile = (TileAnvil) world.getTileEntity(belowPos); TileAnvil tile = (TileAnvil) world.getTileEntity(belowPos);
@@ -307,13 +307,13 @@ public class ModBlocks {
if (pItem instanceof ForgeHammer && world.getBlockState(belowPos).getBlock().equals(Blocks.IRON_BLOCK)) { if (pItem instanceof ForgeHammer && world.getBlockState(belowPos).getBlock().equals(Blocks.IRON_BLOCK)) {
player.swingArm(hand); player.swingArm(hand);
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2); world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
world.setBlockState(belowPos, ModBlocks.ironanvil.getDefaultState().withProperty(Anvil.FACING, player.getHorizontalFacing()), 2); world.setBlockState(belowPos, ModBlocks.ironanvil.getDefaultState().withProperty(AnvilStone.FACING, player.getHorizontalFacing()), 2);
world.playEvent(1031, pos, 0); world.playEvent(1031, pos, 0);
//CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.stoneanvil, 1)); //CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.stoneanvil, 1));
return true; return true;
} }
if (pItem instanceof WorkMallet || pItem.equals(ModItems.forgehammer)) { if (pItem instanceof WorkMallet || pItem.equals(ModItems.forgehammer)) {
if(world.getBlockState(belowPos).getBlock() instanceof Anvil) { if(world.getBlockState(belowPos).getBlock() instanceof AnvilStone) {
TileAnvil tile = (TileAnvil) world.getTileEntity(belowPos); TileAnvil tile = (TileAnvil) world.getTileEntity(belowPos);
@@ -354,8 +354,8 @@ public class ModBlocks {
steelchunk = new IngotBall(Material.IRON, "steelchunk", 6.0f, "chunk"); //steel_ingot steelchunk.json steelchunkhot.json - done steelchunk = new IngotBall(Material.IRON, "steelchunk", 6.0f, "chunk"); //steel_ingot steelchunk.json steelchunkhot.json - done
wootzchunk = new IngotBall(Material.IRON, "wootzchunk", 6.0f, "chunk"); //wootz_ingot wootzchunk.json wootzchunkhot.json - done wootzchunk = new IngotBall(Material.IRON, "wootzchunk", 6.0f, "chunk"); //wootz_ingot wootzchunk.json wootzchunkhot.json - done
stoneanvil = new Anvil(Material.ANVIL, "stoneanvil", 5.0f); stoneanvil = new AnvilStone(Material.ANVIL, "stoneanvil", 5.0f);
ironanvil = new Anvil(Material.ANVIL, "ironanvil", 6.0f); ironanvil = new AnvilStone(Material.ANVIL, "ironanvil", 6.0f);
//ironballitemcool = new ItemBlockIngotBall(ironball); //ironballitemcool = new ItemBlockIngotBall(ironball);
//ironballitemhot = new ItemBlockIngotBall(ironball); //ironballitemhot = new ItemBlockIngotBall(ironball);

View File

@@ -112,25 +112,25 @@ public class ModItems {
/********** /**********
TOOL PARTS TOOL PARTS
**********/ **********/
pickaxehead = new ToolPart("ironpickaxehead", PrimalMaterials.TOOL_WROUGHT_IRON); pickaxehead = new ToolPart("ironpickaxehead", PrimalMaterials.TOOL_WROUGHT_IRON, 8);
ironaxehead = new ToolPart("ironaxehead", PrimalMaterials.TOOL_WROUGHT_IRON); ironaxehead = new ToolPart("ironaxehead", PrimalMaterials.TOOL_WROUGHT_IRON, 9);
ironshovelhead = new ToolPart("ironshovelhead", PrimalMaterials.TOOL_WROUGHT_IRON); ironshovelhead = new ToolPart("ironshovelhead", PrimalMaterials.TOOL_WROUGHT_IRON, 10);
ironhoehead = new ToolPart("ironhoehead", PrimalMaterials.TOOL_WROUGHT_IRON); ironhoehead = new ToolPart("ironhoehead", PrimalMaterials.TOOL_WROUGHT_IRON, 11);
cleanironpickaxehead = new ToolPart("cleanironpickaxehead", PrimalMaterials.TOOL_CLEAN_IRON); cleanironpickaxehead = new ToolPart("cleanironpickaxehead", PrimalMaterials.TOOL_CLEAN_IRON, 17);
cleanironaxehead = new ToolPart("cleanironaxehead", PrimalMaterials.TOOL_CLEAN_IRON); cleanironaxehead = new ToolPart("cleanironaxehead", PrimalMaterials.TOOL_CLEAN_IRON, 18);
cleanironshovelhead = new ToolPart("cleanironshovelhead", PrimalMaterials.TOOL_CLEAN_IRON); cleanironshovelhead = new ToolPart("cleanironshovelhead", PrimalMaterials.TOOL_CLEAN_IRON, 19);
cleanironhoehead = new ToolPart("cleanironhoehead", PrimalMaterials.TOOL_CLEAN_IRON); cleanironhoehead = new ToolPart("cleanironhoehead", PrimalMaterials.TOOL_CLEAN_IRON, 20);
steelpickaxehead = new ToolPart("steelpickaxehead", PrimalMaterials.TOOL_BASIC_STEEL); steelpickaxehead = new ToolPart("steelpickaxehead", PrimalMaterials.TOOL_BASIC_STEEL, 26);
steelaxehead = new ToolPart("steelaxehead", PrimalMaterials.TOOL_BASIC_STEEL); steelaxehead = new ToolPart("steelaxehead", PrimalMaterials.TOOL_BASIC_STEEL, 27);
steelshovelhead = new ToolPart("steelshovelhead", PrimalMaterials.TOOL_BASIC_STEEL); steelshovelhead = new ToolPart("steelshovelhead", PrimalMaterials.TOOL_BASIC_STEEL, 28);
steelhoehead = new ToolPart("steelhoehead", PrimalMaterials.TOOL_BASIC_STEEL); steelhoehead = new ToolPart("steelhoehead", PrimalMaterials.TOOL_BASIC_STEEL, 29);
wootzpickaxehead = new ToolPart("wootzpickaxehead", PrimalMaterials.TOOL_WOOTZ_STEEL); wootzpickaxehead = new ToolPart("wootzpickaxehead", PrimalMaterials.TOOL_WOOTZ_STEEL, 35);
wootzaxehead = new ToolPart("wootzaxehead", PrimalMaterials.TOOL_WOOTZ_STEEL); wootzaxehead = new ToolPart("wootzaxehead", PrimalMaterials.TOOL_WOOTZ_STEEL, 36);
wootzshovelhead = new ToolPart("wootzshovelhead", PrimalMaterials.TOOL_WOOTZ_STEEL); wootzshovelhead = new ToolPart("wootzshovelhead", PrimalMaterials.TOOL_WOOTZ_STEEL, 37);
wootzhoehead = new ToolPart("wootzhoehead", PrimalMaterials.TOOL_WOOTZ_STEEL); wootzhoehead = new ToolPart("wootzhoehead", PrimalMaterials.TOOL_WOOTZ_STEEL, 38);
/********** /**********
TOOLS TOOLS
**********/ **********/

View File

@@ -12,8 +12,7 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.ModInfo; import nmd.primal.forgecraft.util.ToolNBT;
import nmd.primal.forgecraft.ToolNBT;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.List; import java.util.List;
@@ -23,7 +22,9 @@ import java.util.List;
*/ */
public class ToolPart extends Item implements ToolNBT{ public class ToolPart extends Item implements ToolNBT{
public ToolPart(String name, Item.ToolMaterial material) { private int ID;
public ToolPart(String name, Item.ToolMaterial material, Integer ID) {
this.setMaxDamage(material.getMaxUses()); this.setMaxDamage(material.getMaxUses());
this.setUnlocalizedName(name); this.setUnlocalizedName(name);
this.setRegistryName(name); this.setRegistryName(name);
@@ -31,6 +32,8 @@ public class ToolPart extends Item implements ToolNBT{
this.setMaxStackSize(1); this.setMaxStackSize(1);
this.setNoRepair(); this.setNoRepair();
this.ID = ID;
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter()
{ {
@@ -224,6 +227,10 @@ public class ToolPart extends Item implements ToolNBT{
return false; return false;
} }
public int getID() {
return ID;
}
@Override @Override
public void onCreated(ItemStack item, World worldIn, EntityPlayer playerIn) { public void onCreated(ItemStack item, World worldIn, EntityPlayer playerIn) {

View File

@@ -18,7 +18,7 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.ModInfo; import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.ToolNBT; import nmd.primal.forgecraft.util.ToolNBT;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.List; import java.util.List;

View File

@@ -17,7 +17,7 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.ModInfo; import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.ToolNBT; import nmd.primal.forgecraft.util.ToolNBT;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.List; import java.util.List;

View File

@@ -18,7 +18,7 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.ModInfo; import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.ToolNBT; import nmd.primal.forgecraft.util.ToolNBT;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.List; import java.util.List;

View File

@@ -20,7 +20,7 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.ModInfo; import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.ToolNBT; import nmd.primal.forgecraft.util.ToolNBT;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.List; import java.util.List;

View File

@@ -14,9 +14,8 @@ import net.minecraft.item.Item;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import nmd.primal.core.api.PrimalItems; import nmd.primal.core.api.PrimalItems;
import nmd.primal.forgecraft.blocks.Anvil; import nmd.primal.forgecraft.blocks.AnvilStone;
import nmd.primal.forgecraft.blocks.IngotBall; import nmd.primal.forgecraft.blocks.IngotBall;
import nmd.primal.forgecraft.init.ModBlocks;
import nmd.primal.forgecraft.init.ModItems; import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.items.BaseMultiItem; import nmd.primal.forgecraft.items.BaseMultiItem;
import nmd.primal.forgecraft.tiles.TileAnvil; import nmd.primal.forgecraft.tiles.TileAnvil;
@@ -41,7 +40,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
BlockPos pos = tile.getPos(); BlockPos pos = tile.getPos();
IBlockState state = this.getWorld().getBlockState(pos); IBlockState state = this.getWorld().getBlockState(pos);
if (state.getBlock() instanceof Anvil) { if (state.getBlock() instanceof AnvilStone) {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(x, y + 1.5D, z); GL11.glTranslated(x, y + 1.5D, z);
@@ -88,7 +87,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
*/ */
if (state.getValue(Anvil.FACING) == EnumFacing.NORTH) { if (state.getValue(AnvilStone.FACING) == EnumFacing.NORTH) {
int counter = 0; int counter = 0;
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
for (int a = 0; a < 5; a++) { for (int a = 0; a < 5; a++) {
@@ -103,7 +102,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
) { ) {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(tile.getNormalX(a), -0.49D, tile.getNormalZ(i)); GL11.glTranslated(tile.getNormalX(a), -0.499D, tile.getNormalZ(i));
GL11.glRotated(-90.0F, 1.0F, -0.0F, 0.0F); GL11.glRotated(-90.0F, 1.0F, -0.0F, 0.0F);
GL11.glScaled(0.25D, 0.25D, 0.25D); GL11.glScaled(0.25D, 0.25D, 0.25D);
renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED); renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED);
@@ -117,7 +116,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
GL11.glPushMatrix(); GL11.glPushMatrix();
double scale = 1.0D; double scale = 1.0D;
GL11.glScaled(scale, scale, scale); GL11.glScaled(scale, scale, scale);
GL11.glTranslated(tile.getNormalX(a), -0.435D, tile.getNormalZ(i)); GL11.glTranslated(tile.getNormalX(a), -0.465D, tile.getNormalZ(i));
renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED); renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
@@ -129,8 +128,9 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
GL11.glPushMatrix(); GL11.glPushMatrix();
double scale = 1.0D; double scale = 1.0D;
GL11.glScaled(scale, scale, scale); GL11.glScaled(scale, scale, scale);
GL11.glTranslated(tile.getNormalX(a), -0.435D, tile.getNormalZ(i)); GL11.glTranslated(tile.getNormalX(a), -0.51D, tile.getNormalZ(i));
GL11.glRotated(90.0F, 1.0F, 0.0F, 0.0F); GL11.glRotated(90.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotated(180.0F, 0.0F, 0.0F, 1.0F);
renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED); renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
@@ -142,12 +142,17 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
GL11.glPushMatrix(); GL11.glPushMatrix();
double scale = 1.0D; double scale = 1.0D;
GL11.glScaled(scale, scale, scale); GL11.glScaled(scale, scale, scale);
GL11.glTranslated(tile.getNormalX(a), -0.435D, tile.getNormalZ(i)); GL11.glTranslated(tile.getNormalX(a), -0.450D, tile.getNormalZ(i));
GL11.glRotated(90.0F, 1.0F, 0.0F, 0.0F); GL11.glRotated(90.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotated(90.0F, 0.0F, 0.0F, 1.0F);
renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED); renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
if (item.equals(ModItems.ironhoehead)) { if (item.equals(ModItems.ironhoehead) ||
item.equals(ModItems.cleanironhoehead) ||
item.equals(ModItems.steelhoehead) ||
item.equals(ModItems.steelhoehead)
) {
GL11.glPushMatrix(); GL11.glPushMatrix();
double scale = 1.0D; double scale = 1.0D;
GL11.glScaled(scale, scale, scale); GL11.glScaled(scale, scale, scale);
@@ -168,7 +173,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
GL11.glPushMatrix(); GL11.glPushMatrix();
double scale = 1.0D; double scale = 1.0D;
GL11.glScaled(scale, scale, scale); GL11.glScaled(scale, scale, scale);
GL11.glTranslated(tile.getNormalX(a), -0.44D, tile.getNormalZ(i)); GL11.glTranslated(tile.getNormalX(a), -0.50D, tile.getNormalZ(i));
renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED); renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
@@ -178,7 +183,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
} }
} }
} }
if (state.getValue(Anvil.FACING) == EnumFacing.SOUTH) { if (state.getValue(AnvilStone.FACING) == EnumFacing.SOUTH) {
int counter = 0; int counter = 0;
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
for (int a = 0; a < 5; a++) { for (int a = 0; a < 5; a++) {
@@ -271,7 +276,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
} }
} }
} }
if (state.getValue(Anvil.FACING) == EnumFacing.WEST) { if (state.getValue(AnvilStone.FACING) == EnumFacing.WEST) {
int counter = 0; int counter = 0;
for (int a = 0; a < 5; a++) { for (int a = 0; a < 5; a++) {
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
@@ -361,7 +366,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
} }
} }
} }
if (state.getValue(Anvil.FACING) == EnumFacing.EAST) { if (state.getValue(AnvilStone.FACING) == EnumFacing.EAST) {
int counter = 0; int counter = 0;
for (int a = 0; a < 5; a++) { for (int a = 0; a < 5; a++) {
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {

View File

@@ -1,138 +1,63 @@
package nmd.primal.forgecraft.blocks; package nmd.primal.forgecraft.util;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor; import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand; import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.core.api.PrimalItems; import nmd.primal.core.api.PrimalItems;
import nmd.primal.core.api.PrimalMaterials;
import nmd.primal.core.common.items.tools.WorkMallet; import nmd.primal.core.common.items.tools.WorkMallet;
import nmd.primal.forgecraft.CommonUtils; import nmd.primal.forgecraft.CommonUtils;
import nmd.primal.forgecraft.ModInfo; import nmd.primal.forgecraft.blocks.IngotBall;
import nmd.primal.forgecraft.crafting.AnvilCrafting; import nmd.primal.forgecraft.crafting.AnvilCrafting;
import nmd.primal.forgecraft.init.ModBlocks;
import nmd.primal.forgecraft.init.ModItems; import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.items.BaseMultiItem;
import nmd.primal.forgecraft.items.ForgeHammer; import nmd.primal.forgecraft.items.ForgeHammer;
import nmd.primal.forgecraft.items.parts.ToolPart; import nmd.primal.forgecraft.items.parts.ToolPart;
import nmd.primal.forgecraft.tiles.TileAnvil; import nmd.primal.forgecraft.tiles.TileAnvil;
import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.ThreadLocalRandom;
/** import static nmd.primal.forgecraft.blocks.CustomContainerFacing.FACING;
* Created by mminaie on 3/4/17. import static sun.audio.AudioPlayer.player;
*/
public class Anvil extends CustomContainerFacing {
/**
* Created by mminaie on 6/10/17.
*/
public interface AnvilHandler {
double[] normalMin = {0.0625, 0.25, 0.4375, 0.625, 0.8125}; double[] normalMin = {0.0625, 0.25, 0.4375, 0.625, 0.8125};
public double getNormalMin(Integer x) { default double getNormalMin(Integer x) {
return normalMin[x]; return normalMin[x];
} }
double[] normalMax = {0.1875, 0.375, 0.5625, 0.75, 0.9375}; double[] normalMax = {0.1875, 0.375, 0.5625, 0.75, 0.9375};
public double getNormalMax(Integer x) { default double getNormalMax(Integer x) {
return normalMax[x]; return normalMax[x];
} }
double[] reverseMin = {0.8125, 0.625, 0.4375, 0.25, 0.0625}; double[] reverseMin = {0.8125, 0.625, 0.4375, 0.25, 0.0625};
public double getReverseMin(Integer x) { default double getReverseMin(Integer x) {
return reverseMin[x]; return reverseMin[x];
} }
double[] reverseMax = {0.9375, 0.75, 0.5625, 0.375, 0.1875}; double[] reverseMax = {0.9375, 0.75, 0.5625, 0.375, 0.1875};
public double getReverseMax(Integer x) { default double getReverseMax(Integer x) {
return reverseMax[x]; return reverseMax[x];
} }
public Anvil(Material material, String registryName, Float hardness) { default boolean doAnvilRecipe(ItemStack pItem, String[] tempArray, World world, TileAnvil tile, BlockPos pos, EntityPlayer player) {
super(material);
setUnlocalizedName(registryName);
setRegistryName(registryName);
setCreativeTab(ModInfo.TAB_FORGECRAFT);
setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
setHardness(hardness);
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitx, float hity, float hitz) {
/*if (!player.isSwingInProgress) {
player.swingArm(hand);
}*/
/******************************************************************************
Crafting Anvil Recipes
*****************************************************************************/
if (!world.isRemote) {
ItemStack pItem = player.inventory.getCurrentItem();
TileAnvil tile = (TileAnvil) world.getTileEntity(pos);
if (tile != null) {
//System.out.println("Tile is not null");
//if ((player.inventory.getCurrentItem().getItem().equals(PrimalItems.STONE_GALLAGHER)) || (player.inventory.getCurrentItem().getItem() == ModItems.forgehammer)) {
if ((pItem.getItem() instanceof WorkMallet) || (pItem.getItem() == ModItems.forgehammer)) {
String[] tempArray = new String[25];
for (int i = 0; i < 25; i++) {
tempArray[i] = tile.getSlotStack(i).getItem().getRegistryName().toString();
//System.out.println(i + " || " + tempArray[i] + " || " + tile.getSlotStack(i).getItem());
}
if(this.getRegistryName().toString().equals("stoneanvil")){
for (int i = 0; i < 25; i++) {
if (tile.getSlotStack(i).getItem() instanceof BaseMultiItem) {
if(((BaseMultiItem) tile.getSlotStack(i).getItem()).getMaterial(tile.getSlotStack(i).getItem()) != PrimalMaterials.TOOL_WROUGHT_IRON ) {
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2);
CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(PrimalItems.ROCK_STONE, 3));
CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.ironball, 1));
for (ItemStack stack : tile.getSlotList()) {
if (stack != null) {
float offset = 0.7F;
double offsetX = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetY = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetZ = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
EntityItem item = new EntityItem(world, pos.getX() + offsetX, pos.getY() + offsetY, pos.getZ() + offsetZ, stack);
item.setDefaultPickupDelay();
world.spawnEntity(item);
world.removeTileEntity(pos);
world.playEvent(1031, pos, 0);
}
}
}
}
}
}
AnvilCrafting recipe = AnvilCrafting.getRecipe(tempArray); AnvilCrafting recipe = AnvilCrafting.getRecipe(tempArray);
if (recipe != null) { if (recipe != null) {
if (pItem.getItem() instanceof WorkMallet) { if (pItem.getItem() instanceof WorkMallet) {
pItem.damageItem(15, player); pItem.damageItem(15, player);
@@ -237,15 +162,18 @@ public class Anvil extends CustomContainerFacing {
return true; return true;
} }
} }
return false;
} }
//}
/*****************************************************************************
/*****************************************************************************
Adding and Removing Inventory With Tongs Adding and Removing Inventory With Tongs
*****************************************************************************/ *****************************************************************************/
default boolean doAnvilInventoryManager(ItemStack pItem, World world, TileAnvil tile, BlockPos pos, float hitx, float hity, float hitz, IBlockState state, EntityPlayer player) {
if ( (!(pItem.getItem() instanceof WorkMallet)) || (!(pItem.getItem() instanceof ForgeHammer)) ) { if ( (!(pItem.getItem() instanceof WorkMallet)) || (!(pItem.getItem() instanceof ForgeHammer)) ) {
if(Block.getBlockFromItem(pItem.getItem()) instanceof IngotBall) { if(Block.getBlockFromItem(pItem.getItem()) instanceof IngotBall) {
return false; return false;
@@ -257,7 +185,7 @@ public class Anvil extends CustomContainerFacing {
for (int x = 0; x < 5; x++) { for (int x = 0; x < 5; x++) {
if (hitx >= this.getNormalMin(x) && hitx <= this.getNormalMax(x)) { if (hitx >= this.getNormalMin(x) && hitx <= this.getNormalMax(x)) {
if (hitz >= this.getNormalMin(z) && hitz <= this.getNormalMax(z)) { if (hitz >= this.getNormalMin(z) && hitz <= this.getNormalMax(z)) {
doWork(pItem, counter, tile, world, pos, player); AnvilHandler.doWork(pItem, counter, tile, world, pos, player);
return true; return true;
} }
} }
@@ -308,14 +236,11 @@ public class Anvil extends CustomContainerFacing {
} }
} }
} }
}
return false;
}
return false; return false;
} }
private boolean doWork(ItemStack pItem, Integer counter, TileAnvil tile, World world, BlockPos pos, EntityPlayer player) {
static boolean doWork(ItemStack pItem, Integer counter, TileAnvil tile, World world, BlockPos pos, EntityPlayer player) {
if (pItem.getItem().equals(ModItems.stonetongs)) { if (pItem.getItem().equals(ModItems.stonetongs)) {
if ((pItem.getTagCompound().getInteger("type") == 6) || if ((pItem.getTagCompound().getInteger("type") == 6) ||
(pItem.getTagCompound().getInteger("type") == 7) || (pItem.getTagCompound().getInteger("type") == 7) ||
@@ -372,7 +297,32 @@ public class Anvil extends CustomContainerFacing {
tile.setSlotStack(counter, ItemStack.EMPTY); tile.setSlotStack(counter, ItemStack.EMPTY);
return true; return true;
} }
if(tile.getSlotStack(counter).getItem() instanceof ToolPart){
ToolPart item = (ToolPart) tile.getSlotStack(counter).getItem();
if(item.getHot(tile.getSlotStack(counter))) {
switch (item.getID()) {
case 8:
case 9:
case 10:
case 11:
case 17:
case 18:
case 19:
case 20:
case 26:
case 27:
case 28:
case 29:
case 35:
case 36:
case 37:
case 38:
pItem.getTagCompound().setInteger("type", item.getID());
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
}
}
} }
} }
@@ -382,7 +332,7 @@ public class Anvil extends CustomContainerFacing {
//System.out.println("Tongs meta = 6"); //System.out.println("Tongs meta = 6");
tile.setSlotStack((counter), new ItemStack(ModItems.ironingotballhot, 1)); tile.setSlotStack((counter), new ItemStack(ModItems.ironingotballhot, 1));
pItem.getTagCompound().setInteger("type", 0); pItem.getTagCompound().setInteger("type", 0);
//return true; return true;
} }
if (pItem.getTagCompound().getInteger("type") == 7) { if (pItem.getTagCompound().getInteger("type") == 7) {
//System.out.println("Tongs meta = 7"); //System.out.println("Tongs meta = 7");
@@ -390,7 +340,7 @@ public class Anvil extends CustomContainerFacing {
pItem.getTagCompound().setInteger("type", 0); pItem.getTagCompound().setInteger("type", 0);
///System.out.println(counter); ///System.out.println(counter);
//System.out.println(tile.getSlotStack(counter)); //System.out.println(tile.getSlotStack(counter));
//return true; return true;
} }
if (pItem.getTagCompound().getInteger("type") == 8) { if (pItem.getTagCompound().getInteger("type") == 8) {
ItemStack tempStack = new ItemStack(ModItems.pickaxehead, 1); ItemStack tempStack = new ItemStack(ModItems.pickaxehead, 1);
@@ -472,7 +422,7 @@ public class Anvil extends CustomContainerFacing {
//System.out.println("Tongs meta = 6"); //System.out.println("Tongs meta = 6");
tile.setSlotStack((counter), new ItemStack(ModItems.ironcleaningotballhot, 1)); tile.setSlotStack((counter), new ItemStack(ModItems.ironcleaningotballhot, 1));
pItem.getTagCompound().setInteger("type", 0); pItem.getTagCompound().setInteger("type", 0);
//return true; return true;
} }
if (pItem.getTagCompound().getInteger("type") == 16) { if (pItem.getTagCompound().getInteger("type") == 16) {
//System.out.println("Tongs meta = 7"); //System.out.println("Tongs meta = 7");
@@ -480,7 +430,7 @@ public class Anvil extends CustomContainerFacing {
pItem.getTagCompound().setInteger("type", 0); pItem.getTagCompound().setInteger("type", 0);
///System.out.println(counter); ///System.out.println(counter);
//System.out.println(tile.getSlotStack(counter)); //System.out.println(tile.getSlotStack(counter));
//return true; return true;
} }
if (pItem.getTagCompound().getInteger("type") == 17) { if (pItem.getTagCompound().getInteger("type") == 17) {
ItemStack tempStack = new ItemStack(ModItems.cleanironpickaxehead, 1); ItemStack tempStack = new ItemStack(ModItems.cleanironpickaxehead, 1);
@@ -562,7 +512,7 @@ public class Anvil extends CustomContainerFacing {
//System.out.println("Tongs meta = 6"); //System.out.println("Tongs meta = 6");
tile.setSlotStack((counter), new ItemStack(ModItems.steelingotballhot, 1)); tile.setSlotStack((counter), new ItemStack(ModItems.steelingotballhot, 1));
pItem.getTagCompound().setInteger("type", 0); pItem.getTagCompound().setInteger("type", 0);
//return true; return true;
} }
if (pItem.getTagCompound().getInteger("type") == 25) { if (pItem.getTagCompound().getInteger("type") == 25) {
//System.out.println("Tongs meta = 7"); //System.out.println("Tongs meta = 7");
@@ -570,7 +520,7 @@ public class Anvil extends CustomContainerFacing {
pItem.getTagCompound().setInteger("type", 0); pItem.getTagCompound().setInteger("type", 0);
///System.out.println(counter); ///System.out.println(counter);
//System.out.println(tile.getSlotStack(counter)); //System.out.println(tile.getSlotStack(counter));
//return true; return true;
} }
if (pItem.getTagCompound().getInteger("type") == 26) { if (pItem.getTagCompound().getInteger("type") == 26) {
ItemStack tempStack = new ItemStack(ModItems.steelpickaxehead, 1); ItemStack tempStack = new ItemStack(ModItems.steelpickaxehead, 1);
@@ -649,10 +599,6 @@ public class Anvil extends CustomContainerFacing {
} }
} }
//System.out.println("1" + pItem);
if (pItem.getItem().equals(Items.AIR) && player.isSneaking()) { if (pItem.getItem().equals(Items.AIR) && player.isSneaking()) {
if (tile.getSlotStack(counter).getItem().equals(Items.DIAMOND)) { if (tile.getSlotStack(counter).getItem().equals(Items.DIAMOND)) {
@@ -775,125 +721,4 @@ public class Anvil extends CustomContainerFacing {
return false; return false;
} }
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state)
{
if (!world.isRemote && world.getGameRules().getBoolean("doTileDrops"))
{
TileAnvil tile = (TileAnvil) world.getTileEntity(pos);
if (tile !=null)
{
for (ItemStack stack : tile.getSlotList())
{
if (stack != null) {
float offset = 0.7F;
double offsetX = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetY = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
double offsetZ = world.rand.nextFloat() * offset + (1.0F - offset) * 0.5D;
EntityItem item = new EntityItem(world, pos.getX() + offsetX, pos.getY() + offsetY, pos.getZ() + offsetZ, stack);
item.setDefaultPickupDelay();
world.spawnEntity(item);
}
}
}
}
super.breakBlock(world, pos, state);
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta)
{
return new TileAnvil();
}
@Override
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
{
//if(!worldIn.isRemote) {
worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing()), 2);
//}
}
@Override
public int getMetaFromState(IBlockState state) {
int i = 0;
if( state.getValue(FACING) == EnumFacing.EAST) {
i = 0;
return i;
}
if( state.getValue(FACING) == EnumFacing.WEST) {
i = 1;
return i;
}
if( state.getValue(FACING) == EnumFacing.SOUTH){
i = 2;
return i;
}
if( state.getValue(FACING) == EnumFacing.NORTH){
i = 3;
return i;
}
return i;
}
@Override
public IBlockState getStateFromMeta(int meta)
{
IBlockState iblockstate = this.getDefaultState();
if (meta == 0){
iblockstate = iblockstate.withProperty(FACING, EnumFacing.EAST);
}
if (meta == 1) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.WEST);
}
if (meta == 2) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.SOUTH);
}
if (meta == 3) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.NORTH);
}
return iblockstate;
}
@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, new IProperty[] {FACING});
}
@Override
public boolean isFullCube(IBlockState state)
{
return false;
}
@Override
public boolean isFullyOpaque(IBlockState state)
{
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state)
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
return true;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.MODEL;
}
} }

View File

@@ -1,4 +1,4 @@
package nmd.primal.forgecraft; package nmd.primal.forgecraft.util;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;

View File

@@ -2,26 +2,26 @@
"__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio", "__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio",
"parent": "block/block", "parent": "block/block",
"textures": { "textures": {
"particle": "forgecraft:blocks/stone", "particle": "blocks/stone",
"texture": "forgecraft:blocks/stone", "texture": "blocks/stone",
"texture1": "forgecraft:blocks/anvil_base", "texture1": "blocks/anvil_base",
"texture2": "forgecraft:blocks/anvil_base_top" "texture2": "blocks/anvil_base_top"
}, },
"elements": [ "elements": [
{ {
"__comment": "Cube1", "__comment": "Box3",
"from": [ 0, 0, 0 ], "from": [ 0, 0, 0 ],
"to": [ 16, 14, 16 ], "to": [ 16, 14, 16 ],
"faces": { "faces": {
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" },
"north": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" }, "north": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" },
"south": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" }, "south": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture1" },
"west": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" }, "west": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" },
"east": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" } "east": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" }
} }
}, },
{ {
"__comment": "Cube2", "__comment": "Box41",
"from": [ 0, 14, 0 ], "from": [ 0, 14, 0 ],
"to": [ 16, 16, 16 ], "to": [ 16, 16, 16 ],
"faces": { "faces": {

View File

@@ -0,0 +1,60 @@
{
"__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio",
"parent": "block/block",
"textures": {
"particle": "forgecraft:blocks/stone",
"texture": "forgecraft:blocks/stone",
"texture1": "forgecraft:blocks/anvil_base",
"texture2": "forgecraft:blocks/anvil_base_top"
},
"elements": [
{
"__comment": "Cube1",
"from": [ 0, 0, 0 ],
"to": [ 16, 14, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" },
"north": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" },
"south": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" },
"west": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" },
"east": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" }
}
},
{
"__comment": "Cube2",
"from": [ 0, 14, 0 ],
"to": [ 16, 16, 16 ],
"faces": {
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture2" },
"north": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"south": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"west": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"east": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" }
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [ 75, 45, 0 ],
"translation": [ 0, 2.5, 0 ],
"scale": [ 0.375, 0.375, 0.375 ]
},
"firstperson_righthand": {
"rotation": [ 0, 45, 0 ],
"scale": [ 0.4, 0.4, 0.4 ]
},
"gui": {
"rotation": [ 30, 225, 0 ],
"scale": [ 0.625, 0.625, 0.625 ]
},
"ground": {
"translation": [ 0, 3, 0 ],
"scale": [ 0.25, 0.25, 0.25 ]
},
"fixed": {
"scale": [ 0.5, 0.5, 0.5 ]
}
},
"overrides": [
]
}

View File

@@ -0,0 +1,421 @@
{
"__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio",
"parent": "block/block",
"textures": {
"particle": "forgecraft:blocks/stone",
"texture": "forgecraft:blocks/stone",
"texture1": "forgecraft:blocks/anvil_base",
"texture2": "forgecraft:blocks/anvil_base_top"
},
"elements": [
{
"__comment": "Box3",
"from": [ 0, 0, 0 ],
"to": [ 16, 14, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture1" },
"north": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" },
"south": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture1" },
"west": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" },
"east": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" }
}
},
{
"__comment": "Box4",
"from": [ 0, 14, 0 ],
"to": [ 16, 16, 1 ],
"faces": {
"up": { "uv": [ 0, 0, 16, 1 ], "texture": "#texture2" },
"north": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"south": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"west": { "uv": [ 0, 0, 1, 2 ], "texture": "#texture1" },
"east": { "uv": [ 15, 0, 16, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box4",
"from": [ 0, 14, 3 ],
"to": [ 16, 16, 4 ],
"faces": {
"up": { "uv": [ 0, 0, 16, 1 ], "texture": "#texture2" },
"north": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"south": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"west": { "uv": [ 0, 0, 1, 2 ], "texture": "#texture1" },
"east": { "uv": [ 15, 0, 16, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box4",
"from": [ 0, 14, 6 ],
"to": [ 16, 16, 7 ],
"faces": {
"up": { "uv": [ 0, 0, 16, 1 ], "texture": "#texture2" },
"north": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"south": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"west": { "uv": [ 0, 0, 1, 2 ], "texture": "#texture1" },
"east": { "uv": [ 15, 0, 16, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box4",
"from": [ 0, 14, 9 ],
"to": [ 16, 16, 10 ],
"faces": {
"up": { "uv": [ 0, 0, 16, 1 ], "texture": "#texture2" },
"north": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"south": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"west": { "uv": [ 0, 0, 1, 2 ], "texture": "#texture1" },
"east": { "uv": [ 15, 0, 16, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box4",
"from": [ 0, 14, 12 ],
"to": [ 16, 16, 13 ],
"faces": {
"up": { "uv": [ 0, 0, 16, 1 ], "texture": "#texture2" },
"north": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"south": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"west": { "uv": [ 0, 0, 1, 2 ], "texture": "#texture1" },
"east": { "uv": [ 15, 0, 16, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box4",
"from": [ 0, 14, 15 ],
"to": [ 16, 16, 16 ],
"faces": {
"up": { "uv": [ 0, 0, 16, 1 ], "texture": "#texture2" },
"north": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"south": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"west": { "uv": [ 0, 0, 1, 2 ], "texture": "#texture1" },
"east": { "uv": [ 15, 0, 16, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 0, 14, 1 ],
"to": [ 1, 16, 3 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 0, 14, 4 ],
"to": [ 1, 16, 6 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 0, 14, 7 ],
"to": [ 1, 16, 9 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 0, 14, 10 ],
"to": [ 1, 16, 12 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 0, 14, 13 ],
"to": [ 1, 16, 15 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 3, 14, 1 ],
"to": [ 4, 16, 3 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 3, 14, 4 ],
"to": [ 4, 16, 6 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 3, 14, 7 ],
"to": [ 4, 16, 9 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 3, 14, 10 ],
"to": [ 4, 16, 12 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 3, 14, 13 ],
"to": [ 4, 16, 15 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 6, 14, 1 ],
"to": [ 7, 16, 3 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 6, 14, 4 ],
"to": [ 7, 16, 6 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 6, 14, 7 ],
"to": [ 7, 16, 9 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 6, 14, 10 ],
"to": [ 7, 16, 12 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 6, 14, 13 ],
"to": [ 7, 16, 15 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 9, 14, 1 ],
"to": [ 10, 16, 3 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 9, 14, 4 ],
"to": [ 10, 16, 6 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 9, 14, 7 ],
"to": [ 10, 16, 9 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 9, 14, 10 ],
"to": [ 10, 16, 12 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 9, 14, 13 ],
"to": [ 10, 16, 15 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 12, 14, 1 ],
"to": [ 13, 16, 3 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 12, 14, 4 ],
"to": [ 13, 16, 6 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 12, 14, 7 ],
"to": [ 13, 16, 9 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 12, 14, 10 ],
"to": [ 13, 16, 12 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 12, 14, 13 ],
"to": [ 13, 16, 15 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 15, 14, 1 ],
"to": [ 16, 16, 3 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 15, 14, 4 ],
"to": [ 16, 16, 6 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 15, 14, 7 ],
"to": [ 16, 16, 9 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 15, 14, 10 ],
"to": [ 16, 16, 12 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
},
{
"__comment": "Box11",
"from": [ 15, 14, 13 ],
"to": [ 16, 16, 15 ],
"faces": {
"up": { "uv": [ 0, 1, 1, 3 ], "texture": "#texture2" },
"west": { "uv": [ 1, 0, 3, 2 ], "texture": "#texture1" },
"east": { "uv": [ 13, 0, 15, 2 ], "texture": "#texture1" }
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [ 75, 45, 0 ],
"translation": [ 0, 2.5, 0 ],
"scale": [ 0.375, 0.375, 0.375 ]
},
"firstperson_righthand": {
"rotation": [ 0, 45, 0 ],
"scale": [ 0.4, 0.4, 0.4 ]
},
"gui": {
"rotation": [ 30, 225, 0 ],
"scale": [ 0.625, 0.625, 0.625 ]
},
"ground": {
"translation": [ 0, 3, 0 ],
"scale": [ 0.25, 0.25, 0.25 ]
},
"fixed": {
"scale": [ 0.5, 0.5, 0.5 ]
}
},
"overrides": [
]
}