Recipes are now added to the recipe book when a tree tap is used.
This commit is contained in:
parent
5536a6cd94
commit
aa615f86bd
23 changed files with 124 additions and 36 deletions
|
@ -49,6 +49,7 @@ import net.minecraftforge.fluids.IFluidBlock;
|
|||
import net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
/**
|
||||
|
@ -63,6 +64,7 @@ public class DynamicCell extends Item {
|
|||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setUnlocalizedName("techreborn.cell");
|
||||
setMaxStackSize(64);
|
||||
TRRecipeHandler.hideEntry(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -30,6 +30,7 @@ import net.minecraft.init.Items;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
|
@ -48,6 +49,7 @@ public class ItemDusts extends ItemTR {
|
|||
setUnlocalizedName("techreborn.dust");
|
||||
setHasSubtypes(true);
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
TRRecipeHandler.hideEntry(this);
|
||||
}
|
||||
|
||||
public static ItemStack getDustByName(String name, int count) {
|
||||
|
|
|
@ -29,6 +29,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
|
@ -48,6 +49,7 @@ public class ItemDustsSmall extends ItemTR {
|
|||
setUnlocalizedName("techreborn.dustsmall");
|
||||
setHasSubtypes(true);
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
TRRecipeHandler.hideEntry(this);
|
||||
}
|
||||
|
||||
public static ItemStack getSmallDustByName(String name, int count) {
|
||||
|
|
|
@ -29,6 +29,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
|
@ -41,6 +42,7 @@ public class ItemGems extends ItemTR {
|
|||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setUnlocalizedName("techreborn.gem");
|
||||
setHasSubtypes(true);
|
||||
TRRecipeHandler.hideEntry(this);
|
||||
}
|
||||
|
||||
public static ItemStack getGemByName(String name, int count) {
|
||||
|
|
|
@ -30,6 +30,7 @@ import net.minecraft.init.Items;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
|
@ -44,6 +45,7 @@ public class ItemIngots extends ItemTR {
|
|||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setHasSubtypes(true);
|
||||
setUnlocalizedName("techreborn.ingot");
|
||||
TRRecipeHandler.hideEntry(this);
|
||||
}
|
||||
|
||||
public static ItemStack getIngotByName(String name, int count) {
|
||||
|
|
|
@ -25,10 +25,12 @@
|
|||
package techreborn.items;
|
||||
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
|
||||
public class ItemMissingRecipe extends ItemTR {
|
||||
public ItemMissingRecipe() {
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setUnlocalizedName("techreborn.missingrecipe");
|
||||
TRRecipeHandler.hideEntry(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
|
@ -44,6 +45,7 @@ public class ItemNuggets extends ItemTR {
|
|||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setHasSubtypes(true);
|
||||
setUnlocalizedName("techreborn.nuggets");
|
||||
TRRecipeHandler.hideEntry(this);
|
||||
}
|
||||
|
||||
public static ItemStack getNuggetByName(String name, int count) {
|
||||
|
|
|
@ -30,6 +30,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
|
@ -45,6 +46,7 @@ public class ItemPlates extends ItemTR {
|
|||
setUnlocalizedName("techreborn.plate");
|
||||
setHasSubtypes(true);
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
TRRecipeHandler.hideEntry(this);
|
||||
}
|
||||
|
||||
public static ItemStack getPlateByName(String name, int count) {
|
||||
|
|
|
@ -27,6 +27,7 @@ package techreborn.items.armor;
|
|||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 26/02/2016.
|
||||
|
@ -49,5 +50,6 @@ public class ItemTRArmour extends ItemArmor {
|
|||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
this.material = material;
|
||||
this.slot = slot;
|
||||
TRRecipeHandler.hideEntry(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ package techreborn.items.tools;
|
|||
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
|
||||
public class ItemTRAxe extends ItemAxe {
|
||||
private ToolMaterial material = ToolMaterial.WOOD;
|
||||
|
@ -35,5 +36,6 @@ public class ItemTRAxe extends ItemAxe {
|
|||
setUnlocalizedName(material.name().toLowerCase() + "Axe");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
this.material = material;
|
||||
TRRecipeHandler.hideEntry(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ import net.minecraft.item.ItemHoe;
|
|||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
|
||||
public class ItemTRHoe extends ItemHoe {
|
||||
private ToolMaterial material = ToolMaterial.WOOD;
|
||||
|
@ -37,6 +38,7 @@ public class ItemTRHoe extends ItemHoe {
|
|||
setUnlocalizedName(material.name().toLowerCase() + "Hoe");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
this.material = material;
|
||||
TRRecipeHandler.hideEntry(this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
|
|
@ -26,6 +26,7 @@ package techreborn.items.tools;
|
|||
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
|
||||
public class ItemTRPickaxe extends ItemPickaxe {
|
||||
private ToolMaterial material = ToolMaterial.WOOD;
|
||||
|
@ -35,5 +36,6 @@ public class ItemTRPickaxe extends ItemPickaxe {
|
|||
setUnlocalizedName(material.name().toLowerCase() + "Pickaxe");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
this.material = material;
|
||||
TRRecipeHandler.hideEntry(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ package techreborn.items.tools;
|
|||
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
|
||||
public class ItemTRSpade extends ItemSpade {
|
||||
private ToolMaterial material = ToolMaterial.WOOD;
|
||||
|
@ -35,5 +36,6 @@ public class ItemTRSpade extends ItemSpade {
|
|||
setUnlocalizedName(material.name().toLowerCase() + "Spade");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
this.material = material;
|
||||
TRRecipeHandler.hideEntry(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ package techreborn.items.tools;
|
|||
|
||||
import net.minecraft.item.ItemSword;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
|
||||
public class ItemTRSword extends ItemSword {
|
||||
private ToolMaterial material = ToolMaterial.WOOD;
|
||||
|
@ -35,5 +36,6 @@ public class ItemTRSword extends ItemSword {
|
|||
setUnlocalizedName(material.name().toLowerCase() + "Sword");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
this.material = material;
|
||||
TRRecipeHandler.hideEntry(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ import ic2.core.item.tool.ItemTreetap;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
@ -36,6 +37,7 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.world.World;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.compat.CompatManager;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
import techreborn.items.ItemTR;
|
||||
|
||||
public class ItemTreeTap extends ItemTR {
|
||||
|
@ -53,8 +55,12 @@ public class ItemTreeTap extends ItemTR {
|
|||
Block block = state.getBlock();
|
||||
if (CompatManager.isIC2Loaded && block == Block.getBlockFromName("ic2:rubber_wood")) {
|
||||
ItemTreetap.attemptExtract(playerIn, worldIn, pos, side, state, null);
|
||||
if (!worldIn.isRemote)
|
||||
if (!worldIn.isRemote){
|
||||
playerIn.getHeldItem(hand).damageItem(1, playerIn);
|
||||
}
|
||||
if(playerIn instanceof EntityPlayerMP){
|
||||
TRRecipeHandler.unlockTRRecipes((EntityPlayerMP) playerIn);
|
||||
}
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
return EnumActionResult.PASS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue