diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-11-01 14:58:08 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-11-01 14:58:08 +0000 |
commit | 2855aaffb538f5dae1fcbbbd051bfb4e3a5951c8 (patch) | |
tree | 140a276269b08386d24b35bf738d774b3079349d /src/Java/gtPlusPlus/core/item | |
parent | 1b5aaa09e22baa1f09d0777d1465fd61c2a810b4 (diff) | |
download | GT5-Unofficial-2855aaffb538f5dae1fcbbbd051bfb4e3a5951c8.tar.gz GT5-Unofficial-2855aaffb538f5dae1fcbbbd051bfb4e3a5951c8.tar.bz2 GT5-Unofficial-2855aaffb538f5dae1fcbbbd051bfb4e3a5951c8.zip |
+ Added new Radioactive ore.
+ Added Custom Nuclear Texture Set.
% More material work.
$ Fixed issue allowing Multiblocks to have > 1 Control Core Hatch.
$ Fixed Broken Ore texture for ENRICHED TextureSet.
$ Fixed a few fluid recipes broken in the refactor.
Diffstat (limited to 'src/Java/gtPlusPlus/core/item')
4 files changed, 71 insertions, 75 deletions
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 0e21e9b154..c86c10bb53 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -280,6 +280,8 @@ public final class ModItems { public static ItemStack itemHotTitaniumIngot; + public static Fluid fluidZrF4; + static { Logger.INFO("Items!"); //Default item used when recipes fail, handy for debugging. Let's make sure they exist when this class is called upon. @@ -621,7 +623,7 @@ public final class ModItems { //Zirconium Tetrafluoride GT_OreDictUnificator.registerOre("cellZrF4", ItemUtils.getItemStackOfAmountFromOreDict("cellZirconiumTetrafluoride", 1)); GT_OreDictUnificator.registerOre("dustZrF4", ItemUtils.getItemStackOfAmountFromOreDict("dustZirconiumTetrafluoride", 1)); - FluidUtils.generateFluidNoPrefix("ZirconiumTetrafluoride", "Zirconium Tetrafluoride", 500, new short[]{170, 170, 140, 100}); //https://en.wikipedia.org/wiki/Zirconium_tetrafluoride + fluidZrF4 = FluidUtils.generateFluidNoPrefix("ZirconiumTetrafluoride", "Zirconium Tetrafluoride", 500, new short[]{170, 170, 140, 100}); //https://en.wikipedia.org/wiki/Zirconium_tetrafluoride //Coolant Salt //NaBF4 - NaF - 621C diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index ea0a2bb5eb..b07815fa60 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -97,14 +97,14 @@ public class BaseItemComponent extends Item{ return false; } //Register Component - Map<String, BaseItemComponent> aMap = Material.mComponentMap.get(componentMaterial.getUnlocalizedName()); + Map<String, ItemStack> aMap = Material.mComponentMap.get(componentMaterial.getUnlocalizedName()); if (aMap == null) { - aMap = new HashMap<String, BaseItemComponent>(); + aMap = new HashMap<String, ItemStack>(); } String aKey = componentType.getGtOrePrefix().name(); - BaseItemComponent x = aMap.get(aKey); + ItemStack x = aMap.get(aKey); if (x == null) { - aMap.put(aKey, this); + aMap.put(aKey, ItemUtils.getSimpleStack(this)); Material.mComponentMap.put(componentMaterial.getUnlocalizedName(), aMap); return true; } diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java index 56d2aabdba..517e3f7c1f 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java @@ -18,12 +18,12 @@ import gtPlusPlus.core.material.MaterialStack; import gtPlusPlus.core.util.minecraft.EntityUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; -public class ItemBlockGtBlock extends ItemBlock{ +public class ItemBlockGtBlock extends ItemBlock { protected final int blockColour; - protected final int sRadiation; + private int sRadiation; - private final Material mMaterial; + private Material mMaterial; private final Block thisBlock; private boolean isOre = false; @@ -32,46 +32,23 @@ public class ItemBlockGtBlock extends ItemBlock{ public ItemBlockGtBlock(final Block block) { super(block); this.thisBlock = block; - if (block instanceof BlockBaseOre){ + if (block instanceof BlockBaseOre) { this.isOre = true; - } - else if (block instanceof BlockBaseModular) { + } else if (block instanceof BlockBaseModular) { this.isModular = true; } - else { - - } - if (!isModular && !isOre) { - mMaterial = null; - } - else { - if (isOre) { - mMaterial = ((BlockBaseOre) block).getMaterialEx(); - } - else { - mMaterial = ((BlockBaseModular) block).getMaterialEx(); - } - } - final BlockBaseModular baseBlock = (BlockBaseModular) block; if (isModular) { this.blockColour = baseBlock.getRenderColor(0); - } - else if (isOre) { + } else if (isOre) { this.blockColour = block.getBlockColor(); - } - else { + } else { this.blockColour = block.getBlockColor(); } - if (this.mMaterial != null) { - this.sRadiation = mMaterial.vRadiationLevel; - } - else { - this.sRadiation = 0; - } - - - //GT_OreDictUnificator.registerOre("block"+block.getUnlocalizedName().replace("tile.block", "").replace("tile.", "").replace("of", "").replace("Of", "").replace("Block", "").replace("-", "").replace("_", "").replace(" ", ""), ItemUtils.getSimpleStack(this)); + // GT_OreDictUnificator.registerOre("block"+block.getUnlocalizedName().replace("tile.block", + // "").replace("tile.", "").replace("of", "").replace("Of", "").replace("Block", + // "").replace("-", "").replace("_", "").replace(" ", ""), + // ItemUtils.getSimpleStack(this)); } public int getRenderColor(final int aMeta) { @@ -80,45 +57,66 @@ public class ItemBlockGtBlock extends ItemBlock{ @Override public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - - if (this.mMaterial != null){ - list.add(this.mMaterial.vChemicalFormula); - } - - if (this.sRadiation > 0){ - list.add(CORE.GT_Tooltip_Radioactive); + + if (this.mMaterial != null) { + list.add(this.mMaterial.vChemicalFormula); + if (this.mMaterial.vRadiationLevel > 0) { + list.add(CORE.GT_Tooltip_Radioactive); + } + } else { + list.add("Material is Null."); } - + if (KeyboardUtils.isCtrlKeyDown()) { Block b = Block.getBlockFromItem(stack.getItem()); if (b != null) { - + String aTool = b.getHarvestTool(stack.getItemDamage()); int aMiningLevel1 = b.getHarvestLevel(stack.getItemDamage()); - list.add("Mining Level: "+Math.min(Math.max(aMiningLevel1, 0), 5)); - + list.add("Mining Level: " + Math.min(Math.max(aMiningLevel1, 0), 5)); + if (this.mMaterial != null) { - list.add("Ore contains: "); + list.add("Ore contains: "); if (mMaterial.getComposites().isEmpty()) { - list.add("- "+mMaterial.getLocalizedName()); - } - else { + list.add("- " + mMaterial.getLocalizedName()); + } else { for (MaterialStack m : mMaterial.getComposites()) { - list.add("- "+m.getStackMaterial().getLocalizedName()+" x"+m.getPartsPerOneHundred()); + list.add("- " + m.getStackMaterial().getLocalizedName() + " x" + m.getPartsPerOneHundred()); } } } } - } - else { - list.add(EnumChatFormatting.DARK_GRAY+"Hold Ctrl to show additional info."); + } else { + list.add(EnumChatFormatting.DARK_GRAY + "Hold Ctrl to show additional info."); } super.addInformation(stack, aPlayer, list, bool); } @Override - public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) { - EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.sRadiation, world, entityHolding); + public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, + final boolean p_77663_5_) { + + if (!isModular && !isOre) { + mMaterial = null; + } else { + if (this.mMaterial == null) { + Block b = Block.getBlockFromItem(iStack.getItem()); + if (isOre) { + mMaterial = ((BlockBaseOre) b).getMaterialEx(); + } else { + mMaterial = ((BlockBaseModular) b).getMaterialEx(); + } + if (mMaterial != null) { + this.sRadiation = mMaterial.vRadiationLevel; + } else { + this.sRadiation = 0; + } + } + if (this.sRadiation > 0) { + EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.sRadiation, world, entityHolding); + } + } + } } diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java index 791d861414..e4079521d4 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java @@ -57,12 +57,7 @@ public class ItemBlockOre extends ItemBlock{ @Override public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - if (!mInitOres_Everglades || mMapOreBlockItemToDimName.size() == 0 || (aPlayer != null ? aPlayer.worldObj.getWorldTime() % 200 == 0 : false)) { - - //mMapOreBlockItemToDimName.clear(); - mDimsForThisOre.clear(); - - + if (!mInitOres_Everglades) { for (WorldGen_GT_Ore_Layer f : gtPlusPlus.everglades.gen.gt.WorldGen_Ores.validOreveins.values()) { Material[] m2 = new Material[] {f.mPrimary, f.mSecondary, f.mBetween, f.mSporadic}; for (Material m1 : m2) { @@ -70,8 +65,9 @@ public class ItemBlockOre extends ItemBlock{ if (aMap == null) { aMap = new AutoMap<String>(); } - if (!aMap.containsValue("Everglades")) { - aMap.put("Everglades"); + String aDimName = "Everglades"; + if (!aMap.containsValue(aDimName)) { + aMap.put(aDimName); } mMapOreBlockItemToDimName.put(m1.getUnlocalizedName().toLowerCase(), aMap); } @@ -120,21 +116,21 @@ public class ItemBlockOre extends ItemBlock{ } if (mDimsForThisOre.isEmpty()) { - AutoMap A = mMapOreBlockItemToDimName.get(this.mThisMaterial.getUnlocalizedName().toLowerCase()); + AutoMap<String> A = mMapOreBlockItemToDimName.get(this.mThisMaterial.getUnlocalizedName().toLowerCase()); if (A != null) { mDimsForThisOre = A; - } - else { - mDimsForThisOre.put("Unknown"); - } + } } - + + list.add("Found: "); if (!mDimsForThisOre.isEmpty()) { - list.add("Found: "); for (String m : mDimsForThisOre) { list.add("- "+m); } } + else { + list.add("- Unknown"); + } } else { |