aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/glease/ggfab/items
diff options
context:
space:
mode:
authorNotAPenguin <michiel.vandeginste@gmail.com>2024-09-02 23:17:17 +0200
committerGitHub <noreply@github.com>2024-09-02 23:17:17 +0200
commit1b820de08a05070909a267e17f033fcf58ac8710 (patch)
tree02831a025986a06b20f87e5bcc69d1e0c639a342 /src/main/java/net/glease/ggfab/items
parentafd3fd92b6a6ab9ab0d0dc3214e6bc8ff7a86c9b (diff)
downloadGT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.gz
GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.bz2
GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.zip
The Great Renaming (#3014)
* move kekztech to a single root dir * move detrav to a single root dir * move gtnh-lanthanides to a single root dir * move tectech and delete some gross reflection in gt++ * remove more reflection inside gt5u * delete more reflection in gt++ * fix imports * move bartworks and bwcrossmod * fix proxies * move galactigreg and ggfab * move gtneioreplugin * try to fix gt++ bee loader * apply the rename rules to BW * apply rename rules to bwcrossmod * apply rename rules to detrav scanner mod * apply rename rules to galacticgreg * apply rename rules to ggfab * apply rename rules to goodgenerator * apply rename rules to gtnh-lanthanides * apply rename rules to gt++ * apply rename rules to kekztech * apply rename rules to kubatech * apply rename rules to tectech * apply rename rules to gt apply the rename rules to gt * fix tt import * fix mui hopefully * fix coremod except intergalactic * rename assline recipe class * fix a class name i stumbled on * rename StructureUtility to GTStructureUtility to prevent conflict with structurelib * temporary rename of GTTooltipDataCache to old name * fix gt client/server proxy names
Diffstat (limited to 'src/main/java/net/glease/ggfab/items')
-rw-r--r--src/main/java/net/glease/ggfab/items/GGMetaItem_DumbItems.java153
1 files changed, 0 insertions, 153 deletions
diff --git a/src/main/java/net/glease/ggfab/items/GGMetaItem_DumbItems.java b/src/main/java/net/glease/ggfab/items/GGMetaItem_DumbItems.java
deleted file mode 100644
index 20a81a5abb..0000000000
--- a/src/main/java/net/glease/ggfab/items/GGMetaItem_DumbItems.java
+++ /dev/null
@@ -1,153 +0,0 @@
-package net.glease.ggfab.items;
-
-import static gregtech.api.enums.GT_Values.D1;
-
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.List;
-
-import net.glease.ggfab.GGConstants;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gnu.trove.map.TIntObjectMap;
-import gnu.trove.map.hash.TIntObjectHashMap;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.SubTag;
-import gregtech.api.enums.TC_Aspects;
-import gregtech.api.interfaces.IItemBehaviour;
-import gregtech.api.interfaces.IItemContainer;
-import gregtech.api.items.GT_MetaBase_Item;
-import gregtech.api.objects.ItemData;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
-
-// mostly stolen from gt5 itself.
-public class GGMetaItem_DumbItems extends GT_MetaBase_Item {
-
- public static final int MAX_ID = 32766;
- private final BitSet mEnabledItems = new BitSet();
- private final BitSet mVisibleItems = new BitSet();
- private final ArrayList<IIcon> mIconList = new ArrayList<>();
- private final TIntObjectMap<IItemContainer> mIconOverride = new TIntObjectHashMap<>();
-
- public GGMetaItem_DumbItems(String aUnlocalized) {
- super(aUnlocalized);
- }
-
- /**
- * This adds a Custom Item to the ending Range.
- *
- * @param aID The Id of the assigned Item [0 - mItemAmount] (The MetaData gets auto-shifted by +mOffset)
- * @param aEnglish The Default Localized Name of the created Item
- * @param aToolTip The Default ToolTip of the created Item, you can also insert null for having no ToolTip
- * @param aRandomData The OreDict Names you want to give the Item. Also used for TC Aspects and some other things.
- * @return An ItemStack containing the newly created Item.
- */
- public final ItemStack addItem(int aID, String aEnglish, String aToolTip, Object... aRandomData) {
- if (aID < 0 || aID > MAX_ID) return null;
-
- if (aToolTip == null) aToolTip = "";
- ItemStack rStack = new ItemStack(this, 1, aID);
- mEnabledItems.set(aID);
- mVisibleItems.set(aID);
- GT_LanguageManager.addStringLocalization(getUnlocalizedName(rStack) + ".name", aEnglish);
- GT_LanguageManager.addStringLocalization(getUnlocalizedName(rStack) + ".tooltip", aToolTip);
- List<TC_Aspects.TC_AspectStack> tAspects = new ArrayList<>();
- // Important Stuff to do first
- for (Object tRandomData : aRandomData) if (tRandomData instanceof SubTag) {
- if (tRandomData == SubTag.INVISIBLE) {
- mVisibleItems.set(aID, false);
- continue;
- }
- if (tRandomData == SubTag.NO_UNIFICATION) {
- GT_OreDictUnificator.addToBlacklist(rStack);
- }
- }
- // now check for the rest
- for (Object tRandomData : aRandomData) if (tRandomData != null) {
- boolean tUseOreDict = true;
- if (tRandomData instanceof IItemBehaviour) {
- @SuppressWarnings("unchecked")
- IItemBehaviour<GT_MetaBase_Item> behavior = (IItemBehaviour<GT_MetaBase_Item>) tRandomData;
- addItemBehavior(aID, behavior);
- tUseOreDict = false;
- }
- if (tRandomData instanceof IItemContainer) {
- ((IItemContainer) tRandomData).set(rStack);
- tUseOreDict = false;
- }
- if (tRandomData instanceof SubTag) {
- continue;
- }
- if (tRandomData instanceof IItemContainer) {
- mIconOverride.put(aID, (IItemContainer) tRandomData);
- } else if (tRandomData instanceof TC_Aspects.TC_AspectStack) {
- ((TC_Aspects.TC_AspectStack) tRandomData).addToAspectList(tAspects);
- } else if (tRandomData instanceof ItemData) {
- if (GT_Utility.isStringValid(tRandomData)) {
- GT_OreDictUnificator.registerOre(tRandomData, rStack);
- } else {
- GT_OreDictUnificator.addItemData(rStack, (ItemData) tRandomData);
- }
- } else if (tUseOreDict) {
- GT_OreDictUnificator.registerOre(tRandomData, rStack);
- }
- }
- if (GregTech_API.sThaumcraftCompat != null)
- GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false);
- return rStack;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public final void registerIcons(IIconRegister aIconRegister) {
- short j = (short) mEnabledItems.length();
- mIconList.clear();
- mIconList.ensureCapacity(j);
- for (short i = 0; i < j; i++) {
- if (mEnabledItems.get(i)) {
- mIconList.add(aIconRegister.registerIcon(GGConstants.RES_PATH_ITEM + getUnlocalizedName() + "/" + i));
- } else {
- mIconList.add(null);
- }
- }
- }
-
- @Override
- public IIcon getIconFromDamage(int aMetaData) {
- if (aMetaData < 0 || aMetaData >= mIconList.size() || mIconList.get(aMetaData) == null)
- return super.getIconFromDamage(aMetaData);
- return mIconList.get(aMetaData);
- }
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- @SideOnly(Side.CLIENT)
- public void getSubItems(Item aItem, CreativeTabs aCreativeTab, List aList) {
- int j = mEnabledItems.length();
- for (int i = 0; i < j; i++) {
- if (mVisibleItems.get(i) || (D1 && mEnabledItems.get(i))) {
- ItemStack tStack = new ItemStack(this, 1, i);
- isItemStackUsable(tStack);
- aList.add(tStack);
- }
- }
- }
-
- @Override
- public Long[] getElectricStats(ItemStack aStack) {
- return null;
- }
-
- @Override
- public Long[] getFluidContainerStats(ItemStack aStack) {
- return null;
- }
-}