discarded ItemBlock path and opted for abstract item class with custom code in init
This commit is contained in:
3
1.11/eula.txt
Normal file
3
1.11/eula.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula).
|
||||||
|
#Sun Feb 19 22:59:02 EST 2017
|
||||||
|
eula=false
|
||||||
2
1.11/server.properties
Normal file
2
1.11/server.properties
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#Minecraft server properties
|
||||||
|
#Mon Feb 13 22:08:20 EST 2017
|
||||||
@@ -37,7 +37,9 @@ public class IngotBall extends BlockCustomBase {
|
|||||||
@Override
|
@Override
|
||||||
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
|
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
|
||||||
{
|
{
|
||||||
|
//System.out.println(stack.getItemDamage());
|
||||||
worldIn.setBlockState(pos, state.withProperty(ACTIVE, Boolean.valueOf(false)), 2);
|
worldIn.setBlockState(pos, state.withProperty(ACTIVE, Boolean.valueOf(false)), 2);
|
||||||
|
//System.out.println(state.getValue(ACTIVE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package nmd.primal.forgecraft.enumhandler;
|
package nmd.primal.forgecraft.enumhandler;
|
||||||
|
|
||||||
import net.minecraft.util.IStringSerializable;
|
import net.minecraft.util.IStringSerializable;
|
||||||
|
import nmd.primal.forgecraft.util.IMetaLookup;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by mminaie on 2/1/17.
|
* Created by mminaie on 2/1/17.
|
||||||
@@ -35,4 +36,43 @@ public class EnumHandler {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public enum IngotTypes implements IMetaLookup<IngotTypes> {
|
||||||
|
IRONCOOL, /*0*/
|
||||||
|
IRONHOT; /*1*/
|
||||||
|
|
||||||
|
public final int meta;
|
||||||
|
public final String name;
|
||||||
|
public boolean set = false;
|
||||||
|
|
||||||
|
private IngotTypes() {
|
||||||
|
meta = ordinal();
|
||||||
|
name = toString().toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getVariantName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getOrdinal() {
|
||||||
|
return meta;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IngotTypes getByOrdinal(int i) {
|
||||||
|
return this.values()[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getID() {
|
||||||
|
return "ore_type";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import net.minecraft.item.Item;
|
|||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraftforge.client.model.ModelLoader;
|
import net.minecraftforge.client.model.ModelLoader;
|
||||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import nmd.primal.forgecraft.blocks.*;
|
import nmd.primal.forgecraft.blocks.*;
|
||||||
import nmd.primal.forgecraft.items.blocks.ItemBlockIngotBall;
|
import nmd.primal.forgecraft.items.blocks.ItemBlockIngotBall;
|
||||||
|
|
||||||
@@ -37,7 +39,8 @@ public class ModBlocks {
|
|||||||
public static Block failedironcruciblehot;
|
public static Block failedironcruciblehot;
|
||||||
|
|
||||||
public static Block ironball;
|
public static Block ironball;
|
||||||
public static ItemBlock ironballitem;
|
//public static ItemBlock ironballitemcool;
|
||||||
|
//public static ItemBlock ironballitemhot;
|
||||||
|
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
@@ -66,10 +69,12 @@ public class ModBlocks {
|
|||||||
failedironcruciblehot = new CrucibleHot(Material.ROCK, "failedironcruciblehot");
|
failedironcruciblehot = new CrucibleHot(Material.ROCK, "failedironcruciblehot");
|
||||||
|
|
||||||
ironball = new IngotBall(Material.IRON, "ironball", 5.0F);
|
ironball = new IngotBall(Material.IRON, "ironball", 5.0F);
|
||||||
ironballitem = new ItemBlockIngotBall(ironball);
|
//ironballitemcool = new ItemBlockIngotBall(ironball);
|
||||||
|
//ironballitemhot = new ItemBlockIngotBall(ironball);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
registerBlock(firebox);
|
registerBlock(firebox);
|
||||||
registerBlock(bloomery);
|
registerBlock(bloomery);
|
||||||
@@ -93,9 +98,12 @@ public class ModBlocks {
|
|||||||
registerBlock(failedironcrucible);
|
registerBlock(failedironcrucible);
|
||||||
registerBlock(failedironcruciblehot);
|
registerBlock(failedironcruciblehot);
|
||||||
|
|
||||||
registerBlockSubType(ironball, ironballitem);
|
registerBlock(ironball);
|
||||||
|
//registerBlockSubType(ironball, ironballitemcool, "ironcool");
|
||||||
|
//registerBlockSubType(ironball, ironballitemhot, "ironhot");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
public static void registerRenders() {
|
public static void registerRenders() {
|
||||||
registerRender(firebox);
|
registerRender(firebox);
|
||||||
registerRender(pistonbellowsoak);
|
registerRender(pistonbellowsoak);
|
||||||
@@ -118,8 +126,8 @@ public class ModBlocks {
|
|||||||
registerRender(failedironcruciblehot);
|
registerRender(failedironcruciblehot);
|
||||||
|
|
||||||
registerRender(ironball);
|
registerRender(ironball);
|
||||||
registerRenderCustom(ironballitem, 0, new ModelResourceLocation(ironballitem.getUnlocalizedName() + "_0"));
|
//registerRenderCustom(ironballitemcool, 0, new ModelResourceLocation(ironballitemcool.getUnlocalizedName()));
|
||||||
registerRenderCustom(ironballitem, 1, new ModelResourceLocation(ironballitem.getUnlocalizedName() + "_1"));
|
//registerRenderCustom(ironballitemhot, 1, new ModelResourceLocation(ironballitemhot.getUnlocalizedName()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,10 +138,10 @@ public class ModBlocks {
|
|||||||
GameRegistry.register(item);
|
GameRegistry.register(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void registerBlockSubType(Block block, ItemBlock itemBlock){
|
private static void registerBlockSubType(Block block, ItemBlock itemBlock, String registryName){
|
||||||
GameRegistry.register(block);
|
GameRegistry.register(block);
|
||||||
ItemBlock item = itemBlock;
|
ItemBlock item = itemBlock;
|
||||||
item.setRegistryName(block.getRegistryName());
|
item.setRegistryName(registryName);
|
||||||
GameRegistry.register(item);
|
GameRegistry.register(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,18 +4,25 @@ import net.minecraft.client.Minecraft;
|
|||||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumActionResult;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.EnumHand;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.client.model.ModelLoader;
|
import net.minecraftforge.client.model.ModelLoader;
|
||||||
import net.minecraftforge.client.model.obj.OBJLoader;
|
import net.minecraftforge.client.model.obj.OBJLoader;
|
||||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import nmd.primal.forgecraft.ModInfo;
|
import nmd.primal.forgecraft.ModInfo;
|
||||||
import nmd.primal.forgecraft.items.ItemBellowsHandle;
|
import nmd.primal.forgecraft.blocks.IngotBall;
|
||||||
import nmd.primal.forgecraft.items.ItemForgingManual;
|
import nmd.primal.forgecraft.items.*;
|
||||||
import nmd.primal.forgecraft.items.ItemSoftCrucible;
|
|
||||||
import nmd.primal.forgecraft.items.ItemStoneTongs;
|
|
||||||
import nmd.primal.forgecraft.items.blocks.ItemBlockIngotBall;
|
import nmd.primal.forgecraft.items.blocks.ItemBlockIngotBall;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,15 +33,32 @@ public class ModItems {
|
|||||||
public static Item pistonbellows;
|
public static Item pistonbellows;
|
||||||
public static Item softcrucible;
|
public static Item softcrucible;
|
||||||
public static Item stonetongs;
|
public static Item stonetongs;
|
||||||
//public static ItemBlock ironingotball;
|
//public static Item ironingotballcool;
|
||||||
|
public static Item ironingotballhot;
|
||||||
//public static Item forgingmanual;
|
//public static Item forgingmanual;
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
OBJLoader.INSTANCE.addDomain(ModInfo.MOD_ID);
|
//OBJLoader.INSTANCE.addDomain(ModInfo.MOD_ID);
|
||||||
pistonbellows = new ItemBellowsHandle();
|
pistonbellows = new ItemBellowsHandle();
|
||||||
softcrucible = new ItemSoftCrucible();
|
softcrucible = new ItemSoftCrucible();
|
||||||
stonetongs = new ItemStoneTongs("stonetongs");
|
stonetongs = new ItemStoneTongs("stonetongs");
|
||||||
//ironingotball = new ItemBlockIngotBall(ModBlocks.ironball.setRegistryName(ModBlocks.ironball.getRegistryName()));
|
//ironingotballcool = new BaseMultiItem("ironingotcool") {};
|
||||||
|
ironingotballhot = new BaseMultiItem("ironingothot") {
|
||||||
|
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
||||||
|
if(!world.isRemote) {
|
||||||
|
ItemStack itemstack = player.getHeldItem(hand);
|
||||||
|
if (world.getBlockState(pos).getBlock() != ModBlocks.firebox) {
|
||||||
|
BlockPos tempPos = new BlockPos(pos.getX(), pos.getY() + 1, pos.getZ());
|
||||||
|
if(world.getBlockState(tempPos).getBlock() == Blocks.AIR){
|
||||||
|
world.setBlockState(tempPos, ModBlocks.ironball.getDefaultState().withProperty(IngotBall.ACTIVE, true), 3);
|
||||||
|
itemstack.shrink(1);
|
||||||
|
return EnumActionResult.SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return EnumActionResult.FAIL;
|
||||||
|
}
|
||||||
|
};
|
||||||
//forgingmanual = new ItemForgingManual();
|
//forgingmanual = new ItemForgingManual();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,17 +66,21 @@ public class ModItems {
|
|||||||
GameRegistry.register(pistonbellows);
|
GameRegistry.register(pistonbellows);
|
||||||
GameRegistry.register(softcrucible);
|
GameRegistry.register(softcrucible);
|
||||||
GameRegistry.register(stonetongs);
|
GameRegistry.register(stonetongs);
|
||||||
//GameRegistry.register(ironingotball);
|
//GameRegistry.register(ironingotballcool);
|
||||||
|
GameRegistry.register(ironingotballhot);
|
||||||
//GameRegistry.register(forgingmanual);
|
//GameRegistry.register(forgingmanual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
public static void registerRenders() {
|
public static void registerRenders() {
|
||||||
registerRender(pistonbellows);
|
registerRender(pistonbellows);
|
||||||
registerRender(softcrucible);
|
registerRender(softcrucible);
|
||||||
//registerRenderItemBlock(ironingotball);
|
//registerRender(ironingotballcool);
|
||||||
|
registerRender(ironingotballhot);
|
||||||
//registerRender(forgingmanual);
|
//registerRender(forgingmanual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
public static void registerCustomRenders(){
|
public static void registerCustomRenders(){
|
||||||
ModelBakery.registerItemVariants(ModItems.stonetongs, ModItems.stonetongs.getRegistryName(),
|
ModelBakery.registerItemVariants(ModItems.stonetongs, ModItems.stonetongs.getRegistryName(),
|
||||||
new ResourceLocation(ModInfo.MOD_ID, "stonetongs"),
|
new ResourceLocation(ModInfo.MOD_ID, "stonetongs"),
|
||||||
@@ -61,7 +89,8 @@ public class ModItems {
|
|||||||
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_emptyhotcracked"),
|
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_emptyhotcracked"),
|
||||||
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotiron"),
|
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotiron"),
|
||||||
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotironcooked"),
|
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotironcooked"),
|
||||||
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotironfailed")
|
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_hotironfailed"),
|
||||||
|
new ResourceLocation(ModInfo.MOD_ID, "stonetongs_ingot")
|
||||||
);
|
);
|
||||||
ModelLoader.setCustomMeshDefinition(ModItems.stonetongs, new ItemMeshDefinition() {
|
ModelLoader.setCustomMeshDefinition(ModItems.stonetongs, new ItemMeshDefinition() {
|
||||||
|
|
||||||
@@ -86,6 +115,9 @@ public class ModItems {
|
|||||||
else if (stack.getTagCompound().getInteger("type") == 5 ) {
|
else if (stack.getTagCompound().getInteger("type") == 5 ) {
|
||||||
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_hotironfailed", "inventory");
|
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_hotironfailed", "inventory");
|
||||||
}
|
}
|
||||||
|
else if (stack.getTagCompound().getInteger("type") == 6 ) {
|
||||||
|
return new ModelResourceLocation(stack.getItem().getRegistryName() + "_ingot", "inventory");
|
||||||
|
}
|
||||||
else return new ModelResourceLocation(stack.getItem().getRegistryName(), "inventory");
|
else return new ModelResourceLocation(stack.getItem().getRegistryName(), "inventory");
|
||||||
}
|
}
|
||||||
return new ModelResourceLocation(stack.getItem().getRegistryName(), "inventory");
|
return new ModelResourceLocation(stack.getItem().getRegistryName(), "inventory");
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package nmd.primal.forgecraft.items;
|
||||||
|
|
||||||
|
import nmd.primal.forgecraft.items.BaseItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by mminaie on 2/19/17.
|
||||||
|
*/
|
||||||
|
public abstract class BaseMultiItem extends BaseItem {
|
||||||
|
|
||||||
|
public BaseMultiItem( String registryName) {
|
||||||
|
setUnlocalizedName(registryName);
|
||||||
|
setRegistryName(registryName);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -13,6 +13,7 @@ import net.minecraft.world.World;
|
|||||||
import nmd.primal.forgecraft.ModInfo;
|
import nmd.primal.forgecraft.ModInfo;
|
||||||
import nmd.primal.forgecraft.blocks.Crucible;
|
import nmd.primal.forgecraft.blocks.Crucible;
|
||||||
import nmd.primal.forgecraft.blocks.CrucibleHot;
|
import nmd.primal.forgecraft.blocks.CrucibleHot;
|
||||||
|
import nmd.primal.forgecraft.blocks.IngotBall;
|
||||||
import nmd.primal.forgecraft.init.ModBlocks;
|
import nmd.primal.forgecraft.init.ModBlocks;
|
||||||
import nmd.primal.forgecraft.tiles.TileBaseCrucible;
|
import nmd.primal.forgecraft.tiles.TileBaseCrucible;
|
||||||
import nmd.primal.forgecraft.tiles.TileBloomery;
|
import nmd.primal.forgecraft.tiles.TileBloomery;
|
||||||
@@ -44,8 +45,40 @@ public class ItemStoneTongs extends Item {
|
|||||||
|
|
||||||
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
|
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/*
|
||||||
|
0 | Default StoneTongs
|
||||||
|
1 | Empty Crucible Hot
|
||||||
|
2 | Empty Crucible Cracked Hot
|
||||||
|
3 | Hot Iron Crucible
|
||||||
|
4 | Hot Cooked Iron Crucible
|
||||||
|
5 | Hot Failed Iron Crucible
|
||||||
|
6 | Hot Iron Ingot
|
||||||
|
7 |
|
||||||
|
*/
|
||||||
|
|
||||||
if(!world.isRemote) {
|
if(!world.isRemote) {
|
||||||
ItemStack itemstack = player.getHeldItem(hand);
|
ItemStack itemstack = player.getHeldItem(hand);
|
||||||
|
|
||||||
|
/*****
|
||||||
|
Picks Up Hot Ingots from the Ground
|
||||||
|
*****/
|
||||||
|
if (world.getBlockState(pos).getBlock() != ModBlocks.bloomery) {
|
||||||
|
if (world.getBlockState(pos).getBlock() instanceof IngotBall) {
|
||||||
|
//TileBaseCrucible tileCrucible = (TileBaseCrucible) world.getTileEntity(pos);
|
||||||
|
if (world.getBlockState(pos).getBlock() == ModBlocks.ironball) {
|
||||||
|
if(world.getBlockState(pos).getValue(IngotBall.ACTIVE) == true) {
|
||||||
|
itemstack.getTagCompound().setInteger("type", 6);
|
||||||
|
//itemstack.getTagCompound().setInteger("cooldown", tileCrucible.countdown);
|
||||||
|
world.setBlockToAir(pos);
|
||||||
|
System.out.println(itemstack.getTagCompound().getInteger("type"));
|
||||||
|
return EnumActionResult.SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*****
|
/*****
|
||||||
Picks Up Hot Crucibles from the Ground
|
Picks Up Hot Crucibles from the Ground
|
||||||
*****/
|
*****/
|
||||||
@@ -84,7 +117,7 @@ public class ItemStoneTongs extends Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*****
|
/*****
|
||||||
Places the crucible from the Tongs to the World
|
Places the content from the Tongs to the World
|
||||||
*****/
|
*****/
|
||||||
if ((world.getBlockState(pos).getBlock() instanceof Crucible) || (world.getBlockState(pos).getBlock() instanceof CrucibleHot)) {
|
if ((world.getBlockState(pos).getBlock() instanceof Crucible) || (world.getBlockState(pos).getBlock() instanceof CrucibleHot)) {
|
||||||
return EnumActionResult.FAIL;
|
return EnumActionResult.FAIL;
|
||||||
@@ -131,7 +164,9 @@ public class ItemStoneTongs extends Item {
|
|||||||
itemstack.getTagCompound().setInteger("type", 0);
|
itemstack.getTagCompound().setInteger("type", 0);
|
||||||
return EnumActionResult.SUCCESS;
|
return EnumActionResult.SUCCESS;
|
||||||
case 6:
|
case 6:
|
||||||
return EnumActionResult.FAIL;
|
world.setBlockState(tempPos, ModBlocks.ironball.getDefaultState().withProperty(IngotBall.ACTIVE, true), 3);
|
||||||
|
itemstack.getTagCompound().setInteger("type", 0);
|
||||||
|
return EnumActionResult.SUCCESS;
|
||||||
case 7:
|
case 7:
|
||||||
return EnumActionResult.FAIL;
|
return EnumActionResult.FAIL;
|
||||||
}
|
}
|
||||||
@@ -141,6 +176,7 @@ public class ItemStoneTongs extends Item {
|
|||||||
/*****
|
/*****
|
||||||
Pulls the crucible from the Bloomery
|
Pulls the crucible from the Bloomery
|
||||||
*****/
|
*****/
|
||||||
|
if(itemstack.getTagCompound().getInteger("type") == 0){
|
||||||
if (world.getBlockState(pos).getBlock() == ModBlocks.bloomery) {
|
if (world.getBlockState(pos).getBlock() == ModBlocks.bloomery) {
|
||||||
TileBloomery tile = (TileBloomery) world.getTileEntity(pos);
|
TileBloomery tile = (TileBloomery) world.getTileEntity(pos);
|
||||||
if (tile.getSlotStack(1).getItem().equals(Item.getItemFromBlock(ModBlocks.emptycruciblehot))) {
|
if (tile.getSlotStack(1).getItem().equals(Item.getItemFromBlock(ModBlocks.emptycruciblehot))) {
|
||||||
@@ -164,8 +200,11 @@ public class ItemStoneTongs extends Item {
|
|||||||
tile.setSlotStack(1, ItemStack.EMPTY);
|
tile.setSlotStack(1, ItemStack.EMPTY);
|
||||||
return EnumActionResult.SUCCESS;
|
return EnumActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
else return EnumActionResult.FAIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else return EnumActionResult.FAIL;
|
||||||
|
System.out.println(itemstack.getTagCompound().getInteger("type"));
|
||||||
}
|
}
|
||||||
return EnumActionResult.FAIL;
|
return EnumActionResult.FAIL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,20 @@
|
|||||||
package nmd.primal.forgecraft.items.blocks;
|
package nmd.primal.forgecraft.items.blocks;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.NonNullList;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import nmd.primal.forgecraft.ModInfo;
|
import nmd.primal.forgecraft.ModInfo;
|
||||||
|
import nmd.primal.forgecraft.enumhandler.EnumHandler;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static nmd.primal.forgecraft.enumhandler.EnumHandler.IngotTypes.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by mminaie on 2/12/17.
|
* Created by mminaie on 2/12/17.
|
||||||
@@ -24,5 +35,24 @@ public class ItemBlockIngotBall extends ItemBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getUnlocalizedNameInefficiently(ItemStack stack) {
|
||||||
|
EnumHandler.IngotTypes v = EnumHandler.IngotTypes.values()[stack.getItemDamage()];
|
||||||
|
//EnumOreType z = EnumOreType.values()[stack.getItemDamage()];
|
||||||
|
switch(v) {
|
||||||
|
case IRONCOOL:
|
||||||
|
case IRONHOT:
|
||||||
|
|
||||||
|
return "item.forgecraft:"+v.name;
|
||||||
|
default:
|
||||||
|
return "item.forgecraft:unknown";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) {
|
||||||
|
subItems.add(new ItemStack(itemIn, 1, EnumHandler.IngotTypes.IRONCOOL.meta));
|
||||||
|
subItems.add(new ItemStack(itemIn, 1, EnumHandler.IngotTypes.IRONHOT.meta));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package nmd.primal.forgecraft.util;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by mminaie on 2/19/17.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
public interface IMetaLookup<T extends Enum> {
|
||||||
|
public String getID();
|
||||||
|
public T getByOrdinal(int i);
|
||||||
|
|
||||||
|
public String getVariantName();
|
||||||
|
public int getOrdinal();
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"forge_marker":1,
|
||||||
|
"textures": {
|
||||||
|
"particle": "forgecraft:blocks/iron_ingot_hot",
|
||||||
|
"texture": "forgecraft:blocks/iron_ingot_hot"
|
||||||
|
},
|
||||||
|
"parent": "forgecraft:item/ironball"
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"forge_marker":1,
|
||||||
|
"textures": {
|
||||||
|
"particle": "blocks/planks_oak",
|
||||||
|
"texture": "blocks/planks_oak",
|
||||||
|
"texture1": "forgecraft:blocks/stone_slab",
|
||||||
|
"texture2": "forgecraft:blocks/iron_ingot_hot"
|
||||||
|
},
|
||||||
|
"parent": "forgecraft:item/stonetongs_ingot_default"
|
||||||
|
}
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
{
|
||||||
|
"__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio",
|
||||||
|
"textures": {
|
||||||
|
"particle": "blocks/planks_oak",
|
||||||
|
"texture": "blocks/planks_oak",
|
||||||
|
"texture1": "forgecraft:blocks/stone_slab",
|
||||||
|
"texture2": "forgecraft:blocks/iron_ingot_hot"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"__comment": "Cube1",
|
||||||
|
"from": [ 6, 0, 0 ],
|
||||||
|
"to": [ 7, 1, 3 ],
|
||||||
|
"faces": {
|
||||||
|
"down": { "uv": [ 4, 12, 5, 15 ], "texture": "#texture1" },
|
||||||
|
"up": { "uv": [ 4, 1, 5, 4 ], "texture": "#texture1" },
|
||||||
|
"north": { "uv": [ 11, 13, 12, 14 ], "texture": "#texture1" },
|
||||||
|
"south": { "uv": [ 4, 13, 5, 14 ], "texture": "#texture1" },
|
||||||
|
"west": { "uv": [ 1, 14, 4, 15 ], "texture": "#texture1" },
|
||||||
|
"east": { "uv": [ 12, 14, 15, 15 ], "texture": "#texture1" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__comment": "Cube2",
|
||||||
|
"from": [ 9, 0, 0 ],
|
||||||
|
"to": [ 10, 1, 3 ],
|
||||||
|
"faces": {
|
||||||
|
"down": { "uv": [ 4, 12, 5, 15 ], "texture": "#texture1" },
|
||||||
|
"up": { "uv": [ 4, 1, 5, 4 ], "texture": "#texture1" },
|
||||||
|
"north": { "uv": [ 11, 13, 12, 14 ], "texture": "#texture1" },
|
||||||
|
"south": { "uv": [ 4, 13, 5, 14 ], "texture": "#texture1" },
|
||||||
|
"west": { "uv": [ 1, 14, 4, 15 ], "texture": "#texture1" },
|
||||||
|
"east": { "uv": [ 12, 14, 15, 15 ], "texture": "#texture1" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__comment": "Cube3",
|
||||||
|
"from": [ 6, 0, 3 ],
|
||||||
|
"to": [ 7, 1, 8 ],
|
||||||
|
"rotation": { "origin": [ 6, 0, 3 ], "axis": "y", "angle": 45 },
|
||||||
|
"faces": {
|
||||||
|
"down": { "uv": [ 4, 2, 5, 9 ], "texture": "#texture" },
|
||||||
|
"up": { "uv": [ 4, 3, 5, 10 ], "texture": "#texture" },
|
||||||
|
"north": { "uv": [ 11, 15, 12, 16 ], "texture": "#texture" },
|
||||||
|
"south": { "uv": [ 4, 15, 5, 16 ], "texture": "#texture" },
|
||||||
|
"west": { "uv": [ 3, 15, 10, 16 ], "texture": "#texture" },
|
||||||
|
"east": { "uv": [ 7, 15, 14, 16 ], "texture": "#texture" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__comment": "Cube5",
|
||||||
|
"from": [ 6, 0, 5.5 ],
|
||||||
|
"to": [ 7, 1, 16 ],
|
||||||
|
"faces": {
|
||||||
|
"down": { "uv": [ 6, 0.5, 7, 11 ], "texture": "#texture" },
|
||||||
|
"up": { "uv": [ 6, 4.5, 7, 15 ], "texture": "#texture" },
|
||||||
|
"north": { "uv": [ 9, 15, 10, 16 ], "texture": "#texture" },
|
||||||
|
"south": { "uv": [ 7, 15, 8, 16 ], "texture": "#texture" },
|
||||||
|
"west": { "uv": [ 5.5, 15, 16, 16 ], "texture": "#texture" },
|
||||||
|
"east": { "uv": [ 0.5, 15, 11, 16 ], "texture": "#texture" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__comment": "Cube6",
|
||||||
|
"from": [ 9, 0, 5.5 ],
|
||||||
|
"to": [ 10, 1, 16 ],
|
||||||
|
"faces": {
|
||||||
|
"down": { "uv": [ 6, 0.5, 7, 11 ], "texture": "#texture" },
|
||||||
|
"up": { "uv": [ 6, 4.5, 7, 15 ], "texture": "#texture" },
|
||||||
|
"north": { "uv": [ 9, 15, 10, 16 ], "texture": "#texture" },
|
||||||
|
"south": { "uv": [ 7, 15, 8, 16 ], "texture": "#texture" },
|
||||||
|
"west": { "uv": [ 5.5, 15, 16, 16 ], "texture": "#texture" },
|
||||||
|
"east": { "uv": [ 0.5, 15, 11, 16 ], "texture": "#texture" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__comment": "Cube7",
|
||||||
|
"from": [ 7, -0.5, 0 ],
|
||||||
|
"to": [ 9, 1.5, 2 ],
|
||||||
|
"faces": {
|
||||||
|
"down": { "uv": [ 7, 12, 9, 14 ], "texture": "#texture2" },
|
||||||
|
"up": { "uv": [ 7, 0, 9, 2 ], "texture": "#texture2" },
|
||||||
|
"north": { "uv": [ 7, 14, 9, 16 ], "texture": "#texture2" },
|
||||||
|
"south": { "uv": [ 7, 14, 9, 16 ], "texture": "#texture2" },
|
||||||
|
"west": { "uv": [ 0, 14, 2, 16 ], "texture": "#texture2" },
|
||||||
|
"east": { "uv": [ 14, 14, 16, 16 ], "texture": "#texture2" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__comment": "Cube3",
|
||||||
|
"from": [ 9, 0, 3 ],
|
||||||
|
"to": [ 10, 1, 8 ],
|
||||||
|
"rotation": { "origin": [ 10, 1, 3 ], "axis": "y", "angle": -45 },
|
||||||
|
"faces": {
|
||||||
|
"down": { "uv": [ 4, 3, 5, 10 ], "texture": "#texture", "rotation": 180 },
|
||||||
|
"up": { "uv": [ 4, 2, 5, 9 ], "texture": "#texture", "rotation": 180 },
|
||||||
|
"north": { "uv": [ 12, 16, 11, 15 ], "texture": "#texture" },
|
||||||
|
"south": { "uv": [ 5, 16, 4, 15 ], "texture": "#texture" },
|
||||||
|
"west": { "uv": [ 7, 15, 14, 16 ], "texture": "#texture", "rotation": 180 },
|
||||||
|
"east": { "uv": [ 3, 15, 10, 16 ], "texture": "#texture", "rotation": 180 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"display": {
|
||||||
|
"thirdperson_righthand": {
|
||||||
|
"rotation": [60, 0, 0],
|
||||||
|
"translation": [ 0, 8.9, 3.7 ]
|
||||||
|
},
|
||||||
|
"firstperson_righthand": {
|
||||||
|
"translation": [ 0, 5.5, -7 ]
|
||||||
|
},
|
||||||
|
"gui": {
|
||||||
|
"rotation": [ 90, 0, 0 ],
|
||||||
|
"scale": [ 0.95, 0.95, 0.95 ]
|
||||||
|
},
|
||||||
|
"ground": {
|
||||||
|
"translation": [ 0, 4, 0 ]
|
||||||
|
},
|
||||||
|
"fixed": {
|
||||||
|
"rotation": [ 90, 0, 0 ],
|
||||||
|
"translation": [ 0, 0, 8 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user