fixed axe error
This commit is contained in:
@@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx3G
|
|||||||
|
|
||||||
mod_group=nmd.primal.forgecraft
|
mod_group=nmd.primal.forgecraft
|
||||||
mod_name=ForgeCraft
|
mod_name=ForgeCraft
|
||||||
mod_version=1.2.07
|
mod_version=1.2.08
|
||||||
forge_version=13.20.0.2226
|
forge_version=13.20.0.2226
|
||||||
mcp_mappings=snapshot_20161220
|
mcp_mappings=snapshot_20161220
|
||||||
mc_version=1.11.2
|
mc_version=1.11.2
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class ModInfo {
|
|||||||
public static final String MOD_NAME = "Kitsu's ForgeCraft";
|
public static final String MOD_NAME = "Kitsu's ForgeCraft";
|
||||||
//public static final String MOD_PREFIX = MOD_ID + ":";
|
//public static final String MOD_PREFIX = MOD_ID + ":";
|
||||||
public static final String MOD_CHANNEL = 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 MC_VERSIONS = "[1.11.0, 1.12.0)";
|
||||||
public static final String DEPENDENCIES = "required-after:forge@[13.20.0.2226,);" + "required-after:primal;";
|
public static final String DEPENDENCIES = "required-after:forge@[13.20.0.2226,);" + "required-after:primal;";
|
||||||
|
|
||||||
|
|||||||
@@ -238,40 +238,9 @@ public class Forge extends CustomContainerFacing implements ITileEntityProvider/
|
|||||||
{
|
{
|
||||||
if (!world.isRemote)
|
if (!world.isRemote)
|
||||||
{
|
{
|
||||||
if(ent instanceof EntityItem){
|
if(ent instanceof EntityPlayer){
|
||||||
//System.out.println("collision");
|
if(state.getValue(ACTIVE) == true){
|
||||||
EntityItem itemEnt = (EntityItem) ent;
|
ent.setFire(1);
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import net.minecraftforge.common.util.EnumHelper;
|
|||||||
*/
|
*/
|
||||||
public class ModMaterials {
|
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 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 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);
|
public static Item.ToolMaterial WOOTZ_STEEL = EnumHelper.addToolMaterial("wootzsteel", 3, 1100, 7.0F, 7.0F, 0);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import java.util.concurrent.ThreadLocalRandom;
|
|||||||
public class CustomAxe extends ItemAxe implements ToolNBT {
|
public class CustomAxe extends ItemAxe implements ToolNBT {
|
||||||
|
|
||||||
public CustomAxe(String name, Item.ToolMaterial material) {
|
public CustomAxe(String name, Item.ToolMaterial material) {
|
||||||
super(material);
|
super(material, 6, -3.1f);
|
||||||
this.setUnlocalizedName(name);
|
this.setUnlocalizedName(name);
|
||||||
this.setRegistryName(name);
|
this.setRegistryName(name);
|
||||||
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
|
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
|
||||||
@@ -348,12 +348,10 @@ public class CustomAxe extends ItemAxe implements ToolNBT {
|
|||||||
Material material = state.getMaterial();
|
Material material = state.getMaterial();
|
||||||
//return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
|
//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);
|
return super.getStrVsBlock(stack, state);
|
||||||
} else if (this.getRedstoneLevel(stack) > 0) {
|
|
||||||
return this.efficiencyOnProperMaterial * ((this.getRedstoneLevel(stack) / 2) * this.getRedstoneLevel(stack) );
|
|
||||||
} else {
|
} else {
|
||||||
return this.efficiencyOnProperMaterial;
|
return this.efficiencyOnProperMaterial * ( ((this.getRedstoneLevel(stack) / 2) * this.getRedstoneLevel(stack) ) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -378,10 +378,8 @@ public class CustomPickaxe extends ItemPickaxe implements ToolNBT{
|
|||||||
|
|
||||||
if(material != Material.IRON && material != Material.ANVIL && material != Material.ROCK){
|
if(material != Material.IRON && material != Material.ANVIL && material != Material.ROCK){
|
||||||
return super.getStrVsBlock(stack, state);
|
return super.getStrVsBlock(stack, state);
|
||||||
} else if (this.getRedstoneLevel(stack) > 0) {
|
|
||||||
return this.efficiencyOnProperMaterial * ((this.getRedstoneLevel(stack) / 2) * this.getRedstoneLevel(stack) );
|
|
||||||
} else {
|
} else {
|
||||||
return this.efficiencyOnProperMaterial;
|
return this.efficiencyOnProperMaterial * ( ((this.getRedstoneLevel(stack) / 2) * this.getRedstoneLevel(stack) ) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,7 @@ package nmd.primal.forgecraft.items.weapons;
|
|||||||
import net.minecraft.block.BlockDispenser;
|
import net.minecraft.block.BlockDispenser;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.item.IItemPropertyGetter;
|
import net.minecraft.item.*;
|
||||||
import net.minecraft.item.ItemArmor;
|
|
||||||
import net.minecraft.item.ItemShield;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
@@ -19,11 +16,11 @@ import javax.annotation.Nullable;
|
|||||||
*/
|
*/
|
||||||
public class CustomShield extends ItemShield {
|
public class CustomShield extends ItemShield {
|
||||||
|
|
||||||
public CustomShield()
|
public CustomShield(Item.ToolMaterial material)
|
||||||
{
|
{
|
||||||
this.maxStackSize = 1;
|
this.maxStackSize = 1;
|
||||||
this.setCreativeTab(CreativeTabs.COMBAT);
|
this.setCreativeTab(CreativeTabs.COMBAT);
|
||||||
this.setMaxDamage(336);
|
this.setMaxDamage(material.getMaxUses());
|
||||||
this.addPropertyOverride(new ResourceLocation("blocking"), new IItemPropertyGetter()
|
this.addPropertyOverride(new ResourceLocation("blocking"), new IItemPropertyGetter()
|
||||||
{
|
{
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"modid": "forgecraft",
|
"modid": "forgecraft",
|
||||||
"name": "Kitsu's Forgecraft",
|
"name": "Kitsu's Forgecraft",
|
||||||
"description": "Forged with sweat and blood",
|
"description": "Forged with sweat and blood",
|
||||||
"version": "1.2.07",
|
"version": "1.2.08",
|
||||||
"mcversion": "1.11.2",
|
"mcversion": "1.11.2",
|
||||||
"url": "",
|
"url": "",
|
||||||
"updateUrl": "",
|
"updateUrl": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user