Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

ChampionAsh5357

Members
  • Posts

    1217
  • Joined

  • Last visited

  • Days Won

    23

Posts posted by ChampionAsh5357

  1. public class ItemCutter extends Item {
    
    	public ItemCutter() {
    		setUnlocalizedName("cutter");
    		setRegistryName("itemcutter");
    		setCreativeTab(CreativeTabs.MISC);
    		setNoRepair();
    		setMaxDamage(79);
    		setMaxStackSize(1);
    	}
    	
    	@Override
    	public boolean hasContainerItem(ItemStack stack) {
    		return true;
    	}
    	
    	 @Override
    	public ItemStack getContainerItem(ItemStack itemStack) {
    		return itemStack.getItemDamage() < itemStack.getMaxDamage() ? new ItemStack(itemStack.getItem(), 1, itemStack.getItemDamage() + 1) : ItemStack.EMPTY;
    	}
    }

     

  2. I originally created an item that would lose durability each time it was used in the crafting table. I managed to get the code to work properly, but there is a problem wen I shift-click the crafting recipe output. I created a shapeless recipe where it took my container item and another item and converted it into an output. However, if I shift-clicked the output to my inventory, it would convert all the items even if there wasn't enough durability for the entire stack. What I've noticed is that it initially checks the first one and then skips to the last one after it converted all the items. I want to know if there is a way to have it so that shift-clicking only converts the items to the amount of durability still left on the item.

     

    This is taking my container item with only one durability and a stack of items in the crafting table:2017-11-11_23_40_30.thumb.png.25f58ff255fd7a6369c565c995faeb4b.png

     

    This is the result after I shift-click on the output:

    2017-11-11_23_40_38.thumb.png.850e6ddbb5962208085bbf42cc5aa4e4.png

  3. In 1.12, the CraftingHelper.class registers minecraft and modded items for recipes along with the ore dictionary. However, I can't seem to figure out how to call an OreDictionary item through a json file. According to the code, I assumed it would be "item": "ore:logWood", however it says that this is a Unknown item and doesn't exist. Can somebody explain how to call on it please? Thank you.

  4. I know that Minecraft 1.12 is still in early development, but I had to try it out. I believe the only things that didn't work are the recipes and the advancements since they both are running through json files now and Minecraft Forge still hasn't release code supporting these new conditions. My question is regarding the recipes which are run through the CraftingManager and registered through the function func_193372_a with the two parameters being the ResourceLocation (which I assume is for the json file) and IRecipe (which is something that was supported in the past). I have never used IRecipe to register a crafting recipe, but is it possible to use this function in a mod being created for 1.12 if they have the foreknowledge of IRecipe to accurately use the function? I have been trying for the past two days and I'm not 100% sure if I am using IRecipe correctly.

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.