fixed axe error

This commit is contained in:
Mohammad-Ali Minaie
2017-03-31 18:41:23 -04:00
parent 610fb6a788
commit ad6483810a
8 changed files with 15 additions and 53 deletions

View File

@@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx3G
mod_group=nmd.primal.forgecraft
mod_name=ForgeCraft
mod_version=1.2.07
mod_version=1.2.08
forge_version=13.20.0.2226
mcp_mappings=snapshot_20161220
mc_version=1.11.2

View File

@@ -17,7 +17,7 @@ public class ModInfo {
public static final String MOD_NAME = "Kitsu's ForgeCraft";
//public static final String MOD_PREFIX = MOD_ID + ":";
public static final String MOD_CHANNEL = MOD_ID;
public static final String MOD_VERSION = "1.2.07";
public static final String MOD_VERSION = "1.2.08";
public static final String MC_VERSIONS = "[1.11.0, 1.12.0)";
public static final String DEPENDENCIES = "required-after:forge@[13.20.0.2226,);" + "required-after:primal;";

View File

@@ -238,40 +238,9 @@ public class Forge extends CustomContainerFacing implements ITileEntityProvider/
{
if (!world.isRemote)
{
if(ent instanceof EntityItem){
//System.out.println("collision");
EntityItem itemEnt = (EntityItem) ent;
ItemStack stack = itemEnt.getEntityItem();
//System.out.println(stack);
TileForge tile = (TileForge)world.getTileEntity(pos);
if (tile != null) {
if(!tile.getSlotStack(0).isEmpty()) {
if(tile.getSlotStack(0).getItem() == stack.getItem()) {
int entStackSize = stack.getCount();
int tileStackSize = tile.getSlotStack(0).getCount();
int tileSizeRemaining = 64 - tileStackSize;
if (tileStackSize < 64) {
if (entStackSize <= tileSizeRemaining) {
tile.incrementStackSize(tile.getSlotList(), 0, entStackSize);
//tile.setSlotStack(0, new ItemStack(stack.getItem(), tileStackSize + entStackSize, stack.getItemDamage()));
ent.setDead();
world.notifyBlockUpdate(pos, state, state, 3);
tile.updateBlock();
}
if (entStackSize > tileSizeRemaining) {
tile.getSlotStack(0).setCount(64);
stack.setCount(64 - entStackSize);
}
}
}
}
if (tile.getSlotStack(0).isEmpty()) {
//int entStackSize = stack.getCount();
tile.setSlotStack(0, itemEnt.getEntityItem());
itemEnt.setDead();
world.notifyBlockUpdate(pos, state, state, 3);
tile.updateBlock();
}
if(ent instanceof EntityPlayer){
if(state.getValue(ACTIVE) == true){
ent.setFire(1);
}
}
}

View File

@@ -8,7 +8,7 @@ import net.minecraftforge.common.util.EnumHelper;
*/
public class ModMaterials {
public static Item.ToolMaterial TOOL_WROUGHT_IRON = EnumHelper.addToolMaterial("wroughiron", 2, 500, 2.0F, 1.0F, 0);
public static Item.ToolMaterial TOOL_WROUGHT_IRON = EnumHelper.addToolMaterial("wroughtiron", 2, 500, 2.0F, 1.0F, 0);
public static Item.ToolMaterial CLEAN_IRON = EnumHelper.addToolMaterial("cleaniron", 2, 700, 3.0F, 3.0F, 0);
public static Item.ToolMaterial BASIC_STEEL = EnumHelper.addToolMaterial("steelbasic", 3, 900, 5.0F, 5.0F, 0);
public static Item.ToolMaterial WOOTZ_STEEL = EnumHelper.addToolMaterial("wootzsteel", 3, 1100, 7.0F, 7.0F, 0);

View File

@@ -30,7 +30,7 @@ import java.util.concurrent.ThreadLocalRandom;
public class CustomAxe extends ItemAxe implements ToolNBT {
public CustomAxe(String name, Item.ToolMaterial material) {
super(material);
super(material, 6, -3.1f);
this.setUnlocalizedName(name);
this.setRegistryName(name);
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
@@ -348,12 +348,10 @@ public class CustomAxe extends ItemAxe implements ToolNBT {
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){
if(material != Material.WOOD && material != Material.PLANTS && material != Material.VINE){
return super.getStrVsBlock(stack, state);
} else if (this.getRedstoneLevel(stack) > 0) {
return this.efficiencyOnProperMaterial * ((this.getRedstoneLevel(stack) / 2) * this.getRedstoneLevel(stack) );
} else {
return this.efficiencyOnProperMaterial;
return this.efficiencyOnProperMaterial * ( ((this.getRedstoneLevel(stack) / 2) * this.getRedstoneLevel(stack) ) + 1);
}
}

View File

@@ -378,10 +378,8 @@ public class CustomPickaxe extends ItemPickaxe implements ToolNBT{
if(material != Material.IRON && material != Material.ANVIL && material != Material.ROCK){
return super.getStrVsBlock(stack, state);
} else if (this.getRedstoneLevel(stack) > 0) {
return this.efficiencyOnProperMaterial * ((this.getRedstoneLevel(stack) / 2) * this.getRedstoneLevel(stack) );
} else {
return this.efficiencyOnProperMaterial;
return this.efficiencyOnProperMaterial * ( ((this.getRedstoneLevel(stack) / 2) * this.getRedstoneLevel(stack) ) + 1);
}
}

View File

@@ -3,10 +3,7 @@ package nmd.primal.forgecraft.items.weapons;
import net.minecraft.block.BlockDispenser;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemShield;
import net.minecraft.item.ItemStack;
import net.minecraft.item.*;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
@@ -19,11 +16,11 @@ import javax.annotation.Nullable;
*/
public class CustomShield extends ItemShield {
public CustomShield()
public CustomShield(Item.ToolMaterial material)
{
this.maxStackSize = 1;
this.setCreativeTab(CreativeTabs.COMBAT);
this.setMaxDamage(336);
this.setMaxDamage(material.getMaxUses());
this.addPropertyOverride(new ResourceLocation("blocking"), new IItemPropertyGetter()
{
@SideOnly(Side.CLIENT)

View File

@@ -2,7 +2,7 @@
"modid": "forgecraft",
"name": "Kitsu's Forgecraft",
"description": "Forged with sweat and blood",
"version": "1.2.07",
"version": "1.2.08",
"mcversion": "1.11.2",
"url": "",
"updateUrl": "",