diff options
Diffstat (limited to 'src/Java')
9 files changed, 316 insertions, 110 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index 02e490de67..a755db9496 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -50,7 +50,7 @@ import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Recycling; import net.minecraftforge.oredict.OreDictionary; @MCVersion(value = "1.7.10") -@Mod(modid = CORE.MODID, name = CORE.name, version = CORE.VERSION, dependencies = "required-after:Forge; after:TConstruct; after:PlayerAPI; after:dreamcraft; after:IC2; after:ihl; after:psychedelicraft; after:gregtech; after:Forestry; after:MagicBees; after:CoFHCore; after:Growthcraft; after:Railcraft; after:CompactWindmills; after:ForbiddenMagic; after:MorePlanet; after:PneumaticCraft; after:ExtraUtilities; after:Thaumcraft; after:rftools; after:simplyjetpacks; after:BigReactors; after:EnderIO; after:tectech; after:GTRedtech; after:beyondrealitycore; after:OpenBlocks;") +@Mod(modid = CORE.MODID, name = CORE.name, version = CORE.VERSION, dependencies = "required-after:Forge; after:TConstruct; after:PlayerAPI; after:dreamcraft; after:IC2; after:ihl; after:psychedelicraft; after:gregtech; after:Forestry; after:MagicBees; after:CoFHCore; after:Growthcraft; after:Railcraft; after:CompactWindmills; after:ForbiddenMagic; after:MorePlanet; after:PneumaticCraft; after:ExtraUtilities; after:Thaumcraft; after:rftools; after:simplyjetpacks; after:BigReactors; after:EnderIO; after:tectech; after:GTRedtech; after:beyondrealitycore; after:OpenBlocks; after:IC2NuclearControl; after:TGregworks;") public class GTplusplus implements ActionListener { //Mod Instance diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java index 127fc47b4e..b546b492e5 100644 --- a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java +++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java @@ -48,7 +48,6 @@ public class MultiPickaxeBase extends StaballoyPickaxe{ this.setUnlocalizedName(Utils.sanitizeString(unlocalizedName)); //this.setTextureName(CORE.MODID + ":" + "itemPickaxe"); this.setTextureName("minecraft"+":"+"iron_pickaxe"); - this.FACING_HORIZONTAL=true; this.setMaxStackSize(1); if ((materialDurability*3) <= Integer.MAX_VALUE){ this.setMaxDamage((int) (materialDurability*3)); diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java index 3fbec516fd..7b66ca5a82 100644 --- a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java +++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java @@ -36,18 +36,18 @@ public class MultiSpadeBase extends StaballoySpade{ this.setUnlocalizedName(Utils.sanitizeString(unlocalizedName)); //this.setTextureName(CORE.MODID + ":" + "itemShovel"); this.setTextureName("minecraft"+":"+"iron_shovel"); - this.FACING_HORIZONTAL=true; this.setMaxStackSize(1); this.setMaxDamage(materialDurability*3); this.colour = colour; this.materialName = material.name(); this.displayName = unlocalizedName; this.setCreativeTab(AddToCreativeTab.tabTools); - try {this.isValid = this.addRecipe();} catch (final Throwable e){} + try { + this.isValid = this.addRecipe(); + } + catch (final Throwable e){} if ((colour != 0) && this.isValid){ - if (GameRegistry.findItem(CORE.MODID, Utils.sanitizeString(unlocalizedName)) == null){ - GameRegistry.registerItem(this, Utils.sanitizeString(unlocalizedName)); - } + GameRegistry.registerItem(this, Utils.sanitizeString(unlocalizedName)); } } diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java index f3f2a8bea8..3b5c022412 100644 --- a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java +++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java @@ -12,6 +12,7 @@ import net.minecraft.init.Blocks; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; @@ -30,13 +31,117 @@ public class StaballoyPickaxe extends ItemPickaxe{ public double getDurabilityForDisplay(final ItemStack stack) { return (double)stack.getItemDamageForDisplay() / (double)stack.getMaxDamage(); } + + /** + * Creates an NBT tag for this item if it doesn't have one. + * This also set some default values. + * @param rStack + * @return + */ + + private static boolean createNBT(ItemStack rStack){ + final NBTTagCompound tagMain = new NBTTagCompound(); + final NBTTagCompound tagNBT = new NBTTagCompound(); + + tagNBT.setBoolean("FACING_HORIZONTAL", true); + tagNBT.setString("FACING", "north"); + tagNBT.setString("lookingDirection", ""); + + tagMain.setTag("PickStats", tagNBT); + rStack.setTagCompound(tagMain); + return true; + } + + /* + * Is the player facing horizontally? + */ + + public static final boolean isFacingHorizontal(final ItemStack aStack) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("PickStats"); + if (aNBT != null) { + return aNBT.getBoolean("FACING_HORIZONTAL"); + } + } + else { + createNBT(aStack); + } + return true; + } + + public static final boolean setFacingHorizontal(final ItemStack aStack, final boolean aFacingHorizontal) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("PickStats"); + if (aNBT != null) { + aNBT.setBoolean("FACING_HORIZONTAL", aFacingHorizontal); + return true; + } + } + return false; + } + + /* + * Handles the Direction the player is facing + */ + + public static final String getFacingDirection(final ItemStack aStack) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("PickStats"); + if (aNBT != null) { + return aNBT.getString("FACING"); + } + } + else { + createNBT(aStack); + } + return "north"; + } - protected Boolean FACING_HORIZONTAL = true; - protected String FACING = "north"; - protected EntityPlayer localPlayer; - protected String lookingDirection; - protected World localWorld; - public ItemStack thisPickaxe = null; + public static final boolean setFacingDirection(final ItemStack aStack, final String aFacingHorizontal) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("PickStats"); + if (aNBT != null) { + aNBT.setString("FACING", aFacingHorizontal); + return true; + } + } + return false; + } + + /* + * The Looking Direction handlers + */ + + public static final String getLookingDirection(final ItemStack aStack) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("PickStats"); + if (aNBT != null) { + return aNBT.getString("lookingDirection"); + } + } + else { + createNBT(aStack); + } + return ""; + } + + public static final boolean setLookingDirection(final ItemStack aStack, final String aFacingHorizontal) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("PickStats"); + if (aNBT != null) { + aNBT.setString("lookingDirection", aFacingHorizontal); + return true; + } + } + return false; + } + protected int miningLevel; /* @@ -51,9 +156,6 @@ public class StaballoyPickaxe extends ItemPickaxe{ @Override public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer aPlayer) { - this.localPlayer = aPlayer; - this.localWorld = world; - this.thisPickaxe = stack; return super.onItemRightClick(stack, world, aPlayer); } @@ -61,14 +163,11 @@ public class StaballoyPickaxe extends ItemPickaxe{ @Override public boolean onBlockDestroyed(final ItemStack stack, final World world, final Block block, final int X, final int Y, final int Z, final EntityLivingBase entity) { - //super.onBlockDestroyed(stack, world, block, X, Y, Z, entity); - this.localWorld = world; - this.thisPickaxe = stack; - //checkFacing(world); if (!world.isRemote){ - this.GetDestroyOrientation(block, this.lookingDirection, world, X, Y, Z, stack); + if (entity instanceof EntityPlayer) { + this.GetDestroyOrientation((EntityPlayer) entity, block, getLookingDirection(stack), world, X, Y, Z, stack); + } } - return super.onBlockDestroyed(stack, world, block, X, Y, Z, entity); } @@ -116,8 +215,7 @@ public class StaballoyPickaxe extends ItemPickaxe{ return false; } - private void GetDestroyOrientation(final Block block, final String FACING, final World world, final int X, final int Y, final int Z, final ItemStack heldItem){ - this.localWorld = world; + private void GetDestroyOrientation(EntityPlayer entity, final Block block, final String FACING, final World world, final int X, final int Y, final int Z, final ItemStack heldItem){ float DURABILITY_LOSS = 0; if (!world.isRemote){ @@ -189,7 +287,7 @@ public class StaballoyPickaxe extends ItemPickaxe{ else { //setItemDamage(heldItem, durLeft); Logger.WARNING(""+(durNow-durLeft)); - this.damageItem(heldItem, (durNow-durLeft)-1, this.localPlayer); + this.damageItem(heldItem, (durNow-durLeft)-1, entity); } @@ -217,7 +315,6 @@ public class StaballoyPickaxe extends ItemPickaxe{ //Should clear up blocks quicker if I chain it. public final void removeBlockAndDropAsItem(final World world, final int X, final int Y, final int Z, final ItemStack heldItem){ - this.localWorld = world; try { final Block block = world.getBlock(X, Y, Z); final float dur = this.calculateDurabilityLoss(world, X, Y, Z); @@ -265,10 +362,9 @@ public class StaballoyPickaxe extends ItemPickaxe{ } } - public boolean checkFacing(final World world){ - this.localWorld = world; - if (this.localPlayer != null){ - final int direction = MathHelper.floor_double((this.localPlayer.rotationYaw * 4F) / 360F + 0.5D) & 3; + public boolean checkFacing(final ItemStack aStack, final EntityPlayer aPlayer, final World world){ + if (aPlayer != null){ + final int direction = MathHelper.floor_double((aPlayer.rotationYaw * 4F) / 360F + 0.5D) & 3; //Utils.LOG_WARNING("Player - F: "+direction); //Utils.LOG_WARNING("Player - getLookVec(): "+localPlayer.getLookVec().yCoord); @@ -276,7 +372,7 @@ public class StaballoyPickaxe extends ItemPickaxe{ localPlayer.getLookVec().yCoord; }*/ - final MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, this.localPlayer, false); + final MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, aPlayer, false); if (movingobjectposition != null){ final int sideHit = movingobjectposition.sideHit; String playerStandingPosition = ""; @@ -286,41 +382,41 @@ public class StaballoyPickaxe extends ItemPickaxe{ if (sideHit == 0){ playerStandingPosition = "above"; - this.FACING_HORIZONTAL = false; + setFacingHorizontal(aStack, false); } else if (sideHit == 1){ playerStandingPosition = "below"; - this.FACING_HORIZONTAL = false; + setFacingHorizontal(aStack, false); } else if (sideHit == 2){ playerStandingPosition = "facingSouth"; - this.FACING_HORIZONTAL = true; + setFacingHorizontal(aStack, true); } else if (sideHit == 3){ playerStandingPosition = "facingNorth"; - this.FACING_HORIZONTAL = true; + setFacingHorizontal(aStack, true); } else if (sideHit == 4){ playerStandingPosition = "facingEast"; - this.FACING_HORIZONTAL = true; + setFacingHorizontal(aStack, true); } else if (sideHit == 5){ playerStandingPosition = "facingWest"; - this.FACING_HORIZONTAL = true; + setFacingHorizontal(aStack, true); } - this.lookingDirection = playerStandingPosition; + setLookingDirection(aStack, playerStandingPosition); if (direction == 0){ - this.FACING = "south"; + setFacingDirection(aStack, "south"); } else if (direction == 1){ - this.FACING = "west"; + setFacingDirection(aStack, "west"); } else if (direction == 2){ - this.FACING = "north"; + setFacingDirection(aStack, "north"); } else if (direction == 3){ - this.FACING = "east"; + setFacingDirection(aStack, "east"); } } @@ -333,7 +429,6 @@ public class StaballoyPickaxe extends ItemPickaxe{ @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - this.thisPickaxe = stack; list.add(EnumChatFormatting.GRAY+"Mines a 3x3 at 100 durability per block mined."); list.add(EnumChatFormatting.GRAY+"Durability: "+(stack.getMaxDamage()-stack.getItemDamage())+"/"+stack.getMaxDamage()); //super.addInformation(stack, aPlayer, list, bool); @@ -353,9 +448,7 @@ public class StaballoyPickaxe extends ItemPickaxe{ @Override public boolean onBlockStartBreak(final ItemStack itemstack, final int X, final int Y, final int Z, final EntityPlayer aPlayer) { - this.thisPickaxe = itemstack; - this.localPlayer = aPlayer; - this.checkFacing(this.localPlayer.worldObj); + this.checkFacing(itemstack, aPlayer, aPlayer.getEntityWorld()); return super.onBlockStartBreak(itemstack, X, Y, Z, aPlayer); } @@ -363,7 +456,6 @@ public class StaballoyPickaxe extends ItemPickaxe{ super(material); this.setUnlocalizedName(unlocalizedName); this.setTextureName(CORE.MODID + ":" + unlocalizedName); - this.FACING_HORIZONTAL=true; this.setMaxStackSize(1); this.setMaxDamage(3200); this.miningLevel = 5; diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java index 690971452f..6265c9f0a3 100644 --- a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java +++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java @@ -12,6 +12,7 @@ import net.minecraft.init.Blocks; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemSpade; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; @@ -33,12 +34,117 @@ public class StaballoySpade extends ItemSpade{ return 0; } - protected Boolean FACING_HORIZONTAL = true; - protected String FACING = "north"; - protected EntityPlayer localPlayer; - protected String lookingDirection; - protected World localWorld; - public ItemStack thisPickaxe = null; + + /** + * Creates an NBT tag for this item if it doesn't have one. + * This also set some default values. + * @param rStack + * @return + */ + + private static boolean createNBT(ItemStack rStack){ + final NBTTagCompound tagMain = new NBTTagCompound(); + final NBTTagCompound tagNBT = new NBTTagCompound(); + + tagNBT.setBoolean("FACING_HORIZONTAL", true); + tagNBT.setString("FACING", "north"); + tagNBT.setString("lookingDirection", ""); + + tagMain.setTag("PickStats", tagNBT); + rStack.setTagCompound(tagMain); + return true; + } + + /* + * Is the player facing horizontally? + */ + + public static final boolean isFacingHorizontal(final ItemStack aStack) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("PickStats"); + if (aNBT != null) { + return aNBT.getBoolean("FACING_HORIZONTAL"); + } + } + else { + createNBT(aStack); + } + return true; + } + + public static final boolean setFacingHorizontal(final ItemStack aStack, final boolean aFacingHorizontal) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("PickStats"); + if (aNBT != null) { + aNBT.setBoolean("FACING_HORIZONTAL", aFacingHorizontal); + return true; + } + } + return false; + } + + /* + * Handles the Direction the player is facing + */ + + public static final String getFacingDirection(final ItemStack aStack) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("PickStats"); + if (aNBT != null) { + return aNBT.getString("FACING"); + } + } + else { + createNBT(aStack); + } + return "north"; + } + + public static final boolean setFacingDirection(final ItemStack aStack, final String aFacingHorizontal) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("PickStats"); + if (aNBT != null) { + aNBT.setString("FACING", aFacingHorizontal); + return true; + } + } + return false; + } + + /* + * The Looking Direction handlers + */ + + public static final String getLookingDirection(final ItemStack aStack) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("PickStats"); + if (aNBT != null) { + return aNBT.getString("lookingDirection"); + } + } + else { + createNBT(aStack); + } + return ""; + } + + public static final boolean setLookingDirection(final ItemStack aStack, final String aFacingHorizontal) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("PickStats"); + if (aNBT != null) { + aNBT.setString("lookingDirection", aFacingHorizontal); + return true; + } + } + return false; + } + private int miningLevel; /* @@ -53,9 +159,6 @@ public class StaballoySpade extends ItemSpade{ @Override public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer aPlayer) { - this.localPlayer = aPlayer; - this.localWorld = world; - this.thisPickaxe = stack; return super.onItemRightClick(stack, world, aPlayer); } @@ -63,14 +166,11 @@ public class StaballoySpade extends ItemSpade{ @Override public boolean onBlockDestroyed(final ItemStack stack, final World world, final Block block, final int X, final int Y, final int Z, final EntityLivingBase entity) { - //super.onBlockDestroyed(stack, world, block, X, Y, Z, entity); - this.localWorld = world; - this.thisPickaxe = stack; - //checkFacing(world); if (!world.isRemote){ - this.GetDestroyOrientation(this.lookingDirection, world, X, Y, Z, stack); + if (entity instanceof EntityPlayer) { + this.GetDestroyOrientation((EntityPlayer) entity, getLookingDirection(stack), world, X, Y, Z, stack); + } } - return super.onBlockDestroyed(stack, world, block, X, Y, Z, entity); } @@ -90,8 +190,7 @@ public class StaballoySpade extends ItemSpade{ return false; } - private void GetDestroyOrientation(final String FACING, final World world, final int X, final int Y, final int Z, final ItemStack heldItem){ - this.localWorld = world; + private void GetDestroyOrientation(EntityPlayer player, final String FACING, final World world, final int X, final int Y, final int Z, final ItemStack heldItem){ float DURABILITY_LOSS = 0; if (!world.isRemote){ @@ -153,7 +252,7 @@ public class StaballoySpade extends ItemSpade{ else { //setItemDamage(heldItem, durLeft); Logger.WARNING(""+(durNow-durLeft)); - this.damageItem(heldItem, (durNow-durLeft)-1, this.localPlayer); + this.damageItem(heldItem, (durNow-durLeft)-1, player); } DURABILITY_LOSS = 0; @@ -170,7 +269,6 @@ public class StaballoySpade extends ItemSpade{ //Should clear up blocks quicker if I chain it. public int removeBlockAndDropAsItem(final World world, final int X, final int Y, final int Z, final ItemStack heldItem){ - this.localWorld = world; Logger.WARNING("Trying to drop/remove a block."); try { final Block block = world.getBlock(X, Y, Z); @@ -215,10 +313,9 @@ public class StaballoySpade extends ItemSpade{ } } - public boolean checkFacing(final World world){ - this.localWorld = world; - if (this.localPlayer != null){ - final int direction = MathHelper.floor_double((this.localPlayer.rotationYaw * 4F) / 360F + 0.5D) & 3; + public boolean checkFacing(final ItemStack aStack, final EntityPlayer aPlayer, final World world){ + if (aPlayer != null){ + final int direction = MathHelper.floor_double((aPlayer.rotationYaw * 4F) / 360F + 0.5D) & 3; //Utils.LOG_WARNING("Player - F: "+direction); //Utils.LOG_WARNING("Player - getLookVec(): "+localPlayer.getLookVec().yCoord); @@ -226,7 +323,7 @@ public class StaballoySpade extends ItemSpade{ localPlayer.getLookVec().yCoord; }*/ - final MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, this.localPlayer, false); + final MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, aPlayer, false); if (movingobjectposition != null){ final int sideHit = movingobjectposition.sideHit; String playerStandingPosition = ""; @@ -236,41 +333,41 @@ public class StaballoySpade extends ItemSpade{ if (sideHit == 0){ playerStandingPosition = "above"; - this.FACING_HORIZONTAL = false; + setFacingHorizontal(aStack, false); } else if (sideHit == 1){ playerStandingPosition = "below"; - this.FACING_HORIZONTAL = false; + setFacingHorizontal(aStack, false); } else if (sideHit == 2){ playerStandingPosition = "facingSouth"; - this.FACING_HORIZONTAL = true; + setFacingHorizontal(aStack, true); } else if (sideHit == 3){ playerStandingPosition = "facingNorth"; - this.FACING_HORIZONTAL = true; + setFacingHorizontal(aStack, true); } else if (sideHit == 4){ playerStandingPosition = "facingEast"; - this.FACING_HORIZONTAL = true; + setFacingHorizontal(aStack, true); } else if (sideHit == 5){ playerStandingPosition = "facingWest"; - this.FACING_HORIZONTAL = true; + setFacingHorizontal(aStack, true); } - this.lookingDirection = playerStandingPosition; + setLookingDirection(aStack, playerStandingPosition); if (direction == 0){ - this.FACING = "south"; + setFacingDirection(aStack, "south"); } else if (direction == 1){ - this.FACING = "west"; + setFacingDirection(aStack, "west"); } else if (direction == 2){ - this.FACING = "north"; + setFacingDirection(aStack, "north"); } else if (direction == 3){ - this.FACING = "east"; + setFacingDirection(aStack, "east"); } } @@ -283,7 +380,6 @@ public class StaballoySpade extends ItemSpade{ @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - this.thisPickaxe = stack; list.add(EnumChatFormatting.GOLD+"Spades a 3x3 area in the direction you are facing."); super.addInformation(stack, aPlayer, list, bool); } @@ -302,16 +398,13 @@ public class StaballoySpade extends ItemSpade{ @Override public boolean onBlockStartBreak(final ItemStack itemstack, final int X, final int Y, final int Z, final EntityPlayer aPlayer) { - this.thisPickaxe = itemstack; - this.localPlayer = aPlayer; - this.checkFacing(this.localPlayer.worldObj); + this.checkFacing(itemstack, aPlayer, aPlayer.worldObj); return super.onBlockStartBreak(itemstack, X, Y, Z, aPlayer); } public StaballoySpade(final String unlocalizedName, final ToolMaterial material) { super(material); this.setUnlocalizedName(unlocalizedName); this.setTextureName(CORE.MODID + ":" + unlocalizedName); - this.FACING_HORIZONTAL=true; this.setMaxStackSize(1); this.setMaxDamage(3200); } diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 4fa17ec7aa..fefe9f8c82 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -162,7 +162,7 @@ public class Material { } } else { - this.boilingPointC = this.calculateMeltingPoint(); + this.boilingPointC = this.calculateBoilingPoint(); } this.meltingPointK = (int) MathUtils.celsiusToKelvin(this.meltingPointC); @@ -901,7 +901,7 @@ public class Material { if (part != null){ int incrementor = part.getStackMaterial().getMeltingPointC(); meltingPoint += incrementor; - Logger.INFO("Melting Point for "+this.getLocalizedName()+" increased to "+ incrementor); + Logger.INFO("Melting Point for "+this.getLocalizedName()+" increased by "+ incrementor); } else { Logger.MATERIALS(this.getLocalizedName()+" has a really invalid composition."); @@ -923,6 +923,7 @@ public class Material { for (MaterialStack part : this.vMaterialInput){ if (part != null){ boilingPoint += part.getStackMaterial().getBoilingPointC(); + Logger.INFO("Melting Point for "+this.getLocalizedName()+" increased by "+ part.getStackMaterial().getBoilingPointC()); } else { Logger.MATERIALS(this.getLocalizedName()+" has a really invalid composition."); diff --git a/src/Java/gtPlusPlus/core/recipe/common/CI.java b/src/Java/gtPlusPlus/core/recipe/common/CI.java index 58a9a045d0..3074c3a4fe 100644 --- a/src/Java/gtPlusPlus/core/recipe/common/CI.java +++ b/src/Java/gtPlusPlus/core/recipe/common/CI.java @@ -167,6 +167,7 @@ public class CI { public static String craftingToolFile = "craftingToolFile"; public static String craftingToolKnife = "craftingToolKnife"; public static String craftingToolCrowbar = "craftingToolCrowbar"; + public static String craftingToolSaw = "craftingToolSaw"; public static String craftingToolWireCutter = "craftingToolWirecutter"; public static String craftingToolSolderingIron = "craftingToolSolderingIron"; diff --git a/src/Java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java b/src/Java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java index 3ee719be4d..b152be46b1 100644 --- a/src/Java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java +++ b/src/Java/gtPlusPlus/xmod/bop/HANDLER_BiomesOPlenty.java @@ -1,6 +1,13 @@ package gtPlusPlus.xmod.bop; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.recipe.common.CI; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.RecipeUtils; import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator; public class HANDLER_BiomesOPlenty { @@ -22,7 +29,12 @@ public class HANDLER_BiomesOPlenty { public static void postInit(){ if (LoadedMods.BiomesOPlenty){ - + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {ItemUtils.getSimpleStack(BOP_Block_Registrator.log_Rainforest)}, ItemUtils.getSimpleStack(Item.getItemFromBlock(Blocks.planks), 2)); + RecipeUtils.recipeBuilder( + CI.craftingToolSaw, null, null, + ItemUtils.getSimpleStack(BOP_Block_Registrator.log_Rainforest), null, null, + null, null, null, + ItemUtils.getSimpleStack(Item.getItemFromBlock(Blocks.planks), 4)); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java index d2c95a4ba6..056d5a2afd 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java @@ -232,50 +232,58 @@ public class RecipeGen_DustGeneration implements Runnable{ } else if (inputStacks.length == 2) { input3 = CI.getNumberedCircuit(20); - + } else if (inputStacks.length == 3) { input4 = CI.getNumberedCircuit(20); - + } - - + + //Add mixer Recipe FluidStack oxygen = GT_Values.NF; if (material.getComposites() != null){ + int compSlot = 0; for (final MaterialStack x : material.getComposites()){ if (!material.getComposites().isEmpty()){ if (x != null){ if (x.getStackMaterial() != null){ if (x.getStackMaterial().getDust(1) == null){ - if (x.getStackMaterial().getState() == MaterialState.GAS){ - oxygen = x.getStackMaterial().getFluid(1000); + MaterialState f = x.getStackMaterial().getState(); + if (f == MaterialState.GAS || f == MaterialState.LIQUID || f == MaterialState.PURE_LIQUID){ + oxygen = x.getStackMaterial().getFluid((int) (material.vSmallestRatio[compSlot] * 1000)); } } } } } + compSlot++; } } //Add mixer Recipe - if (GT_Values.RA.addMixerRecipe( - input1, input2, - input3, input4, - oxygen, - null, - outputStacks, - (int) Math.max(material.getMass() * 2L * 1, 1), - 2 * material.vVoltageMultiplier)) //Was 6, but let's try 2. This makes Potin LV, for example. - { - Logger.WARNING("Dust Mixer Recipe: "+material.getLocalizedName()+" - Success"); - return true; + try { + if (GT_Values.RA.addMixerRecipe( + input1, input2, + input3, input4, + oxygen, + null, + outputStacks, + (int) Math.max(material.getMass() * 2L * 1, 1), + 2 * material.vVoltageMultiplier)) //Was 6, but let's try 2. This makes Potin LV, for example. + { + Logger.WARNING("Dust Mixer Recipe: "+material.getLocalizedName()+" - Success"); + return true; + } + else { + Logger.WARNING("Dust Mixer Recipe: "+material.getLocalizedName()+" - Failed"); + return false; + } } - else { - Logger.WARNING("Dust Mixer Recipe: "+material.getLocalizedName()+" - Failed"); - return false; + catch (Throwable t) { + t.printStackTrace(); } } else { |