diff options
35 files changed, 374 insertions, 3115 deletions
diff --git a/dependencies.gradle b/dependencies.gradle index 67de402103..4b53241655 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -35,16 +35,17 @@ */ dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.82:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.95:dev') api("com.github.GTNewHorizons:EnderCore:0.2.16:dev") api("com.github.GTNewHorizons:EnderIO:2.4.18:dev") - api("com.github.GTNewHorizons:ForestryMC:4.6.7:dev") - api("com.github.GTNewHorizons:ModularUI:1.1.10:dev") + api("com.github.GTNewHorizons:ForestryMC:4.6.8:dev") + api("com.github.GTNewHorizons:ModularUI:1.1.12:dev") + api("com.github.GTNewHorizons:Mobs-Info:0.0.2-GTNH:dev") devOnlyNonPublishable("com.github.GTNewHorizons:Infernal-Mobs:1.7.9-GTNH:dev") //compileOnly("curse.maven:extrautilities-225561:2264384") { // transitive = false //} - compileOnly("com.github.GTNewHorizons:GTplusplus:1.9.38:dev") + compileOnly("com.github.GTNewHorizons:GTplusplus:1.9.49:dev") { transitive = false } @@ -60,11 +61,11 @@ dependencies { { transitive = false } - compileOnly("com.github.GTNewHorizons:bartworks:0.7.17:dev") + compileOnly("com.github.GTNewHorizons:bartworks:0.7.20:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.1.50:dev") + compileOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.1.62:dev") { transitive = false } @@ -83,16 +84,16 @@ dependencies { // For testing //runtimeOnly("com.github.GTNewHorizons:BetterLoadingScreen:1.4.1-GTNH:dev") - //runtimeOnly("com.github.GTNewHorizons:GTplusplus:1.9.38:dev") + //runtimeOnly("com.github.GTNewHorizons:GTplusplus:1.9.49:dev") //runtimeOnly("com.github.GTNewHorizons:harvestcraft:1.1.0-GTNH:dev") - //runtimeOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.1.50:dev") + //runtimeOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.1.62:dev") //runtimeOnly("com.github.GTNewHorizons:OpenBlocks:1.7.0-GTNH:dev") - //runtimeOnly("com.github.GTNewHorizons:bartworks:0.7.17:dev") + //runtimeOnly("com.github.GTNewHorizons:bartworks:0.7.20:dev") //runtimeOnly("com.github.GTNewHorizons:CraftTweaker:3.2.12:dev") //api("com.github.GTNewHorizons:SpecialMobs:3.4.0:dev") //api("com.github.GTNewHorizons:twilightforest:2.4.3:dev") //api("com.github.GTNewHorizons:EnderZoo:1.0.23:dev") - //runtimeOnly("com.github.GTNewHorizons:Draconic-Evolution:1.1.16-GTNH:dev") + //runtimeOnly("com.github.GTNewHorizons:Draconic-Evolution:1.1.19-GTNH:dev") //runtimeOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") //runtimeOnly("com.github.GTNewHorizons:BloodMagic:1.4.1:dev") //api("curse.maven:witchery-69673:2234410") diff --git a/repositories.gradle b/repositories.gradle index 92bcd9fb22..8329248cf4 100644 --- a/repositories.gradle +++ b/repositories.gradle @@ -2,25 +2,6 @@ repositories { maven { - name = "GTNH Maven" - url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" - } - maven { - name = "ic2" - url = "http://maven.ic2.player.to/" - metadataSources { - mavenPom() - artifact() - } - } - maven { - url "https://cursemaven.com" - } - maven { - name = "jitpack.io" - url = "https://jitpack.io" - } - maven { url 'https://repo.openmods.info/artifactory/openmods/' } } diff --git a/src/main/java/kubatech/ClientProxy.java b/src/main/java/kubatech/ClientProxy.java index 99e9661e33..4d53d945e4 100644 --- a/src/main/java/kubatech/ClientProxy.java +++ b/src/main/java/kubatech/ClientProxy.java @@ -30,7 +30,6 @@ import cpw.mods.fml.common.event.FMLServerStartingEvent; import cpw.mods.fml.common.event.FMLServerStoppedEvent; import cpw.mods.fml.common.event.FMLServerStoppingEvent; import kubatech.api.utils.ModUtils; -import kubatech.loaders.MobRecipeLoader; import kubatech.nei.IMCForNEI; @SuppressWarnings("unused") @@ -72,6 +71,5 @@ public class ClientProxy extends CommonProxy { public void loadComplete(FMLLoadCompleteEvent event) { super.loadComplete(event); - MobRecipeLoader.generateMobRecipeMap(); } } diff --git a/src/main/java/kubatech/CommonProxy.java b/src/main/java/kubatech/CommonProxy.java index 267efdab21..6d54bbf326 100644 --- a/src/main/java/kubatech/CommonProxy.java +++ b/src/main/java/kubatech/CommonProxy.java @@ -39,6 +39,7 @@ import kubatech.api.LoaderReference; import kubatech.commands.CommandHandler; import kubatech.config.Config; import kubatech.loaders.MTLoader; +import kubatech.loaders.MobHandlerLoader; import kubatech.loaders.RecipeLoader; import kubatech.loaders.TCLoader; import kubatech.savedata.PlayerDataManager; @@ -56,6 +57,7 @@ public class CommonProxy { MinecraftForge.EVENT_BUS.register(new PlayerDataManager()); registerItems(); registerBlocks(); + MobHandlerLoader.init(); } public void init(FMLInitializationEvent event) { diff --git a/src/main/java/kubatech/FMLEventHandler.java b/src/main/java/kubatech/FMLEventHandler.java index 27ff42615c..e4d216bde9 100644 --- a/src/main/java/kubatech/FMLEventHandler.java +++ b/src/main/java/kubatech/FMLEventHandler.java @@ -25,7 +25,7 @@ import net.minecraft.entity.player.EntityPlayerMP; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; import kubatech.api.helpers.UUIDFinder; -import kubatech.api.network.LoadConfigPacket; +import kubatech.network.LoadConfigPacket; import kubatech.savedata.PlayerDataManager; public class FMLEventHandler { diff --git a/src/main/java/kubatech/api/ConstructableItemStack.java b/src/main/java/kubatech/api/ConstructableItemStack.java deleted file mode 100644 index 3e82f64958..0000000000 --- a/src/main/java/kubatech/api/ConstructableItemStack.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * spotless:off - * KubaTech - Gregtech Addon - * Copyright (C) 2022 - 2023 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/>. - * spotless:on - */ - -package kubatech.api; - -import java.nio.charset.StandardCharsets; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTSizeTracker; -import net.minecraft.nbt.NBTTagCompound; - -import cpw.mods.fml.common.registry.GameRegistry; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; - -public class ConstructableItemStack { - - public final GameRegistry.UniqueIdentifier itemIdentifier; - public final int meta; - public final int size; - public final NBTTagCompound tagCompound; - - private ConstructableItemStack(GameRegistry.UniqueIdentifier itemIdentifier, int meta, int size, - NBTTagCompound tagCompound) { - this.itemIdentifier = itemIdentifier; - this.meta = meta; - this.size = size; - this.tagCompound = tagCompound; - } - - public ConstructableItemStack(ItemStack stack) { - itemIdentifier = GameRegistry.findUniqueIdentifierFor(stack.getItem()); - meta = stack.getItemDamage(); - size = stack.stackSize; - tagCompound = stack.stackTagCompound; - } - - public ItemStack construct() { - if (itemIdentifier == null) return null; - Item it = GameRegistry.findItem(itemIdentifier.modId, itemIdentifier.name); - if (it == null) return null; - ItemStack stack = new ItemStack(it, size, meta); - stack.stackTagCompound = tagCompound; - return stack; - } - - public boolean isSame(ConstructableItemStack stack, boolean ignoreSize) { - if (!stack.itemIdentifier.modId.equals(itemIdentifier.modId)) return false; - if (!stack.itemIdentifier.name.equals(itemIdentifier.name)) return false; - return ignoreSize || stack.size == size; - } - - private static final ByteBuf BufHelper = Unpooled.buffer(); - - public void writeToByteBuf(ByteBuf byteBuf) { - BufHelper.clear(); - byte[] bytes = itemIdentifier.modId.getBytes(StandardCharsets.UTF_8); - BufHelper.writeInt(bytes.length); - BufHelper.writeBytes(bytes); - bytes = itemIdentifier.name.getBytes(StandardCharsets.UTF_8); - BufHelper.writeInt(bytes.length); - BufHelper.writeBytes(bytes); - BufHelper.writeInt(meta); - BufHelper.writeInt(size); - BufHelper.writeBoolean(tagCompound != null); - if (tagCompound != null) { - try { - bytes = CompressedStreamTools.compress(tagCompound); - } catch (Exception ignored) { - bytes = new byte[0]; - } - BufHelper.writeInt(bytes.length); - BufHelper.writeBytes(bytes); - } - byteBuf.writeInt(BufHelper.readableBytes()); - byteBuf.writeBytes(BufHelper); - } - - public static ConstructableItemStack readFromByteBuf(ByteBuf byteBuf) { - int size = byteBuf.readInt(); - byte[] bytes = new byte[byteBuf.readInt()]; - byteBuf.readBytes(bytes); - String modid = new String(bytes, StandardCharsets.UTF_8); - bytes = new byte[byteBuf.readInt()]; - byteBuf.readBytes(bytes); - String name = new String(bytes, StandardCharsets.UTF_8); - int meta = byteBuf.readInt(); - int stacksize = byteBuf.readInt(); - NBTTagCompound nbtTagCompound = null; - if (byteBuf.readBoolean()) { - bytes = new byte[byteBuf.readInt()]; - byteBuf.readBytes(bytes); - try { - nbtTagCompound = CompressedStreamTools.func_152457_a(bytes, new NBTSizeTracker(2097152L)); - } catch (Exception ignored) {} - } - return new ConstructableItemStack( - new GameRegistry.UniqueIdentifier(modid + ":" + name), - meta, - stacksize, - nbtTagCompound); - } -} diff --git a/src/main/java/kubatech/api/helpers/EnderIOHelper.java b/src/main/java/kubatech/api/helpers/EnderIOHelper.java deleted file mode 100644 index 63da31e76e..0000000000 --- a/src/main/java/kubatech/api/helpers/EnderIOHelper.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * spotless:off - * KubaTech - Gregtech Addon - * Copyright (C) 2022 - 2023 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/>. - * spotless:on - */ - -package kubatech.api.helpers; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.boss.IBossDisplayData; - -import crazypants.enderio.EnderIO; -import kubatech.api.LoaderReference; - -public class EnderIOHelper { - - public static boolean canEntityBeCapturedWithSoulVial(Entity entity, String entityID) { - if (!LoaderReference.EnderIO) return true; - if (ReflectionHelper.<Boolean>callMethod(EnderIO.itemSoulVessel, "isBlackListed", false, entityID)) - return false; - return crazypants.enderio.config.Config.soulVesselCapturesBosses || !(entity instanceof IBossDisplayData); - } - - public static boolean canEntityBeCapturedWithSoulVial(Entity entity) { - return canEntityBeCapturedWithSoulVial(entity, EntityList.getEntityString(entity)); - } -} diff --git a/src/main/java/kubatech/api/mobhandler/MobDrop.java b/src/main/java/kubatech/api/mobhandler/MobDrop.java deleted file mode 100644 index 9b8b9cd51c..0000000000 --- a/src/main/java/kubatech/api/mobhandler/MobDrop.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * spotless:off - * KubaTech - Gregtech Addon - * Copyright (C) 2022 - 2023 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/>. - * spotless:on - */ - -package kubatech.api.mobhandler; - -import java.util.HashMap; - -import net.minecraft.item.ItemStack; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import kubatech.api.ConstructableItemStack; -import kubatech.api.utils.GSONUtils; - -public class MobDrop { - - public enum DropType { - - Normal, - Rare, - Additional, - Infernal; - - private static final DropType[] values = values(); - - public static DropType get(int ordinal) { - return values[ordinal]; - } - } - - @GSONUtils.SkipGSON - public ItemStack stack; - - public ConstructableItemStack reconstructableStack; - public DropType type; - public int chance; - public Integer enchantable; - public HashMap<Integer, Integer> damages; - public boolean lootable = false; - public boolean playerOnly = false; - - private MobDrop() {} - - public MobDrop(ItemStack stack, DropType type, int chance, Integer enchantable, HashMap<Integer, Integer> damages, - boolean lootable, boolean playerOnly) { - this.stack = stack; - this.reconstructableStack = new ConstructableItemStack(stack); - this.type = type; - this.chance = chance; - this.enchantable = enchantable; - this.damages = damages; - this.lootable = lootable; - this.playerOnly = playerOnly; - } - - public void reconstructStack() { - this.stack = reconstructableStack.construct(); - } - - private static final ByteBuf BufHelper = Unpooled.buffer(); - - public void writeToByteBuf(ByteBuf byteBuf) { - BufHelper.clear(); - reconstructableStack.writeToByteBuf(BufHelper); - BufHelper.writeInt(type.ordinal()); - BufHelper.writeInt(chance); - BufHelper.writeBoolean(enchantable != null); - if (enchantable != null) BufHelper.writeInt(enchantable); - BufHelper.writeBoolean(damages != null); - if (damages != null) { - BufHelper.writeInt(damages.size()); - damages.forEach((k, v) -> { - BufHelper.writeInt(k); - BufHelper.writeInt(v); - }); - } - BufHelper.writeBoolean(lootable); - BufHelper.writeBoolean(playerOnly); - byteBuf.writeInt(BufHelper.readableBytes()); - byteBuf.writeBytes(BufHelper); - } - - public static MobDrop readFromByteBuf(ByteBuf byteBuf) { - MobDrop mobDrop = new MobDrop(); - int size = byteBuf.readInt(); - mobDrop.reconstructableStack = ConstructableItemStack.readFromByteBuf(byteBuf); - mobDrop.type = DropType.get(byteBuf.readInt()); - mobDrop.chance = byteBuf.readInt(); - if (byteBuf.readBoolean()) mobDrop.enchantable = byteBuf.readInt(); - else mobDrop.enchantable = null; - if (byteBuf.readBoolean()) { - mobDrop.damages = new HashMap<>(); - int damagessize = byteBuf.readInt(); - for (int i = 0; i < damagessize; i++) mobDrop.damages.put(byteBuf.readInt(), byteBuf.readInt()); - } else mobDrop.damages = null; - mobDrop.lootable = byteBuf.readBoolean(); - mobDrop.playerOnly = byteBuf.readBoolean(); - mobDrop.reconstructStack(); - return mobDrop; - } -} diff --git a/src/main/java/kubatech/api/network/LoadConfigPacket.java b/src/main/java/kubatech/api/network/LoadConfigPacket.java deleted file mode 100644 index be3d0b803c..0000000000 --- a/src/main/java/kubatech/api/network/LoadConfigPacket.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * spotless:off - * KubaTech - Gregtech Addon - * Copyright (C) 2022 - 2023 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/>. - * spotless:on - */ - -package kubatech.api.network; - -import java.nio.charset.StandardCharsets; -import java.util.HashMap; -import java.util.HashSet; - -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import io.netty.buffer.ByteBuf; -import kubatech.config.Config; -import kubatech.config.OverridesConfig; -import kubatech.kubatech; -import kubatech.loaders.MobRecipeLoader; - -public class LoadConfigPacket implements IMessage { - - public static final LoadConfigPacket instance = new LoadConfigPacket(); - - public final HashSet<String> mobsToLoad = new HashSet<>(); - public final HashMap<String, OverridesConfig.MobOverride> mobsOverrides = new HashMap<>(); - - @Override - public void fromBytes(ByteBuf buf) { - if (!buf.readBoolean()) mobsToLoad.clear(); - else { - mobsToLoad.clear(); - int mobssize = buf.readInt(); - for (int i = 0; i < mobssize; i++) { - byte[] sbytes = new byte[buf.readInt()]; - buf.readBytes(sbytes); - mobsToLoad.add(new String(sbytes, StandardCharsets.UTF_8)); - } - int overridessize = buf.readInt(); - for (int i = 0; i < overridessize; i++) { - byte[] sbytes = new byte[buf.readInt()]; - buf.readBytes(sbytes); - mobsOverrides - .put(new String(sbytes, StandardCharsets.UTF_8), OverridesConfig.MobOverride.readFromByteBuf(buf)); - } - } - } - - @Override - public void toBytes(ByteBuf buf) { - if (!Config.MobHandler.mobHandlerEnabled) buf.writeBoolean(false); - else { - buf.writeBoolean(true); - buf.writeInt(mobsToLoad.size()); - mobsToLoad.forEach(s -> { - byte[] sbytes = s.getBytes(StandardCharsets.UTF_8); - buf.writeInt(sbytes.length); - buf.writeBytes(sbytes); - }); - buf.writeInt(mobsOverrides.size()); - mobsOverrides.forEach((k, v) -> { - byte[] sbytes = k.getBytes(StandardCharsets.UTF_8); - buf.writeInt(sbytes.length); - buf.writeBytes(sbytes); - v.writeToByteBuf(buf); - }); - } - } - - public static class Handler implements IMessageHandler<LoadConfigPacket, IMessage> { - - @Override - public IMessage onMessage(LoadConfigPacket message, MessageContext ctx) { - kubatech.info("Received Mob Handler config, parsing"); - MobRecipeLoader.processMobRecipeMap(message.mobsToLoad, message.mobsOverrides); - return null; - } - } -} diff --git a/src/main/java/kubatech/api/tileentity/CustomTileEntityPacketHandler.java b/src/main/java/kubatech/api/tileentity/CustomTileEntityPacketHandler.java index 82343dd4ea..98de36150f 100644 --- a/src/main/java/kubatech/api/tileentity/CustomTileEntityPacketHandler.java +++ b/src/main/java/kubatech/api/tileentity/CustomTileEntityPacketHandler.java @@ -20,7 +20,7 @@ package kubatech.api.tileentity; -import kubatech.api.network.CustomTileEntityPacket; +import kubatech.network.CustomTileEntityPacket; public interface CustomTileEntityPacketHandler { diff --git a/src/main/java/kubatech/api/utils/ItemID.java b/src/main/java/kubatech/api/utils/ItemID.java deleted file mode 100644 index 819b08e572..0000000000 --- a/src/main/java/kubatech/api/utils/ItemID.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * spotless:off - * KubaTech - Gregtech Addon - * Copyright (C) 2022 - 2023 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/>. - * spotless:on - */ - -package kubatech.api.utils; - -import java.util.Objects; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -public class ItemID { - - private final Item item; - private final int count; - private final int meta; - private final NBTTagCompound tag; - private final boolean ignorecount; - private final boolean ignoremeta; - private final boolean ignorenbt; - - public static ItemID create(ItemStack stack) { - return new ItemID(stack, true, true, true, true); // ignore count by default - } - - public static ItemID create(ItemStack stack, boolean ignorecount) { - return new ItemID(stack, ignorecount, false, false, true); - } - - public static ItemID create(ItemStack stack, boolean ignorecount, boolean ignoremeta) { - return new ItemID(stack, ignorecount, ignoremeta, false, true); - } - - public static ItemID create(ItemStack stack, boolean ignorecount, boolean ignoremeta, boolean ignorenbt) { - return new ItemID(stack, ignorecount, ignoremeta, ignorenbt, true); - } - - public static ItemID create_NoCopy(ItemStack stack) { - return new ItemID(stack, true, false, false, false); // ignore count by default - } - - public static ItemID create_NoCopy(ItemStack stack, boolean ignorecount) { - return new ItemID(stack, ignorecount, false, false, false); - } - - public static ItemID create_NoCopy(ItemStack stack, boolean ignorecount, boolean ignoremeta) { - return new ItemID(stack, ignorecount, ignoremeta, false, false); - } - - public static ItemID create_NoCopy(ItemStack stack, boolean ignorecount, boolean ignoremeta, boolean ignorenbt) { - return new ItemID(stack, ignorecount, ignoremeta, ignorenbt, false); - } - - private ItemID(ItemStack stack, boolean ignorecount, boolean ignoremeta, boolean ignorenbt, boolean createcopy) { - this.ignorecount = ignorecount; - this.ignoremeta = ignoremeta; - this.ignorenbt = ignorenbt; - item = stack.getItem(); - count = ignorecount ? 0 : stack.stackSize; - meta = ignoremeta ? 0 : stack.getItemDamage(); - tag = ignorenbt ? null : (createcopy ? (NBTTagCompound) stack.stackTagCompound.copy() : stack.stackTagCompound); - } - - @Override - public int hashCode() { - return Objects.hash(item, count, meta, tag); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) return false; - if (obj == this) return true; - if (obj instanceof ItemID) return obj.hashCode() == this.hashCode(); - if (obj instanceof ItemStack) { - if (!item.equals(((ItemStack) obj).getItem())) return false; - if (!ignorecount) if (count != ((ItemStack) obj).stackSize) return false; - if (!ignoremeta) if (meta != ((ItemStack) obj).getItemDamage()) return false; - if (!ignorenbt) { - if (tag == null) - return ((ItemStack) obj).stackTagCompound == null || ((ItemStack) obj).stackTagCompound.hasNoTags(); - return tag.equals(((ItemStack) obj).stackTagCompound); - } - return true; - } - return false; - } -} diff --git a/src/main/java/kubatech/api/utils/MobUtils.java b/src/main/java/kubatech/api/utils/MobUtils.java deleted file mode 100644 index d3ec59757a..0000000000 --- a/src/main/java/kubatech/api/utils/MobUtils.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * spotless:off - * KubaTech - Gregtech Addon - * Copyright (C) 2022 - 2023 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/>. - * spotless:on - */ - -package kubatech.api.utils; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBox; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.entity.RendererLivingEntity; -import net.minecraft.entity.EntityLiving; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import kubatech.mixin.mixins.minecraft.Ren |
