diff --git a/1.11/src/main/java/nmd/primal/forgecraft/CommonEvents.java b/1.11/src/main/java/nmd/primal/forgecraft/CommonEvents.java index 604ae4a3..664de21a 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/CommonEvents.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/CommonEvents.java @@ -5,17 +5,17 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 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.tools.CustomAxe; import nmd.primal.forgecraft.items.tools.CustomHoe; import nmd.primal.forgecraft.items.tools.CustomPickaxe; import nmd.primal.forgecraft.items.tools.CustomShovel; +import nmd.primal.forgecraft.util.ToolNBT; /** * Created by mminaie on 3/15/17. */ -public class CommonEvents implements ToolNBT{ +public class CommonEvents implements ToolNBT { @SubscribeEvent(priority= EventPriority.LOWEST, receiveCanceled=true) diff --git a/1.11/src/main/java/nmd/primal/forgecraft/blocks/AnvilIron.java b/1.11/src/main/java/nmd/primal/forgecraft/blocks/AnvilIron.java new file mode 100644 index 00000000..307539a8 --- /dev/null +++ b/1.11/src/main/java/nmd/primal/forgecraft/blocks/AnvilIron.java @@ -0,0 +1,7 @@ +package nmd.primal.forgecraft.blocks; + +/** + * Created by mminaie on 6/10/17. + */ +public class AnvilIron { +} diff --git a/1.11/src/main/java/nmd/primal/forgecraft/blocks/AnvilSteel.java b/1.11/src/main/java/nmd/primal/forgecraft/blocks/AnvilSteel.java new file mode 100644 index 00000000..c820430d --- /dev/null +++ b/1.11/src/main/java/nmd/primal/forgecraft/blocks/AnvilSteel.java @@ -0,0 +1,7 @@ +package nmd.primal.forgecraft.blocks; + +/** + * Created by mminaie on 6/10/17. + */ +public class AnvilSteel { +} diff --git a/1.11/src/main/java/nmd/primal/forgecraft/blocks/AnvilStone.java b/1.11/src/main/java/nmd/primal/forgecraft/blocks/AnvilStone.java new file mode 100644 index 00000000..88d4a26d --- /dev/null +++ b/1.11/src/main/java/nmd/primal/forgecraft/blocks/AnvilStone.java @@ -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; + } + +} diff --git a/1.11/src/main/java/nmd/primal/forgecraft/init/ModBlocks.java b/1.11/src/main/java/nmd/primal/forgecraft/init/ModBlocks.java index ad434297..4d8dcb0c 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/init/ModBlocks.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/init/ModBlocks.java @@ -142,7 +142,7 @@ public class ModBlocks { if (pItem instanceof WorkMallet && world.getBlockState(belowPos).getBlock().equals(Blocks.STONE)) { player.swingArm(hand); 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); //CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.stoneanvil, 1)); return true; @@ -150,7 +150,7 @@ public class ModBlocks { /*if (pItem instanceof ForgeHammer && world.getBlockState(belowPos).getBlock().equals(Blocks.IRON_BLOCK)) { player.swingArm(hand); 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); //CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.stoneanvil, 1)); return true; @@ -203,13 +203,13 @@ public class ModBlocks { if (pItem instanceof ForgeHammer && world.getBlockState(belowPos).getBlock().equals(Blocks.IRON_BLOCK)) { player.swingArm(hand); 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); //System.out.println("Activating"); return true; } 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); @@ -255,13 +255,13 @@ public class ModBlocks { if (pItem instanceof ForgeHammer && world.getBlockState(belowPos).getBlock().equals(Blocks.IRON_BLOCK)) { player.swingArm(hand); 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); //CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.stoneanvil, 1)); return true; } 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); @@ -307,13 +307,13 @@ public class ModBlocks { if (pItem instanceof ForgeHammer && world.getBlockState(belowPos).getBlock().equals(Blocks.IRON_BLOCK)) { player.swingArm(hand); 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); //CommonUtils.spawnItemEntityFromWorld(world, pos, new ItemStack(ModBlocks.stoneanvil, 1)); return true; } 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); @@ -354,8 +354,8 @@ public class ModBlocks { 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 - stoneanvil = new Anvil(Material.ANVIL, "stoneanvil", 5.0f); - ironanvil = new Anvil(Material.ANVIL, "ironanvil", 6.0f); + stoneanvil = new AnvilStone(Material.ANVIL, "stoneanvil", 5.0f); + ironanvil = new AnvilStone(Material.ANVIL, "ironanvil", 6.0f); //ironballitemcool = new ItemBlockIngotBall(ironball); //ironballitemhot = new ItemBlockIngotBall(ironball); diff --git a/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java b/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java index 61a71b0f..4c8123e4 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/init/ModItems.java @@ -112,25 +112,25 @@ public class ModItems { /********** TOOL PARTS **********/ - pickaxehead = new ToolPart("ironpickaxehead", PrimalMaterials.TOOL_WROUGHT_IRON); - ironaxehead = new ToolPart("ironaxehead", PrimalMaterials.TOOL_WROUGHT_IRON); - ironshovelhead = new ToolPart("ironshovelhead", PrimalMaterials.TOOL_WROUGHT_IRON); - ironhoehead = new ToolPart("ironhoehead", PrimalMaterials.TOOL_WROUGHT_IRON); + pickaxehead = new ToolPart("ironpickaxehead", PrimalMaterials.TOOL_WROUGHT_IRON, 8); + ironaxehead = new ToolPart("ironaxehead", PrimalMaterials.TOOL_WROUGHT_IRON, 9); + ironshovelhead = new ToolPart("ironshovelhead", PrimalMaterials.TOOL_WROUGHT_IRON, 10); + ironhoehead = new ToolPart("ironhoehead", PrimalMaterials.TOOL_WROUGHT_IRON, 11); - cleanironpickaxehead = new ToolPart("cleanironpickaxehead", PrimalMaterials.TOOL_CLEAN_IRON); - cleanironaxehead = new ToolPart("cleanironaxehead", PrimalMaterials.TOOL_CLEAN_IRON); - cleanironshovelhead = new ToolPart("cleanironshovelhead", PrimalMaterials.TOOL_CLEAN_IRON); - cleanironhoehead = new ToolPart("cleanironhoehead", PrimalMaterials.TOOL_CLEAN_IRON); + cleanironpickaxehead = new ToolPart("cleanironpickaxehead", PrimalMaterials.TOOL_CLEAN_IRON, 17); + cleanironaxehead = new ToolPart("cleanironaxehead", PrimalMaterials.TOOL_CLEAN_IRON, 18); + cleanironshovelhead = new ToolPart("cleanironshovelhead", PrimalMaterials.TOOL_CLEAN_IRON, 19); + cleanironhoehead = new ToolPart("cleanironhoehead", PrimalMaterials.TOOL_CLEAN_IRON, 20); - steelpickaxehead = new ToolPart("steelpickaxehead", PrimalMaterials.TOOL_BASIC_STEEL); - steelaxehead = new ToolPart("steelaxehead", PrimalMaterials.TOOL_BASIC_STEEL); - steelshovelhead = new ToolPart("steelshovelhead", PrimalMaterials.TOOL_BASIC_STEEL); - steelhoehead = new ToolPart("steelhoehead", PrimalMaterials.TOOL_BASIC_STEEL); + steelpickaxehead = new ToolPart("steelpickaxehead", PrimalMaterials.TOOL_BASIC_STEEL, 26); + steelaxehead = new ToolPart("steelaxehead", PrimalMaterials.TOOL_BASIC_STEEL, 27); + steelshovelhead = new ToolPart("steelshovelhead", PrimalMaterials.TOOL_BASIC_STEEL, 28); + steelhoehead = new ToolPart("steelhoehead", PrimalMaterials.TOOL_BASIC_STEEL, 29); - wootzpickaxehead = new ToolPart("wootzpickaxehead", PrimalMaterials.TOOL_WOOTZ_STEEL); - wootzaxehead = new ToolPart("wootzaxehead", PrimalMaterials.TOOL_WOOTZ_STEEL); - wootzshovelhead = new ToolPart("wootzshovelhead", PrimalMaterials.TOOL_WOOTZ_STEEL); - wootzhoehead = new ToolPart("wootzhoehead", PrimalMaterials.TOOL_WOOTZ_STEEL); + wootzpickaxehead = new ToolPart("wootzpickaxehead", PrimalMaterials.TOOL_WOOTZ_STEEL, 35); + wootzaxehead = new ToolPart("wootzaxehead", PrimalMaterials.TOOL_WOOTZ_STEEL, 36); + wootzshovelhead = new ToolPart("wootzshovelhead", PrimalMaterials.TOOL_WOOTZ_STEEL, 37); + wootzhoehead = new ToolPart("wootzhoehead", PrimalMaterials.TOOL_WOOTZ_STEEL, 38); /********** TOOLS **********/ diff --git a/1.11/src/main/java/nmd/primal/forgecraft/items/parts/ToolPart.java b/1.11/src/main/java/nmd/primal/forgecraft/items/parts/ToolPart.java index 30e729a6..2f48d566 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/items/parts/ToolPart.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/items/parts/ToolPart.java @@ -12,8 +12,7 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import nmd.primal.forgecraft.ModInfo; -import nmd.primal.forgecraft.ToolNBT; +import nmd.primal.forgecraft.util.ToolNBT; import javax.annotation.Nullable; import java.util.List; @@ -23,7 +22,9 @@ import java.util.List; */ 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.setUnlocalizedName(name); this.setRegistryName(name); @@ -31,6 +32,8 @@ public class ToolPart extends Item implements ToolNBT{ this.setMaxStackSize(1); this.setNoRepair(); + this.ID = ID; + this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() { @@ -224,6 +227,10 @@ public class ToolPart extends Item implements ToolNBT{ return false; } + public int getID() { + return ID; + } + @Override public void onCreated(ItemStack item, World worldIn, EntityPlayer playerIn) { diff --git a/1.11/src/main/java/nmd/primal/forgecraft/items/tools/CustomAxe.java b/1.11/src/main/java/nmd/primal/forgecraft/items/tools/CustomAxe.java index cfc64277..36497605 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/items/tools/CustomAxe.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/items/tools/CustomAxe.java @@ -18,7 +18,7 @@ import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import nmd.primal.forgecraft.ModInfo; -import nmd.primal.forgecraft.ToolNBT; +import nmd.primal.forgecraft.util.ToolNBT; import javax.annotation.Nullable; import java.util.List; diff --git a/1.11/src/main/java/nmd/primal/forgecraft/items/tools/CustomHoe.java b/1.11/src/main/java/nmd/primal/forgecraft/items/tools/CustomHoe.java index db30e06b..ac15fab5 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/items/tools/CustomHoe.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/items/tools/CustomHoe.java @@ -17,7 +17,7 @@ import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import nmd.primal.forgecraft.ModInfo; -import nmd.primal.forgecraft.ToolNBT; +import nmd.primal.forgecraft.util.ToolNBT; import javax.annotation.Nullable; import java.util.List; diff --git a/1.11/src/main/java/nmd/primal/forgecraft/items/tools/CustomPickaxe.java b/1.11/src/main/java/nmd/primal/forgecraft/items/tools/CustomPickaxe.java index 7afceacb..3c4da92d 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/items/tools/CustomPickaxe.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/items/tools/CustomPickaxe.java @@ -18,7 +18,7 @@ import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import nmd.primal.forgecraft.ModInfo; -import nmd.primal.forgecraft.ToolNBT; +import nmd.primal.forgecraft.util.ToolNBT; import javax.annotation.Nullable; import java.util.List; diff --git a/1.11/src/main/java/nmd/primal/forgecraft/items/tools/CustomShovel.java b/1.11/src/main/java/nmd/primal/forgecraft/items/tools/CustomShovel.java index 622c0c59..ee5beac6 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/items/tools/CustomShovel.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/items/tools/CustomShovel.java @@ -20,7 +20,7 @@ import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import nmd.primal.forgecraft.ModInfo; -import nmd.primal.forgecraft.ToolNBT; +import nmd.primal.forgecraft.util.ToolNBT; import javax.annotation.Nullable; import java.util.List; diff --git a/1.11/src/main/java/nmd/primal/forgecraft/renders/blocks/TileAnvilRender.java b/1.11/src/main/java/nmd/primal/forgecraft/renders/blocks/TileAnvilRender.java index 572d4bf4..1c4e409c 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/renders/blocks/TileAnvilRender.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/renders/blocks/TileAnvilRender.java @@ -14,9 +14,8 @@ import net.minecraft.item.Item; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; 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.init.ModBlocks; import nmd.primal.forgecraft.init.ModItems; import nmd.primal.forgecraft.items.BaseMultiItem; import nmd.primal.forgecraft.tiles.TileAnvil; @@ -41,7 +40,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer BlockPos pos = tile.getPos(); IBlockState state = this.getWorld().getBlockState(pos); - if (state.getBlock() instanceof Anvil) { + if (state.getBlock() instanceof AnvilStone) { GL11.glPushMatrix(); GL11.glTranslated(x, y + 1.5D, z); @@ -88,7 +87,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer */ - if (state.getValue(Anvil.FACING) == EnumFacing.NORTH) { + if (state.getValue(AnvilStone.FACING) == EnumFacing.NORTH) { int counter = 0; for (int i = 0; i < 5; i++) { for (int a = 0; a < 5; a++) { @@ -103,7 +102,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer ) { 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.glScaled(0.25D, 0.25D, 0.25D); renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED); @@ -117,7 +116,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer GL11.glPushMatrix(); double scale = 1.0D; 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); GL11.glPopMatrix(); } @@ -129,8 +128,9 @@ public class TileAnvilRender extends TileEntitySpecialRenderer GL11.glPushMatrix(); double scale = 1.0D; 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(180.0F, 0.0F, 0.0F, 1.0F); renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED); GL11.glPopMatrix(); } @@ -142,12 +142,17 @@ public class TileAnvilRender extends TileEntitySpecialRenderer GL11.glPushMatrix(); double scale = 1.0D; 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, 0.0F, 0.0F, 1.0F); renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED); 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(); double scale = 1.0D; GL11.glScaled(scale, scale, scale); @@ -168,7 +173,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer GL11.glPushMatrix(); double scale = 1.0D; 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); GL11.glPopMatrix(); } @@ -178,7 +183,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer } } } - if (state.getValue(Anvil.FACING) == EnumFacing.SOUTH) { + if (state.getValue(AnvilStone.FACING) == EnumFacing.SOUTH) { int counter = 0; for (int i = 0; i < 5; i++) { for (int a = 0; a < 5; a++) { @@ -271,7 +276,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer } } } - if (state.getValue(Anvil.FACING) == EnumFacing.WEST) { + if (state.getValue(AnvilStone.FACING) == EnumFacing.WEST) { int counter = 0; for (int a = 0; a < 5; a++) { for (int i = 0; i < 5; i++) { @@ -361,7 +366,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer } } } - if (state.getValue(Anvil.FACING) == EnumFacing.EAST) { + if (state.getValue(AnvilStone.FACING) == EnumFacing.EAST) { int counter = 0; for (int a = 0; a < 5; a++) { for (int i = 0; i < 5; i++) { diff --git a/1.11/src/main/java/nmd/primal/forgecraft/blocks/Anvil.java b/1.11/src/main/java/nmd/primal/forgecraft/util/AnvilHandler.java similarity index 61% rename from 1.11/src/main/java/nmd/primal/forgecraft/blocks/Anvil.java rename to 1.11/src/main/java/nmd/primal/forgecraft/util/AnvilHandler.java index 51d7567b..41e8d430 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/blocks/Anvil.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/util/AnvilHandler.java @@ -1,321 +1,246 @@ -package nmd.primal.forgecraft.blocks; +package nmd.primal.forgecraft.util; 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.Item; 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.blocks.IngotBall; 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 java.util.concurrent.ThreadLocalRandom; -/** - * Created by mminaie on 3/4/17. - */ -public class Anvil extends CustomContainerFacing { +import static nmd.primal.forgecraft.blocks.CustomContainerFacing.FACING; +import static sun.audio.AudioPlayer.player; +/** + * Created by mminaie on 6/10/17. + */ +public interface AnvilHandler { 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]; } 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]; } 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]; } 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]; } - public Anvil(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); - }*/ + default boolean doAnvilRecipe(ItemStack pItem, String[] tempArray, World world, TileAnvil tile, BlockPos pos, EntityPlayer player) { + AnvilCrafting recipe = AnvilCrafting.getRecipe(tempArray); + if (recipe != null) { + if (pItem.getItem() instanceof WorkMallet) { + pItem.damageItem(15, player); + } + if (pItem.getItem() instanceof ForgeHammer) { + pItem.damageItem(1, player); + } + world.playEvent(1031, pos, 0); - /****************************************************************************** - 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 (ThreadLocalRandom.current().nextInt(0, 2)==0) { + if (recipe.getOutput().getItem() instanceof ToolPart) { + if (!tile.getSlotStack(12).getItem().equals(recipe.getOutput().getItem())) { + ItemStack tempStack = recipe.getOutput(); + tempStack.setTagCompound(new NBTTagCompound()); + NBTTagCompound tags = new NBTTagCompound(); - if ((pItem.getItem() instanceof WorkMallet) || (pItem.getItem() == ModItems.forgehammer)) { + tempStack.getTagCompound().setTag("tags", tags); + tempStack.getSubCompound("tags").setBoolean("hot", false); + tempStack.getSubCompound("tags").setBoolean("emerald", false); + tempStack.getSubCompound("tags").setInteger("diamond", 0); + tempStack.getSubCompound("tags").setInteger("redstone", 0); + tempStack.getSubCompound("tags").setInteger("lapis", 0); - 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()); + tempStack.getSubCompound("tags").setInteger("modifiers", 0); + CommonUtils.spawnItemEntityFromWorld(world, pos, tempStack); } - 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); - } - } - } - } + if (tile.getSlotStack(12).getItem().equals(recipe.getOutput().getItem())) { + + NBTTagCompound tempNBT = tile.getSlotStack(12).getSubCompound("tags"); + ItemStack outputStack = recipe.getOutput(); + outputStack.setTagCompound(new NBTTagCompound()); + outputStack.getTagCompound().setTag("tags", tempNBT); + outputStack.getSubCompound("tags").setBoolean("hot", false); + + if (recipe.getUpgrade() == "repair") { + CommonUtils.spawnItemEntityFromWorld(world, pos, outputStack); } - } - AnvilCrafting recipe = AnvilCrafting.getRecipe(tempArray); + if (outputStack.getSubCompound("tags").getInteger("modifiers") < 3) { - if (recipe != null) { - if (pItem.getItem() instanceof WorkMallet) { - pItem.damageItem(15, player); - } - if (pItem.getItem() instanceof ForgeHammer) { - pItem.damageItem(1, player); - } - world.playEvent(1031, pos, 0); - - - if (ThreadLocalRandom.current().nextInt(0, 2)==0) { - - if (recipe.getOutput().getItem() instanceof ToolPart) { - - if (!tile.getSlotStack(12).getItem().equals(recipe.getOutput().getItem())) { - ItemStack tempStack = recipe.getOutput(); - tempStack.setTagCompound(new NBTTagCompound()); - NBTTagCompound tags = new NBTTagCompound(); - - tempStack.getTagCompound().setTag("tags", tags); - tempStack.getSubCompound("tags").setBoolean("hot", false); - - tempStack.getSubCompound("tags").setBoolean("emerald", false); - tempStack.getSubCompound("tags").setInteger("diamond", 0); - tempStack.getSubCompound("tags").setInteger("redstone", 0); - tempStack.getSubCompound("tags").setInteger("lapis", 0); - - tempStack.getSubCompound("tags").setInteger("modifiers", 0); - CommonUtils.spawnItemEntityFromWorld(world, pos, tempStack); - } - - if (tile.getSlotStack(12).getItem().equals(recipe.getOutput().getItem())) { - - NBTTagCompound tempNBT = tile.getSlotStack(12).getSubCompound("tags"); - ItemStack outputStack = recipe.getOutput(); - outputStack.setTagCompound(new NBTTagCompound()); - outputStack.getTagCompound().setTag("tags", tempNBT); - outputStack.getSubCompound("tags").setBoolean("hot", false); - - if (recipe.getUpgrade() == "repair") { + //Upgrade emerald + if (recipe.getUpgrade() == "emerald") { + if (outputStack.getSubCompound("tags").getInteger("lapis") == 0) { + if (outputStack.getSubCompound("tags").getBoolean("emerald") == false) { + outputStack.setItemDamage(tile.getSlotStack(12).getItemDamage()); + outputStack.getSubCompound("tags").setInteger("emerald", + (outputStack.getSubCompound("tags").getInteger("emerald") + 1)); + outputStack.getSubCompound("tags").setInteger("modifiers", + (outputStack.getSubCompound("tags").getInteger("modifiers") + 1)); CommonUtils.spawnItemEntityFromWorld(world, pos, outputStack); } - - if (outputStack.getSubCompound("tags").getInteger("modifiers") < 3) { - - //Upgrade emerald - if (recipe.getUpgrade() == "emerald") { - if (outputStack.getSubCompound("tags").getInteger("lapis") == 0) { - if (outputStack.getSubCompound("tags").getBoolean("emerald") == false) { - outputStack.setItemDamage(tile.getSlotStack(12).getItemDamage()); - outputStack.getSubCompound("tags").setInteger("emerald", - (outputStack.getSubCompound("tags").getInteger("emerald") + 1)); - outputStack.getSubCompound("tags").setInteger("modifiers", - (outputStack.getSubCompound("tags").getInteger("modifiers") + 1)); - CommonUtils.spawnItemEntityFromWorld(world, pos, outputStack); - } - } - } - - //Upgrade diamond - if (recipe.getUpgrade() == "diamond") { - outputStack.setItemDamage(tile.getSlotStack(12).getItemDamage()); - outputStack.getSubCompound("tags").setInteger("diamond", - (outputStack.getSubCompound("tags").getInteger("diamond") + 1)); - outputStack.getSubCompound("tags").setInteger("modifiers", - (outputStack.getSubCompound("tags").getInteger("modifiers") + 1)); - CommonUtils.spawnItemEntityFromWorld(world, pos, outputStack); - } - - //Upgrade redstone - if (recipe.getUpgrade() == "redstone") { - outputStack.setItemDamage(tile.getSlotStack(12).getItemDamage()); - outputStack.getSubCompound("tags").setInteger("redstone", - (outputStack.getSubCompound("tags").getInteger("redstone") + 1)); - outputStack.getSubCompound("tags").setInteger("modifiers", - (outputStack.getSubCompound("tags").getInteger("modifiers") + 1)); - CommonUtils.spawnItemEntityFromWorld(world, pos, outputStack); - } - - //Upgrade lapis - if (recipe.getUpgrade() == "lapis") { - outputStack.setItemDamage(tile.getSlotStack(12).getItemDamage()); - if (outputStack.getSubCompound("tags").getBoolean("emerald") == false) { - outputStack.getSubCompound("tags").setInteger("lapis", - (outputStack.getSubCompound("tags").getInteger("lapis") + 1)); - outputStack.getSubCompound("tags").setInteger("modifiers", - (outputStack.getSubCompound("tags").getInteger("modifiers") + 1)); - CommonUtils.spawnItemEntityFromWorld(world, pos, outputStack); - } - } - } - } - } else { - CommonUtils.spawnItemEntityFromWorld(world, pos, recipe.getOutput()); - } - //world.playEvent(1031, pos, 0); - for (int i = 0; i < tile.getSlotListSize(); i++) { - if (!tile.getSlotStack(i).isEmpty()) { - tile.setSlotStack(i, ItemStack.EMPTY); } } - return true; - } - } - } - //} - - - /***************************************************************************** - Adding and Removing Inventory With Tongs - *****************************************************************************/ - - - if ( (!(pItem.getItem() instanceof WorkMallet)) || (!(pItem.getItem() instanceof ForgeHammer)) ) { - if(Block.getBlockFromItem(pItem.getItem()) instanceof IngotBall) { - return false; - } - - if (state.getValue(FACING) == EnumFacing.NORTH) { - int counter = 0; - for (int z = 0; z < 5; z++) { - for (int x = 0; x < 5; x++) { - if (hitx >= this.getNormalMin(x) && hitx <= this.getNormalMax(x)) { - if (hitz >= this.getNormalMin(z) && hitz <= this.getNormalMax(z)) { - doWork(pItem, counter, tile, world, pos, player); - return true; - } - } - counter++; - } - } - } - if (state.getValue(FACING) == EnumFacing.SOUTH) { - int counter = 0; - for (int z = 0; z < 5; z++) { - for (int x = 0; x < 5; x++) { - if (hitx >= this.getReverseMin(x) && hitx <= this.getReverseMax(x)) { - if (hitz >= this.getReverseMin(z) && hitz <= this.getReverseMax(z)) { - doWork(pItem, counter, tile, world, pos, player); - return true; - } - } - counter++; - } - } - } - if (state.getValue(FACING) == EnumFacing.WEST) { - int counter = 0; - for (int x = 0; x < 5; x++) { - for (int z = 0; z < 5; z++) { - if (hitx >= this.getNormalMin(x) && hitx <= this.getNormalMax(x)) { - if (hitz >= this.getReverseMin(z) && hitz <= this.getReverseMax(z)) { - doWork(pItem, counter, tile, world, pos, player); - return true; - } - } - counter++; - } - } - } - if (state.getValue(FACING) == EnumFacing.EAST) { - int counter = 0; - for (int x = 0; x < 5; x++) { - for (int z = 0; z < 5; z++) { - if (hitx >= this.getReverseMin(x) && hitx <= this.getReverseMax(x)) { - if (hitz >= this.getNormalMin(z) && hitz <= this.getNormalMax(z)) { - doWork(pItem, counter, tile, world, pos, player); - return true; - } - } - counter++; - } + + //Upgrade diamond + if (recipe.getUpgrade() == "diamond") { + outputStack.setItemDamage(tile.getSlotStack(12).getItemDamage()); + outputStack.getSubCompound("tags").setInteger("diamond", + (outputStack.getSubCompound("tags").getInteger("diamond") + 1)); + outputStack.getSubCompound("tags").setInteger("modifiers", + (outputStack.getSubCompound("tags").getInteger("modifiers") + 1)); + CommonUtils.spawnItemEntityFromWorld(world, pos, outputStack); + } + + //Upgrade redstone + if (recipe.getUpgrade() == "redstone") { + outputStack.setItemDamage(tile.getSlotStack(12).getItemDamage()); + outputStack.getSubCompound("tags").setInteger("redstone", + (outputStack.getSubCompound("tags").getInteger("redstone") + 1)); + outputStack.getSubCompound("tags").setInteger("modifiers", + (outputStack.getSubCompound("tags").getInteger("modifiers") + 1)); + CommonUtils.spawnItemEntityFromWorld(world, pos, outputStack); + } + + //Upgrade lapis + if (recipe.getUpgrade() == "lapis") { + outputStack.setItemDamage(tile.getSlotStack(12).getItemDamage()); + if (outputStack.getSubCompound("tags").getBoolean("emerald") == false) { + outputStack.getSubCompound("tags").setInteger("lapis", + (outputStack.getSubCompound("tags").getInteger("lapis") + 1)); + outputStack.getSubCompound("tags").setInteger("modifiers", + (outputStack.getSubCompound("tags").getInteger("modifiers") + 1)); + CommonUtils.spawnItemEntityFromWorld(world, pos, outputStack); + } + } } } + } else { + CommonUtils.spawnItemEntityFromWorld(world, pos, recipe.getOutput()); + } + //world.playEvent(1031, pos, 0); + for (int i = 0; i < tile.getSlotListSize(); i++) { + if (!tile.getSlotStack(i).isEmpty()) { + tile.setSlotStack(i, ItemStack.EMPTY); + } } + return true; } - return false; } return false; } - private boolean doWork(ItemStack pItem, Integer counter, TileAnvil tile, World world, BlockPos pos, EntityPlayer player) { + + + +/***************************************************************************** + 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(Block.getBlockFromItem(pItem.getItem()) instanceof IngotBall) { + return false; + } + + if (state.getValue(FACING) == EnumFacing.NORTH) { + int counter = 0; + for (int z = 0; z < 5; z++) { + for (int x = 0; x < 5; x++) { + if (hitx >= this.getNormalMin(x) && hitx <= this.getNormalMax(x)) { + if (hitz >= this.getNormalMin(z) && hitz <= this.getNormalMax(z)) { + AnvilHandler.doWork(pItem, counter, tile, world, pos, player); + return true; + } + } + counter++; + } + } + } + if (state.getValue(FACING) == EnumFacing.SOUTH) { + int counter = 0; + for (int z = 0; z < 5; z++) { + for (int x = 0; x < 5; x++) { + if (hitx >= this.getReverseMin(x) && hitx <= this.getReverseMax(x)) { + if (hitz >= this.getReverseMin(z) && hitz <= this.getReverseMax(z)) { + doWork(pItem, counter, tile, world, pos, player); + return true; + } + } + counter++; + } + } + } + if (state.getValue(FACING) == EnumFacing.WEST) { + int counter = 0; + for (int x = 0; x < 5; x++) { + for (int z = 0; z < 5; z++) { + if (hitx >= this.getNormalMin(x) && hitx <= this.getNormalMax(x)) { + if (hitz >= this.getReverseMin(z) && hitz <= this.getReverseMax(z)) { + doWork(pItem, counter, tile, world, pos, player); + return true; + } + } + counter++; + } + } + } + if (state.getValue(FACING) == EnumFacing.EAST) { + int counter = 0; + for (int x = 0; x < 5; x++) { + for (int z = 0; z < 5; z++) { + if (hitx >= this.getReverseMin(x) && hitx <= this.getReverseMax(x)) { + if (hitz >= this.getNormalMin(z) && hitz <= this.getNormalMax(z)) { + doWork(pItem, counter, tile, world, pos, player); + return true; + } + } + counter++; + } + } + } + } + return false; + } + + + static boolean doWork(ItemStack pItem, Integer counter, TileAnvil tile, World world, BlockPos pos, EntityPlayer player) { if (pItem.getItem().equals(ModItems.stonetongs)) { if ((pItem.getTagCompound().getInteger("type") == 6) || (pItem.getTagCompound().getInteger("type") == 7) || @@ -372,7 +297,32 @@ public class Anvil extends CustomContainerFacing { tile.setSlotStack(counter, ItemStack.EMPTY); 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"); tile.setSlotStack((counter), new ItemStack(ModItems.ironingotballhot, 1)); pItem.getTagCompound().setInteger("type", 0); - //return true; + return true; } if (pItem.getTagCompound().getInteger("type") == 7) { //System.out.println("Tongs meta = 7"); @@ -390,7 +340,7 @@ public class Anvil extends CustomContainerFacing { pItem.getTagCompound().setInteger("type", 0); ///System.out.println(counter); //System.out.println(tile.getSlotStack(counter)); - //return true; + return true; } if (pItem.getTagCompound().getInteger("type") == 8) { ItemStack tempStack = new ItemStack(ModItems.pickaxehead, 1); @@ -472,7 +422,7 @@ public class Anvil extends CustomContainerFacing { //System.out.println("Tongs meta = 6"); tile.setSlotStack((counter), new ItemStack(ModItems.ironcleaningotballhot, 1)); pItem.getTagCompound().setInteger("type", 0); - //return true; + return true; } if (pItem.getTagCompound().getInteger("type") == 16) { //System.out.println("Tongs meta = 7"); @@ -480,7 +430,7 @@ public class Anvil extends CustomContainerFacing { pItem.getTagCompound().setInteger("type", 0); ///System.out.println(counter); //System.out.println(tile.getSlotStack(counter)); - //return true; + return true; } if (pItem.getTagCompound().getInteger("type") == 17) { ItemStack tempStack = new ItemStack(ModItems.cleanironpickaxehead, 1); @@ -562,7 +512,7 @@ public class Anvil extends CustomContainerFacing { //System.out.println("Tongs meta = 6"); tile.setSlotStack((counter), new ItemStack(ModItems.steelingotballhot, 1)); pItem.getTagCompound().setInteger("type", 0); - //return true; + return true; } if (pItem.getTagCompound().getInteger("type") == 25) { //System.out.println("Tongs meta = 7"); @@ -570,7 +520,7 @@ public class Anvil extends CustomContainerFacing { pItem.getTagCompound().setInteger("type", 0); ///System.out.println(counter); //System.out.println(tile.getSlotStack(counter)); - //return true; + return true; } if (pItem.getTagCompound().getInteger("type") == 26) { 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 (tile.getSlotStack(counter).getItem().equals(Items.DIAMOND)) { @@ -689,8 +635,8 @@ public class Anvil extends CustomContainerFacing { if (Block.getBlockFromItem(tile.getSlotStack(counter).getItem()) instanceof IngotBall ) { CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter)); - tile.setSlotStack(counter, ItemStack.EMPTY); - return true; + tile.setSlotStack(counter, ItemStack.EMPTY); + return true; } if (tile.getSlotStack(counter).getItem().equals(ModItems.pickaxehead)) { @@ -775,125 +721,4 @@ public class Anvil extends CustomContainerFacing { 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; - } - } diff --git a/1.11/src/main/java/nmd/primal/forgecraft/ToolNBT.java b/1.11/src/main/java/nmd/primal/forgecraft/util/ToolNBT.java similarity index 98% rename from 1.11/src/main/java/nmd/primal/forgecraft/ToolNBT.java rename to 1.11/src/main/java/nmd/primal/forgecraft/util/ToolNBT.java index 3f19cdf3..2f345809 100644 --- a/1.11/src/main/java/nmd/primal/forgecraft/ToolNBT.java +++ b/1.11/src/main/java/nmd/primal/forgecraft/util/ToolNBT.java @@ -1,4 +1,4 @@ -package nmd.primal.forgecraft; +package nmd.primal.forgecraft.util; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; diff --git a/1.11/src/main/resources/assets/forgecraft/models/block/stoneanvil.json b/1.11/src/main/resources/assets/forgecraft/models/block/stoneanvil.json index 22bbcd73..cd34da9f 100644 --- a/1.11/src/main/resources/assets/forgecraft/models/block/stoneanvil.json +++ b/1.11/src/main/resources/assets/forgecraft/models/block/stoneanvil.json @@ -2,26 +2,26 @@ "__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" + "particle": "blocks/stone", + "texture": "blocks/stone", + "texture1": "blocks/anvil_base", + "texture2": "blocks/anvil_base_top" }, "elements": [ { - "__comment": "Cube1", + "__comment": "Box3", "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" }, + "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": "Cube2", + "__comment": "Box41", "from": [ 0, 14, 0 ], "to": [ 16, 16, 16 ], "faces": { diff --git a/1.11/src/main/resources/assets/forgecraft/models/block/stoneanvilbkp.json b/1.11/src/main/resources/assets/forgecraft/models/block/stoneanvilbkp.json new file mode 100644 index 00000000..22bbcd73 --- /dev/null +++ b/1.11/src/main/resources/assets/forgecraft/models/block/stoneanvilbkp.json @@ -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": [ + ] +} \ No newline at end of file diff --git a/1.11/src/main/resources/assets/forgecraft/models/block/stoneanvilbkpnew.json b/1.11/src/main/resources/assets/forgecraft/models/block/stoneanvilbkpnew.json new file mode 100644 index 00000000..89b02a32 --- /dev/null +++ b/1.11/src/main/resources/assets/forgecraft/models/block/stoneanvilbkpnew.json @@ -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": [ + ] +} \ No newline at end of file