Forge Light level reduce, forge cools down, ingots dont need to read upgrades, casting form fixed, anvil now cools its inventory, longbow arrow velocity balanced, more bucket crafting, config, copper tools, config for lowering fortune multiplier need to finish copper tool and tool head assets
This commit is contained in:
@@ -11,15 +11,15 @@
|
||||
- [x] Anvil cool down items
|
||||
- [x] Longbow Fire Speed
|
||||
- [x] More Crafting for buckets
|
||||
- [x] Config Usage
|
||||
- [x] Copper Tools
|
||||
- [x] Config for lowering fortune multiplier
|
||||
|
||||
- [ ] Config Usage
|
||||
- [ ] Copper Tools
|
||||
- [ ] Copper Tool Casting
|
||||
- [ ] Copper Tool Assets
|
||||
|
||||
- [ ] Emerald and redstone asset
|
||||
- [ ] Diamond + Redstone no texture
|
||||
- [ ] Craft Tweaker Support
|
||||
|
||||
- [ ] Config for lowering fortune multiplier
|
||||
- [ ] Hardened Leather Helmet Inventory Model
|
||||
|
||||
## Feature Musket
|
||||
@@ -36,7 +36,7 @@
|
||||
## Backlog
|
||||
- [ ] Bloomery Print out
|
||||
- [ ] Random Floats for hot texture
|
||||
- [ ] Diamond + Redstone no texture
|
||||
|
||||
- [ ] Mass Ore Production
|
||||
- [ ] Silver/Lead Production
|
||||
- [ ] Sparks to forging
|
||||
|
||||
@@ -5,9 +5,12 @@ 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.items.parts.BronzeToolPart;
|
||||
import nmd.primal.forgecraft.items.parts.SimpleToolPart;
|
||||
import nmd.primal.forgecraft.items.parts.ToolPart;
|
||||
import nmd.primal.forgecraft.items.tools.*;
|
||||
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.items.tools.bronze.BronzeAxe;
|
||||
import nmd.primal.forgecraft.items.tools.bronze.BronzeHoe;
|
||||
import nmd.primal.forgecraft.items.tools.bronze.BronzePickaxe;
|
||||
@@ -31,7 +34,7 @@ public class CommonEvents implements ToolNBT {
|
||||
|
||||
if (event.craftMatrix.getStackInSlot(i) != null) { // If there is an item
|
||||
ItemStack a = event.craftMatrix.getStackInSlot(i); // Gets the item
|
||||
if (a.getItem() instanceof ToolPart || a.getItem() instanceof BronzeToolPart) {
|
||||
if (a.getItem() instanceof ToolPart || a.getItem() instanceof SimpleToolPart) {
|
||||
tempTag = a.getSubCompound("tags").copy();
|
||||
event.crafting.getTagCompound().setTag("tags", tempTag);
|
||||
event.crafting.getItem().updateItemStackNBT(event.crafting.getTagCompound());
|
||||
@@ -46,7 +49,7 @@ public class CommonEvents implements ToolNBT {
|
||||
|
||||
if (event.craftMatrix.getStackInSlot(i) != null) { // If there is an item
|
||||
ItemStack a = event.craftMatrix.getStackInSlot(i); // Gets the item
|
||||
if (a.getItem() instanceof ToolPart || a.getItem() instanceof BronzeToolPart) {
|
||||
if (a.getItem() instanceof ToolPart || a.getItem() instanceof SimpleToolPart) {
|
||||
tempTag = a.getSubCompound("tags").copy();
|
||||
event.crafting.getTagCompound().setTag("tags", tempTag);
|
||||
event.crafting.getItem().updateItemStackNBT(event.crafting.getTagCompound());
|
||||
@@ -61,7 +64,7 @@ public class CommonEvents implements ToolNBT {
|
||||
|
||||
if (event.craftMatrix.getStackInSlot(i) != null) { // If there is an item
|
||||
ItemStack a = event.craftMatrix.getStackInSlot(i); // Gets the item
|
||||
if (a.getItem() instanceof ToolPart || a.getItem() instanceof BronzeToolPart) {
|
||||
if (a.getItem() instanceof ToolPart || a.getItem() instanceof SimpleToolPart) {
|
||||
tempTag = a.getSubCompound("tags").copy();
|
||||
event.crafting.getTagCompound().setTag("tags", tempTag);
|
||||
event.crafting.getItem().updateItemStackNBT(event.crafting.getTagCompound());
|
||||
@@ -76,7 +79,7 @@ public class CommonEvents implements ToolNBT {
|
||||
|
||||
if (event.craftMatrix.getStackInSlot(i) != null) { // If there is an item
|
||||
ItemStack a = event.craftMatrix.getStackInSlot(i); // Gets the item
|
||||
if (a.getItem() instanceof ToolPart || a.getItem() instanceof BronzeToolPart) {
|
||||
if (a.getItem() instanceof ToolPart || a.getItem() instanceof SimpleToolPart) {
|
||||
tempTag = a.getSubCompound("tags").copy();
|
||||
event.crafting.getTagCompound().setTag("tags", tempTag);
|
||||
event.crafting.getItem().updateItemStackNBT(event.crafting.getTagCompound());
|
||||
@@ -85,7 +88,7 @@ public class CommonEvents implements ToolNBT {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (event.crafting.getItem() instanceof ToolPart || event.crafting.getItem() instanceof BronzeToolPart) {
|
||||
if (event.crafting.getItem() instanceof ToolPart || event.crafting.getItem() instanceof SimpleToolPart) {
|
||||
NBTTagCompound tempTag = new NBTTagCompound();
|
||||
for (int i = 0; i < event.craftMatrix.getSizeInventory(); i++) { // Checks all the slots
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import nmd.primal.forgecraft.crafting.CrucibleCrafting;
|
||||
import nmd.primal.forgecraft.init.ModBlocks;
|
||||
import nmd.primal.forgecraft.init.ModItems;
|
||||
import nmd.primal.forgecraft.items.SlottedTongs;
|
||||
import nmd.primal.forgecraft.items.parts.BronzeToolPart;
|
||||
import nmd.primal.forgecraft.items.parts.SimpleToolPart;
|
||||
import nmd.primal.forgecraft.tiles.TileCastingForm;
|
||||
import nmd.primal.forgecraft.util.CastingFormHandler;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
@@ -64,11 +64,14 @@ public class CastingForm extends CustomContainerFacing implements CastingFormHan
|
||||
doInventoryManager(pItem, world, tile, pos, hitx, hity, hitz, state, player);
|
||||
}
|
||||
if(pItem.getItem().equals(ModItems.slottedtongs)){
|
||||
|
||||
IItemHandler inventory = pItem.getCapability(ITEM_HANDLER, null);
|
||||
ItemStack slotStack = inventory.getStackInSlot(0).copy();
|
||||
SlottedTongs itemstackItem = (SlottedTongs) pItem.getItem();
|
||||
ItemStack tongsStack = inventory.getStackInSlot(0).copy();
|
||||
|
||||
SlottedTongs tongs = (SlottedTongs) pItem.getItem();
|
||||
if(slotStack.getItem().equals(Item.getItemFromBlock(ModBlocks.nbtCrucible))) {
|
||||
ItemStack tongsStack = slotStack.copy();
|
||||
if(tongsStack.getItem().equals(Item.getItemFromBlock(ModBlocks.nbtCrucible))) {
|
||||
|
||||
NBTTagCompound tag = tongsStack.getTagCompound().copy();
|
||||
|
||||
if(tag != null){
|
||||
@@ -86,7 +89,8 @@ public class CastingForm extends CustomContainerFacing implements CastingFormHan
|
||||
CastingCrafting casting = CastingCrafting.getRecipe(tongsStack, tempArray);
|
||||
if(casting != null){
|
||||
NBTTagCompound tagOutput = casting.getOutput().getTagCompound();
|
||||
//System.out.println(tagOutput);
|
||||
NBTTagCompound crucibleOutput = crucibleRecipe.getDropsCooked().getTagCompound();
|
||||
|
||||
if(tagOutput != null) {
|
||||
ItemStack dropStack = casting.getOutput();
|
||||
dropStack.setTagCompound(new NBTTagCompound());
|
||||
@@ -94,46 +98,39 @@ public class CastingForm extends CustomContainerFacing implements CastingFormHan
|
||||
|
||||
dropStack.getTagCompound().setTag("tags", tags);
|
||||
setHot(dropStack, false);
|
||||
if (tagOutput.getString("upgrades") == "emerald") {
|
||||
if (crucibleOutput.getString("upgrades") == "emerald") {
|
||||
setEmerald(dropStack, true);
|
||||
setModifiers(dropStack, 1);
|
||||
} else {
|
||||
setEmerald(dropStack, false);
|
||||
}
|
||||
if (tagOutput.getString("upgrades") == "diamond") {
|
||||
if (crucibleOutput.getString("upgrades") == "diamond") {
|
||||
setDiamondLevel(dropStack, 1);
|
||||
setModifiers(dropStack, 1);
|
||||
} else {
|
||||
setDiamondLevel(dropStack, 0);
|
||||
}
|
||||
if (tagOutput.getString("upgrades") == "redstone") {
|
||||
if (crucibleOutput.getString("upgrades") == "redstone") {
|
||||
setRedstoneLevel(dropStack, 1);
|
||||
setModifiers(dropStack, 1);
|
||||
} else {
|
||||
setRedstoneLevel(dropStack, 0);
|
||||
}
|
||||
if (tagOutput.getString("upgrades") == "lapis") {
|
||||
if (crucibleOutput.getString("upgrades") == "lapis") {
|
||||
setLapisLevel(dropStack, 1);
|
||||
setModifiers(dropStack, 1);
|
||||
} else {
|
||||
setLapisLevel(dropStack, 0);
|
||||
}
|
||||
setModifiers(dropStack, 1);
|
||||
|
||||
CommonUtils.spawnItemEntityFromWorld(world, pos, dropStack);
|
||||
tag.getCompoundTag("BlockEntityTag").setBoolean("status", false);
|
||||
tag.getCompoundTag("BlockEntityTag").setInteger("hot", 0);
|
||||
ItemStackHelper.saveAllItems(tag.getCompoundTag("BlockEntityTag"), ingListEmpty);
|
||||
inventory.getStackInSlot(0).setTagCompound(tag);
|
||||
itemstackItem.markDirty(pItem);
|
||||
return true;
|
||||
}
|
||||
if(tagOutput == null){
|
||||
System.out.println("Tag is null");
|
||||
if( !(casting.getOutput().getItem() instanceof BronzeToolPart) ){
|
||||
ItemStack dropStack = casting.getOutput();
|
||||
CommonUtils.spawnItemEntityFromWorld(world, pos, dropStack);
|
||||
tag.getCompoundTag("BlockEntityTag").setBoolean("status", false);
|
||||
tag.getCompoundTag("BlockEntityTag").setInteger("hot", 0);
|
||||
ItemStackHelper.saveAllItems(tag.getCompoundTag("BlockEntityTag"), ingListEmpty);
|
||||
inventory.getStackInSlot(0).setTagCompound(tag);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package nmd.primal.forgecraft.init;
|
||||
|
||||
import net.minecraftforge.common.config.Config;
|
||||
import nmd.primal.forgecraft.ForgeCraft;
|
||||
import nmd.primal.forgecraft.ModInfo;
|
||||
|
||||
@Config(modid = ModInfo.MOD_ID, name = ModInfo.MOD_CONFIG, category = "")
|
||||
@@ -10,9 +9,9 @@ import nmd.primal.forgecraft.ModInfo;
|
||||
|
||||
public final class ModConfig
|
||||
{
|
||||
static {
|
||||
ForgeCraft.LOGGER.info("Loading Config File: " + ModInfo.MOD_CONFIG + ".cfg");
|
||||
}
|
||||
//static {
|
||||
// ForgeCraft.LOGGER.info("Loading Config File: " + ModInfo.MOD_CONFIG + ".cfg");
|
||||
//}
|
||||
|
||||
/**
|
||||
* Main Config Sections
|
||||
@@ -44,6 +43,7 @@ public final class ModConfig
|
||||
public static boolean ENABLE_COPPER_TOOLS = false;
|
||||
|
||||
@Config.Comment({"Bronze Tool Lapis Bonus do not go greater than 5"})
|
||||
@Config.RangeInt(min = 0, max = 5)
|
||||
public static int BRONZE_LAPIS_MULTIPLIER = 5;
|
||||
|
||||
@Config.Comment({"Copper Tools Emerald Upgrade"})
|
||||
|
||||
@@ -30,7 +30,6 @@ public class ModCrafting{
|
||||
|
||||
NBTTagCompound newTag = new NBTTagCompound();
|
||||
|
||||
|
||||
NBTTagCompound setHot = new NBTTagCompound();
|
||||
setHot.setBoolean("hot", true);
|
||||
|
||||
@@ -174,15 +173,16 @@ public class ModCrafting{
|
||||
|
||||
|
||||
for(ItemStack temp : toolArray) {
|
||||
NBTTagCompound tags = new NBTTagCompound();
|
||||
temp.getTagCompound().setTag("tags", tags);
|
||||
NBTTagCompound tags = temp.getTagCompound();
|
||||
tags.setTag("tags", tags);
|
||||
|
||||
temp.getSubCompound("tags").setBoolean("hot", false);
|
||||
temp.getSubCompound("tags").setBoolean("emerald", false);
|
||||
temp.getSubCompound("tags").setInteger("diamond", 0);
|
||||
temp.getSubCompound("tags").setInteger("redstone", 0);
|
||||
temp.getSubCompound("tags").setInteger("lapis", 0);
|
||||
temp.getSubCompound("tags").setInteger("modifiers", 0);
|
||||
tags.getCompoundTag("tags").setBoolean("hot", false);
|
||||
tags.getCompoundTag("tags").setBoolean("emerald", false);
|
||||
tags.getCompoundTag("tags").setInteger("diamond", 0);
|
||||
tags.getCompoundTag("tags").setInteger("redstone", 0);
|
||||
tags.getCompoundTag("tags").setInteger("lapis", 0);
|
||||
tags.getCompoundTag("tags").setInteger("modifiers", 0);
|
||||
temp.setTagCompound(tags);
|
||||
}
|
||||
|
||||
bronzepickaxehead = toolArray[0];
|
||||
@@ -393,20 +393,6 @@ public class ModCrafting{
|
||||
800,
|
||||
600);
|
||||
|
||||
|
||||
/*CrucibleCrafting.addRecipe(
|
||||
new OreIngredient("oreBronze"),
|
||||
Ingredient.EMPTY,
|
||||
Ingredient.EMPTY,
|
||||
Ingredient.EMPTY,
|
||||
Ingredient.EMPTY,
|
||||
new ItemStack(PrimalAPI.Items.SLAG, 1),
|
||||
defaultBronze,
|
||||
1100,
|
||||
800,
|
||||
600);
|
||||
*/
|
||||
|
||||
CrucibleCrafting.addRecipe(
|
||||
new OreIngredient("ingotBronze"),
|
||||
Ingredient.EMPTY,
|
||||
@@ -419,10 +405,6 @@ public class ModCrafting{
|
||||
800,
|
||||
600);
|
||||
|
||||
//NBTTagCompound tag = new NBTTagCompound();
|
||||
//tag.setString("upgrades", "redstone");
|
||||
//ItemStack redBronze = new ItemStack(ModItems.bronzeingotball, 1);
|
||||
//redBronze.setTagCompound(tag.copy());
|
||||
ItemStack redBronze = defaultBronze.copy();
|
||||
redBronze.getTagCompound().setString("upgrades", "redstone");
|
||||
CrucibleCrafting.addRecipe(
|
||||
@@ -469,7 +451,7 @@ public class ModCrafting{
|
||||
lapisBronze.getTagCompound().setString("upgrades", "lapis");
|
||||
CrucibleCrafting.addRecipe(
|
||||
new OreIngredient("ingotBronze"),
|
||||
new OreIngredient("dustLapis"),
|
||||
new OreIngredient("gemLapis"),
|
||||
Ingredient.EMPTY,
|
||||
Ingredient.EMPTY,
|
||||
Ingredient.EMPTY,
|
||||
|
||||
@@ -12,13 +12,20 @@ import nmd.primal.core.api.PrimalAPI;
|
||||
import nmd.primal.forgecraft.items.*;
|
||||
import nmd.primal.forgecraft.items.armor.CustomHelmet;
|
||||
import nmd.primal.forgecraft.items.blocks.ItemNBTCrucible;
|
||||
import nmd.primal.forgecraft.items.parts.BronzeToolPart;
|
||||
import nmd.primal.forgecraft.items.parts.SimpleToolPart;
|
||||
import nmd.primal.forgecraft.items.parts.ToolPart;
|
||||
import nmd.primal.forgecraft.items.tools.*;
|
||||
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.items.tools.bronze.BronzeAxe;
|
||||
import nmd.primal.forgecraft.items.tools.bronze.BronzeHoe;
|
||||
import nmd.primal.forgecraft.items.tools.bronze.BronzePickaxe;
|
||||
import nmd.primal.forgecraft.items.tools.bronze.BronzeShovel;
|
||||
import nmd.primal.forgecraft.items.tools.copper.CopperAxe;
|
||||
import nmd.primal.forgecraft.items.tools.copper.CopperHoe;
|
||||
import nmd.primal.forgecraft.items.tools.copper.CopperPickaxe;
|
||||
import nmd.primal.forgecraft.items.tools.copper.CopperShovel;
|
||||
import nmd.primal.forgecraft.items.weapons.CustomShield;
|
||||
import nmd.primal.forgecraft.items.weapons.CustomSword;
|
||||
import nmd.primal.forgecraft.items.weapons.Longbow;
|
||||
@@ -129,6 +136,7 @@ public class ModItems {
|
||||
public static Item steelslayer;
|
||||
public static Item wootzslayer;
|
||||
|
||||
public static Item brokencoppertool;
|
||||
public static Item brokenbronzetool;
|
||||
public static Item brokenwroughtirontool;
|
||||
public static Item brokencleanirontool;
|
||||
@@ -171,21 +179,21 @@ public class ModItems {
|
||||
TOOL PARTS
|
||||
**********/
|
||||
if(ModConfig.Features.ENABLE_COPPER_TOOLS){
|
||||
copperpickaxehead;
|
||||
copperaxehead;
|
||||
coppershovelhead;
|
||||
copperhoehead;
|
||||
copperpickaxehead = new SimpleToolPart("copperpickaxehead", PrimalAPI.ToolMaterials.TOOL_COPPER, "pickaxe");
|
||||
copperaxehead = new SimpleToolPart("copperaxehead", PrimalAPI.ToolMaterials.TOOL_COPPER, "axe");
|
||||
coppershovelhead= new SimpleToolPart("coppershovelhead", PrimalAPI.ToolMaterials.TOOL_COPPER, "shovel");
|
||||
copperhoehead = new SimpleToolPart("copperhoehead", PrimalAPI.ToolMaterials.TOOL_COPPER, "hoe");
|
||||
|
||||
copperpickaxe;
|
||||
copperaxe;
|
||||
coppershovel;
|
||||
copperhoe;
|
||||
copperpickaxe = new CopperPickaxe("copperpickaxe", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool);
|
||||
copperaxe = new CopperAxe("copperaxe", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool, 4, -2.6F);
|
||||
coppershovel = new CopperShovel("coppershovel", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool);
|
||||
copperhoe = new CopperHoe("copperhoe", PrimalAPI.ToolMaterials.TOOL_COPPER, brokencoppertool);
|
||||
}
|
||||
|
||||
bronzepickaxehead = new BronzeToolPart("bronzepickaxehead", PrimalAPI.ToolMaterials.TOOL_BRONZE, "pickaxe");
|
||||
bronzeaxehead = new BronzeToolPart("bronzeaxehead", PrimalAPI.ToolMaterials.TOOL_BRONZE, "axe");
|
||||
bronzeshovelhead = new BronzeToolPart("bronzeshovelhead", PrimalAPI.ToolMaterials.TOOL_BRONZE, "shovel");
|
||||
bronzehoehead = new BronzeToolPart("bronzehoehead", PrimalAPI.ToolMaterials.TOOL_BRONZE, "hoe");
|
||||
bronzepickaxehead = new SimpleToolPart("bronzepickaxehead", PrimalAPI.ToolMaterials.TOOL_BRONZE, "pickaxe");
|
||||
bronzeaxehead = new SimpleToolPart("bronzeaxehead", PrimalAPI.ToolMaterials.TOOL_BRONZE, "axe");
|
||||
bronzeshovelhead = new SimpleToolPart("bronzeshovelhead", PrimalAPI.ToolMaterials.TOOL_BRONZE, "shovel");
|
||||
bronzehoehead = new SimpleToolPart("bronzehoehead", PrimalAPI.ToolMaterials.TOOL_BRONZE, "hoe");
|
||||
|
||||
pickaxehead = new ToolPart("ironpickaxehead", PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON, "pickaxe");
|
||||
ironaxehead = new ToolPart("ironaxehead", PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON, "axe");
|
||||
@@ -276,6 +284,7 @@ public class ModItems {
|
||||
//forgingmanual = new ItemForgingManual();
|
||||
//test = new ItemTest("ironsword");
|
||||
|
||||
brokencoppertool = new BaseItem("brokencoppertool");
|
||||
brokenbronzetool = new BaseItem("brokenbronzetool");
|
||||
brokenwroughtirontool = new BaseItem("brokenwroughtirontool");
|
||||
brokencleanirontool = new BaseItem("brokencleanirontool");
|
||||
@@ -316,6 +325,18 @@ public class ModItems {
|
||||
/**********
|
||||
TOOL PARTS
|
||||
**********/
|
||||
if(ModConfig.Features.ENABLE_COPPER_TOOLS){
|
||||
ForgeRegistries.ITEMS.register(copperpickaxehead);
|
||||
ForgeRegistries.ITEMS.register(copperaxehead);
|
||||
ForgeRegistries.ITEMS.register(coppershovelhead);
|
||||
ForgeRegistries.ITEMS.register(copperhoehead);
|
||||
|
||||
ForgeRegistries.ITEMS.register(copperpickaxe);
|
||||
ForgeRegistries.ITEMS.register(copperaxe);
|
||||
ForgeRegistries.ITEMS.register(coppershovel);
|
||||
ForgeRegistries.ITEMS.register(copperhoe);
|
||||
}
|
||||
|
||||
ForgeRegistries.ITEMS.register(bronzepickaxehead);
|
||||
ForgeRegistries.ITEMS.register(bronzeaxehead);
|
||||
ForgeRegistries.ITEMS.register(bronzeshovelhead);
|
||||
@@ -437,6 +458,19 @@ public class ModItems {
|
||||
/**********
|
||||
TOOL PARTS
|
||||
**********/
|
||||
|
||||
if(ModConfig.Features.ENABLE_COPPER_TOOLS){
|
||||
registerRender(copperpickaxehead);
|
||||
registerRender(copperaxehead);
|
||||
registerRender(coppershovelhead);
|
||||
registerRender(copperhoehead);
|
||||
|
||||
registerRender(copperpickaxe);
|
||||
registerRender(copperaxe);
|
||||
registerRender(coppershovel);
|
||||
registerRender(copperhoe);
|
||||
}
|
||||
|
||||
registerRender(bronzepickaxehead);
|
||||
registerRender(bronzeaxehead);
|
||||
registerRender(bronzeshovelhead);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package nmd.primal.forgecraft.items;
|
||||
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -16,7 +15,6 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import nmd.primal.core.api.PrimalAPI;
|
||||
import nmd.primal.core.common.helper.FireHelper;
|
||||
import nmd.primal.forgecraft.init.ModItems;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -13,6 +13,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.util.ToolNBT;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@@ -21,61 +22,53 @@ import java.util.List;
|
||||
/**
|
||||
* Created by mminaie on 3/9/17.
|
||||
*/
|
||||
public class BronzeToolPart extends Item implements ToolNBT{
|
||||
public class SimpleToolPart extends Item implements ToolNBT{
|
||||
|
||||
private String toolType;
|
||||
|
||||
public BronzeToolPart(String name, ToolMaterial material, String type) {
|
||||
public SimpleToolPart(String name, ToolMaterial material, String type) {
|
||||
this.setMaxDamage(material.getMaxUses());
|
||||
this.setUnlocalizedName(name);
|
||||
this.setRegistryName(name);
|
||||
//this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
|
||||
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
|
||||
this.setMaxStackSize(1);
|
||||
this.setNoRepair();
|
||||
|
||||
this.toolType = type;
|
||||
|
||||
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter()
|
||||
{
|
||||
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
|
||||
|
||||
/***
|
||||
|
||||
hot . emerald . diamond . redstone . lapis
|
||||
0 . 0 . 0 . 0 . 0
|
||||
hot | emerald | diamond | redstone | lapis
|
||||
X.0 | 0.X | 0.0X | 0.00X | 0.000X
|
||||
|
||||
***/
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn)
|
||||
{
|
||||
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
|
||||
if (item.hasTagCompound()) {
|
||||
|
||||
|
||||
if (getModifiers(item) != 0) {
|
||||
if (getEmerald(item)) {
|
||||
return 0.1F;
|
||||
}
|
||||
|
||||
if (getDiamondLevel(item) == 1) {
|
||||
return 0.2F;
|
||||
}
|
||||
|
||||
if ( getRedstoneLevel(item) == 1) {
|
||||
return 0.3F;
|
||||
}
|
||||
|
||||
if (getLapisLevel(item) == 1) {
|
||||
return 0.4F;
|
||||
}
|
||||
Float returnFloat = 0.0F;
|
||||
if(getHot(item)){
|
||||
returnFloat = returnFloat + 1.0F;
|
||||
}
|
||||
if (getModifiers(item) == 0) {
|
||||
return 0.0F;
|
||||
if(getEmerald(item)){
|
||||
returnFloat += 0.1F;
|
||||
}
|
||||
if(getDiamondLevel(item)>0){
|
||||
returnFloat += (0.01F * getDiamondLevel(item));
|
||||
}
|
||||
if(getRedstoneLevel(item)>0){
|
||||
returnFloat += (0.001F * getRedstoneLevel(item));
|
||||
}
|
||||
if(getLapisLevel(item)>0){
|
||||
returnFloat += (0.0001F * getLapisLevel(item));
|
||||
}
|
||||
return returnFloat;
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public static boolean isHidden()
|
||||
@@ -130,8 +123,8 @@ public class BronzeToolPart extends Item implements ToolNBT{
|
||||
{
|
||||
if(item.hasTagCompound())
|
||||
{
|
||||
tooltip.add(ChatFormatting.GRAY + "Upgrades");
|
||||
if (getEmerald(item) == true) {
|
||||
tooltip.add(ChatFormatting.GRAY + "Upgrades: " + getModifiers(item));
|
||||
if (getEmerald(item)) {
|
||||
tooltip.add(ChatFormatting.DARK_GREEN + "Emerald");
|
||||
}
|
||||
if (getDiamondLevel(item) > 0) {
|
||||
@@ -16,7 +16,6 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import nmd.primal.core.api.PrimalAPI;
|
||||
import nmd.primal.core.common.helper.FireHelper;
|
||||
import nmd.primal.forgecraft.ModInfo;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
|
||||
@@ -42,192 +41,39 @@ public class ToolPart extends Item implements ToolNBT{
|
||||
this.toolType = type;
|
||||
this.toolMaterial = material;
|
||||
|
||||
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter()
|
||||
{
|
||||
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
|
||||
|
||||
/***
|
||||
|
||||
hot . emerald . diamond . redstone . lapis
|
||||
0 . 0 . 0 . 0 . 0
|
||||
hot | emerald | diamond | redstone | lapis
|
||||
X.0 | 0.X | 0.0X | 0.00X | 0.000X
|
||||
|
||||
***/
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn)
|
||||
{
|
||||
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
|
||||
if (item.hasTagCompound()) {
|
||||
|
||||
if (getHot(item) == false) {
|
||||
if (getModifiers(item) != 0) {
|
||||
if ( (getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.1F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.11F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 2) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.12F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.111F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 2) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.102F;
|
||||
}
|
||||
|
||||
// ============
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.01F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 2) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.02F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 3) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.03F;
|
||||
}
|
||||
|
||||
//=======
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.001F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 2) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.002F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 3) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.003F;
|
||||
}
|
||||
|
||||
//=========
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 1)) {
|
||||
return 0.0001F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 2)) {
|
||||
return 0.0002F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 3)) {
|
||||
return 0.0003F;
|
||||
}
|
||||
|
||||
//=======
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 1)) {
|
||||
return 0.0111F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 2) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.021F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 2) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.012F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 2)) {
|
||||
return 0.0012F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 2) &&
|
||||
(getLapisLevel(item) == 1)) {
|
||||
return 0.0021F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 2) ) {
|
||||
return 0.0102F;
|
||||
}
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 1) ) {
|
||||
return 0.0011F;
|
||||
}
|
||||
}
|
||||
Float returnFloat = 0.0F;
|
||||
if(getHot(item)){
|
||||
returnFloat = returnFloat + 1.0F;
|
||||
}
|
||||
if (getHot(item) == true) {
|
||||
return 1.0F;
|
||||
if(getEmerald(item)){
|
||||
returnFloat += 0.1F;
|
||||
}
|
||||
|
||||
if (getHot(item) == false) {
|
||||
if (getModifiers(item) == 0) {
|
||||
return 0.0F;
|
||||
}
|
||||
if(getDiamondLevel(item)>0){
|
||||
returnFloat += (0.01F * getDiamondLevel(item));
|
||||
}
|
||||
if(getRedstoneLevel(item)>0){
|
||||
returnFloat += (0.001F * getRedstoneLevel(item));
|
||||
}
|
||||
if(getLapisLevel(item)>0){
|
||||
returnFloat += (0.0001F * getLapisLevel(item));
|
||||
}
|
||||
return returnFloat;
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public static boolean isHidden()
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -30,7 +29,7 @@ public abstract class AbstractAxe extends ItemAxe implements ToolNBT {
|
||||
|
||||
Item drop;
|
||||
|
||||
public AbstractAxe(String name, Item.ToolMaterial material, Item damageDrop, Integer damage, Float speed) {
|
||||
public AbstractAxe(String name, ToolMaterial material, Item damageDrop, Integer damage, Float speed) {
|
||||
super(material, damage, speed);
|
||||
this.setUnlocalizedName(name);
|
||||
this.setRegistryName(name);
|
||||
@@ -39,6 +38,39 @@ public abstract class AbstractAxe extends ItemAxe implements ToolNBT {
|
||||
this.setNoRepair();
|
||||
this.drop = damageDrop;
|
||||
|
||||
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
|
||||
|
||||
/***
|
||||
|
||||
hot | emerald | diamond | redstone | lapis
|
||||
X.0 | 0.X | 0.0X | 0.00X | 0.000X
|
||||
|
||||
***/
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
|
||||
if (item.hasTagCompound()) {
|
||||
Float returnFloat = 0.0F;
|
||||
if(getHot(item)){
|
||||
returnFloat = returnFloat + 1.0F;
|
||||
}
|
||||
if(getEmerald(item)){
|
||||
returnFloat += 0.1F;
|
||||
}
|
||||
if(getDiamondLevel(item)>0){
|
||||
returnFloat += (0.01F * getDiamondLevel(item));
|
||||
}
|
||||
if(getRedstoneLevel(item)>0){
|
||||
returnFloat += (0.001F * getRedstoneLevel(item));
|
||||
}
|
||||
if(getLapisLevel(item)>0){
|
||||
returnFloat += (0.0001F * getLapisLevel(item));
|
||||
}
|
||||
return returnFloat;
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean isHidden()
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
package nmd.primal.forgecraft.items.tools;
|
||||
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemHoe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import nmd.primal.core.common.helper.PlayerHelper;
|
||||
import nmd.primal.forgecraft.ModInfo;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public abstract class AbstractHoe extends ItemHoe implements ToolNBT {
|
||||
|
||||
private Item drop;
|
||||
|
||||
public AbstractHoe(String name, ToolMaterial material, Item damageDrop) {
|
||||
super(material);
|
||||
this.setUnlocalizedName(name);
|
||||
this.setRegistryName(name);
|
||||
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
|
||||
this.setMaxStackSize(1);
|
||||
this.setNoRepair();
|
||||
this.drop = damageDrop;
|
||||
}
|
||||
|
||||
public static boolean isHidden()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreated(ItemStack item, World world, EntityPlayer playerIn) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
if (!item.hasTagCompound()) {
|
||||
item.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound tags = new NBTTagCompound();
|
||||
|
||||
item.getTagCompound().setTag("tags", tags);
|
||||
|
||||
/*setHot(item, false);
|
||||
|
||||
setHot(item, false);
|
||||
setEmerald(item, false);
|
||||
setDiamondLevel(item, 0);
|
||||
setRedstoneLevel(item, 0);
|
||||
setLapisLevel(item, 0);
|
||||
setModifiers(item, 0);*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) {
|
||||
if(!world.isRemote) {
|
||||
if (!item.hasTagCompound()) {
|
||||
item.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound tags = new NBTTagCompound();
|
||||
|
||||
item.getTagCompound().setTag("tags", tags);
|
||||
|
||||
setHot(item, false);
|
||||
setEmerald(item, false);
|
||||
setDiamondLevel(item, 0);
|
||||
setRedstoneLevel(item, 0);
|
||||
setLapisLevel(item, 0);
|
||||
setModifiers(item, 0);
|
||||
|
||||
}
|
||||
|
||||
if( this.getMaxDamage(item) - this.getDamage(item) <= 1 ){
|
||||
PlayerHelper.spawnItemOnPlayer(world, (EntityPlayer) player, new ItemStack(this.drop, 1));
|
||||
((EntityPlayer) player).inventory.deleteStack(item);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//public void onItemTooltip(ItemTooltipEvent event){
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack item, @Nullable World world, List<String> tooltip, ITooltipFlag flagIn)
|
||||
{
|
||||
if(item.hasTagCompound())
|
||||
{
|
||||
tooltip.add(ChatFormatting.GRAY + "Upgrades: " + (getModifiers(item)) );
|
||||
if (getEmerald(item) == true) {
|
||||
tooltip.add(ChatFormatting.DARK_GREEN + "Emerald");
|
||||
}
|
||||
if (getDiamondLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.AQUA + "Diamond Level: " + getDiamondLevel(item));
|
||||
}
|
||||
if (getRedstoneLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.RED + "Redstone Level: " + getRedstoneLevel(item) );
|
||||
}
|
||||
if (getLapisLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.BLUE + "Lapis Level: " + getLapisLevel(item) );
|
||||
}
|
||||
tooltip.add(ChatFormatting.LIGHT_PURPLE + "Damage: " + item.getItemDamage() );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void setBlock(ItemStack stack, EntityPlayer player, World worldIn, BlockPos pos, IBlockState state)
|
||||
{
|
||||
worldIn.playSound(player, pos, SoundEvents.ITEM_HOE_TILL, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
|
||||
if (!worldIn.isRemote)
|
||||
{
|
||||
worldIn.setBlockState(pos, state, 11);
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.damageItem(1, player);
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(drop, 1);
|
||||
dropStack.setItemDamage(stack.getItemDamage());
|
||||
dropStack.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound copyNBT;
|
||||
copyNBT = stack.getSubCompound("tags").copy();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
PlayerHelper.spawnItemOnPlayer(worldIn, player, dropStack);
|
||||
player.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
|
||||
{
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.damageItem(1, attacker);
|
||||
return true;
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(drop, 1, stack.getItemDamage());
|
||||
NBTTagCompound copyNBT = stack.getTagCompound();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
|
||||
EntityPlayer player = (EntityPlayer) attacker;
|
||||
World world = attacker.getEntityWorld();
|
||||
if(!world.isRemote) {
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
|
||||
attacker.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
|
||||
{
|
||||
if (!world.isRemote && (double)state.getBlockHardness(world, pos) != 0.0D)
|
||||
{
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.getTagCompound().removeTag("ench");
|
||||
if(getDiamondLevel(stack) > 0) {
|
||||
if(ThreadLocalRandom.current().nextInt(0, getDiamondLevel(stack)) == 0) {
|
||||
stack.damageItem(1, entityLiving);
|
||||
}
|
||||
} else stack.damageItem(1, entityLiving);
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(drop, 1, stack.getItemDamage());
|
||||
NBTTagCompound copyNBT = stack.getTagCompound();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
EntityPlayer player = (EntityPlayer) entityLiving;
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
|
||||
entityLiving.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack stack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getItemEnchantability(ItemStack stack)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,243 @@
|
||||
package nmd.primal.forgecraft.items.tools;
|
||||
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.IItemPropertyGetter;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import nmd.primal.core.common.helper.PlayerHelper;
|
||||
import nmd.primal.forgecraft.ModInfo;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public abstract class AbstractPickaxe extends ItemPickaxe implements ToolNBT {
|
||||
private Item drop;
|
||||
|
||||
public AbstractPickaxe(String name, Item.ToolMaterial material, Item damageDrop) {
|
||||
super(material);
|
||||
this.setUnlocalizedName(name);
|
||||
this.setRegistryName(name);
|
||||
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
|
||||
this.setMaxStackSize(1);
|
||||
this.setNoRepair();
|
||||
this.drop=damageDrop;
|
||||
//this.toolClass = "pickaxe";
|
||||
|
||||
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
|
||||
|
||||
/***
|
||||
|
||||
hot | emerald | diamond | redstone | lapis
|
||||
X.0 | 0.X | 0.0X | 0.00X | 0.000X
|
||||
|
||||
***/
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
|
||||
if (item.hasTagCompound()) {
|
||||
Float returnFloat = 0.0F;
|
||||
if(getHot(item)){
|
||||
returnFloat = returnFloat + 1.0F;
|
||||
}
|
||||
if(getEmerald(item)){
|
||||
returnFloat += 0.1F;
|
||||
}
|
||||
if(getDiamondLevel(item)>0){
|
||||
returnFloat += (0.01F * getDiamondLevel(item));
|
||||
}
|
||||
if(getRedstoneLevel(item)>0){
|
||||
returnFloat += (0.001F * getRedstoneLevel(item));
|
||||
}
|
||||
if(getLapisLevel(item)>0){
|
||||
returnFloat += (0.0001F * getLapisLevel(item));
|
||||
}
|
||||
return returnFloat;
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean isHidden()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreated(ItemStack item, World world, EntityPlayer playerIn) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
if (!item.hasTagCompound()) {
|
||||
item.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound tags = new NBTTagCompound();
|
||||
|
||||
item.getTagCompound().setTag("tags", tags);
|
||||
|
||||
setHot(item, false);
|
||||
|
||||
setHot(item, false);
|
||||
setEmerald(item, false);
|
||||
setDiamondLevel(item, 0);
|
||||
setRedstoneLevel(item, 0);
|
||||
setLapisLevel(item, 0);
|
||||
setModifiers(item, 0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) {
|
||||
if(!world.isRemote) {
|
||||
//item.setItemDamage(item.getMaxDamage()-2);
|
||||
|
||||
if (!item.hasTagCompound()) {
|
||||
item.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound tags = new NBTTagCompound();
|
||||
|
||||
item.getTagCompound().setTag("tags", tags);
|
||||
|
||||
setHot(item, false);
|
||||
setEmerald(item, false);
|
||||
setDiamondLevel(item, 0);
|
||||
setRedstoneLevel(item, 0);
|
||||
setLapisLevel(item, 0);
|
||||
setModifiers(item, 0);
|
||||
|
||||
}
|
||||
|
||||
if( this.getMaxDamage(item) - this.getDamage(item) <= 1 ){
|
||||
PlayerHelper.spawnItemOnPlayer(world, (EntityPlayer) player, new ItemStack(this.drop, 1));
|
||||
((EntityPlayer) player).inventory.deleteStack(item);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//public void onItemTooltip(ItemTooltipEvent event){
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack item, @Nullable World world, List<String> tooltip, ITooltipFlag flagIn)
|
||||
{
|
||||
//tooltip.add(ChatFormatting.GRAY + "Damage: " + item.getItemDamage() );
|
||||
if(item.hasTagCompound())
|
||||
{
|
||||
tooltip.add(ChatFormatting.GRAY + "Upgrades Left: " + (3 - getModifiers(item)) );
|
||||
if (getEmerald(item) == true) {
|
||||
tooltip.add(ChatFormatting.DARK_GREEN + "Emerald");
|
||||
}
|
||||
if (getDiamondLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.AQUA + "Diamond Level: " + getDiamondLevel(item));
|
||||
}
|
||||
if (getRedstoneLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.RED + "Redstone Level: " + getRedstoneLevel(item) );
|
||||
}
|
||||
if (getLapisLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.BLUE + "Lapis Level: " + getLapisLevel(item) );
|
||||
}
|
||||
tooltip.add(ChatFormatting.LIGHT_PURPLE + "Damage: " + item.getItemDamage() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
|
||||
{
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.damageItem(1, attacker);
|
||||
return true;
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(drop, 1, stack.getItemDamage());
|
||||
NBTTagCompound copyNBT = stack.getTagCompound();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
|
||||
EntityPlayer player = (EntityPlayer) attacker;
|
||||
World world = attacker.getEntityWorld();
|
||||
if(!world.isRemote) {
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
|
||||
attacker.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
|
||||
{
|
||||
if (!world.isRemote && (double)state.getBlockHardness(world, pos) != 0.0D)
|
||||
{
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.getTagCompound().removeTag("ench");
|
||||
if(getDiamondLevel(stack) > 0) {
|
||||
if(ThreadLocalRandom.current().nextInt(0, getDiamondLevel(stack)) == 0) {
|
||||
stack.damageItem(1, entityLiving);
|
||||
}
|
||||
} else stack.damageItem(1, entityLiving);
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(drop, 1, stack.getItemDamage());
|
||||
NBTTagCompound copyNBT = stack.getTagCompound();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
EntityPlayer player = (EntityPlayer) entityLiving;
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
|
||||
entityLiving.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
player.inventory.markDirty();
|
||||
//player.inventory.inventoryChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack stack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getItemEnchantability(ItemStack stack)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDestroySpeed(ItemStack stack, IBlockState state)
|
||||
{
|
||||
Material material = state.getMaterial();
|
||||
//return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
|
||||
|
||||
if(material != Material.IRON && material != Material.ANVIL && material != Material.ROCK){
|
||||
return super.getDestroySpeed(stack, state);
|
||||
} else {
|
||||
return this.efficiency * ( (this.getRedstoneLevel(stack) * 2 ) + 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,237 @@
|
||||
package nmd.primal.forgecraft.items.tools;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.IItemPropertyGetter;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import nmd.primal.core.common.helper.PlayerHelper;
|
||||
import nmd.primal.forgecraft.ModInfo;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class AbstractShovel extends ItemSpade implements ToolNBT {
|
||||
|
||||
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.CLAY, Blocks.DIRT, Blocks.FARMLAND, Blocks.GRASS, Blocks.GRAVEL, Blocks.MYCELIUM, Blocks.SAND, Blocks.SNOW, Blocks.SNOW_LAYER, Blocks.SOUL_SAND, Blocks.GRASS_PATH});
|
||||
private Item drop;
|
||||
|
||||
public AbstractShovel(String name, Item.ToolMaterial material, Item damageDrop) {
|
||||
super(material);
|
||||
this.setUnlocalizedName(name);
|
||||
this.setRegistryName(name);
|
||||
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
|
||||
this.setMaxStackSize(1);
|
||||
this.setNoRepair();
|
||||
this.drop = damageDrop;
|
||||
|
||||
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
|
||||
|
||||
/***
|
||||
|
||||
hot | emerald | diamond | redstone | lapis
|
||||
X.0 | 0.X | 0.0X | 0.00X | 0.000X
|
||||
|
||||
***/
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
|
||||
if (item.hasTagCompound()) {
|
||||
Float returnFloat = 0.0F;
|
||||
if(getHot(item)){
|
||||
returnFloat = returnFloat + 1.0F;
|
||||
}
|
||||
if(getEmerald(item)){
|
||||
returnFloat += 0.1F;
|
||||
}
|
||||
if(getDiamondLevel(item)>0){
|
||||
returnFloat += (0.01F * getDiamondLevel(item));
|
||||
}
|
||||
if(getRedstoneLevel(item)>0){
|
||||
returnFloat += (0.001F * getRedstoneLevel(item));
|
||||
}
|
||||
if(getLapisLevel(item)>0){
|
||||
returnFloat += (0.0001F * getLapisLevel(item));
|
||||
}
|
||||
return returnFloat;
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean isHidden()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreated(ItemStack item, World world, EntityPlayer playerIn) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
if (!item.hasTagCompound()) {
|
||||
item.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound tags = new NBTTagCompound();
|
||||
|
||||
item.getTagCompound().setTag("tags", tags);
|
||||
|
||||
/*setHot(item, false);
|
||||
|
||||
setHot(item, false);
|
||||
setEmerald(item, false);
|
||||
setDiamondLevel(item, 0);
|
||||
setRedstoneLevel(item, 0);
|
||||
setLapisLevel(item, 0);
|
||||
setModifiers(item, 0);*/
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) {
|
||||
if(!world.isRemote) {
|
||||
if (!item.hasTagCompound()) {
|
||||
item.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound tags = new NBTTagCompound();
|
||||
|
||||
item.getTagCompound().setTag("tags", tags);
|
||||
|
||||
setHot(item, false);
|
||||
setEmerald(item, false);
|
||||
setDiamondLevel(item, 0);
|
||||
setRedstoneLevel(item, 0);
|
||||
setLapisLevel(item, 0);
|
||||
setModifiers(item, 0);
|
||||
|
||||
}
|
||||
|
||||
if( this.getMaxDamage(item) - this.getDamage(item) <= 1 ){
|
||||
PlayerHelper.spawnItemOnPlayer(world, (EntityPlayer) player, new ItemStack(this.drop, 1));
|
||||
((EntityPlayer) player).inventory.deleteStack(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//public void onItemTooltip(ItemTooltipEvent event){
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack item, @Nullable World world, List<String> tooltip, ITooltipFlag flagIn)
|
||||
{
|
||||
if(item.hasTagCompound())
|
||||
{
|
||||
|
||||
tooltip.add(ChatFormatting.GRAY + "Upgrades: " + getModifiers(item) );
|
||||
if (getEmerald(item)) {
|
||||
tooltip.add(ChatFormatting.DARK_GREEN + "Emerald");
|
||||
}
|
||||
if (getDiamondLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.AQUA + "Diamond Level: " + getDiamondLevel(item));
|
||||
}
|
||||
if (getRedstoneLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.RED + "Redstone Level: " + getRedstoneLevel(item) );
|
||||
}
|
||||
if (getLapisLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.BLUE + "Lapis Level: " + getLapisLevel(item) );
|
||||
}
|
||||
tooltip.add(ChatFormatting.LIGHT_PURPLE + "Damage: " + item.getItemDamage() );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
|
||||
{
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.damageItem(1, attacker);
|
||||
return true;
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(drop, 1, stack.getItemDamage());
|
||||
NBTTagCompound copyNBT = stack.getTagCompound();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
|
||||
EntityPlayer player = (EntityPlayer) attacker;
|
||||
World world = attacker.getEntityWorld();
|
||||
if(!world.isRemote) {
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
|
||||
attacker.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
|
||||
{
|
||||
if (!world.isRemote && (double)state.getBlockHardness(world, pos) != 0.0D)
|
||||
{
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.getTagCompound().removeTag("ench");
|
||||
if(getDiamondLevel(stack) > 0) {
|
||||
if(ThreadLocalRandom.current().nextInt(0, getDiamondLevel(stack)) == 0) {
|
||||
stack.damageItem(1, entityLiving);
|
||||
}
|
||||
} else stack.damageItem(1, entityLiving);
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(this.drop, 1, stack.getItemDamage());
|
||||
NBTTagCompound copyNBT = stack.getTagCompound();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
EntityPlayer player = (EntityPlayer) entityLiving;
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
|
||||
entityLiving.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDestroySpeed(ItemStack stack, IBlockState state)
|
||||
{
|
||||
for (String type : getToolClasses(stack))
|
||||
{
|
||||
if (state.getBlock().isToolEffective(type, state))
|
||||
return efficiency;
|
||||
}
|
||||
return this.EFFECTIVE_ON.contains(state.getBlock()) ? (this.efficiency * ( (this.getRedstoneLevel(stack) * 2 ) + 1)) : 1.0F;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack stack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getItemEnchantability(ItemStack stack)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,33 +1,13 @@
|
||||
package nmd.primal.forgecraft.items.tools;
|
||||
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.IItemPropertyGetter;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import nmd.primal.core.api.PrimalAPI;
|
||||
import nmd.primal.core.common.helper.PlayerHelper;
|
||||
import nmd.primal.forgecraft.ModInfo;
|
||||
import nmd.primal.forgecraft.init.ModItems;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
/**
|
||||
* Created by mminaie on 3/20/17.
|
||||
*/
|
||||
@@ -37,186 +17,6 @@ public class CustomAxe extends AbstractAxe implements ToolNBT {
|
||||
|
||||
public CustomAxe(String name, Item.ToolMaterial material, Item damageDrop, Integer damage, Float speed) {
|
||||
super(name, material, damageDrop, damage, speed);
|
||||
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
|
||||
|
||||
/***
|
||||
|
||||
hot . emerald . diamond . redstone . lapis
|
||||
0 . 0 . 0 . 0 . 0
|
||||
|
||||
***/
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
|
||||
if (item.hasTagCompound()) {
|
||||
|
||||
|
||||
|
||||
if (getHot(item) != true) {
|
||||
if (getModifiers(item) != 0) {
|
||||
if ((getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.1F;
|
||||
}
|
||||
|
||||
if ((getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.11F;
|
||||
}
|
||||
|
||||
if ((getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 2) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.12F;
|
||||
}
|
||||
|
||||
if ((getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.111F;
|
||||
}
|
||||
|
||||
if ((getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 2) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.102F;
|
||||
}
|
||||
|
||||
// ============
|
||||
|
||||
if ((getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.01F;
|
||||
}
|
||||
|
||||
if ((getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 2) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.02F;
|
||||
}
|
||||
|
||||
if ((getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 3) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.03F;
|
||||
}
|
||||
|
||||
//=======
|
||||
|
||||
if ((getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.001F;
|
||||
}
|
||||
|
||||
if ((getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 2) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.002F;
|
||||
}
|
||||
|
||||
if ((getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 3) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.003F;
|
||||
}
|
||||
|
||||
//=========
|
||||
|
||||
if ((getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 1)) {
|
||||
return 0.0001F;
|
||||
}
|
||||
|
||||
if ((getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 2)) {
|
||||
return 0.0002F;
|
||||
}
|
||||
|
||||
if ((getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 3)) {
|
||||
return 0.0003F;
|
||||
}
|
||||
|
||||
//=======
|
||||
|
||||
if ((getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 1)) {
|
||||
return 0.0111F;
|
||||
}
|
||||
|
||||
if ((getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 2) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.021F;
|
||||
}
|
||||
|
||||
if ((getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 2) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.012F;
|
||||
}
|
||||
|
||||
if ((getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 2)) {
|
||||
return 0.0012F;
|
||||
}
|
||||
|
||||
if ((getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 2) &&
|
||||
(getLapisLevel(item) == 1)) {
|
||||
return 0.0021F;
|
||||
}
|
||||
|
||||
if ((getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 2)) {
|
||||
return 0.0102F;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (getHot(item) == true) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
if (getHot(item) == false) {
|
||||
if (getModifiers(item) == 0) {
|
||||
return 0.0F;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,49 +1,29 @@
|
||||
package nmd.primal.forgecraft.items.tools;
|
||||
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.IItemPropertyGetter;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemHoe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import nmd.primal.core.api.PrimalAPI;
|
||||
import nmd.primal.core.common.helper.PlayerHelper;
|
||||
import nmd.primal.forgecraft.ModInfo;
|
||||
import nmd.primal.forgecraft.init.ModItems;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
/**
|
||||
* Created by mminaie on 3/21/17.
|
||||
*/
|
||||
public class CustomHoe extends ItemHoe implements ToolNBT {
|
||||
public class CustomHoe extends AbstractHoe implements ToolNBT {
|
||||
|
||||
private Item drop;
|
||||
|
||||
public CustomHoe(String name, Item.ToolMaterial material, Item damageDrop) {
|
||||
super(material);
|
||||
this.setUnlocalizedName(name);
|
||||
this.setRegistryName(name);
|
||||
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
|
||||
this.setMaxStackSize(1);
|
||||
this.setNoRepair();
|
||||
this.drop = damageDrop;
|
||||
super(name, material, damageDrop);
|
||||
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
|
||||
|
||||
/***
|
||||
@@ -223,86 +203,6 @@ public class CustomHoe extends ItemHoe implements ToolNBT {
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean isHidden()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreated(ItemStack item, World world, EntityPlayer playerIn) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
if (!item.hasTagCompound()) {
|
||||
item.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound tags = new NBTTagCompound();
|
||||
|
||||
item.getTagCompound().setTag("tags", tags);
|
||||
|
||||
/*setHot(item, false);
|
||||
|
||||
setHot(item, false);
|
||||
setEmerald(item, false);
|
||||
setDiamondLevel(item, 0);
|
||||
setRedstoneLevel(item, 0);
|
||||
setLapisLevel(item, 0);
|
||||
setModifiers(item, 0);*/
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) {
|
||||
if(!world.isRemote) {
|
||||
if (!item.hasTagCompound()) {
|
||||
item.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound tags = new NBTTagCompound();
|
||||
|
||||
item.getTagCompound().setTag("tags", tags);
|
||||
|
||||
setHot(item, false);
|
||||
setEmerald(item, false);
|
||||
setDiamondLevel(item, 0);
|
||||
setRedstoneLevel(item, 0);
|
||||
setLapisLevel(item, 0);
|
||||
setModifiers(item, 0);
|
||||
|
||||
}
|
||||
|
||||
if( this.getMaxDamage(item) - this.getDamage(item) <= 1 ){
|
||||
PlayerHelper.spawnItemOnPlayer(world, (EntityPlayer) player, new ItemStack(this.drop, 1));
|
||||
((EntityPlayer) player).inventory.deleteStack(item);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//public void onItemTooltip(ItemTooltipEvent event){
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack item, @Nullable World world, List<String> tooltip, ITooltipFlag flagIn)
|
||||
{
|
||||
if(item.hasTagCompound())
|
||||
{
|
||||
tooltip.add(ChatFormatting.GRAY + "Upgrades Left: " + (3 - getModifiers(item)) );
|
||||
if (getEmerald(item) == true) {
|
||||
tooltip.add(ChatFormatting.DARK_GREEN + "Emerald");
|
||||
}
|
||||
if (getDiamondLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.AQUA + "Diamond Level: " + getDiamondLevel(item));
|
||||
}
|
||||
if (getRedstoneLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.RED + "Redstone Level: " + getRedstoneLevel(item) );
|
||||
}
|
||||
if (getLapisLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.BLUE + "Lapis Level: " + getLapisLevel(item) );
|
||||
}
|
||||
tooltip.add(ChatFormatting.LIGHT_PURPLE + "Damage: " + item.getItemDamage() );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
@@ -330,95 +230,4 @@ public class CustomHoe extends ItemHoe implements ToolNBT {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setBlock(ItemStack stack, EntityPlayer player, World worldIn, BlockPos pos, IBlockState state)
|
||||
{
|
||||
worldIn.playSound(player, pos, SoundEvents.ITEM_HOE_TILL, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
|
||||
if (!worldIn.isRemote)
|
||||
{
|
||||
worldIn.setBlockState(pos, state, 11);
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.damageItem(1, player);
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(drop, 1);
|
||||
dropStack.setItemDamage(stack.getItemDamage());
|
||||
dropStack.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound copyNBT;
|
||||
copyNBT = stack.getSubCompound("tags").copy();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
PlayerHelper.spawnItemOnPlayer(worldIn, player, dropStack);
|
||||
player.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
|
||||
{
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.damageItem(1, attacker);
|
||||
return true;
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(drop, 1, stack.getItemDamage());
|
||||
NBTTagCompound copyNBT = stack.getTagCompound();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
|
||||
EntityPlayer player = (EntityPlayer) attacker;
|
||||
World world = attacker.getEntityWorld();
|
||||
if(!world.isRemote) {
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
|
||||
attacker.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
|
||||
{
|
||||
if (!world.isRemote && (double)state.getBlockHardness(world, pos) != 0.0D)
|
||||
{
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.getTagCompound().removeTag("ench");
|
||||
if(getDiamondLevel(stack) > 0) {
|
||||
if(ThreadLocalRandom.current().nextInt(0, getDiamondLevel(stack)) == 0) {
|
||||
stack.damageItem(1, entityLiving);
|
||||
}
|
||||
} else stack.damageItem(1, entityLiving);
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(drop, 1, stack.getItemDamage());
|
||||
NBTTagCompound copyNBT = stack.getTagCompound();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
EntityPlayer player = (EntityPlayer) entityLiving;
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
|
||||
entityLiving.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack stack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getItemEnchantability(ItemStack stack)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,309 +1,22 @@
|
||||
package nmd.primal.forgecraft.items.tools;
|
||||
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.IItemPropertyGetter;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import nmd.primal.core.api.PrimalAPI;
|
||||
import nmd.primal.core.common.helper.PlayerHelper;
|
||||
import nmd.primal.forgecraft.ModInfo;
|
||||
import nmd.primal.forgecraft.init.ModItems;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
/**
|
||||
* Created by mminaie on 3/14/17.
|
||||
*/
|
||||
public class CustomPickaxe extends ItemPickaxe implements ToolNBT{
|
||||
public class CustomPickaxe extends AbstractPickaxe implements ToolNBT{
|
||||
|
||||
private Item drop;
|
||||
|
||||
public CustomPickaxe(String name, Item.ToolMaterial material, Item damageDrop) {
|
||||
super(material);
|
||||
this.setUnlocalizedName(name);
|
||||
this.setRegistryName(name);
|
||||
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
|
||||
this.setMaxStackSize(1);
|
||||
this.setNoRepair();
|
||||
this.drop=damageDrop;
|
||||
//this.toolClass = "pickaxe";
|
||||
|
||||
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
|
||||
|
||||
/***
|
||||
|
||||
hot . emerald . diamond . redstone . lapis
|
||||
0 . 0 . 0 . 0 . 0
|
||||
|
||||
***/
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
|
||||
if (item.hasTagCompound()) {
|
||||
|
||||
if (getHot(item) == false) {
|
||||
if (getModifiers(item) != 0) {
|
||||
if ( (getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.1F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.11F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 2) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.12F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.111F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 2) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.102F;
|
||||
}
|
||||
|
||||
// ============
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.01F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 2) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.02F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 3) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.03F;
|
||||
}
|
||||
|
||||
//=======
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.001F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 2) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.002F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 3) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.003F;
|
||||
}
|
||||
|
||||
//=========
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 1)) {
|
||||
return 0.0001F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 2)) {
|
||||
return 0.0002F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 3)) {
|
||||
return 0.0003F;
|
||||
}
|
||||
|
||||
//=======
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 1)) {
|
||||
return 0.0111F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 2) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.021F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 2) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.012F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 2)) {
|
||||
return 0.0012F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 2) &&
|
||||
(getLapisLevel(item) == 1)) {
|
||||
return 0.0021F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 2) ) {
|
||||
return 0.0102F;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (getHot(item) == true) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
if (getHot(item) == false) {
|
||||
if (getModifiers(item) == 0) {
|
||||
return 0.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean isHidden()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreated(ItemStack item, World world, EntityPlayer playerIn) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
if (!item.hasTagCompound()) {
|
||||
item.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound tags = new NBTTagCompound();
|
||||
|
||||
item.getTagCompound().setTag("tags", tags);
|
||||
|
||||
setHot(item, false);
|
||||
|
||||
setHot(item, false);
|
||||
setEmerald(item, false);
|
||||
setDiamondLevel(item, 0);
|
||||
setRedstoneLevel(item, 0);
|
||||
setLapisLevel(item, 0);
|
||||
setModifiers(item, 0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) {
|
||||
if(!world.isRemote) {
|
||||
//item.setItemDamage(item.getMaxDamage()-2);
|
||||
|
||||
if (!item.hasTagCompound()) {
|
||||
item.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound tags = new NBTTagCompound();
|
||||
|
||||
item.getTagCompound().setTag("tags", tags);
|
||||
|
||||
setHot(item, false);
|
||||
setEmerald(item, false);
|
||||
setDiamondLevel(item, 0);
|
||||
setRedstoneLevel(item, 0);
|
||||
setLapisLevel(item, 0);
|
||||
setModifiers(item, 0);
|
||||
|
||||
}
|
||||
|
||||
if( this.getMaxDamage(item) - this.getDamage(item) <= 1 ){
|
||||
PlayerHelper.spawnItemOnPlayer(world, (EntityPlayer) player, new ItemStack(this.drop, 1));
|
||||
((EntityPlayer) player).inventory.deleteStack(item);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//public void onItemTooltip(ItemTooltipEvent event){
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack item, @Nullable World world, List<String> tooltip, ITooltipFlag flagIn)
|
||||
{
|
||||
//tooltip.add(ChatFormatting.GRAY + "Damage: " + item.getItemDamage() );
|
||||
if(item.hasTagCompound())
|
||||
{
|
||||
tooltip.add(ChatFormatting.GRAY + "Upgrades Left: " + (3 - getModifiers(item)) );
|
||||
if (getEmerald(item) == true) {
|
||||
tooltip.add(ChatFormatting.DARK_GREEN + "Emerald");
|
||||
}
|
||||
if (getDiamondLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.AQUA + "Diamond Level: " + getDiamondLevel(item));
|
||||
}
|
||||
if (getRedstoneLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.RED + "Redstone Level: " + getRedstoneLevel(item) );
|
||||
}
|
||||
if (getLapisLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.BLUE + "Lapis Level: " + getLapisLevel(item) );
|
||||
}
|
||||
tooltip.add(ChatFormatting.LIGHT_PURPLE + "Damage: " + item.getItemDamage() );
|
||||
}
|
||||
super(name, material, damageDrop);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -333,87 +46,4 @@ public class CustomPickaxe extends ItemPickaxe implements ToolNBT{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
|
||||
{
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.damageItem(1, attacker);
|
||||
return true;
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(drop, 1, stack.getItemDamage());
|
||||
NBTTagCompound copyNBT = stack.getTagCompound();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
|
||||
EntityPlayer player = (EntityPlayer) attacker;
|
||||
World world = attacker.getEntityWorld();
|
||||
if(!world.isRemote) {
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
|
||||
attacker.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
|
||||
{
|
||||
if (!world.isRemote && (double)state.getBlockHardness(world, pos) != 0.0D)
|
||||
{
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.getTagCompound().removeTag("ench");
|
||||
if(getDiamondLevel(stack) > 0) {
|
||||
if(ThreadLocalRandom.current().nextInt(0, getDiamondLevel(stack)) == 0) {
|
||||
stack.damageItem(1, entityLiving);
|
||||
}
|
||||
} else stack.damageItem(1, entityLiving);
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(drop, 1, stack.getItemDamage());
|
||||
NBTTagCompound copyNBT = stack.getTagCompound();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
EntityPlayer player = (EntityPlayer) entityLiving;
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
|
||||
entityLiving.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
player.inventory.markDirty();
|
||||
//player.inventory.inventoryChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack stack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getItemEnchantability(ItemStack stack)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDestroySpeed(ItemStack stack, IBlockState state)
|
||||
{
|
||||
Material material = state.getMaterial();
|
||||
//return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
|
||||
|
||||
if(material != Material.IRON && material != Material.ANVIL && material != Material.ROCK){
|
||||
return super.getDestroySpeed(stack, state);
|
||||
} else {
|
||||
return this.efficiency * ( (this.getRedstoneLevel(stack) * 2 ) + 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,308 +1,20 @@
|
||||
package nmd.primal.forgecraft.items.tools;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.IItemPropertyGetter;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import nmd.primal.core.api.PrimalAPI;
|
||||
import nmd.primal.core.common.helper.PlayerHelper;
|
||||
import nmd.primal.forgecraft.ModInfo;
|
||||
import nmd.primal.forgecraft.init.ModItems;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
/**
|
||||
* Created by mminaie on 3/21/17.
|
||||
*/
|
||||
public class CustomShovel extends ItemSpade implements ToolNBT {
|
||||
|
||||
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.CLAY, Blocks.DIRT, Blocks.FARMLAND, Blocks.GRASS, Blocks.GRAVEL, Blocks.MYCELIUM, Blocks.SAND, Blocks.SNOW, Blocks.SNOW_LAYER, Blocks.SOUL_SAND, Blocks.GRASS_PATH});
|
||||
private Item drop;
|
||||
public class CustomShovel extends AbstractShovel implements ToolNBT {
|
||||
|
||||
public CustomShovel(String name, Item.ToolMaterial material, Item damageDrop) {
|
||||
super(material);
|
||||
this.setUnlocalizedName(name);
|
||||
this.setRegistryName(name);
|
||||
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
|
||||
this.setMaxStackSize(1);
|
||||
this.setNoRepair();
|
||||
this.drop=damageDrop;
|
||||
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
|
||||
|
||||
/***
|
||||
|
||||
hot . emerald . diamond . redstone . lapis
|
||||
0 . 0 . 0 . 0 . 0
|
||||
|
||||
***/
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
|
||||
if (item.hasTagCompound()) {
|
||||
|
||||
if (getHot(item) == false) {
|
||||
if (getModifiers(item) != 0) {
|
||||
if ( (getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.1F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.11F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 2) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.12F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.111F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == true) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 2) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.102F;
|
||||
}
|
||||
|
||||
// ============
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.01F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 2) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.02F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 3) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.03F;
|
||||
}
|
||||
|
||||
//=======
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.001F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 2) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.002F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 3) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.003F;
|
||||
}
|
||||
|
||||
//=========
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 1)) {
|
||||
return 0.0001F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 2)) {
|
||||
return 0.0002F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 3)) {
|
||||
return 0.0003F;
|
||||
}
|
||||
|
||||
//=======
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 1)) {
|
||||
return 0.0111F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 2) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.021F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 2) &&
|
||||
(getLapisLevel(item) == 0)) {
|
||||
return 0.012F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 1) &&
|
||||
(getLapisLevel(item) == 2)) {
|
||||
return 0.0012F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 0) &&
|
||||
(getRedstoneLevel(item) == 2) &&
|
||||
(getLapisLevel(item) == 1)) {
|
||||
return 0.0021F;
|
||||
}
|
||||
|
||||
if ( (getEmerald(item) == false) &&
|
||||
(getDiamondLevel(item) == 1) &&
|
||||
(getRedstoneLevel(item) == 0) &&
|
||||
(getLapisLevel(item) == 2) ) {
|
||||
return 0.0102F;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (getHot(item) == true) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
if (getHot(item) == false) {
|
||||
if (getModifiers(item) == 0) {
|
||||
return 0.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean isHidden()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreated(ItemStack item, World world, EntityPlayer playerIn) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
if (!item.hasTagCompound()) {
|
||||
item.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound tags = new NBTTagCompound();
|
||||
|
||||
item.getTagCompound().setTag("tags", tags);
|
||||
|
||||
/*setHot(item, false);
|
||||
|
||||
setHot(item, false);
|
||||
setEmerald(item, false);
|
||||
setDiamondLevel(item, 0);
|
||||
setRedstoneLevel(item, 0);
|
||||
setLapisLevel(item, 0);
|
||||
setModifiers(item, 0);*/
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) {
|
||||
if(!world.isRemote) {
|
||||
if (!item.hasTagCompound()) {
|
||||
item.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound tags = new NBTTagCompound();
|
||||
|
||||
item.getTagCompound().setTag("tags", tags);
|
||||
|
||||
setHot(item, false);
|
||||
setEmerald(item, false);
|
||||
setDiamondLevel(item, 0);
|
||||
setRedstoneLevel(item, 0);
|
||||
setLapisLevel(item, 0);
|
||||
setModifiers(item, 0);
|
||||
|
||||
}
|
||||
|
||||
if( this.getMaxDamage(item) - this.getDamage(item) <= 1 ){
|
||||
PlayerHelper.spawnItemOnPlayer(world, (EntityPlayer) player, new ItemStack(this.drop, 1));
|
||||
((EntityPlayer) player).inventory.deleteStack(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//public void onItemTooltip(ItemTooltipEvent event){
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack item, @Nullable World world, List<String> tooltip, ITooltipFlag flagIn)
|
||||
{
|
||||
if(item.hasTagCompound())
|
||||
{
|
||||
|
||||
tooltip.add(ChatFormatting.GRAY + "Upgrades Left: " + (3 - getModifiers(item)) );
|
||||
if (getEmerald(item) == true) {
|
||||
tooltip.add(ChatFormatting.DARK_GREEN + "Emerald");
|
||||
}
|
||||
if (getDiamondLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.AQUA + "Diamond Level: " + getDiamondLevel(item));
|
||||
}
|
||||
if (getRedstoneLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.RED + "Redstone Level: " + getRedstoneLevel(item) );
|
||||
}
|
||||
if (getLapisLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.BLUE + "Lapis Level: " + getLapisLevel(item) );
|
||||
}
|
||||
tooltip.add(ChatFormatting.LIGHT_PURPLE + "Damage: " + item.getItemDamage() );
|
||||
}
|
||||
super(name, material, damageDrop);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -331,82 +43,4 @@ public class CustomShovel extends ItemSpade implements ToolNBT {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
|
||||
{
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.damageItem(1, attacker);
|
||||
return true;
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(drop, 1, stack.getItemDamage());
|
||||
NBTTagCompound copyNBT = stack.getTagCompound();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
|
||||
EntityPlayer player = (EntityPlayer) attacker;
|
||||
World world = attacker.getEntityWorld();
|
||||
if(!world.isRemote) {
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
|
||||
attacker.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
|
||||
{
|
||||
if (!world.isRemote && (double)state.getBlockHardness(world, pos) != 0.0D)
|
||||
{
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.getTagCompound().removeTag("ench");
|
||||
if(getDiamondLevel(stack) > 0) {
|
||||
if(ThreadLocalRandom.current().nextInt(0, getDiamondLevel(stack)) == 0) {
|
||||
stack.damageItem(1, entityLiving);
|
||||
}
|
||||
} else stack.damageItem(1, entityLiving);
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(drop, 1, stack.getItemDamage());
|
||||
NBTTagCompound copyNBT = stack.getTagCompound();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
EntityPlayer player = (EntityPlayer) entityLiving;
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
|
||||
entityLiving.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDestroySpeed(ItemStack stack, IBlockState state)
|
||||
{
|
||||
for (String type : getToolClasses(stack))
|
||||
{
|
||||
if (state.getBlock().isToolEffective(type, state))
|
||||
return efficiency;
|
||||
}
|
||||
return this.EFFECTIVE_ON.contains(state.getBlock()) ? (this.efficiency * ( (this.getRedstoneLevel(stack) * 2 ) + 1)) : 1.0F;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack stack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getItemEnchantability(ItemStack stack)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,25 +3,14 @@ package nmd.primal.forgecraft.items.tools.bronze;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.IItemPropertyGetter;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import nmd.primal.core.common.helper.PlayerHelper;
|
||||
import nmd.primal.forgecraft.init.ModConfig;
|
||||
import nmd.primal.forgecraft.items.tools.AbstractAxe;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
/**
|
||||
* Created by mminaie on 6/25/17.
|
||||
*/
|
||||
@@ -31,46 +20,6 @@ public class BronzeAxe extends AbstractAxe implements ToolNBT {
|
||||
|
||||
public BronzeAxe(String name, Item.ToolMaterial material, Item damageDrop, Integer damage, Float speed) {
|
||||
super(name, material, damageDrop, damage, speed);
|
||||
|
||||
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
|
||||
|
||||
/***
|
||||
|
||||
hot . emerald . diamond . redstone . lapis
|
||||
0 . 0 . 0 . 0 . 0
|
||||
|
||||
***/
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn)
|
||||
{
|
||||
|
||||
if (item.hasTagCompound()) {
|
||||
|
||||
if (getModifiers(item) != 0) {
|
||||
if (getEmerald(item)) {
|
||||
return 0.1F;
|
||||
}
|
||||
|
||||
if (getDiamondLevel(item) == 1) {
|
||||
return 0.2F;
|
||||
}
|
||||
|
||||
if ( getRedstoneLevel(item) == 1) {
|
||||
return 0.3F;
|
||||
}
|
||||
|
||||
if (getLapisLevel(item) == 1) {
|
||||
return 0.4F;
|
||||
}
|
||||
}
|
||||
if (getModifiers(item) == 0) {
|
||||
return 0.0F;
|
||||
}
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +27,6 @@ public class BronzeAxe extends AbstractAxe implements ToolNBT {
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
if(!player.world.isRemote){
|
||||
World world = player.getEntityWorld();
|
||||
//System.out.println(world.getBlockState(pos).getBlock());
|
||||
if(itemstack.getItem() instanceof BronzeAxe){
|
||||
if( getEmerald(itemstack)){
|
||||
|
||||
@@ -1,88 +1,29 @@
|
||||
package nmd.primal.forgecraft.items.tools.bronze;
|
||||
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.IItemPropertyGetter;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemHoe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import nmd.primal.core.common.helper.PlayerHelper;
|
||||
import nmd.primal.forgecraft.ModInfo;
|
||||
import nmd.primal.forgecraft.init.ModConfig;
|
||||
import nmd.primal.forgecraft.items.tools.CustomHoe;
|
||||
import nmd.primal.forgecraft.items.tools.AbstractHoe;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
/**
|
||||
* Created by mminaie on 3/21/17.
|
||||
*/
|
||||
public class BronzeHoe extends AbstractHoe implements ToolNBT {
|
||||
|
||||
Item drop;
|
||||
|
||||
public BronzeHoe(String name, Item.ToolMaterial material, Item damageDrop) {
|
||||
super(material);
|
||||
this.setUnlocalizedName(name);
|
||||
this.setRegistryName(name);
|
||||
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
|
||||
this.setMaxStackSize(1);
|
||||
this.setNoRepair();
|
||||
this.drop=damageDrop;
|
||||
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
|
||||
|
||||
/***
|
||||
|
||||
hot . emerald . diamond . redstone . lapis
|
||||
0 . 0 . 0 . 0 . 0
|
||||
|
||||
***/
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn)
|
||||
{
|
||||
if (item.hasTagCompound()) {
|
||||
|
||||
|
||||
if (getModifiers(item) != 0) {
|
||||
if (getEmerald(item)) {
|
||||
return 0.1F;
|
||||
}
|
||||
|
||||
if (getDiamondLevel(item) == 1) {
|
||||
return 0.2F;
|
||||
}
|
||||
|
||||
if ( getRedstoneLevel(item) == 1) {
|
||||
return 0.3F;
|
||||
}
|
||||
|
||||
if (getLapisLevel(item) == 1) {
|
||||
return 0.4F;
|
||||
}
|
||||
}
|
||||
if (getModifiers(item) == 0) {
|
||||
return 0.0F;
|
||||
}
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
});
|
||||
public BronzeHoe(String name, ToolMaterial material, Item damageDrop) {
|
||||
super(name, material, damageDrop);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,10 +43,10 @@ public class BronzeHoe extends AbstractHoe implements ToolNBT {
|
||||
/*if( getRedstoneLevel(itemstack) > 0 ){
|
||||
itemstack.addEnchantment(Enchantment.getEnchantmentByID(32), getRedstoneLevel(itemstack));
|
||||
//System.out.println(itemstack.getEnchantmentTagList());
|
||||
}
|
||||
}*/
|
||||
if ( getLapisLevel(itemstack) > 0) {
|
||||
itemstack.addEnchantment(Enchantment.getEnchantmentByID(35), ModConfig.Features.BRONZE_LAPIS_MULTIPLIER);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,170 +1,26 @@
|
||||
package nmd.primal.forgecraft.items.tools.bronze;
|
||||
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.IItemPropertyGetter;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import nmd.primal.core.common.helper.PlayerHelper;
|
||||
import nmd.primal.forgecraft.ModInfo;
|
||||
import nmd.primal.forgecraft.init.ModConfig;
|
||||
import nmd.primal.forgecraft.items.tools.AbstractPickaxe;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
/**
|
||||
* Created by mminaie on 3/14/17.
|
||||
*/
|
||||
public class BronzePickaxe extends ItemPickaxe implements ToolNBT{
|
||||
public class BronzePickaxe extends AbstractPickaxe implements ToolNBT {
|
||||
|
||||
private Item drop;
|
||||
|
||||
public BronzePickaxe(String name, ToolMaterial material, Item damageDrop) {
|
||||
super(material);
|
||||
this.setUnlocalizedName(name);
|
||||
this.setRegistryName(name);
|
||||
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
|
||||
this.setMaxStackSize(1);
|
||||
this.setNoRepair();
|
||||
this.drop=damageDrop;
|
||||
//this.toolClass = "pickaxe";
|
||||
|
||||
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
|
||||
|
||||
/***
|
||||
|
||||
hot . emerald . diamond . redstone . lapis
|
||||
0 . 0 . 0 . 0 . 0
|
||||
|
||||
***/
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn)
|
||||
{
|
||||
if (item.hasTagCompound()) {
|
||||
|
||||
|
||||
if (getModifiers(item) != 0) {
|
||||
if (getEmerald(item)) {
|
||||
return 0.1F;
|
||||
}
|
||||
|
||||
if (getDiamondLevel(item) == 1) {
|
||||
return 0.2F;
|
||||
}
|
||||
|
||||
if ( getRedstoneLevel(item) == 1) {
|
||||
return 0.3F;
|
||||
}
|
||||
|
||||
if (getLapisLevel(item) == 1) {
|
||||
return 0.4F;
|
||||
}
|
||||
}
|
||||
if (getModifiers(item) == 0) {
|
||||
return 0.0F;
|
||||
}
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
});
|
||||
super(name, material, damageDrop);
|
||||
}
|
||||
|
||||
public static boolean isHidden()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreated(ItemStack item, World world, EntityPlayer playerIn) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
if (!item.hasTagCompound()) {
|
||||
item.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound tags = new NBTTagCompound();
|
||||
|
||||
item.getTagCompound().setTag("tags", tags);
|
||||
|
||||
/*setHot(item, false);
|
||||
|
||||
setHot(item, false);
|
||||
setEmerald(item, false);
|
||||
setDiamondLevel(item, 0);
|
||||
setRedstoneLevel(item, 0);
|
||||
setLapisLevel(item, 0);
|
||||
setModifiers(item, 0);*/
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) {
|
||||
if(!world.isRemote) {
|
||||
if (!item.hasTagCompound()) {
|
||||
item.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound tags = new NBTTagCompound();
|
||||
|
||||
item.getTagCompound().setTag("tags", tags);
|
||||
|
||||
setHot(item, false);
|
||||
setEmerald(item, false);
|
||||
setDiamondLevel(item, 0);
|
||||
setRedstoneLevel(item, 0);
|
||||
setLapisLevel(item, 0);
|
||||
setModifiers(item, 0);
|
||||
|
||||
}
|
||||
if( this.getMaxDamage(item) - this.getDamage(item) <= 1 ){
|
||||
PlayerHelper.spawnItemOnPlayer(world, (EntityPlayer) player, new ItemStack(this.drop, 1));
|
||||
((EntityPlayer) player).inventory.deleteStack(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//public void onItemTooltip(ItemTooltipEvent event){
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack item, @Nullable World world, List<String> tooltip, ITooltipFlag flagIn)
|
||||
{
|
||||
if(!item.isEmpty())
|
||||
{
|
||||
if (item.hasTagCompound())
|
||||
{
|
||||
tooltip.add(ChatFormatting.GRAY + "Upgrades Left: " + (1 - getModifiers(item)) );
|
||||
if (getEmerald(item) == true) {
|
||||
tooltip.add(ChatFormatting.DARK_GREEN + "Emerald");
|
||||
}
|
||||
if (getDiamondLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.AQUA + "Diamond Level: " + getDiamondLevel(item));
|
||||
}
|
||||
if (getRedstoneLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.RED + "Redstone Level: " + getRedstoneLevel(item) );
|
||||
}
|
||||
if (getLapisLevel(item) > 0) {
|
||||
int lapisOutput = Integer.valueOf(ModConfig.Features.BRONZE_LAPIS_MULTIPLIER) ;
|
||||
tooltip.add(ChatFormatting.BLUE + "Lapis Level: " + Integer.toString(lapisOutput*1));
|
||||
}
|
||||
tooltip.add(ChatFormatting.LIGHT_PURPLE + "Damage: " + item.getItemDamage() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, EntityPlayer player)
|
||||
@@ -185,89 +41,8 @@ public class BronzePickaxe extends ItemPickaxe implements ToolNBT{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
|
||||
{
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.damageItem(1, attacker);
|
||||
return true;
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(drop, 1, stack.getItemDamage());
|
||||
NBTTagCompound copyNBT = stack.getTagCompound();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
|
||||
EntityPlayer player = (EntityPlayer) attacker;
|
||||
World world = attacker.getEntityWorld();
|
||||
if(!world.isRemote) {
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
|
||||
attacker.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
|
||||
{
|
||||
if (!world.isRemote && (double)state.getBlockHardness(world, pos) != 0.0D)
|
||||
{
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.getTagCompound().removeTag("ench");
|
||||
if(getDiamondLevel(stack) > 0) {
|
||||
if(ThreadLocalRandom.current().nextInt(0, getDiamondLevel(stack)) == 0) {
|
||||
stack.damageItem(1, entityLiving);
|
||||
}
|
||||
} else stack.damageItem(1, entityLiving);
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(drop, 1, stack.getItemDamage());
|
||||
NBTTagCompound copyNBT = stack.getTagCompound();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
EntityPlayer player = (EntityPlayer) entityLiving;
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
|
||||
entityLiving.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack stack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getItemEnchantability(ItemStack stack)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDestroySpeed(ItemStack stack, IBlockState state)
|
||||
{
|
||||
Material material = state.getMaterial();
|
||||
//return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
|
||||
|
||||
if(material != Material.IRON && material != Material.ANVIL && material != Material.ROCK){
|
||||
return super.getDestroySpeed(stack, state);
|
||||
} else {
|
||||
return this.efficiency + 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,177 +1,29 @@
|
||||
package nmd.primal.forgecraft.items.tools.bronze;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.IItemPropertyGetter;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import nmd.primal.core.common.helper.PlayerHelper;
|
||||
import nmd.primal.forgecraft.ModInfo;
|
||||
import nmd.primal.forgecraft.init.ModConfig;
|
||||
import nmd.primal.forgecraft.items.tools.AbstractShovel;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
/**
|
||||
* Created by mminaie on 3/21/17.
|
||||
*/
|
||||
public class BronzeShovel extends ItemSpade implements ToolNBT {
|
||||
|
||||
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.CLAY, Blocks.DIRT, Blocks.FARMLAND, Blocks.GRASS, Blocks.GRAVEL, Blocks.MYCELIUM, Blocks.SAND, Blocks.SNOW, Blocks.SNOW_LAYER, Blocks.SOUL_SAND, Blocks.GRASS_PATH});
|
||||
Item drop;
|
||||
public class BronzeShovel extends AbstractShovel implements ToolNBT {
|
||||
|
||||
public BronzeShovel(String name, ToolMaterial material, Item damageDrop) {
|
||||
super(material);
|
||||
this.setUnlocalizedName(name);
|
||||
this.setRegistryName(name);
|
||||
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
|
||||
this.setMaxStackSize(1);
|
||||
this.setNoRepair();
|
||||
this.drop=damageDrop;
|
||||
this.addPropertyOverride(new ResourceLocation("type"), new IItemPropertyGetter() {
|
||||
|
||||
/***
|
||||
|
||||
hot . emerald . diamond . redstone . lapis
|
||||
0 . 0 . 0 . 0 . 0
|
||||
|
||||
***/
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack item, @Nullable World worldIn, @Nullable EntityLivingBase entityIn)
|
||||
{
|
||||
if (item.hasTagCompound()) {
|
||||
|
||||
|
||||
if (getModifiers(item) != 0) {
|
||||
if (getEmerald(item)) {
|
||||
return 0.1F;
|
||||
}
|
||||
|
||||
if (getDiamondLevel(item) == 1) {
|
||||
return 0.2F;
|
||||
}
|
||||
|
||||
if ( getRedstoneLevel(item) == 1) {
|
||||
return 0.3F;
|
||||
}
|
||||
|
||||
if (getLapisLevel(item) == 1) {
|
||||
return 0.4F;
|
||||
}
|
||||
}
|
||||
if (getModifiers(item) == 0) {
|
||||
return 0.0F;
|
||||
}
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
});
|
||||
super(name, material, damageDrop);
|
||||
}
|
||||
|
||||
public static boolean isHidden()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreated(ItemStack item, World world, EntityPlayer playerIn) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
if (!item.hasTagCompound()) {
|
||||
item.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound tags = new NBTTagCompound();
|
||||
|
||||
item.getTagCompound().setTag("tags", tags);
|
||||
|
||||
/*setHot(item, false);
|
||||
|
||||
setHot(item, false);
|
||||
setEmerald(item, false);
|
||||
setDiamondLevel(item, 0);
|
||||
setRedstoneLevel(item, 0);
|
||||
setLapisLevel(item, 0);
|
||||
setModifiers(item, 0);*/
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) {
|
||||
if(!world.isRemote) {
|
||||
if (!item.hasTagCompound()) {
|
||||
item.setTagCompound(new NBTTagCompound());
|
||||
NBTTagCompound tags = new NBTTagCompound();
|
||||
|
||||
item.getTagCompound().setTag("tags", tags);
|
||||
|
||||
setHot(item, false);
|
||||
setEmerald(item, false);
|
||||
setDiamondLevel(item, 0);
|
||||
setRedstoneLevel(item, 0);
|
||||
setLapisLevel(item, 0);
|
||||
setModifiers(item, 0);
|
||||
|
||||
}
|
||||
if( this.getMaxDamage(item) - this.getDamage(item) <= 1 ){
|
||||
PlayerHelper.spawnItemOnPlayer(world, (EntityPlayer) player, new ItemStack(this.drop, 1));
|
||||
((EntityPlayer) player).inventory.deleteStack(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//public void onItemTooltip(ItemTooltipEvent event){
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack item, @Nullable World world, List<String> tooltip, ITooltipFlag flagIn)
|
||||
{
|
||||
if(!item.isEmpty())
|
||||
{
|
||||
if (item.hasTagCompound())
|
||||
{
|
||||
tooltip.add(ChatFormatting.GRAY + "Upgrades Left: " + (1 - getModifiers(item)) );
|
||||
if (getEmerald(item) == true) {
|
||||
tooltip.add(ChatFormatting.DARK_GREEN + "Emerald");
|
||||
}
|
||||
if (getDiamondLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.AQUA + "Diamond Level: " + getDiamondLevel(item));
|
||||
}
|
||||
if (getRedstoneLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.RED + "Redstone Level: " + getRedstoneLevel(item) );
|
||||
}
|
||||
if (getLapisLevel(item) > 0) {
|
||||
tooltip.add(ChatFormatting.BLUE + "Lapis Level: " + Integer.toString(ModConfig.Features.BRONZE_LAPIS_MULTIPLIER));
|
||||
}
|
||||
tooltip.add(ChatFormatting.LIGHT_PURPLE + "Damage: " + item.getItemDamage() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
if(!player.world.isRemote){
|
||||
World world = player.getEntityWorld();
|
||||
|
||||
if(itemstack.getItem() instanceof BronzeShovel){
|
||||
if( getEmerald(itemstack)){
|
||||
@@ -186,55 +38,6 @@ Item drop;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
|
||||
{
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.damageItem(1, attacker);
|
||||
return true;
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(drop, 1, stack.getItemDamage());
|
||||
NBTTagCompound copyNBT = stack.getTagCompound();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
|
||||
EntityPlayer player = (EntityPlayer) attacker;
|
||||
World world = attacker.getEntityWorld();
|
||||
if(!world.isRemote) {
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
|
||||
attacker.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
|
||||
{
|
||||
if (!world.isRemote && (double)state.getBlockHardness(world, pos) != 0.0D)
|
||||
{
|
||||
if(stack.getMaxDamage() - stack.getItemDamage() >1 ) {
|
||||
stack.getTagCompound().removeTag("ench");
|
||||
if(getDiamondLevel(stack) > 0) {
|
||||
if(ThreadLocalRandom.current().nextInt(0, getDiamondLevel(stack)) == 0) {
|
||||
stack.damageItem(1, entityLiving);
|
||||
}
|
||||
} else stack.damageItem(1, entityLiving);
|
||||
} else {
|
||||
ItemStack dropStack = new ItemStack(drop, 1, stack.getItemDamage());
|
||||
NBTTagCompound copyNBT = stack.getTagCompound();
|
||||
dropStack.setTagCompound(copyNBT);
|
||||
EntityPlayer player = (EntityPlayer) entityLiving;
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, dropStack);
|
||||
entityLiving.renderBrokenItemStack(stack);
|
||||
stack.shrink(1);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDestroySpeed(ItemStack stack, IBlockState state)
|
||||
{
|
||||
@@ -246,22 +49,4 @@ Item drop;
|
||||
return this.efficiency + 1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack stack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getItemEnchantability(ItemStack stack)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package nmd.primal.forgecraft.items.tools.copper;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import nmd.primal.forgecraft.init.ModConfig;
|
||||
import nmd.primal.forgecraft.items.tools.AbstractAxe;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
|
||||
/**
|
||||
* Created by mminaie on 6/25/17.
|
||||
*/
|
||||
public class CopperAxe extends AbstractAxe implements ToolNBT {
|
||||
|
||||
Item drop;
|
||||
|
||||
public CopperAxe(String name, ToolMaterial material, Item damageDrop, Integer damage, Float speed) {
|
||||
super(name, material, damageDrop, damage, speed);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
if(!player.world.isRemote){
|
||||
//System.out.println(world.getBlockState(pos).getBlock());
|
||||
if(itemstack.getItem() instanceof CopperAxe){
|
||||
if(ModConfig.Features.ENABLE_COPPER_EMERALD) {
|
||||
if (getEmerald(itemstack)) {
|
||||
itemstack.addEnchantment(Enchantment.getEnchantmentByID(33), 1);
|
||||
}
|
||||
}
|
||||
/*if( getDiamondLevel(itemstack) > 0 ){
|
||||
itemstack.getItem().setHarvestLevel("pickaxe", 3);
|
||||
}
|
||||
if ( getLapisLevel(itemstack) > 0) {
|
||||
itemstack.addEnchantment(Enchantment.getEnchantmentByID(35), ModConfig.Features.BRONZE_LAPIS_MULTIPLIER);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDestroySpeed(ItemStack stack, IBlockState state)
|
||||
{
|
||||
Material material = state.getMaterial();
|
||||
//return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
|
||||
|
||||
if(material != Material.WOOD && material != Material.PLANTS && material != Material.VINE){
|
||||
return super.getDestroySpeed(stack, state);
|
||||
} else {
|
||||
return this.efficiency + 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package nmd.primal.forgecraft.items.tools.copper;
|
||||
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.IItemPropertyGetter;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import nmd.primal.forgecraft.init.ModConfig;
|
||||
import nmd.primal.forgecraft.items.tools.AbstractHoe;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Created by mminaie on 3/21/17.
|
||||
*/
|
||||
public class CopperHoe extends AbstractHoe implements ToolNBT {
|
||||
|
||||
public CopperHoe(String name, ToolMaterial material, Item damageDrop) {
|
||||
super(name, material, damageDrop);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
if(!player.world.isRemote){
|
||||
World world = player.getEntityWorld();
|
||||
if(ModConfig.Features.ENABLE_COPPER_EMERALD) {
|
||||
if (getEmerald(itemstack)) {
|
||||
itemstack.addEnchantment(Enchantment.getEnchantmentByID(33), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package nmd.primal.forgecraft.items.tools.copper;
|
||||
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import nmd.primal.forgecraft.init.ModConfig;
|
||||
import nmd.primal.forgecraft.items.tools.AbstractPickaxe;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
|
||||
/**
|
||||
* Created by mminaie on 3/14/17.
|
||||
*/
|
||||
public class CopperPickaxe extends AbstractPickaxe implements ToolNBT {
|
||||
|
||||
private Item drop;
|
||||
|
||||
public CopperPickaxe(String name, ToolMaterial material, Item damageDrop) {
|
||||
super(name, material, damageDrop);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
if(!player.world.isRemote){
|
||||
World world = player.getEntityWorld();
|
||||
if(ModConfig.Features.ENABLE_COPPER_EMERALD) {
|
||||
if (getEmerald(itemstack)) {
|
||||
itemstack.addEnchantment(Enchantment.getEnchantmentByID(33), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package nmd.primal.forgecraft.items.tools.copper;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import nmd.primal.forgecraft.init.ModConfig;
|
||||
import nmd.primal.forgecraft.items.tools.AbstractShovel;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
|
||||
/**
|
||||
* Created by mminaie on 3/21/17.
|
||||
*/
|
||||
public class CopperShovel extends AbstractShovel implements ToolNBT {
|
||||
|
||||
public CopperShovel(String name, ToolMaterial material, Item damageDrop) {
|
||||
super(name, material, damageDrop);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
if(!player.world.isRemote){
|
||||
|
||||
if(itemstack.getItem() instanceof CopperShovel){
|
||||
if(ModConfig.Features.ENABLE_COPPER_EMERALD) {
|
||||
if (getEmerald(itemstack)) {
|
||||
itemstack.addEnchantment(Enchantment.getEnchantmentByID(33), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDestroySpeed(ItemStack stack, IBlockState state)
|
||||
{
|
||||
for (String type : getToolClasses(stack))
|
||||
{
|
||||
if (state.getBlock().isToolEffective(type, state))
|
||||
return efficiency;
|
||||
}
|
||||
return this.efficiency + 1;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,7 +15,6 @@ import nmd.primal.forgecraft.crafting.ForgeCrafting;
|
||||
import nmd.primal.forgecraft.items.BaseMultiItem;
|
||||
import nmd.primal.forgecraft.items.parts.ToolPart;
|
||||
import nmd.primal.forgecraft.util.ToolNBT;
|
||||
import scala.Int;
|
||||
|
||||
import static nmd.primal.core.api.PrimalAPI.randomCheck;
|
||||
import static nmd.primal.core.common.helper.FireHelper.makeSmoke;
|
||||
@@ -69,7 +68,7 @@ public class TileForge extends TileBaseSlot implements ITickable, ToolNBT{
|
||||
}
|
||||
}
|
||||
if(this.iteration == 250){
|
||||
setHeat(this.getHeat()-50);
|
||||
setHeat(this.getHeat()-25);
|
||||
}
|
||||
if (this.iteration == 300) {
|
||||
this.heatManager(this.getHeat(), state, this.getSlotStack(0), world, pos);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"parent": "forgecraft:item/axe",
|
||||
"textures": {
|
||||
"particle": "forgecraft:items/raw_bronze",
|
||||
"texture": "blocks/planks_oak",
|
||||
"texture1": "forgecraft:items/finished_bronze"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"parent": "forgecraft:item/axe",
|
||||
"textures": {
|
||||
"particle": "forgecraft:items/raw_bronze",
|
||||
"texture": "blocks/planks_oak",
|
||||
"texture1": "forgecraft:items/finished_bronze_emerald"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"parent": "forgecraft:item/axe",
|
||||
"textures": {
|
||||
"particle": "forgecraft:items/raw_bronze",
|
||||
"texture": "blocks/planks_oak",
|
||||
"texture1": "forgecraft:items/finished_bronze_diamond"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"parent": "forgecraft:item/axe",
|
||||
"textures": {
|
||||
"particle": "forgecraft:items/raw_bronze",
|
||||
"texture": "blocks/planks_oak",
|
||||
"texture1": "forgecraft:items/finished_bronze_redstone"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"parent": "forgecraft:item/axe",
|
||||
"textures": {
|
||||
"particle": "forgecraft:items/raw_bronze",
|
||||
"texture": "blocks/planks_oak",
|
||||
"texture1": "forgecraft:items/finished_bronze_lapis"
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,10 @@
|
||||
},
|
||||
"overrides": [
|
||||
{"predicate": {"type": 0.0},"model": "forgecraft:item/axe/bronze/bronzeaxe_0"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/axe/bronze/bronzeaxe_1"},
|
||||
{"predicate": {"type": 0.2},"model": "forgecraft:item/axe/bronze/bronzeaxe_2"},
|
||||
{"predicate": {"type": 0.3},"model": "forgecraft:item/axe/bronze/bronzeaxe_3"},
|
||||
{"predicate": {"type": 0.4},"model": "forgecraft:item/axe/bronze/bronzeaxe_4"}
|
||||
|
||||
{"predicate": {"type": 0.0001},"model": "forgecraft:item/axe/bronze/bronzeaxe_4"},
|
||||
{"predicate": {"type": 0.001},"model": "forgecraft:item/axe/bronze/bronzeaxe_3"},
|
||||
{"predicate": {"type": 0.01},"model": "forgecraft:item/axe/bronze/bronzeaxe_2"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/axe/bronze/bronzeaxe_1"}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -7,14 +7,12 @@
|
||||
},
|
||||
"overrides": [
|
||||
{"predicate": {"type": 0.0},"model": "forgecraft:item/axehead/bronze/bronzeaxehead_0"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/axehead/bronze/bronzeaxehead_1"},
|
||||
{"predicate": {"type": 0.2},"model": "forgecraft:item/axehead/bronze/bronzeaxehead_2"},
|
||||
{"predicate": {"type": 0.3},"model": "forgecraft:item/axehead/bronze/bronzeaxehead_3"},
|
||||
{"predicate": {"type": 0.4},"model": "forgecraft:item/axehead/bronze/bronzeaxehead_4"}
|
||||
|
||||
{"predicate": {"type": 0.0001},"model": "forgecraft:item/axehead/bronze/bronzeaxehead_4"},
|
||||
{"predicate": {"type": 0.001},"model": "forgecraft:item/axehead/bronze/bronzeaxehead_3"},
|
||||
{"predicate": {"type": 0.01},"model": "forgecraft:item/axehead/bronze/bronzeaxehead_2"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/axehead/bronze/bronzeaxehead_1"}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
},
|
||||
"overrides": [
|
||||
{"predicate": {"type": 0.0},"model": "forgecraft:item/hoe/bronze/bronzehoe_0"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/hoe/bronze/bronzehoe_1"},
|
||||
{"predicate": {"type": 0.2},"model": "forgecraft:item/hoe/bronze/bronzehoe_2"},
|
||||
{"predicate": {"type": 0.3},"model": "forgecraft:item/hoe/bronze/bronzehoe_3"},
|
||||
{"predicate": {"type": 0.4},"model": "forgecraft:item/hoe/bronze/bronzehoe_4"}
|
||||
{"predicate": {"type": 0.0001},"model": "forgecraft:item/hoe/bronze/bronzehoe_4"},
|
||||
{"predicate": {"type": 0.001},"model": "forgecraft:item/hoe/bronze/bronzehoe_3"},
|
||||
{"predicate": {"type": 0.01},"model": "forgecraft:item/hoe/bronze/bronzehoe_2"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/hoe/bronze/bronzehoe_1"}
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
},
|
||||
"overrides": [
|
||||
{"predicate": {"type": 0.0},"model": "forgecraft:item/hoehead/bronze/bronzehoehead_0"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/hoehead/bronze/bronzehoehead_1"},
|
||||
{"predicate": {"type": 0.2},"model": "forgecraft:item/hoehead/bronze/bronzehoehead_2"},
|
||||
{"predicate": {"type": 0.3},"model": "forgecraft:item/hoehead/bronze/bronzehoehead_3"},
|
||||
{"predicate": {"type": 0.4},"model": "forgecraft:item/hoehead/bronze/bronzehoehead_4"}
|
||||
{"predicate": {"type": 0.0001},"model": "forgecraft:item/hoehead/bronze/bronzehoehead_4"},
|
||||
{"predicate": {"type": 0.001},"model": "forgecraft:item/hoehead/bronze/bronzehoehead_3"},
|
||||
{"predicate": {"type": 0.01},"model": "forgecraft:item/hoehead/bronze/bronzehoehead_2"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/hoehead/bronze/bronzehoehead_1"}
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
},
|
||||
"overrides": [
|
||||
{"predicate": {"type": 0.0},"model": "forgecraft:item/pickaxe/bronze/bronzepickaxe_0"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/pickaxe/bronze/bronzepickaxe_1"},
|
||||
{"predicate": {"type": 0.2},"model": "forgecraft:item/pickaxe/bronze/bronzepickaxe_2"},
|
||||
{"predicate": {"type": 0.3},"model": "forgecraft:item/pickaxe/bronze/bronzepickaxe_3"},
|
||||
{"predicate": {"type": 0.4},"model": "forgecraft:item/pickaxe/bronze/bronzepickaxe_4"}
|
||||
{"predicate": {"type": 0.0001},"model": "forgecraft:item/pickaxe/bronze/bronzepickaxe_4"},
|
||||
{"predicate": {"type": 0.001},"model": "forgecraft:item/pickaxe/bronze/bronzepickaxe_3"},
|
||||
{"predicate": {"type": 0.01},"model": "forgecraft:item/pickaxe/bronze/bronzepickaxe_2"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/pickaxe/bronze/bronzepickaxe_1"}
|
||||
|
||||
]
|
||||
}
|
||||
@@ -7,10 +7,10 @@
|
||||
},
|
||||
"overrides": [
|
||||
{"predicate": {"type": 0.0},"model": "forgecraft:item/pickaxehead/bronze/bronzepickaxehead_0"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/pickaxehead/bronze/bronzepickaxehead_1"},
|
||||
{"predicate": {"type": 0.2},"model": "forgecraft:item/pickaxehead/bronze/bronzepickaxehead_2"},
|
||||
{"predicate": {"type": 0.3},"model": "forgecraft:item/pickaxehead/bronze/bronzepickaxehead_3"},
|
||||
{"predicate": {"type": 0.4},"model": "forgecraft:item/pickaxehead/bronze/bronzepickaxehead_4"}
|
||||
{"predicate": {"type": 0.0001},"model": "forgecraft:item/pickaxehead/bronze/bronzepickaxehead_4"},
|
||||
{"predicate": {"type": 0.001},"model": "forgecraft:item/pickaxehead/bronze/bronzepickaxehead_3"},
|
||||
{"predicate": {"type": 0.01},"model": "forgecraft:item/pickaxehead/bronze/bronzepickaxehead_2"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/pickaxehead/bronze/bronzepickaxehead_1"}
|
||||
|
||||
]
|
||||
}
|
||||
@@ -7,10 +7,10 @@
|
||||
},
|
||||
"overrides": [
|
||||
{"predicate": {"type": 0.0},"model": "forgecraft:item/shovel/bronze/bronzeshovel_0"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/shovel/bronze/bronzeshovel_1"},
|
||||
{"predicate": {"type": 0.2},"model": "forgecraft:item/shovel/bronze/bronzeshovel_2"},
|
||||
{"predicate": {"type": 0.3},"model": "forgecraft:item/shovel/bronze/bronzeshovel_3"},
|
||||
{"predicate": {"type": 0.4},"model": "forgecraft:item/shovel/bronze/bronzeshovel_4"}
|
||||
{"predicate": {"type": 0.0001},"model": "forgecraft:item/shovel/bronze/bronzeshovel_4"},
|
||||
{"predicate": {"type": 0.001},"model": "forgecraft:item/shovel/bronze/bronzeshovel_3"},
|
||||
{"predicate": {"type": 0.01},"model": "forgecraft:item/shovel/bronze/bronzeshovel_2"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/shovel/bronze/bronzeshovel_1"}
|
||||
|
||||
]
|
||||
}
|
||||
@@ -7,10 +7,10 @@
|
||||
},
|
||||
"overrides": [
|
||||
{"predicate": {"type": 0.0},"model": "forgecraft:item/shovelhead/bronze/bronzeshovelhead_0"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/shovelhead/bronze/bronzeshovelhead_1"},
|
||||
{"predicate": {"type": 0.2},"model": "forgecraft:item/shovelhead/bronze/bronzeshovelhead_2"},
|
||||
{"predicate": {"type": 0.3},"model": "forgecraft:item/shovelhead/bronze/bronzeshovelhead_3"},
|
||||
{"predicate": {"type": 0.4},"model": "forgecraft:item/shovelhead/bronze/bronzeshovelhead_4"}
|
||||
{"predicate": {"type": 0.0001},"model": "forgecraft:item/shovelhead/bronze/bronzeshovelhead_4"},
|
||||
{"predicate": {"type": 0.001},"model": "forgecraft:item/shovelhead/bronze/bronzeshovelhead_3"},
|
||||
{"predicate": {"type": 0.01},"model": "forgecraft:item/shovelhead/bronze/bronzeshovelhead_2"},
|
||||
{"predicate": {"type": 0.1},"model": "forgecraft:item/shovelhead/bronze/bronzeshovelhead_1"}
|
||||
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user