From f18c0e23ce7602f66bb2cf50216d51413147034b Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Tue, 5 Feb 2019 05:50:54 +0000 Subject: + Added recipes for ULV generators. + Added recipes for New batteries and their components. (To be use in the charger packs). % Mildly adjusted Circuit programmer recipe. % Adjusted Plasma hatch to be output only. $ Fixed bad tooltips on material blocks/frames. $ Fixed Lang formatting issue. --- .../core/item/base/itemblock/ItemBlockGtBlock.java | 48 ++++++++++++--- .../item/base/itemblock/ItemBlockGtFrameBox.java | 71 ++++++++++++++++++++++ 2 files changed, 112 insertions(+), 7 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item/base') diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java index 517e3f7c1f..396689ef63 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java @@ -15,6 +15,7 @@ import gtPlusPlus.core.block.base.BlockBaseOre; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialStack; +import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.EntityUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; @@ -44,7 +45,16 @@ public class ItemBlockGtBlock extends ItemBlock { this.blockColour = block.getBlockColor(); } else { this.blockColour = block.getBlockColor(); + } + + if (block instanceof BlockBaseModular){ + BlockBaseModular g = (BlockBaseModular) block; + this.mMaterial = g.getMaterialEx(); + } + else { + this.mMaterial = null; } + // GT_OreDictUnificator.registerOre("block"+block.getUnlocalizedName().replace("tile.block", // "").replace("tile.", "").replace("of", "").replace("Of", "").replace("Block", // "").replace("-", "").replace("_", "").replace(" ", ""), @@ -59,24 +69,32 @@ public class ItemBlockGtBlock extends ItemBlock { 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.mMaterial.vRadiationLevel > 0) { - list.add(CORE.GT_Tooltip_Radioactive); - } + list.add(this.mMaterial.vChemicalFormula); } else { - list.add("Material is Null."); + + try { + BlockBaseModular g = (BlockBaseModular) thisBlock; + this.mMaterial = g.getMaterialEx(); + } + catch (Throwable t) { + + } + + + //list.add("Material is Null."); } + if (this.isOre) { 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)); if (this.mMaterial != null) { - list.add("Ore contains: "); + list.add("Mining Level: " + Math.min(Math.max(aMiningLevel1, 0), 5)); + list.add("Contains: "); if (mMaterial.getComposites().isEmpty()) { list.add("- " + mMaterial.getLocalizedName()); } else { @@ -89,6 +107,22 @@ public class ItemBlockGtBlock extends ItemBlock { } else { list.add(EnumChatFormatting.DARK_GRAY + "Hold Ctrl to show additional info."); } + } + else { + 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)); + } + } + + if (this.mMaterial != null) { + if (this.mMaterial.vRadiationLevel > 0) { + list.add(CORE.GT_Tooltip_Radioactive); + } + } + super.addInformation(stack, aPlayer, list, bool); } diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java index 74dd2f196c..0dd125bf7b 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java @@ -1,18 +1,45 @@ package gtPlusPlus.core.item.base.itemblock; import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +import java.util.List; import gtPlusPlus.core.block.base.BlockBaseModular; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.material.MaterialStack; +import gtPlusPlus.core.util.minecraft.EntityUtils; +import gtPlusPlus.core.util.sys.KeyboardUtils; public class ItemBlockGtFrameBox extends ItemBlock{ protected int blockColour; + private Material mMaterial; + private int sRadiation; public ItemBlockGtFrameBox(final Block block) { super(block); final BlockBaseModular baseBlock = (BlockBaseModular) block; this.blockColour = baseBlock.getRenderColor(1); + + + + if (block instanceof BlockBaseModular){ + BlockBaseModular g = (BlockBaseModular) block; + this.mMaterial = g.getMaterialEx(); + sRadiation = mMaterial.vRadiationLevel; + } + else { + this.mMaterial = null; + sRadiation = 0; + } + //GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""), ItemUtils.getSimpleStack(this)); } @@ -20,4 +47,48 @@ public class ItemBlockGtFrameBox extends ItemBlock{ return this.blockColour; } + @SuppressWarnings("unchecked") + @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.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)); + if (this.mMaterial != null) { + list.add("Contains: "); + if (mMaterial.getComposites().isEmpty()) { + list.add("- " + mMaterial.getLocalizedName()); + } else { + for (MaterialStack m : mMaterial.getComposites()) { + list.add("- " + m.getStackMaterial().getLocalizedName() + " x" + m.getPartsPerOneHundred()); + } + } + } + } + } 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_) { + + if (this.sRadiation > 0) { + EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.sRadiation, world, entityHolding); + } + } + + } -- cgit From 5507b8c0e7b2117a33dfb1fedbd14b3c30f6a01b Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Tue, 5 Feb 2019 20:02:33 +0000 Subject: + Added recipe for Nano Healer. + Added recipe for Strange Dust. + Added recipe for Slow Builders Ring. + Added recipes for Charge Packs. + Added recipes to make obtaining Zirconium a little earlier. + Added packager recipes for all ore materials. + Added lathe recipes for all materials -> rods. Closes #411. + Added way to process Silicon Carbide into Synthetic Graphite. Closes #407. + Added proper achievement localization for all new AL recipes. + Added more INIT_PHASE's. - Removed ways to obtain Trinium dust in GTNH. (Leave handling to GT instead). % Adjusted recipes for Cyclotron and Casings, it's now assembled instead of shape crafted. % Adjusted circuits used in lower tier dehydrator recipes for consistency. Closes #364. % Adjusted a few materials having '-' in their name within en_US.lang. % Adjusted power capacity of the Gem Batteries. % Adjusted tiering for Large Auto-Assembler, it has been reduced by one. % Adjusted composition of Pikyonium to now require Yttrium, instead of the rare Ytterbium. % Adjusted composition of DEEP_EARTH_REACTOR_FUEL_DEPOSIT to be slightly more balanced. % Adjusted smelting point of Zirconium Carbide. $ Fixed an NPE in GeneralTooltipEventHandler.java. $ Fixed weird invisible recipes. Closes #304. $ Confirmed Large Mixer is now working correctly. Closes #366. (Closed in previous commit https://github.com/draknyte1/GTplusplus/commit/918d763dabd82d47db739a1b0a51c01f0803adc0). $ Confirmed Matter Fabricator is now working correctly. Closes #360. + Auto Doors. Closes #338. (Closed in previous commit https://github.com/draknyte1/GTplusplus/commit/22c6a05a8a3a00294bcb8890a1e2a0fdc9196de8). % Changed Energy Buffer Recipes. Closes #52. (Closed in previous commit https://github.com/draknyte1/GTplusplus/commit/499411aa21ac4a742b6d51ef3ce9c4046d0a22c1). $ Invalid Recipe. Closes #241. (Closed in unknown, previous commit). --- .../core/item/base/rods/BaseItemRod.java | 30 ++++++++++++++++------ .../core/item/base/screws/BaseItemScrew.java | 4 +-- 2 files changed, 24 insertions(+), 10 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item/base') diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java index b6a5dff2ac..eaa0905c93 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java @@ -14,22 +14,36 @@ public class BaseItemRod extends BaseItemComponent{ public BaseItemRod(final Material material) { super(material, BaseItemComponent.ComponentTypes.ROD); this.addExtruderRecipe(); + this.addLatheRecipe(); } private void addExtruderRecipe(){ Logger.WARNING("Adding cutter recipe for "+this.materialName+" Rods"); - final ItemStack stackStick = this.componentMaterial.getRod(1); final ItemStack stackBolt = this.componentMaterial.getBolt(4); - + if (ItemUtils.checkForInvalidItems(new ItemStack[] {stackStick, stackBolt})) - GT_Values.RA.addCutterRecipe( - stackStick, - stackBolt, - null, - (int) Math.max(this.componentMaterial.getMass() * 2L, 1L), - 4); + GT_Values.RA.addCutterRecipe( + stackStick, + stackBolt, + null, + (int) Math.max(this.componentMaterial.getMass() * 2L, 1L), + 4); + } + + + private void addLatheRecipe(){ + Logger.WARNING("Adding recipe for "+this.materialName+" Rod"); + ItemStack boltStack = this.componentMaterial.getIngot(1); + if (ItemUtils.checkForInvalidItems(boltStack)){ + GT_Values.RA.addLatheRecipe( + boltStack, + ItemUtils.getSimpleStack(this), + null, + (int) Math.max(this.componentMaterial.getMass() / 8L, 1L), + 4); + } } } diff --git a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java index af74c1d535..29e525ed10 100644 --- a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java +++ b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java @@ -18,8 +18,8 @@ public class BaseItemScrew extends BaseItemComponent{ private void addLatheRecipe(){ Logger.WARNING("Adding recipe for "+this.materialName+" Screws"); - final ItemStack boltStack = ItemUtils.getItemStackOfAmountFromOreDict(this.unlocalName.replace("itemScrew", "bolt"), 1); - if (null != boltStack){ + ItemStack boltStack = this.componentMaterial.getBolt(1); + if (ItemUtils.checkForInvalidItems(boltStack)){ GT_Values.RA.addLatheRecipe( boltStack, ItemUtils.getSimpleStack(this), -- cgit From 94f842fa9223d1d0fa233266495a20a00eafa030 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Mon, 4 Mar 2019 21:05:08 +0000 Subject: % Final touches to TC aspects. The 5 custom ones added by GT++ now have names and proper handling. --- src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java | 7 ++++--- src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item/base') diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index 4dbb5851f2..522b7e900e 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -8,6 +8,7 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TC_Aspects; import gregtech.api.enums.TextureSet; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.api.objects.Logger; @@ -21,7 +22,7 @@ import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.EntityUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; -import gtPlusPlus.xmod.thaumcraft.aspect.GTPP_Aspects; +import gtPlusPlus.xmod.thaumcraft.objects.wrapper.aspect.TC_Aspect_Wrapper; import gtPlusPlus.xmod.thaumcraft.util.ThaumcraftUtils; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; @@ -66,9 +67,9 @@ public class BaseItemComponent extends Item{ GT_OreDictUnificator.registerOre(componentType.getOreDictName()+material.getUnlocalizedName(), ItemUtils.getSimpleStack(this)); if (LoadedMods.Thaumcraft) { - ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), GTPP_Aspects.METALLUM, 1); + ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.METALLUM.mAspect), 1); if (componentMaterial.isRadioactive) { - ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), GTPP_Aspects.RADIO, 2); + ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.RADIO.mAspect), componentMaterial.vRadiationLevel); } } registerComponent(); diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java index 2b3f477c56..de47ed8225 100644 --- a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java @@ -16,6 +16,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TC_Aspects; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.creative.AddToCreativeTab; @@ -26,7 +27,7 @@ import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.EntityUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.xmod.thaumcraft.aspect.GTPP_Aspects; +import gtPlusPlus.xmod.thaumcraft.objects.wrapper.aspect.TC_Aspect_Wrapper; import gtPlusPlus.xmod.thaumcraft.util.ThaumcraftUtils; public class BaseOreComponent extends Item{ @@ -57,9 +58,9 @@ public class BaseOreComponent extends Item{ registerComponent(); GT_OreDictUnificator.registerOre(componentType.getComponent()+material.getUnlocalizedName(), ItemUtils.getSimpleStack(this)); if (LoadedMods.Thaumcraft) { - ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), GTPP_Aspects.METALLUM, 2); + ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.METALLUM.mAspect), 1); if (componentMaterial.isRadioactive) { - ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), GTPP_Aspects.RADIO, 4); + ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.RADIO.mAspect), componentMaterial.vRadiationLevel); } } -- cgit From 064c0dc0cfab1cc677dfffc4b3b56642017e412b Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Fri, 8 Mar 2019 03:14:13 +0000 Subject: + Added some AgriChem. (You can now use Raw waste as a fuel source) + Added OreDict names to vanilla items, as was done in Forge 1.8.9. + Added functions to allow other mods to add Semifluid Fuels. + Added functions to handle String data into StringUtils.java. % Renamed getItemStack -> getItemStackFromFQRN. $ Fixed handling of custom cells for fluids using '.' within their names. $ Fixed HF exploit. --- .../core/item/base/BaseItemComponent.java | 24 ++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item/base') diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index 522b7e900e..fd69c97ff5 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -18,6 +18,7 @@ import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.data.StringUtils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.EntityUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -77,18 +78,33 @@ public class BaseItemComponent extends Item{ //For Cell Generation public BaseItemComponent(final String unlocalName, final String localName, final short[] RGBA) { + + // Handles .'s from fluid internal names. + String aFormattedNameForFluids; + if (unlocalName.contains(".")) { + if (StringUtils.characterCount(unlocalName, '.') > 1) { + aFormattedNameForFluids = StringUtils.splitAndUppercase(unlocalName, "."); + } + else { + aFormattedNameForFluids = unlocalName.replace(".", ""); + } + } + else { + aFormattedNameForFluids = unlocalName; + } + this.componentMaterial = null; - this.unlocalName = "itemCell"+unlocalName; + this.unlocalName = "itemCell"+aFormattedNameForFluids; this.materialName = localName; this.componentType = ComponentTypes.CELL; this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(unlocalName); + this.setUnlocalizedName(aFormattedNameForFluids); this.setMaxStackSize(64); this.componentColour = MathUtils.getRgbAsHex(RGBA); this.extraData = RGBA; this.setTextureName(CORE.MODID + ":" + "item"+ComponentTypes.CELL.COMPONENT_NAME); - GameRegistry.registerItem(this, unlocalName); - GT_OreDictUnificator.registerOre(ComponentTypes.CELL.getOreDictName()+unlocalName, ItemUtils.getSimpleStack(this)); + GameRegistry.registerItem(this, aFormattedNameForFluids); + GT_OreDictUnificator.registerOre(ComponentTypes.CELL.getOreDictName()+aFormattedNameForFluids, ItemUtils.getSimpleStack(this)); registerComponent(); } -- cgit From 86c8b91b00624c7b1824b6b75290ed383338e48f Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Fri, 8 Mar 2019 03:47:14 +0000 Subject: % Rebalanced AgroChem recipes a bit. $ Fixed AgroChem fuels being worth 1000x the intended EU total. $ Fixed Unique Dusts not having recipes for their Small/Tiny forms. --- src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item/base') diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index fd69c97ff5..ceeff7e655 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -82,12 +82,7 @@ public class BaseItemComponent extends Item{ // Handles .'s from fluid internal names. String aFormattedNameForFluids; if (unlocalName.contains(".")) { - if (StringUtils.characterCount(unlocalName, '.') > 1) { - aFormattedNameForFluids = StringUtils.splitAndUppercase(unlocalName, "."); - } - else { - aFormattedNameForFluids = unlocalName.replace(".", ""); - } + aFormattedNameForFluids = StringUtils.splitAndUppercase(unlocalName, "."); } else { aFormattedNameForFluids = unlocalName; -- cgit From 11494f1b654a9088896e3e282267e90bb912fde6 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Fri, 8 Mar 2019 18:46:29 +0000 Subject: $ More work on fluid overhaul. --- .../core/item/base/itemblock/FluidItemBlock.java | 61 +++++++++++++++++ .../core/item/base/itemblock/ItemBlockFluid.java | 78 ---------------------- 2 files changed, 61 insertions(+), 78 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/item/base/itemblock/FluidItemBlock.java delete mode 100644 src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java (limited to 'src/Java/gtPlusPlus/core/item/base') diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/FluidItemBlock.java b/src/Java/gtPlusPlus/core/item/base/itemblock/FluidItemBlock.java new file mode 100644 index 0000000000..96b5425437 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/FluidItemBlock.java @@ -0,0 +1,61 @@ +package gtPlusPlus.core.item.base.itemblock; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +import gtPlusPlus.core.fluids.BlockFluidBase; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; + +public class FluidItemBlock extends ItemBlock{ + + protected final int blockColour; + final BlockFluidBase baseBlock; + String name; + + public FluidItemBlock(final Block block) { + super(block); + this.baseBlock = (BlockFluidBase) block; + this.blockColour = this.baseBlock.getRenderColor(1); + this.name = this.baseBlock.getLocalizedName().replace("tile", "").replace("fluid", "").replace("name", "").replace("block", "").replace(".", ""); + //GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""), UtilsItems.getSimpleStack(this)); + } + + public int getRenderColor(final int aMeta) { + return this.blockColour; + } + + @Override + public String getItemStackDisplayName(final ItemStack iStack) { + /*if (this.thisFluid != null){ + this.name = "Molten "+this.thisFluid.getLocalizedName(); + return this.name; + }*/ + this.name = "Molten "+this.baseBlock.getLocalizedName().replace("tile", "").replace("fluid", "").replace("name", "").replace("block", "").replace(".", ""); + return this.name; + } + + @Override + public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) { + if (this.blockColour == 0){ + return MathUtils.generateSingularRandomHexValue(); + } + return this.blockColour; + } + + @Override + public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { + /*list.add("Temperature: "+MathUtils.celsiusToKelvin(this.thisFluid.getMeltingPointC())+"K"); + if (this.sRadiation > 0){ + list.add(CORE.GT_Tooltip_Radioactive); + }*/ + super.addInformation(stack, aPlayer, list, bool); + } + +} diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java deleted file mode 100644 index 84fae41bb0..0000000000 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java +++ /dev/null @@ -1,78 +0,0 @@ -package gtPlusPlus.core.item.base.itemblock; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -import gtPlusPlus.core.fluids.BlockFluidBase; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; - -public class ItemBlockFluid extends ItemBlock{ - - protected final int blockColour; - protected final int sRadiation; - protected Material thisFluid; - final BlockFluidBase baseBlock; - String name; - - public ItemBlockFluid(final Block block) { - super(block); - this.baseBlock = (BlockFluidBase) block; - this.blockColour = this.baseBlock.getRenderColor(1); - this.thisFluid = this.baseBlock.getFluidMaterial(); - this.sRadiation=ItemUtils.getRadioactivityLevel(this.baseBlock.getUnlocalizedName()); - this.name = this.baseBlock.getLocalizedName().replace("tile", "").replace("fluid", "").replace("name", "").replace("block", "").replace(".", ""); - //GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""), UtilsItems.getSimpleStack(this)); - } - - public final Material setFluidMaterial(final Material M){ - return this.thisFluid=M; - } - - public int getRenderColor(final int aMeta) { - return this.blockColour; - } - - @Override - public String getItemStackDisplayName(final ItemStack iStack) { - if (this.thisFluid != null){ - this.name = "Molten "+this.thisFluid.getLocalizedName(); - return this.name; - } - this.name = "Molten "+this.baseBlock.getLocalizedName().replace("tile", "").replace("fluid", "").replace("name", "").replace("block", "").replace(".", ""); - return this.name; - } - - @Override - public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) { - if (this.blockColour == 0){ - return MathUtils.generateSingularRandomHexValue(); - } - return this.blockColour; - - } - - @Override - public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - list.add("Temperature: "+MathUtils.celsiusToKelvin(this.thisFluid.getMeltingPointC())+"K"); - if (this.sRadiation > 0){ - list.add(CORE.GT_Tooltip_Radioactive); - } - super.addInformation(stack, aPlayer, list, bool); - } - - public String GetProperName() { - String tempIngot; - - tempIngot = "Molten "+this.baseBlock.getLocalizedName(); - - return tempIngot; - } - -} -- cgit From 12ce668c351be6107433ad0ce902ed0df61ff998 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Thu, 14 Mar 2019 04:18:51 +0000 Subject: + Added crafting recipe for Biocomposite Collector. $ Minor fixes. --- src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Java/gtPlusPlus/core/item/base') diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java index 1d48bbbbf9..d55ee6b707 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java @@ -15,7 +15,7 @@ public class ItemBlockMeta extends ItemBlockWithMetadata { super(p_i45326_1_, p_i45326_1_); this.mBlock = p_i45326_1_; - this.setMaxDamage(0); + this.setMaxDamage(15); this.setHasSubtypes(true); } -- cgit From 2ef253ff474723d136a607c293bee44e67f634aa Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Thu, 14 Mar 2019 05:00:44 +0000 Subject: - Removed recipe for crafting XP Convertor. $ More small fixes & general QoL improvements for the Biocomposite Collector & it's simpler counterpart. --- .../core/item/base/itemblock/ItemBlockMeta.java | 77 ++++++++++++++++++++-- 1 file changed, 73 insertions(+), 4 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item/base') diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java index d55ee6b707..c271ab39d0 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java @@ -1,8 +1,14 @@ package gtPlusPlus.core.item.base.itemblock; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - +import gtPlusPlus.api.interfaces.ITileTooltip; +import gtPlusPlus.api.objects.data.AutoMap; import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlockWithMetadata; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; @@ -10,13 +16,36 @@ import net.minecraft.util.IIcon; public class ItemBlockMeta extends ItemBlockWithMetadata { private final Block mBlock; + private HashMap> aTooltips = new LinkedHashMap>(); - public ItemBlockMeta(final Block p_i45326_1_) + public ItemBlockMeta(final Block aBlock) { - super(p_i45326_1_, p_i45326_1_); - this.mBlock = p_i45326_1_; + super(aBlock, aBlock); + this.mBlock = aBlock; this.setMaxDamage(15); this.setHasSubtypes(true); + if (aBlock instanceof ITileTooltip) { + ITileTooltip aTooltip = (ITileTooltip) aBlock; + //aTooltips.put(aTooltip.getTooltipID(), aTooltip.getTooltipMap()); + } + } + + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { + Block aThis = Block.getBlockFromItem(stack.getItem()); + if (aThis != null) { + if (!aTooltips.isEmpty()) { + AutoMap h = aTooltips.get(stack.getItemDamage()); + if (h != null && !h.isEmpty()) { + for (String s : h) { + list.add(s); + } + } + } + } + super.addInformation(stack, aPlayer, list, bool); } /** @@ -42,4 +71,44 @@ public class ItemBlockMeta extends ItemBlockWithMetadata public String getUnlocalizedName(final ItemStack stack) { return this.getUnlocalizedName() + "." + stack.getItemDamage(); } + + @Override + public boolean isDamageable() { + return false; + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) { + return false; + } + + @Override + public boolean isBookEnchantable(ItemStack stack, ItemStack book) { + return false; + } + + @Override + public int getDisplayDamage(ItemStack stack) { + return 0; + } + + @Override + public boolean showDurabilityBar(ItemStack stack) { + return false; + } + + @Override + public double getDurabilityForDisplay(ItemStack stack) { + return 0; + } + + @Override + public int getItemEnchantability(ItemStack stack) { + return 0; + } } \ No newline at end of file -- cgit From 0cb924d25dd80c22d000898fb27ab3ed0e0f80fb Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Thu, 14 Mar 2019 18:16:17 +0000 Subject: + Added Bombs. % Made RAW collectors produce 10x less. $ Fixed tooltips on RAW collectors. $ Fixed a bug regarding STARTUP_PHASE. --- src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Java/gtPlusPlus/core/item/base') diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java index c271ab39d0..b26ac67225 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java @@ -22,7 +22,7 @@ public class ItemBlockMeta extends ItemBlockWithMetadata { super(aBlock, aBlock); this.mBlock = aBlock; - this.setMaxDamage(15); + this.setMaxDamage(0); this.setHasSubtypes(true); if (aBlock instanceof ITileTooltip) { ITileTooltip aTooltip = (ITileTooltip) aBlock; -- cgit