diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-08-04 19:55:10 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-08-04 19:55:10 +1000 |
commit | a94c9acbb4455be86d5841598d4ac07f3cddbaf0 (patch) | |
tree | 6c17ca80736ac3faedddebd0b83a5b51fd1e4b6b /src/Java/miscutil/core/item | |
parent | a0d482a7f23bd959ca26466de024d779ec6bf352 (diff) | |
download | GT5-Unofficial-a94c9acbb4455be86d5841598d4ac07f3cddbaf0.tar.gz GT5-Unofficial-a94c9acbb4455be86d5841598d4ac07f3cddbaf0.tar.bz2 GT5-Unofficial-a94c9acbb4455be86d5841598d4ac07f3cddbaf0.zip |
% Changed handling of generated block names back to how it was.
% Changed power handling for Universal Battery.
% Disabled Sinter furnacing and related debugging completely for release.
% Changed generated dust tooltip handling.
Diffstat (limited to 'src/Java/miscutil/core/item')
3 files changed, 59 insertions, 21 deletions
diff --git a/src/Java/miscutil/core/item/base/dusts/BaseItemDust.java b/src/Java/miscutil/core/item/base/dusts/BaseItemDust.java index 1dee49bfa4..49fb1ac13d 100644 --- a/src/Java/miscutil/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/miscutil/core/item/base/dusts/BaseItemDust.java @@ -6,6 +6,7 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; import java.util.List; @@ -39,7 +40,6 @@ public class BaseItemDust extends Item{ this.setTextureName(CORE.MODID + ":" + "dust");} else{ this.setTextureName(CORE.MODID + ":" + "dust"+pileSize);} - this.setMaxStackSize(64); this.setCreativeTab(tabMisc); this.colour = colour; this.mTier = tier; @@ -94,14 +94,17 @@ public class BaseItemDust extends Item{ @Override public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { - if (pileType != null && materialName != null && pileType != "" && materialName != "" && !pileType.equals("") && !materialName.equals("")){ - if (this.pileType == "dust"){ - list.add(EnumChatFormatting.GRAY+"A pile of " + materialName + " dust."); + //if (pileType != null && materialName != null && pileType != "" && materialName != "" && !pileType.equals("") && !materialName.equals("")){ + if (getUnlocalizedName().contains("DustTiny")){ + list.add(EnumChatFormatting.GRAY+"A tiny pile of " + materialName + " dust."); } - else{ - list.add(EnumChatFormatting.GRAY+"A "+this.pileType.toLowerCase()+" pile of " + materialName + " dust."); + else if (getUnlocalizedName().contains("DustSmall")){ + list.add(EnumChatFormatting.GRAY+"A small pile of " + materialName + " dust."); } - } + else { + list.add(EnumChatFormatting.GRAY+"A pile of " + materialName + " dust."); + } + //} super.addInformation(stack, aPlayer, list, bool); } @@ -151,11 +154,11 @@ public class BaseItemDust extends Item{ } else { if (outputStacks[0] != null){ - Utils.LOG_INFO("Getting output dusts for mixer recipe. Checking ENUM, got: "+outputStacks[0].toString()); + Utils.LOG_WARNING("Getting output dusts for mixer recipe. Checking ENUM, got: "+outputStacks[0].toString()); tempOutput = outputStacks[0]; } else { - Utils.LOG_INFO("Getting output dusts for mixer recipe. Enum check failed, failback item is: "+temp); + Utils.LOG_WARNING("Getting output dusts for mixer recipe. Enum check failed, failback item is: "+temp); tempOutput = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1); } } @@ -178,14 +181,32 @@ public class BaseItemDust extends Item{ null, null, null); } else { - Utils.LOG_WARNING("Generating a shapeless Dust recipe for "+materialName); + Utils.LOG_INFO("Generating a Dust recipe for "+materialName+" in the mixer."); - GT_Values.RA.addMixerRecipe( + /*GT_Values.RA.addMixerRecipe( inputStacks[0], inputStacks[1], inputStacks[2], inputStacks[3], null, null, tempOutput, + 8*mTier*20, 8*mTier*2);*/ + int i = 0; + for (ItemStack is : inputStacks){ + i++; + if (is != null){ + Utils.LOG_INFO("Found "+is.getDisplayName()+" as an input for mixer recipe."); + } + else { + Utils.LOG_INFO("Input "+i+" was null."); + } + } + + GT_Values.RA.addMixerRecipe( + GT_Utility.copyAmount(inputStacks[0].stackSize, new Object[]{inputStacks[0]}), GT_Utility.copyAmount(inputStacks[1].stackSize, new Object[]{inputStacks[1]}), + GT_Utility.copyAmount(inputStacks[2].stackSize, new Object[]{inputStacks[2]}), GT_Utility.copyAmount(inputStacks[3].stackSize, new Object[]{inputStacks[3]}), + null, null, + tempOutput, 8*mTier*20, 8*mTier*2); + } } diff --git a/src/Java/miscutil/core/item/base/itemblock/ItemBlockGtBlock.java b/src/Java/miscutil/core/item/base/itemblock/ItemBlockGtBlock.java index 0bd051928e..79364cb079 100644 --- a/src/Java/miscutil/core/item/base/itemblock/ItemBlockGtBlock.java +++ b/src/Java/miscutil/core/item/base/itemblock/ItemBlockGtBlock.java @@ -12,7 +12,7 @@ public class ItemBlockGtBlock extends ItemBlock{ public ItemBlockGtBlock(Block block) { super(block); this.blockColour = block.getBlockColor(); - GT_OreDictUnificator.registerOre("block"+block.getUnlocalizedName().replace("tile.block", "").replace("tile.", "").replace("of", "").replace("Block", "").replace("-", "").replace("_", "").replace(" ", ""), UtilsItems.getSimpleStack(this)); + GT_OreDictUnificator.registerOre("block"+block.getUnlocalizedName().replace("tile.block", "").replace("tile.", "").replace("of", "").replace("Of", "").replace("Block", "").replace("-", "").replace("_", "").replace(" ", ""), UtilsItems.getSimpleStack(this)); } public int getRenderColor(int aMeta) { diff --git a/src/Java/miscutil/core/item/general/RF2EU_Battery.java b/src/Java/miscutil/core/item/general/RF2EU_Battery.java index a6888b4dcc..ae03ea5a06 100644 --- a/src/Java/miscutil/core/item/general/RF2EU_Battery.java +++ b/src/Java/miscutil/core/item/general/RF2EU_Battery.java @@ -17,6 +17,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import cofh.api.energy.ItemEnergyContainer; @@ -110,7 +111,7 @@ public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, @Override public String getItemStackDisplayName(ItemStack p_77653_1_) { - return ("Universally chargeable battery"); + return ("Universally Chargeable Battery"); } @Override @@ -149,13 +150,13 @@ public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, @Override public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { - list.add("IC2/EU Information"); - list.add("Tier: ["+getTier(thisStack)+"]"+" Current Power: ["+(long) getCharge(stack)+"/EU]"); - list.add("Transfer Limit: ["+getTransferLimit(thisStack)+"Eu/t]"+" Burn Time: ["+getBurnTime(stack)/20+"s]"); + list.add(EnumChatFormatting.YELLOW+"IC2/EU Information"+EnumChatFormatting.GRAY); + list.add(EnumChatFormatting.GRAY+"Tier: ["+EnumChatFormatting.YELLOW+getTier(thisStack)+EnumChatFormatting.GRAY+"] Current Power: ["+EnumChatFormatting.YELLOW+(long) getCharge(stack)+EnumChatFormatting.GRAY+"/EU]"); + list.add(EnumChatFormatting.GRAY+"Transfer Limit: ["+EnumChatFormatting.YELLOW+getTransferLimit(thisStack)+ EnumChatFormatting.GRAY +"Eu/t]" +"Burn Time: ["+EnumChatFormatting.YELLOW+getBurnTime(stack)/20+EnumChatFormatting.GRAY+"s]"); list.add(""); - list.add("RF Information"); - list.add("Extraction Rate: [" + this.maxExtract + "Rf/t]" + " Insert Rate: [" + this.maxReceive+"Rf/t]"); - list.add("Current Charge: ["+getEnergyStored(stack) + "Rf / " + getMaxEnergyStored(stack)+"Rf] "+MathUtils.findPercentage(getEnergyStored(stack), getMaxEnergyStored(stack))+"%"); + list.add(EnumChatFormatting.RED+"RF Information"); + list.add(EnumChatFormatting.GRAY+"Extraction Rate: [" +EnumChatFormatting.RED+ this.maxExtract + EnumChatFormatting.GRAY + "Rf/t]" + " Insert Rate: [" +EnumChatFormatting.RED+ this.maxReceive+EnumChatFormatting.GRAY+"Rf/t]"); + list.add(EnumChatFormatting.GRAY+"Current Charge: ["+EnumChatFormatting.RED+getEnergyStored(stack) + EnumChatFormatting.GRAY + "Rf / " + getMaxEnergyStored(stack)+"Rf] "+EnumChatFormatting.RED+MathUtils.findPercentage(getEnergyStored(stack), getMaxEnergyStored(stack))+EnumChatFormatting.GRAY+"%"); super.addInformation(stack, aPlayer, list, bool); } @@ -205,6 +206,10 @@ public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, public double discharge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate) { if ((stack.stackTagCompound == null) || (!stack.stackTagCompound.hasKey("Energy"))) { + double euCharge = getCharge(UtilsItems.getSimpleStack(this)); + if (euCharge != 0 && euCharge >= 1){ + return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU)); + } return 0; } int energy = stack.stackTagCompound.getInteger("Energy"); @@ -248,8 +253,12 @@ public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, @Override public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) { - if (container.stackTagCompound == null) { - container.stackTagCompound = new NBTTagCompound(); + if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) { + double euCharge = getCharge(UtilsItems.getSimpleStack(this)); + if (euCharge != 0 && euCharge >= 1){ + return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU)); + } + return 0; } int energy = container.stackTagCompound.getInteger("Energy"); int energyReceived = Math.min(this.capacity - energy, Math.min(this.maxReceive, maxReceive)); @@ -268,6 +277,10 @@ public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) { if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) { + double euCharge = getCharge(UtilsItems.getSimpleStack(this)); + if (euCharge != 0 && euCharge >= 1){ + return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU)); + } return 0; } int energy = container.stackTagCompound.getInteger("Energy"); @@ -286,6 +299,10 @@ public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, public int getEnergyStored(ItemStack container) { if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) { + double euCharge = getCharge(UtilsItems.getSimpleStack(this)); + if (euCharge != 0 && euCharge >= 1){ + return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU)); + } return 0; } int energy = container.stackTagCompound.getInteger("Energy"); |