diff options
| author | Jason Mitchell <mitchej@gmail.com> | 2023-01-28 19:03:53 -0800 |
|---|---|---|
| committer | Jason Mitchell <mitchej@gmail.com> | 2023-01-28 19:03:53 -0800 |
| commit | f51616bda220887fdd45c4bc951ff59e3398213a (patch) | |
| tree | 35fdbb15b4c7ea0282773a388eff517a1d09d941 /src/main/java/kubatech/api | |
| parent | 11216d666cbc30fc1e1dfc84e1e0c2f4252b1fc2 (diff) | |
| download | GT5-Unofficial-f51616bda220887fdd45c4bc951ff59e3398213a.tar.gz GT5-Unofficial-f51616bda220887fdd45c4bc951ff59e3398213a.tar.bz2 GT5-Unofficial-f51616bda220887fdd45c4bc951ff59e3398213a.zip | |
[ci skip] spotlessApply with the new settings
Diffstat (limited to 'src/main/java/kubatech/api')
19 files changed, 254 insertions, 373 deletions
diff --git a/src/main/java/kubatech/api/ConstructableItemStack.java b/src/main/java/kubatech/api/ConstructableItemStack.java index 0d03fc5fd2..0d80076760 100644 --- a/src/main/java/kubatech/api/ConstructableItemStack.java +++ b/src/main/java/kubatech/api/ConstructableItemStack.java @@ -1,42 +1,36 @@ /* - * 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/>. - * + * 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/>. */ package kubatech.api; -import cpw.mods.fml.common.registry.GameRegistry; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; 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) { + private ConstructableItemStack(GameRegistry.UniqueIdentifier itemIdentifier, int meta, int size, + NBTTagCompound tagCompound) { this.itemIdentifier = itemIdentifier; this.meta = meta; this.size = size; @@ -107,10 +101,12 @@ public class ConstructableItemStack { byteBuf.readBytes(bytes); try { nbtTagCompound = CompressedStreamTools.func_152457_a(bytes, new NBTSizeTracker(2097152L)); - } catch (Exception ignored) { - } + } catch (Exception ignored) {} } return new ConstructableItemStack( - new GameRegistry.UniqueIdentifier(modid + ":" + name), meta, stacksize, nbtTagCompound); + new GameRegistry.UniqueIdentifier(modid + ":" + name), + meta, + stacksize, + nbtTagCompound); } } diff --git a/src/main/java/kubatech/api/LoaderReference.java b/src/main/java/kubatech/api/LoaderReference.java index 3215fa1b21..5ae387ed63 100644 --- a/src/main/java/kubatech/api/LoaderReference.java +++ b/src/main/java/kubatech/api/LoaderReference.java @@ -3,6 +3,7 @@ package kubatech.api; import cpw.mods.fml.common.Loader; public class LoaderReference { + public static final boolean BloodMagic = Loader.isModLoaded("AWWayofTime"); public static final boolean EnderIO = Loader.isModLoaded("EnderIO"); public static final boolean ExtraUtilities = Loader.isModLoaded("ExtraUtilities"); diff --git a/src/main/java/kubatech/api/Variables.java b/src/main/java/kubatech/api/Variables.java index 0f07c48324..bc67003a68 100644 --- a/src/main/java/kubatech/api/Variables.java +++ b/src/main/java/kubatech/api/Variables.java @@ -1,30 +1,23 @@ /* - * 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/>. - * + * 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/>. */ package kubatech.api; import kubatech.api.utils.StringUtils; + import net.minecraft.util.EnumChatFormatting; public class Variables { - public static final String Author = - "Author: " + StringUtils.applyRainbow("kuba6000", 0, EnumChatFormatting.BOLD.toString()); + + public static final String Author = "Author: " + + StringUtils.applyRainbow("kuba6000", 0, EnumChatFormatting.BOLD.toString()); public static String buildAuthorList(String... authors) { if (authors.length == 0) return "Author: Unknown"; @@ -32,17 +25,19 @@ public class Variables { .append(StringUtils.applyRainbow(authors[0], 0, EnumChatFormatting.BOLD.toString())); for (int i = 1; i < authors.length; i++) { String author = authors[i]; - b.append(EnumChatFormatting.RESET) - .append(" & ") - .append(EnumChatFormatting.GOLD) - .append(author); + b.append(EnumChatFormatting.RESET).append(" & ").append(EnumChatFormatting.GOLD).append(author); } return b.toString(); } - public static final String StructureHologram = - "To see the structure, use a " + EnumChatFormatting.BLUE + "Tec" + EnumChatFormatting.DARK_BLUE + "Tech" - + EnumChatFormatting.RESET + "" + EnumChatFormatting.GRAY + " Blueprint on the Controller!"; + public static final String StructureHologram = "To see the structure, use a " + EnumChatFormatting.BLUE + + "Tec" + + EnumChatFormatting.DARK_BLUE + + "Tech" + + EnumChatFormatting.RESET + + "" + + EnumChatFormatting.GRAY + + " Blueprint on the Controller!"; public static final double ln4 = Math.log(4d); public static final double ln2 = Math.log(2d); diff --git a/src/main/java/kubatech/api/enums/ItemList.java b/src/main/java/kubatech/api/enums/ItemList.java index b92dead10e..426cac0df5 100644 --- a/src/main/java/kubatech/api/enums/ItemList.java +++ b/src/main/java/kubatech/api/enums/ItemList.java @@ -3,17 +3,20 @@ package kubatech.api.enums; import static gregtech.api.enums.GT_Values.NI; import static gregtech.api.enums.GT_Values.W; +import java.util.Locale; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + import gregtech.api.interfaces.IItemContainer; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; -import java.util.Locale; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; public enum ItemList implements IItemContainer { + ExtremeExterminationChamber, ExtremeIndustrialApiary, LegendaryBlackTea, @@ -147,10 +150,8 @@ public enum ItemList implements IItemContainer { StringBuilder tCamelCasedDisplayNameBuilder = new StringBuilder(); final String[] tDisplayNameWords = aDisplayName.split("\\W"); for (String tWord : tDisplayNameWords) { - if (tWord.length() > 0) - tCamelCasedDisplayNameBuilder.append(tWord.substring(0, 1).toUpperCase(Locale.US)); - if (tWord.length() > 1) - tCamelCasedDisplayNameBuilder.append(tWord.substring(1).toLowerCase(Locale.US)); + if (tWord.length() > 0) tCamelCasedDisplayNameBuilder.append(tWord.substring(0, 1).toUpperCase(Locale.US)); + if (tWord.length() > 1) tCamelCasedDisplayNameBuilder.append(tWord.substring(1).toLowerCase(Locale.US)); } if (tCamelCasedDisplayNameBuilder.length() == 0) { // CamelCased DisplayName is empty, so use hash of aDisplayName @@ -197,9 +198,8 @@ public enum ItemList implements IItemContainer { } /** - * Returns the internal stack. - * This method is unsafe. It's here only for quick operations. - * DON'T CHANGE THE RETURNED VALUE! + * Returns the internal stack. This method is unsafe. It's here only for quick operations. DON'T CHANGE THE RETURNED + * VALUE! */ public ItemStack getInternalStack_unsafe() { return mStack; diff --git a/src/main/java/kubatech/api/helpers/EnderIOHelper.java b/src/main/java/kubatech/api/helpers/EnderIOHelper.java index c5bb281b7e..30158500c7 100644 --- a/src/main/java/kubatech/api/helpers/EnderIOHelper.java +++ b/src/main/java/kubatech/api/helpers/EnderIOHelper.java @@ -1,31 +1,25 @@ /* - * 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/>. - * + * 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/>. */ package kubatech.api.helpers; -import crazypants.enderio.EnderIO; import kubatech.api.LoaderReference; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.boss.IBossDisplayData; +import crazypants.enderio.EnderIO; + 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)) diff --git a/src/main/java/kubatech/api/helpers/GTHelper.java b/src/main/java/kubatech/api/helpers/GTHelper.java index 782c697232..16abbe348c 100644 --- a/src/main/java/kubatech/api/helpers/GTHelper.java +++ b/src/main/java/kubatech/api/helpers/GTHelper.java @@ -3,9 +3,9 @@ package kubatech.api.helpers; import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity; import static kubatech.api.Variables.ln4; +import kubatech.api.implementations.KubaTechGTMultiBlockBase; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import kubatech.api.implementations.KubaTechGTMultiBlockBase; public class GTHelper { diff --git a/src/main/java/kubatech/api/helpers/InfernalHelper.java b/src/main/java/kubatech/api/helpers/InfernalHelper.java index dcfd87daad..a2842d66a7 100644 --- a/src/main/java/kubatech/api/helpers/InfernalHelper.java +++ b/src/main/java/kubatech/api/helpers/InfernalHelper.java @@ -1,34 +1,28 @@ /* - * 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/>. - * + * 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/>. */ package kubatech.api.helpers; -import atomicstryker.infernalmobs.common.InfernalMobsCore; -import atomicstryker.infernalmobs.common.mods.api.ModifierLoader; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.ArrayList; + import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; +import atomicstryker.infernalmobs.common.InfernalMobsCore; +import atomicstryker.infernalmobs.common.mods.api.ModifierLoader; + @SuppressWarnings("unchecked") public class InfernalHelper { + private static Method isClassAllowed = null; public static boolean isClassAllowed(EntityLivingBase e) { @@ -49,8 +43,8 @@ public class InfernalHelper { public static boolean checkEntityClassForced(EntityLivingBase e) { try { if (checkEntityClassForced == null) { - checkEntityClassForced = - InfernalMobsCore.class.getDeclaredMethod("checkEntityClassForced", EntityLivingBase.class); + checkEntityClassForced = InfernalMobsCore.class + .getDeclaredMethod("checkEntityClassForced", EntityLivingBase.class); checkEntityClassForced.setAccessible(true); } return (boolean) checkEntityClassForced.invoke(InfernalMobsCore.instance(), e); diff --git a/src/main/java/kubatech/api/helpers/ReflectionHelper.java b/src/main/java/kubatech/api/helpers/ReflectionHelper.java index 03fc9f45d9..404d1de5f9 100644 --- a/src/main/java/kubatech/api/helpers/ReflectionHelper.java +++ b/src/main/java/kubatech/api/helpers/ReflectionHelper.java @@ -1,20 +1,11 @@ /* - * 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/>. - * + * 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/>. */ package kubatech.api.helpers; @@ -24,7 +15,9 @@ import java.lang.reflect.Method; import java.util.HashMap; public class ReflectionHelper { + private static class _FieldsMethods { + HashMap<String, Field> fields = new HashMap<>(); HashMap<String, Method> methods = new HashMap<>(); } diff --git a/src/main/java/kubatech/api/implementations/KubaTechGTMultiBlockBase.java b/src/main/java/kubatech/api/implementations/KubaTechGTMultiBlockBase.java index aa51834a10..0b31c27011 100644 --- a/src/main/java/kubatech/api/implementations/KubaTechGTMultiBlockBase.java +++ b/src/main/java/kubatech/api/implementations/KubaTechGTMultiBlockBase.java @@ -3,16 +3,19 @@ package kubatech.api.implementations; import static kubatech.api.Variables.ln2; import static kubatech.api.Variables.ln4; -import com.gtnewhorizons.modularui.api.drawable.IDrawable; -import com.gtnewhorizons.modularui.api.widget.Widget; -import gregtech.api.gui.modularui.GT_UITextures; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_ExtendedPowerMultiBlockBase; import java.util.ArrayList; import java.util.Arrays; import java.util.function.Function; + import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import com.gtnewhorizons.modularui.api.drawable.IDrawable; +import com.gtnewhorizons.modularui.api.widget.Widget; + +import gregtech.api.gui.modularui.GT_UITextures; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_ExtendedPowerMultiBlockBase; + public abstract class KubaTechGTMultiBlockBase<T extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase<T>> extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase<T> { @@ -25,8 +28,9 @@ public abstract class KubaTechGTMultiBlockBase<T extends GT_MetaTileEntity_Exten } /** - * Enables infinite overclocking (will give more outputs with more energy past 1 tick) - * Currently doesn't support recipe inputs + * Enables infinite overclocking (will give more outputs with more energy past 1 tick) Currently doesn't support + * recipe inputs + * * @return If this supports infinite overclock */ protected boolean isOverclockingInfinite() { @@ -41,16 +45,16 @@ public abstract class KubaTechGTMultiBlockBase<T extends GT_MetaTileEntity_Exten } @Override - protected void calculateOverclockedNessMultiInternal( - long aEUt, int aDuration, int mAmperage, long maxInputVoltage, boolean perfectOC) { + protected void calculateOverclockedNessMultiInternal(long aEUt, int aDuration, int mAmperage, long maxInputVoltage, + boolean perfectOC) { calculateOverclock(aEUt, aDuration, getMaxInputEu(), perfectOC); } /** - * @param aEUt Recipe EU/t - * @param aDuration Recipe duration (in ticks) + * @param aEUt Recipe EU/t + * @param aDuration Recipe duration (in ticks) * @param maxInputEU The amount of energy we want to overclock to - * @param isPerfect Is this overclock perfect ? + * @param isPerfect Is this overclock perfect ? * @return The amount of overclocks */ protected int calculateOverclock(long aEUt, int aDuration, final long maxInputEU, final boolean isPerfect) { @@ -61,8 +65,8 @@ public abstract class KubaTechGTMultiBlockBase<T extends GT_MetaTileEntity_Exten this.mMaxProgresstime = aDuration; return 0; } - int durationTiers = - (int) Math.ceil(Math.log((double) aDuration / (double) minDuration) / (isPerfect ? ln4 : ln2)); + int durationTiers = (int) Math + .ceil(Math.log((double) aDuration / (double) minDuration) / (isPerfect ? ln4 : ln2)); if (durationTiers < 0) durationTiers = 0; // We do not support downclocks (yet) if (durationTiers > tiers) durationTiers = tiers; if (!isOverclockingInfinite()) { @@ -135,7 +139,7 @@ public abstract class KubaTechGTMultiBlockBase<T extends GT_MetaTileEntity_Exten protected final Function<Widget, Boolean> isFixed = widget -> getIdealStatus() == getRepairStatus() && mMachine; protected static final Function<Integer, IDrawable[]> toggleButtonBackgroundGetter = val -> { - if (val == 0) return new IDrawable[] {GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CROSS}; - else return new IDrawable[] {GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CHECKMARK}; + if (val == 0) return new IDrawable[] { GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CROSS }; + else return new IDrawable[] { GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CHECKMARK }; }; } diff --git a/src/main/java/kubatech/api/mobhandler/MobDrop.java b/src/main/java/kubatech/api/mobhandler/MobDrop.java index 1a5f73ae49..554e36bd6a 100644 --- a/src/main/java/kubatech/api/mobhandler/MobDrop.java +++ b/src/main/java/kubatech/api/mobhandler/MobDrop.java @@ -1,37 +1,34 @@ /* - * 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/>. - * + * 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/>. */ package kubatech.api.mobhandler; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; import java.util.HashMap; + import kubatech.api.ConstructableItemStack; import kubatech.api.utils.GSONUtils; + import net.minecraft.item.ItemStack; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; + public class MobDrop { + public enum DropType { + Normal, Rare, Additional, Infernal; + private static final DropType[] values = values(); public static DropType get(int ordinal) { @@ -52,14 +49,8 @@ public class MobDrop { private MobDrop() {} - public MobDrop( - ItemStack stack, - DropType type, - int chance, - Integer enchantable, - HashMap<Integer, Integer> damages, - boolean lootable, - boolean playerOnly) { + 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; diff --git a/src/main/java/kubatech/api/network/CustomTileEntityPacket.java b/src/main/java/kubatech/api/network/CustomTileEntityPacket.java index 334ff091aa..551110a107 100644 --- a/src/main/java/kubatech/api/network/CustomTileEntityPacket.java +++ b/src/main/java/kubatech/api/network/CustomTileEntityPacket.java @@ -1,24 +1,25 @@ /* - * 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/>. - * + * 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/>. */ package kubatech.api.network; +import java.nio.charset.StandardCharsets; + +import kubatech.api.tileentity.CustomTileEntityPacketHandler; +import kubatech.api.utils.ModUtils; +import kubatech.kubatech; + +import net.minecraft.client.Minecraft; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; @@ -27,15 +28,9 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import java.nio.charset.StandardCharsets; -import kubatech.api.tileentity.CustomTileEntityPacketHandler; -import kubatech.api.utils.ModUtils; -import kubatech.kubatech; -import net.minecraft.client.Minecraft; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; public class CustomTileEntityPacket implements IMessage { + public int w, x, y, z; public final ByteBuf customdata = Unpooled.buffer(); @@ -125,6 +120,7 @@ public class CustomTileEntityPacket implements IMessage { } public static class Handler implements IMessageHandler<CustomTileEntityPacket, IMessage> { + @Override public IMessage onMessage(CustomTileEntityPacket message, MessageContext ctx) { if (!ModUtils.isClientSided) return null; diff --git a/src/main/java/kubatech/api/network/LoadConfigPacket.java b/src/main/java/kubatech/api/network/LoadConfigPacket.java index 0c9015de12..04a8f68770 100644 --- a/src/main/java/kubatech/api/network/LoadConfigPacket.java +++ b/src/main/java/kubatech/api/network/LoadConfigPacket.java @@ -1,35 +1,27 @@ /* - * 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/>. - * + * 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/>. */ package kubatech.api.network; -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 java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.HashSet; + import kubatech.config.Config; import kubatech.config.OverridesConfig; import kubatech.kubatech; import kubatech.loaders.MobRecipeLoader; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleim |
