aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorJakub <53441451+kuba6000@users.noreply.github.com>2022-08-25 19:58:55 +0200
committerGitHub <noreply@github.com>2022-08-25 19:58:55 +0200
commit0618db983f399da0556aae55179906504100a663 (patch)
tree56222b0bd035f94386bb26586babe432b4a70304 /src/main/java
parent6a2b3f3dea2071b4c459106496621c655df98e6c (diff)
downloadGT5-Unofficial-0618db983f399da0556aae55179906504100a663.tar.gz
GT5-Unofficial-0618db983f399da0556aae55179906504100a663.tar.bz2
GT5-Unofficial-0618db983f399da0556aae55179906504100a663.zip
Add Secret Tea collection (#10)
* Licensing stuff * Turbo Legendary Secret Tea Collection * Turbo Legendary Secret Tea Collection * ᲼᲼
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/kubatech/CommonProxy.java3
-rw-r--r--src/main/java/kubatech/api/ConstructableItemStack.java19
-rw-r--r--src/main/java/kubatech/api/enums/ItemList.java16
-rw-r--r--src/main/java/kubatech/api/mobhandler/MobDrop.java19
-rw-r--r--src/main/java/kubatech/api/network/CustomTileEntityPacket.java19
-rw-r--r--src/main/java/kubatech/api/tileentity/CustomTileEntityPacketHandler.java19
-rw-r--r--src/main/java/kubatech/api/utils/FastRandom.java19
-rw-r--r--src/main/java/kubatech/api/utils/GSONUtils.java19
-rw-r--r--src/main/java/kubatech/api/utils/ItemID.java19
-rw-r--r--src/main/java/kubatech/api/utils/MobUtils.java19
-rw-r--r--src/main/java/kubatech/commands/CommandHelp.java3
-rw-r--r--src/main/java/kubatech/config/OverridesConfig.java24
-rw-r--r--src/main/java/kubatech/kubatech.java24
-rw-r--r--src/main/java/kubatech/loaders/ItemLoader.java48
-rw-r--r--src/main/java/kubatech/loaders/item/ItemProxy.java84
-rw-r--r--src/main/java/kubatech/loaders/item/KubaItems.java145
-rw-r--r--src/main/java/kubatech/loaders/item/items/Tea.java193
-rw-r--r--src/main/java/kubatech/loaders/item/items/TeaUltimate.java67
-rw-r--r--src/main/java/kubatech/mixin/Mixin.java2
-rw-r--r--src/main/java/kubatech/mixin/MixinPlugin.java2
-rw-r--r--src/main/java/kubatech/nei/Mob_Handler.java4
-rw-r--r--src/main/java/kubatech/nei/NEI_Config.java16
22 files changed, 777 insertions, 6 deletions
diff --git a/src/main/java/kubatech/CommonProxy.java b/src/main/java/kubatech/CommonProxy.java
index db752f9fa0..6f9a187cc2 100644
--- a/src/main/java/kubatech/CommonProxy.java
+++ b/src/main/java/kubatech/CommonProxy.java
@@ -19,6 +19,8 @@
package kubatech;
+import static kubatech.loaders.ItemLoader.RegisterItems;
+
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.*;
import kubatech.commands.CommandConfig;
@@ -36,6 +38,7 @@ public class CommonProxy {
Config.synchronizeConfiguration();
RecipeLoader.addRecipes();
FMLCommonHandler.instance().bus().register(new FMLEventHandler());
+ RegisterItems();
}
public void init(FMLInitializationEvent event) {}
diff --git a/src/main/java/kubatech/api/ConstructableItemStack.java b/src/main/java/kubatech/api/ConstructableItemStack.java
index 668d21d803..728e7299cd 100644
--- a/src/main/java/kubatech/api/ConstructableItemStack.java
+++ b/src/main/java/kubatech/api/ConstructableItemStack.java
@@ -1,3 +1,22 @@
+/*
+ * KubaTech - Gregtech Addon
+ * Copyright (C) 2022 kuba6000
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
package kubatech.api;
import cpw.mods.fml.common.registry.GameRegistry;
diff --git a/src/main/java/kubatech/api/enums/ItemList.java b/src/main/java/kubatech/api/enums/ItemList.java
index b0cf3289b6..270faf39cc 100644
--- a/src/main/java/kubatech/api/enums/ItemList.java
+++ b/src/main/java/kubatech/api/enums/ItemList.java
@@ -14,7 +14,21 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public enum ItemList implements IItemContainer {
- ExtremeExterminationChamber;
+ ExtremeExterminationChamber,
+ BlackTea,
+ ButterflyTea,
+ EarlGrayTea,
+ GreenTea,
+ LemonTea,
+ MilkTea,
+ OolongTea,
+ PeppermintTea,
+ PuerhTea,
+ RedTea,
+ WhiteTea,
+ YellowTea,
+ UltimateTea,
+ ;
private ItemStack mStack;
private boolean mHasNotBeenSet = true;
diff --git a/src/main/java/kubatech/api/mobhandler/MobDrop.java b/src/main/java/kubatech/api/mobhandler/MobDrop.java
index 76942b3148..247c73a2be 100644
--- a/src/main/java/kubatech/api/mobhandler/MobDrop.java
+++ b/src/main/java/kubatech/api/mobhandler/MobDrop.java
@@ -1,3 +1,22 @@
+/*
+ * KubaTech - Gregtech Addon
+ * Copyright (C) 2022 kuba6000
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
package kubatech.api.mobhandler;
import io.netty.buffer.ByteBuf;
diff --git a/src/main/java/kubatech/api/network/CustomTileEntityPacket.java b/src/main/java/kubatech/api/network/CustomTileEntityPacket.java
index cd7bfd3389..9a3df765d2 100644
--- a/src/main/java/kubatech/api/network/CustomTileEntityPacket.java
+++ b/src/main/java/kubatech/api/network/CustomTileEntityPacket.java
@@ -1,3 +1,22 @@
+/*
+ * KubaTech - Gregtech Addon
+ * Copyright (C) 2022 kuba6000
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
package kubatech.api.network;
import cpw.mods.fml.common.network.NetworkRegistry;
diff --git a/src/main/java/kubatech/api/tileentity/CustomTileEntityPacketHandler.java b/src/main/java/kubatech/api/tileentity/CustomTileEntityPacketHandler.java
index 643ca70d0f..4208ea92fe 100644
--- a/src/main/java/kubatech/api/tileentity/CustomTileEntityPacketHandler.java
+++ b/src/main/java/kubatech/api/tileentity/CustomTileEntityPacketHandler.java
@@ -1,3 +1,22 @@
+/*
+ * KubaTech - Gregtech Addon
+ * Copyright (C) 2022 kuba6000
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
package kubatech.api.tileentity;
import kubatech.api.network.CustomTileEntityPacket;
diff --git a/src/main/java/kubatech/api/utils/FastRandom.java b/src/main/java/kubatech/api/utils/FastRandom.java
index c0fb1ec9d5..0927dee6c0 100644
--- a/src/main/java/kubatech/api/utils/FastRandom.java
+++ b/src/main/java/kubatech/api/utils/FastRandom.java
@@ -1,3 +1,22 @@
+/*
+ * KubaTech - Gregtech Addon
+ * Copyright (C) 2022 kuba6000
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
package kubatech.api.utils;
import java.util.Random;
diff --git a/src/main/java/kubatech/api/utils/GSONUtils.java b/src/main/java/kubatech/api/utils/GSONUtils.java
index 90f777000c..2936aee2b2 100644
--- a/src/main/java/kubatech/api/utils/GSONUtils.java
+++ b/src/main/java/kubatech/api/utils/GSONUtils.java
@@ -1,3 +1,22 @@
+/*
+ * KubaTech - Gregtech Addon
+ * Copyright (C) 2022 kuba6000
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
package kubatech.api.utils;
import com.google.gson.*;
diff --git a/src/main/java/kubatech/api/utils/ItemID.java b/src/main/java/kubatech/api/utils/ItemID.java
index 932c45a0f9..a452021bad 100644
--- a/src/main/java/kubatech/api/utils/ItemID.java
+++ b/src/main/java/kubatech/api/utils/ItemID.java
@@ -1,3 +1,22 @@
+/*
+ * KubaTech - Gregtech Addon
+ * Copyright (C) 2022 kuba6000
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
package kubatech.api.utils;
import java.util.Objects;
diff --git a/src/main/java/kubatech/api/utils/MobUtils.java b/src/main/java/kubatech/api/utils/MobUtils.java
index 0b20364484..a82b336190 100644
--- a/src/main/java/kubatech/api/utils/MobUtils.java
+++ b/src/main/java/kubatech/api/utils/MobUtils.java
@@ -1,3 +1,22 @@
+/*
+ * KubaTech - Gregtech Addon
+ * Copyright (C) 2022 kuba6000
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
package kubatech.api.utils;
import cpw.mods.fml.relauncher.Side;
diff --git a/src/main/java/kubatech/commands/CommandHelp.java b/src/main/java/kubatech/commands/CommandHelp.java
index dba8ab622d..8f9c19c42e 100644
--- a/src/main/java/kubatech/commands/CommandHelp.java
+++ b/src/main/java/kubatech/commands/CommandHelp.java
@@ -19,7 +19,8 @@
package kubatech.commands;
-import static kubatech.commands.CommandHelp.Translations.*;
+import static kubatech.commands.CommandHelp.Translations.POSSIBLE_COMMANDS;
+import static kubatech.commands.CommandHelp.Translations.USAGE;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
diff --git a/src/main/java/kubatech/config/OverridesConfig.java b/src/main/java/kubatech/config/OverridesConfig.java
index 0ea7a318f7..7d149fef81 100644
--- a/src/main/java/kubatech/config/OverridesConfig.java
+++ b/src/main/java/kubatech/config/OverridesConfig.java
@@ -1,3 +1,22 @@
+/*
+ * KubaTech - Gregtech Addon
+ * Copyright (C) 2022 kuba6000
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
package kubatech.config;
import com.dreammaster.main.MainRegistry;
@@ -12,7 +31,10 @@ import java.io.File;
import java.io.Reader;
import java.io.Writer;
import java.nio.charset.StandardCharsets;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import kubatech.Tags;
import kubatech.api.ConstructableItemStack;
import kubatech.api.LoaderReference;
diff --git a/src/main/java/kubatech/kubatech.java b/src/main/java/kubatech/kubatech.java
index 6973c281b4..6a19eb3721 100644
--- a/src/main/java/kubatech/kubatech.java
+++ b/src/main/java/kubatech/kubatech.java
@@ -19,6 +19,8 @@
package kubatech;
+import static kubatech.api.enums.ItemList.RedTea;
+
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.*;
@@ -26,6 +28,9 @@ import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import cpw.mods.fml.relauncher.Side;
import kubatech.api.network.CustomTileEntityPacket;
import kubatech.api.network.LoadConfigPacket;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -42,6 +47,25 @@ public class kubatech {
public static kubatech instance = null;
public static final SimpleNetworkWrapper NETWORK = new SimpleNetworkWrapper(Tags.MODID);
+ public static final CreativeTabs KT = new CreativeTabs(Tags.MODID) {
+ private ItemStack iconItemStack = null;
+
+ @Override
+ public ItemStack getIconItemStack() {
+ if (iconItemStack == null) iconItemStack = RedTea.get(1);
+ return iconItemStack;
+ }
+
+ @Override
+ public Item getTabIconItem() {
+ return null;
+ }
+
+ @Override
+ public String getTranslatedTabLabel() {
+ return Tags.MODNAME;
+ }
+ };
static {
NETWORK.registerMessage(new LoadConfigPacket.Handler(), LoadConfigPacket.class, 0, Side.CLIENT);
diff --git a/src/main/java/kubatech/loaders/ItemLoader.java b/src/main/java/kubatech/loaders/ItemLoader.java
new file mode 100644
index 0000000000..940f5274f9
--- /dev/null
+++ b/src/main/java/kubatech/loaders/ItemLoader.java
@@ -0,0 +1,48 @@
+/*
+ * KubaTech - Gregtech Addon
+ * Copyright (C) 2022 kuba6000
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+package kubatech.loaders;
+
+import static kubatech.api.enums.ItemList.*;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import kubatech.loaders.item.KubaItems;
+import kubatech.loaders.item.items.Tea;
+import kubatech.loaders.item.items.TeaUltimate;
+
+public class ItemLoader {
+ public static final KubaItems kubaitems = new KubaItems();
+
+ public static void RegisterItems() {
+ GameRegistry.registerItem(kubaitems, "kubaitems");
+ BlackTea.set(kubaitems.registerProxyItem(new Tea("black_tea")));
+ ButterflyTea.set(kubaitems.registerProxyItem(new Tea("butterfly_tea")));
+ EarlGrayTea.set(kubaitems.registerProxyItem(new Tea("earl_gray_tea")));
+ GreenTea.set(kubaitems.registerProxyItem(new Tea("green_tea")));
+ LemonTea.set(kubaitems.registerProxyItem(new Tea("lemon_tea")));
+ MilkTea.set(kubaitems.registerProxyItem(new Tea("milk_tea")));
+ OolongTea.set(kubaitems.registerProxyItem(new Tea("oolong_tea")));
+ PeppermintTea.set(kubaitems.registerProxyItem(new Tea("peppermint_tea")));
+ PuerhTea.set(kubaitems.registerProxyItem(new Tea("pu-erh_tea")));
+ RedTea.set(kubaitems.registerProxyItem(new Tea("red_tea")));
+ WhiteTea.set(kubaitems.registerProxyItem(new Tea("white_tea")));
+ YellowTea.set(kubaitems.registerProxyItem(new Tea("yellow_tea")));
+ UltimateTea.set(kubaitems.registerProxyItem(new TeaUltimate()));
+ }
+}
diff --git a/src/main/java/kubatech/loaders/item/ItemProxy.java b/src/main/java/kubatech/loaders/item/ItemProxy.java
new file mode 100644
index 0000000000..67491a0ba8
--- /dev/null
+++ b/src/main/java/kubatech/loaders/item/ItemProxy.java
@@ -0,0 +1,84 @@
+/*
+ * KubaTech - Gregtech Addon
+ * Copyright (C) 2022 kuba6000
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+package kubatech.loaders.item;
+
+import java.util.List;
+import kubatech.Tags;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.EnumAction;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+
+public class ItemProxy {
+ private final String unlocalizedName;
+ private final String texturepath;
+ private IIcon icon;
+ private int itemID;
+
+ public ItemProxy(String unlocalizedName, String texture) {
+ this.unlocalizedName = "item.kubaitem." + unlocalizedName;
+ texturepath = Tags.MODID + ":" + texture;
+ }
+
+ public void ItemInit(int index) {
+ itemID = index;
+ }
+
+ public String getUnlocalizedName() {
+ return unlocalizedName;
+ }
+
+ public String getDisplayName(ItemStack stack) {
+ return StatCollector.translateToLocal(this.unlocalizedName + ".name").trim();
+ }
+
+ public void registerIcon(IIconRegister iconRegister) {
+ icon = iconRegister.registerIcon(texturepath);
+ }
+
+ public IIcon getIcon() {
+ return icon;
+ }
+
+ public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {}
+
+ public void onUpdate(
+ ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {}
+
+ public EnumAction getItemUseAction(ItemStack p_77661_1_) {
+ return EnumAction.none;
+ }
+
+ public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
+ return p_77659_1_;
+ }
+
+ public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) {
+ return p_77654_1_;
+ }
+
+ public int getMaxItemUseDuration() {
+ return 0;
+ }
+}
diff --git a/src/main/java/kubatech/loaders/item/KubaItems.java b/src/main/java/kubatech/loaders/item/KubaItems.java
new file mode 100644
index 0000000000..fdc38ec0ba
--- /dev/null
+++ b/src/main/java/kubatech/loaders/item/KubaItems.java
@@ -0,0 +1,145 @@
+/*
+ * KubaTech - Gregtech Addon
+ * Copyright (C) 2022 kuba6000
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+package kubatech.loaders.item;
+
+import static kubatech.kubatech.KT;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import java.util.HashMap;
+import java.util.List;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.EnumAction;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.World;
+
+public class KubaItems extends Item {
+ private static final HashMap<Integer, ItemProxy> items = new HashMap<>();
+ private static int idCounter = 0;
+
+ public KubaItems() {
+ this.setMaxDamage(0);
+ this.setHasSubtypes(true);
+ this.setCreativeTab(KT);
+ this.setUnlocalizedName("kubaitems");
+ }
+
+ public ItemStack registerProxyItem(ItemProxy item) {
+ items.put(idCounter, item);
+ item.ItemInit(idCounter);
+ return new ItemStack(this, 1, idCounter++);
+ }
+
+ private ItemProxy getItem(ItemStack stack) {
+ return items.get(stack.getItemDamage());
+ }
+
+ private ItemProxy getItem(int damage) {
+ return items.get(damage);
+ }
+
+ @Override
+ public boolean onItemUse(
+ ItemStack p_77648_1_,
+ EntityPlayer p_77648_2_,
+ World p_77648_3_,
+ int p_77648_4_,
+ int p_77648_5_,
+ int p_77648_6_,
+ int p_77648_7_,
+ float p_77648_8_,
+ float p_77648_9_,
+ float p_77648_10_) {
+ return false;
+ }
+
+ @Override
+ public EnumAction getItemUseAction(ItemStack p_77661_1_) {
+ return getItem(p_77661_1_).getItemUseAction(p_77661_1_);
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
+ return getItem(p_77659_1_).onItemRightClick(p_77659_1_, p_77659_2_, p_77659_3_);
+ }
+
+ @Override
+ public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) {
+ return getItem(p_77654_1_).onEaten(p_77654_1_, p_77654_2_, p_77654_3_);
+ }
+
+ @Override
+ public int getMaxItemUseDuration(ItemStack p_77626_1_) {
+ return getItem(p_77626_1_).getMaxItemUseDuration();
+ }
+
+ @Override
+ public int getMetadata(int p_77647_1_) {
+ return p_77647_1_;
+ }
+
+ @Override
+ public String getUnlocalizedName() {
+ return super.getUnlocalizedName();
+ }
+
+ @Override
+ public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
+ getItem(p_77624_1_).addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_);
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack p_77667_1_) {
+ return getItem(p_77667_1_).getUnlocalizedName();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+ return getItem(p_77653_1_).getDisplayName(p_77653_1_);
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void registerIcons(IIconRegister p_94581_1_) {
+ items.values().forEach(t -> t.registerIcon(p_94581_1_));
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public IIcon getIconFromDamage(int damage) {
+ return getItem(damage).getIcon();
+ }
+
+ @Override
+ public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) {
+ for (int i = 0; i < items.size(); i++) p_150895_3_.add(new ItemStack(p_150895_1_, 1, i));
+ }
+
+ @Override
+ public void onUpdate(
+ ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
+ getItem(p_77663_1_).onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_);
+ }
+}
diff --git a/src/main/java/kubatech/loaders/item/items/Tea.java b/src/main/java/kubatech/loaders/item/items/Tea.java
new file mode 100644
index 0000000000..d9f39bc06f
--- /dev/null
+++ b/src/main/java/kubatech/loaders/item/items/Tea.java
@@ -0,0 +1,193 @@
+/*
+ * KubaTech - Gregtech Addon
+ * Copyright (C) 2022 kuba6000
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+package kubatech.loaders.item.items;
+
+import java.util.LinkedList;
+import java.util.List;
+import kubatech.api.utils.ModUtils;
+import kubatech.loaders.ItemLoader;
+import kubatech.loaders.item.ItemProxy;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.entity.EntityClientPlayerMP;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.EnumAction;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.stats.Achievement;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+import net.minecraftforge.common.AchievementPage;
+
+public class Tea extends ItemProxy {
+ protected static TeaPage teapage;
+ protected static LinkedList<Achievement> achievements;
+ protected Achievement achievement;
+ private final String achievementname;
+
+ public Tea(String unlocalizedName) {
+ super("teacollection." + unlocalizedName, "teacollection/" + unlocalizedName);
+ achievementname = "teacollection." + unlocalizedName;
+ }
+
+ private static final int[][] achievement_poses = new int[][] {
+ {0, 0},
+ {2, 0},
+ {3, 1},
+ {4, 2},
+ {4, 4},
+ {3, 5},
+ {2, 6},
+ {0, 6},
+ {-1, 5},
+ {-2, 4},
+ {-2, 2},
+ {-1, 1},
+ {1, 3}
+ };
+
+ @Override
+ public void ItemInit(int index) {
+ super.ItemInit(index);
+ if (teapage == null) {
+ teapage = new TeaPage();
+ AchievementPage.registerAchievementPage(teapage);
+ achievements = teapage.getAchievementsOriginal();
+ }
+ achievements.add(
+ achievement = new Achievement(
+ achievementname,
+ achievementname,
+ achievement_poses[index][0],
+ achievement_poses[index][1],
+ new ItemStack(ItemLoader.kubaitems, 1, index),
+ null)
+ .registerStat());
+ }
+
+ @Override
+ public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
+ if (p_77624_1_.