aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dependencies.gradle20
-rw-r--r--src/main/java/kubatech/ClientProxy.java27
-rw-r--r--src/main/java/kubatech/CommonProxy.java29
-rw-r--r--src/main/java/kubatech/FMLEventHandler.java30
-rw-r--r--src/main/java/kubatech/Tags.java23
-rw-r--r--src/main/java/kubatech/api/ConstructableItemStack.java44
-rw-r--r--src/main/java/kubatech/api/LoaderReference.java1
-rw-r--r--src/main/java/kubatech/api/Variables.java45
-rw-r--r--src/main/java/kubatech/api/enums/ItemList.java22
-rw-r--r--src/main/java/kubatech/api/helpers/EnderIOHelper.java28
-rw-r--r--src/main/java/kubatech/api/helpers/GTHelper.java2
-rw-r--r--src/main/java/kubatech/api/helpers/InfernalHelper.java34
-rw-r--r--src/main/java/kubatech/api/helpers/ReflectionHelper.java25
-rw-r--r--src/main/java/kubatech/api/implementations/KubaTechGTMultiBlockBase.java34
-rw-r--r--src/main/java/kubatech/api/mobhandler/MobDrop.java43
-rw-r--r--src/main/java/kubatech/api/network/CustomTileEntityPacket.java42
-rw-r--r--src/main/java/kubatech/api/network/LoadConfigPacket.java36
-rw-r--r--src/main/java/kubatech/api/tileentity/CustomTileEntityPacketHandler.java24
-rw-r--r--src/main/java/kubatech/api/utils/FastRandom.java23
-rw-r--r--src/main/java/kubatech/api/utils/GSONUtils.java45
-rw-r--r--src/main/java/kubatech/api/utils/ItemID.java25
-rw-r--r--src/main/java/kubatech/api/utils/MobUtils.java33
-rw-r--r--src/main/java/kubatech/api/utils/ModUtils.java67
-rw-r--r--src/main/java/kubatech/api/utils/StringUtils.java54
-rw-r--r--src/main/java/kubatech/client/effect/EntityRenderer.java54
-rw-r--r--src/main/java/kubatech/client/effect/MegaApiaryBeesRenderer.java45
-rw-r--r--src/main/java/kubatech/commands/CommandBees.java40
-rw-r--r--src/main/java/kubatech/commands/CommandConfig.java30
-rw-r--r--src/main/java/kubatech/commands/CommandHandler.java41
-rw-r--r--src/main/java/kubatech/commands/CommandHelp.java35
-rw-r--r--src/main/java/kubatech/commands/CommandTea.java30
-rw-r--r--src/main/java/kubatech/config/Config.java93
-rw-r--r--src/main/java/kubatech/config/OverridesConfig.java84
-rw-r--r--src/main/java/kubatech/kubatech.java55
-rw-r--r--src/main/java/kubatech/loaders/BlockLoader.java27
-rw-r--r--src/main/java/kubatech/loaders/ItemLoader.java30
-rw-r--r--src/main/java/kubatech/loaders/MTLoader.java24
-rw-r--r--src/main/java/kubatech/loaders/MobRecipeLoader.java468
-rw-r--r--src/main/java/kubatech/loaders/RecipeLoader.java219
-rw-r--r--src/main/java/kubatech/loaders/TCLoader.java171
-rw-r--r--src/main/java/kubatech/loaders/block/BlockProxy.java28
-rw-r--r--src/main/java/kubatech/loaders/block/IProxyTileEntityProvider.java1
-rw-r--r--src/main/java/kubatech/loaders/block/KubaBlock.java124
-rw-r--r--src/main/java/kubatech/loaders/block/KubaItemBlock.java26
-rw-r--r--src/main/java/kubatech/loaders/block/blocks/TeaAcceptor.java25
-rw-r--r--src/main/java/kubatech/loaders/item/IItemProxyGUI.java4
-rw-r--r--src/main/java/kubatech/loaders/item/ItemProxy.java77
-rw-r--r--src/main/java/kubatech/loaders/item/KubaItems.java48
-rw-r--r--src/main/java/kubatech/loaders/item/items/Tea.java26
-rw-r--r--src/main/java/kubatech/loaders/item/items/TeaCollection.java79
-rw-r--r--src/main/java/kubatech/loaders/item/items/TeaIngredient.java26
-rw-r--r--src/main/java/kubatech/loaders/item/items/TeaUltimate.java221
-rw-r--r--src/main/java/kubatech/mixin/Mixin.java9
-rw-r--r--src/main/java/kubatech/mixin/MixinPlugin.java11
-rw-r--r--src/main/java/kubatech/mixin/TargetedMod.java15
-rw-r--r--src/main/java/kubatech/mixin/mixins/minecraft/EnchantmentHelperMixin.java8
-rw-r--r--src/main/java/kubatech/mixin/mixins/minecraft/WorldMixin.java2
-rw-r--r--src/main/java/kubatech/nei/IMCForNEI.java31
-rw-r--r--src/main/java/kubatech/nei/Mob_Handler.java151
-rw-r--r--src/main/java/kubatech/nei/NEI_Config.java26
-rw-r--r--src/main/java/kubatech/savedata/PlayerData.java24
-rw-r--r--src/main/java/kubatech/savedata/PlayerDataManager.java27
-rw-r--r--src/main/java/kubatech/tileentity/TeaAcceptorTile.java88
-rw-r--r--src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeExterminationChamber.java571
-rw-r--r--src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java664
65 files changed, 1997 insertions, 2517 deletions
diff --git a/dependencies.gradle b/dependencies.gradle
index 50ea139839..126df8ecec 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -34,8 +34,8 @@ dependencies {
{
transitive = false
}
- runtime("com.github.GTNewHorizons:Baubles:1.0.1.14:dev")
- runtime("curse.maven:cofh-core-69162:2388751")
+ runtimeOnly("com.github.GTNewHorizons:Baubles:1.0.1.14:dev")
+ runtimeOnly("curse.maven:cofh-core-69162:2388751")
/*
{
exclude group:"com.github.GTNewHorizons", module:"SpongePoweredMixin"
@@ -44,16 +44,16 @@ dependencies {
*/
// For testing
- //runtime("com.github.GTNewHorizons:GTplusplus:1.7.134:dev")
- //runtime("com.github.GTNewHorizons:harvestcraft:1.0.18-GTNH:dev")
- //runtime("com.github.GTNewHorizons:NewHorizonsCoreMod:1.9.103:dev")
- //runtime("com.github.GTNewHorizons:OpenBlocks:1.6.9-GTNH:dev")
- //runtime("com.github.GTNewHorizons:bartworks:0.5.125:dev")
- //runtime("com.github.GTNewHorizons:CraftTweaker:3.2.9:dev")
+ //runtimeOnly("com.github.GTNewHorizons:GTplusplus:1.7.134:dev")
+ //runtimeOnly("com.github.GTNewHorizons:harvestcraft:1.0.18-GTNH:dev")
+ //runtimeOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:1.9.103:dev")
+ //runtimeOnly("com.github.GTNewHorizons:OpenBlocks:1.6.9-GTNH:dev")
+ //runtimeOnly("com.github.GTNewHorizons:bartworks:0.5.125:dev")
+ //runtimeOnly("com.github.GTNewHorizons:CraftTweaker:3.2.9:dev")
//compile("com.github.GTNewHorizons:SpecialMobs:3.3.13:dev")
//compile("com.github.GTNewHorizons:twilightforest:2.3.8.17:dev")
//compile("com.github.GTNewHorizons:EnderZoo:1.0.23:dev")
- //runtime("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
- //runtime("com.github.GTNewHorizons:BloodMagic:1.3.18:dev")
+ //runtimeOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
+ //runtimeOnly("com.github.GTNewHorizons:BloodMagic:1.3.18:dev")
//compile("curse.maven:witchery-69673:2234410")
}
diff --git a/src/main/java/kubatech/ClientProxy.java b/src/main/java/kubatech/ClientProxy.java
index b9cfcf5e66..618518a016 100644
--- a/src/main/java/kubatech/ClientProxy.java
+++ b/src/main/java/kubatech/ClientProxy.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;
-import cpw.mods.fml.common.event.*;
import kubatech.api.utils.ModUtils;
import kubatech.loaders.MobRecipeLoader;
import kubatech.nei.IMCForNEI;
+
import net.minecraftforge.common.MinecraftForge;
+import cpw.mods.fml.common.event.*;
+
@SuppressWarnings("unused")
public class ClientProxy extends CommonProxy {
diff --git a/src/main/java/kubatech/CommonProxy.java b/src/main/java/kubatech/CommonProxy.java
index e8453d13eb..b8e063e5d8 100644
--- a/src/main/java/kubatech/CommonProxy.java
+++ b/src/main/java/kubatech/CommonProxy.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;
@@ -22,8 +13,6 @@ package kubatech;
import static kubatech.loaders.BlockLoader.registerBlocks;
import static kubatech.loaders.ItemLoader.registerItems;
-import cpw.mods.fml.common.FMLCommonHandler;
-import cpw.mods.fml.common.event.*;
import kubatech.api.LoaderReference;
import kubatech.commands.CommandConfig;
import kubatech.commands.CommandHandler;
@@ -34,8 +23,12 @@ import kubatech.loaders.MTLoader;
import kubatech.loaders.RecipeLoader;
import kubatech.loaders.TCLoader;
import kubatech.savedata.PlayerDataManager;
+
import net.minecraftforge.common.MinecraftForge;
+import cpw.mods.fml.common.FMLCommonHandler;
+import cpw.mods.fml.common.event.*;
+
public class CommonProxy {
public void preInit(FMLPreInitializationEvent event) {
diff --git a/src/main/java/kubatech/FMLEventHandler.java b/src/main/java/kubatech/FMLEventHandler.java
index 26fe14e906..b096c7bb11 100644
--- a/src/main/java/kubatech/FMLEventHandler.java
+++ b/src/main/java/kubatech/FMLEventHandler.java
@@ -1,30 +1,24 @@
/*
- * 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;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import cpw.mods.fml.common.gameevent.PlayerEvent;
import kubatech.api.network.LoadConfigPacket;
+
import net.minecraft.entity.player.EntityPlayerMP;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import cpw.mods.fml.common.gameevent.PlayerEvent;
+
public class FMLEventHandler {
+
// Gets fired only server-sided
@SubscribeEvent
public void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) {
diff --git a/src/main/java/kubatech/Tags.java b/src/main/java/kubatech/Tags.java
index 9e027782a3..f25192bfa8 100644
--- a/src/main/java/kubatech/Tags.java
+++ b/src/main/java/kubatech/Tags.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;
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.simpleimpl.IMessageHandler;
+import cpw.mods.fml.common.network.simpleimpl.MessageContext;
+import io.netty.buffer.ByteBuf;
public class LoadConfigPacket implements IMessage {
@@ -54,7 +46,8 @@ public class LoadConfigPacket implements IMessage {
byte[] sbytes = new byte[buf.readInt()];
buf.readBytes(sbytes);
mobsOverrides.put(
- new String(sbytes, StandardCharsets.UTF_8), OverridesConfig.MobOverride.readFromByteBuf(buf));
+ new String(sbytes, StandardCharsets.UTF_8),
+ OverridesConfig.MobOverride.readFromByteBuf(buf));
}
}
}
@@ -81,6 +74,7 @@ public class LoadConfigPacket implements IMessage {
}
public static class Handler implements IMessageHandler<LoadConfigPacket, IMessage> {
+
@Override
public IMessage onMessage(LoadConfigPacket message, MessageContext ctx) {
kubatech.info("Received Mob Handler config, parsing");
diff --git a/src/main/java/kubatech/api/tileentity/CustomTileEntityPacketHandler.java b/src/main/java/kubatech/api/tileentity/CustomTileEntityPacketHandler.java
index 3a1fa78d15..039b545890 100644
--- a/src/main/java/kubatech/api/tileentity/CustomTileEntityPacketHandler.java
+++ b/src/main/java/kubatech/api/tileentity/CustomTileEntityPacketHandler.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.tileentity;
@@ -22,5 +13,6 @@ package kubatech.api.tileentity;
import kubatech.api.network.CustomTileEntityPacket;
public interface CustomTileEntityPacketHandler {
+
void HandleCustomPacket(CustomTileEntityPacket customdata);
}
diff --git a/src/main/java/kubatech/api/utils/FastRandom.java b/src/main/java/kubatech/api/utils/FastRandom.java
index 03699d2b62..33d157a1aa 100644
--- a/src/main/java/kubatech/api/utils/FastRandom.java
+++ b/src/main/java/kubatech/api/utils/FastRandom.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.utils;
diff --git a/src/main/java/kubatech/api/utils/GSONUtils.java b/src/main/java/kubatech/api/utils/GSONUtils.java
index 1882a1e346..99580ad803 100644
--- a/src/main/java/kubatech/api/utils/GSONUtils.java
+++ b/src/main/java/kubatech/api/utils/GSONUtils.java
@@ -1,40 +1,35 @@
/*
- * 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.utils;
-import com.google.gson.*;
import java.io.IOException;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+
import net.minecraft.nbt.CompressedStreamTools;
import net.minecraft.nbt.NBTSizeTracker;
import net.minecraft.nbt.NBTTagCompound;
+import com.google.gson.*;
+
public class GSONUtils {
+
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface SkipGSON {}
private static final ExclusionStrategy GSONStrategy = new ExclusionStrategy() {
+
@Override
public boolean shouldSkipField(FieldAttributes f) {
return f.getAnnotation(SkipGSON.class) != null;
@@ -62,25 +57,19 @@ public class GSONUtils {
try {
if (!(json instanceof JsonArray)) return null;
byte[] bytes = new byte[((JsonArray) json).size()];
- for (int i = 0; i < bytes.length; i++)
- bytes[i] = ((JsonArray) json).get(i).getAsByte();
+ for (int i = 0; i < bytes.length; i++) bytes[i] = ((JsonArray) json).get(i).getAsByte();
return CompressedStreamTools.func_152457_a(bytes, new NBTSizeTracker(2097152L));
} catch (IOException e) {
throw new RuntimeException(e);
}
};
- public static final GsonBuilder GSON_BUILDER = new GsonBuilder()
- .addSerializationExclusionStrategy(GSONStrategy)
+ public static final GsonBuilder GSON_BUILDER = new GsonBuilder().addSerializationExclusionStrategy(GSONStrategy)
.addDeserializationExclusionStrategy(GSONStrategy)
.registerTypeAdapter(NBTTagCompound.class, NBTTagCompoundDeserializer)
- .registerTypeAdapter(NBTTagCompound.class, NBTTagCompoundSerializer)
- .serializeNulls();
+ .registerTypeAdapter(NBTTagCompound.class, NBTTagCompoundSerializer).serializeNulls();
public static final GsonBuilder GSON_BUILDER_PRETTY = new GsonBuilder()
- .addSerializationExclusionStrategy(GSONStrategy)
- .addDeserializationExclusionStrategy(GSONStrategy)
+ .addSerializationExclusionStrategy(GSONStrategy).addDeserializationExclusionStrategy(GSONStrategy)
.registerTypeAdapter(NBTTagCompound.class, NBTTagCompoundDeserializer)
- .registerTypeAdapter(NBTTagCompound.class, NBTTagCompoundSerializer)
- .serializeNulls()
- .setPrettyPrinting();
+ .registerTypeAdapter(NBTTagCompound.class, NBTTagCompoundSerializer).serializeNulls().setPrettyPrinting();
}
diff --git a/src/main/java/kubatech/api/utils/ItemID.java b/src/main/java/kubatech/api/utils/ItemID.java
index d296c7d80d..c2060e59bc 100644
--- a/src/main/java/kubatech/api/utils/ItemID.java
+++ b/src/main/java/kubatech/api/utils/ItemID.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.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;
diff --git a/src/main/java/kubatech/api/utils/MobUtils.java b/src/main/java/kubatech/api/utils/MobUtils.java
index 76bec7b988..0a6881edeb 100644
--- a/src/main/java/kubatech/api/utils/MobUtils.java
+++ b/src/main/java/kubatech/api/utils/MobUtils.java
@@ -1,27 +1,17 @@
/*
- * 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.utils;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import java.lang.reflect.Field;
+
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBox;
import net.minecraft.client.model.ModelRenderer;
@@ -30,6 +20,9 @@ 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;
+
public class MobUtils {
private static Field mainmodelfield = null;
@@ -48,8 +41,8 @@ public class MobUtils {
public static float getMobHeight(EntityLiving e) {
try {
if (mainmodelfield == null) {
- mainmodelfield = RendererLivingEntity.class.getDeclaredField(
- ModUtils.isDeobfuscatedEnvironment ? "mainModel" : "field_77045_g");
+ mainmodelfield = RendererLivingEntity.class
+ .getDeclaredField(ModUtils.isDeobfuscatedEnvironment ? "mainModel" : "field_77045_g");
mainmodelfield.setAccessible(true);
}
float eheight = e.height;
diff --git a/src/main/java/kubatech/api/utils/ModUtils.java b/src/main/java/kubatech/api/utils/ModUtils.java
index 6870a8801d..a09b3b68ee 100644
--- a/src/main/java/kubatech/api/utils/ModUtils.java
+++ b/src/main/java/kubatech/api/utils/ModUtils.java
@@ -1,35 +1,30 @@
/*
- * 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.utils;
-import cpw.mods.fml.common.Loader;
-import cpw.mods.fml.common.ModContainer;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.*;
+
import javax.xml.bind.DatatypeConverter;
+
import net.minecraft.launchwrapper.Launch;
+import cpw.mods.fml.common.Loader;
+import cpw.mods.fml.common.ModContainer;
+
public class ModUtils {
- public static final boolean isDeobfuscatedEnvironment =
- (boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
+
+ public static final boolean isDeobfuscatedEnvironment = (boolean) Launch.blackboard
+ .get("fml.deobfuscatedEnvironment");
public static boolean isClientSided = false;
private static final HashMap<String, String> classNamesToModIDs = new HashMap<>();
private static final Map.Entry<String, String> emptyEntry = new AbstractMap.SimpleEntry<>("", "");
@@ -39,15 +34,11 @@ public class ModUtils {
classNamesToModIDs.put("net.minecraft", "Minecraft");
Loader.instance().getActiveModList().forEach(m -> {
Object Mod = m.getMod();
- if (Mod != null)
- classNamesToModIDs.put(Mod.getClass().getPackage().getName(), m.getName());
+ if (Mod != null) classNamesToModIDs.put(Mod.getClass().getPackage().getName(), m.getName());
});
}
- return classNamesToModIDs.entrySet().stream()
- .filter(e -> classname.startsWith(e.getKey()))
- .findAny()
- .orElse(emptyEntry)
- .getValue();
+ return classNamesToModIDs.entrySet().stream().filter(e -> classname.startsWith(e.getKey())).findAny()
+ .orElse(emptyEntry).getValue();
}
private static String modListVersion = null;
@@ -55,10 +46,9 @@ public class ModUtils {
public static String getModListVersion() {
if (modListVersion != null) return modListVersion;
@SuppressWarnings("unchecked")
- ArrayList<ModContainer> modlist = (ArrayList<ModContainer>)
- ((ArrayList<ModContainer>) Loader.instance().getActiveModList()).clone();
- String sortedList = modlist.stream()
- .filter(m -> m.getMod() != null)
+ ArrayList<ModContainer> modlist = (ArrayList<ModContainer>) ((ArrayList<ModContainer>) Loader.instance()
+ .getActiveModList()).clone();
+ String sortedList = modlist.stream().filter(m -> m.getMod() != null)
.sorted(Comparator.comparing(ModContainer::getModId))
.collect(
StringBuilder::new,
@@ -81,19 +71,16 @@ public class ModUtils {
public static String getModListVersionIgnoringModVersions() {
if (modListVersionIgnoringModVersions != null) return modListVersionIgnoringModVersions;
@SuppressWarnings("unchecked")
- ArrayList<ModContainer> modlist = (ArrayList<ModContainer>)
- ((ArrayList<ModContainer>) Loader.instance().getActiveModList()).clone();
- String sortedList = modlist.stream()
- .filter(m -> m.getMod() != null)
+ ArrayList<ModContainer> modlist = (ArrayList<ModContainer>) ((ArrayList<ModContainer>) Loader.instance()
+ .getActiveModList()).clone();
+ String sortedList = modlist.stream().filter(m -> m.getMod() != null)
.sorted(Comparator.comparing(ModContainer::getModId))
- .collect(StringBuilder::new, (a, b) -> a.append(b.getModId()), (a, b) -> a.append(", ")
- .append(b))
+ .collect(StringBuilder::new, (a, b) -> a.append(b.getModId()), (a, b) -> a.append(", ").append(b))
.toString();
try {
MessageDigest md = MessageDigest.getInstance("MD5");
- modListVersionIgnoringModVersions = DatatypeConverter.printHexBinary(
- md.digest(sortedList.getBytes(StandardCharsets.UTF_8)))
- .toUpperCase();
+ modListVersionIgnoringModVersions = DatatypeConverter
+ .printHexBinary(md.digest(sortedList.getBytes(StandardCharsets.UTF_8))).toUpperCase();
return modListVersionIgnoringModVersions;
} catch (Exception e) {
modListVersionIgnoringModVersions = sortedList;
diff --git a/src/main/java/kubatech/api/utils/StringUtils.java b/src/main/java/kubatech/api/utils/StringUtils.java
index f7bbdcf9b7..066fa69d4f 100644
--- a/src/main/java/kubatech/api/utils/StringUtils.java
+++ b/src/main/java/kubatech/api/utils/StringUtils.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.utils;
@@ -23,33 +14,20 @@ import net.minecraft.util.EnumChatFormatting;
public class StringUtils {
- private static final String[] rainbow = new String[] {
- EnumChatFormatting.DARK_RED.toString(),
- EnumChatFormatting.RED.toString(),
- EnumChatFormatting.GOLD.toString(),
- EnumChatFormatting.YELLOW.toString(),
- EnumChatFormatting.DARK_GREEN.toString(),
- EnumChatFormatting.GREEN.toString(),
- EnumChatFormatting.AQUA.toString(),
- EnumChatFormatting.DARK_AQUA.toString(),
- EnumChatFormatting.DARK_BLUE.toString(),
- EnumChatFormatting.BLUE.toString(),
- EnumChatFormatting.LIGHT_PURPLE.toString(),
- EnumChatFormatting.DARK_PURPLE.toString(),
- EnumChatFormatting.WHITE.toString(),
- EnumChatFormatting.GRAY.toString(),
- EnumChatFormatting.DARK_GRAY.toString(),
- EnumChatFormatting.BLACK.toString(),
- };
+ private static final String[] rainbow = new String[] { EnumChatFormatting.DARK_RED.toString(),
+ EnumChatFormatting.RED.toString(), EnumChatFormatting.GOLD.toString(), EnumChatFormatting.YELLOW.toString(),
+ EnumChatFormatting.DARK_GREEN.toString(), EnumChatFormatting.GREEN.toString(),
+ EnumChatFormatting.AQUA.toString(), EnumChatFormatting.DARK_AQUA.toString(),
+ EnumChatFormatting.DARK_BLUE.toString(), EnumChatFormatting.BLUE.toString(),
+ EnumChatFormatting.LIGHT_PURPLE.toString(), EnumChatFormatting.DARK_PURPLE.toString(),
+ EnumChatFormatting.WHITE.toString(), EnumChatFormatting.GRAY.toString(),
+ EnumChatFormatting.DARK_GRAY.toString(), EnumChatFormatting.BLACK.toString(), };
public static String applyRainbow(String str, int offset, String additional) {
StringBuilder final_string = new StringBuilder();
int i = offset;
for (char c : str.toCharArray())
- final_string
- .append(rainbow[i++ % rainbow.length])
- .append(additional)
- .append(c);
+ final_string.append(rainbow[i++ % rainbow.length]).append(additional).append(c);
return final_string.toString();
}
diff --git a/src/main/java/kubatech/client/effect/EntityRenderer.java b/src/main/java/kubatech/client/effect/EntityRenderer.java
index 1c7add7051..c357d61000 100644
--- a/src/main/java/kubatech/client/effect/EntityRenderer.java
+++ b/src/main/java/kubatech/client/effect/EntityRenderer.java
@@ -1,31 +1,21 @@
/*
- * 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.client.effect;
import static net.minecraft.client.renderer.entity.RenderManager.*;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import kubatech.Tags;
import kubatech.api.utils.MobUtils;
import kubatech.config.Config;
+
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.OpenGlHelper;
@@ -35,14 +25,19 @@ import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.boss.BossStatus;
import net.minecraft.world.World;
+
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import org.lwjgl.util.glu.GLU;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
@SideOnly(Side.CLIENT)
public class EntityRenderer extends EntityFX {
+
private static final Logger LOG = LogManager.getLogger(Tags.MODID + "[Entity Renderer]");
private EntityLiving entityToRender = null;
@@ -89,14 +84,8 @@ public class EntityRenderer extends EntityFX {
}
@Override
- public void renderParticle(
- Tessellator p_70539_1_,
- float p_70539_2_,
- float p_70539_3_,
- float p_70539_4_,
- float p_70539_5_,
- float p_70539_6_,
- float p_70539_7_) {
+ public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_,
+ float p_70539_5_, float p_70539_6_, float p_70539_7_) {
if (entityToRender == null) return;
GL11.glEnable(GL11.GL_LIGHTING);
@@ -158,7 +147,9 @@ public class EntityRenderer extends EntityFX {
int stackdepth = GL11.glGetInteger(GL11.GL_MODELVIEW_STACK_DEPTH);
GL11.glPushMatrix();
GL11.glTranslatef(
- (float) (this.posX - renderPosX), (float) (this.posY - renderPosY), (float) (this.posZ - renderPosZ));
+ (float) (this.posX - renderPosX),
+ (float) (this.posY - renderPosY),
+ (float) (this.posZ - renderPosZ));
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
float desiredScale = MobUtils.getDesiredScale(entityToRender, 2f);
if (desiredScale < 1f) GL11.glScalef(desiredScale, desiredScale, desiredScale);
@@ -174,8 +165,7 @@ public class EntityRenderer extends EntityFX {
Tessellator tes = Tessellator.instance;
try {
tes.draw();
- } catch (Exception ignored) {
- }
+ } catch (Exception ignored) {}
}
BossStatus.healthScale = healthScale;
@@ -191,10 +181,8 @@ public class EntityRenderer extends EntityFX {
GL11.glPopAttrib();
int err;
- while ((err = GL11.glGetError()) != GL11.GL_NO_ERROR)
- if (Config.Debug.showRenderErrors)
- LOG.error(EntityList.getEntityString(entityToRender) + " | GL ERROR: " + err + " / "
- + GLU.gluErrorString(err));
+ while ((err = GL11.glGetError()) != GL11.GL_NO_ERROR) if (Config.Debug.showRenderErrors) LOG.error(
+ EntityList.getEntityString(entityToRender) + " | GL ERROR: " + err + " / " + GLU.gluErrorString(err));
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_COLOR_MATERIAL);
diff --git a/src/main/java/kubatech/client/effect/MegaApiaryBeesRenderer.java b/src/main/java/kubatech/client/effect/MegaApiaryBeesRenderer.java
index 43bcf03791..6758cf73df 100644
--- a/src/main/java/kubatech/client/effect/MegaApiaryBeesRenderer.java
+++ b/src/main/java/kubatech/client/effect/MegaApiaryBeesRenderer.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.client.effect;
@@ -22,6 +13,7 @@ package kubatech.client.effect;
import static net.minecraft.client.renderer.entity.RenderManager.*;
import kubatech.api.enums.ItemList;
+
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.OpenGlHelper;
@@ -30,10 +22,12 @@ import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
+
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class MegaApiaryBeesRenderer extends EntityFX {
+
public MegaApiaryBeesRenderer(World world, double x, double y, double z, int age) {
super(world, x, y + 2, z);
this.particleMaxAge = age;
@@ -42,9 +36,8 @@ public class MegaApiaryBeesRenderer extends EntityFX {
@Override
public void onUpdate() {
if (this.particleAge++ == this.particleMaxAge) this.setDead();
- if (this.particleAge % 4 == 0)
- if (this.particleAge % 8 == 0) this.posY += 0.1;
- else this.posY -= 0.1;
+ if (this.particleAge % 4 == 0) if (this.particleAge % 8 == 0) this.posY += 0.1;
+ else this.posY -= 0.1;
}
@Override
@@ -58,14 +51,8 @@ public class MegaApiaryBeesRenderer extends EntityFX {
}
@Override
- public void renderParticle(
- Tessellator p_70539_1_,
- float p_70539_2_,
- float p_70539_3_,
- float p_70539_4_,
- float p_70539_5_,
- float p_70539_6_,
- float p_70539_7_) {
+ public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_,
+ float p_70539_5_, float p_70539_6_, float p_70539_7_) {
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND);
@@ -73,7 +60,9 @@ public class MegaApiaryBeesRenderer extends EntityFX {
GL11.glPushMatrix();
GL11.glTranslatef(
- (float) (this.posX - renderPosX), (float) (this.posY - renderPosY), (float) (this.posZ - renderPosZ));
+ (float) (this.posX - renderPosX),
+ (float) (this.posY - renderPosY),
+ (float) (this.posZ - renderPosZ));
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glRotatef(180f, 1f, 0f, 0f);
diff --git a/src/main/java/kubatech/commands/CommandBees.java b/src/main/java/kubatech/commands/CommandBees.java
index 62f81fe7cf..2d6e746812 100644
--- a/src/main/java/kubatech/commands/CommandBees.java
+++ b/src/main/java/kubatech/commands/CommandBees.java
@@ -1,40 +1,35 @@
/*
- * 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.commands;
import static forestry.api.apiculture.BeeManager.beeRoot;
-import com.google.common.io.Files;
-import forestry.api.apiculture.IAlleleBeeSpecies;
-import forestry.api.apiculture.IBee;
-import forestry.api.apiculture.IBeeGenome;
import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;
+
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.item.ItemStack;
+import com.google.common.io.Files;
+
+import forestry.api.apiculture.IAlleleBeeSpecies;
+import forestry.api.apiculture.IBee;
+import forestry.api.apiculture.IBeeGenome;
+
public class CommandBees extends CommandBase {
+
@Override
public String getCommandName() {
return "bees";
@@ -116,9 +111,8 @@ public class CommandBees extends CommandBase {
chance *= 100f;
float productionModifier = (float) upgradeCount * 0.25f;
return (float) (((1f + t / 6f) * Math.sqrt(chance) * 2f * (1f + beeSpeed)
- + Math.pow(productionModifier, Math.cbrt(chance))
- - 3f)
- / 100f);
+ + Math.pow(productionModifier, Math.cbrt(chance))
+ - 3f) / 100f);
}
private double productChanceOld(int upgradeCount, double beeSpeed, double chance) {
diff --git a/src/main/java/kubatech/commands/CommandConfig.java b/src/main/java/kubatech/commands/CommandConfig.java
index 70c7f1d6e5..b2d9fb09e7 100644
--- a/src/main/java/kubatech/commands/CommandConfig.java
+++ b/src/main/java/kubatech/commands/CommandConfig.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.commands;
@@ -25,6 +16,7 @@ import kubatech.api.network.LoadConfigPacket;
import kubatech.config.Config;
import kubatech.kubatech;
import kubatech.loaders.MobRecipeLoader;
+
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -33,11 +25,13 @@ import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector;
public class CommandConfig extends CommandBase {
+
enum Translations {
+
INVALID_OPTION,
SUCCESS,
- USAGE,
- ;
+ USAGE,;
+
final String key;
Translations() {
diff --git a/src/main/java/kubatech/commands/CommandHandler.java b/src/main/java/kubatech/commands/CommandHandler.java
index 65be53b715..4694b9ca2f 100644
--- a/src/main/java/kubatech/commands/CommandHandler.java
+++ b/src/main/java/kubatech/commands/CommandHandler.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.commands;
@@ -22,6 +13,7 @@ package kubatech.commands;
import static kubatech.commands.CommandHandler.Translations.*;
import java.util.*;
+
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
@@ -31,12 +23,14 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
public class CommandHandler extends CommandBase {
+
enum Translations {
+
INVALID,
CANT_FIND,
GENERIC_HELP,
- USAGE,
- ;
+ USAGE,;
+
final String key;
Translations() {
@@ -95,14 +89,13 @@ public class CommandHandler extends CommandBase {
}
ICommand cmd = commands.get(p_71515_2_[0]);
if (!cmd.canCommandSenderUseCommand(p_71515_1_)) {
- ChatComponentTranslation chatcomponenttranslation2 =
- new ChatComponentTranslation("commands.generic.permission");
+ ChatComponentTranslation chatcomponenttranslation2 = new ChatComponentTranslation(
+ "commands.generic.permission");
chatcomponenttranslation2.getChatStyle().setColor(EnumChatFormatting.RED);
p_71515_1_.addChatMessage(chatcomponenttranslation2);
- } else
- cmd.processCommand(
- p_71515_1_,
- p_71515_2_.length > 1 ? Arrays.copyOfRange(p_71515_2_, 1, p_71515_2_.length) : new String[0]);
+ } else cmd.processCommand(
+ p_71515_1_,
+ p_71515_2_.length > 1 ? Arrays.copyOfRange(p_71515_2_, 1, p_71515_2_.length) : new String[0]);
}
@Override
diff --git a/src/main/java/kubatech/commands/CommandHelp.java b/src/main/java/kubatech/commands/CommandHelp.java
index 8c7d70df81..822c56dd5a 100644
--- a/src/main/java/kubatech/commands/CommandHelp.java
+++ b/src/main/java/kubatech/commands/CommandHelp.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.commands;
@@ -28,10 +19,12 @@ import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector;
public class CommandHelp extends CommandBase {
+
enum Translations {
+
POSSIBLE_COMMANDS,
- USAGE,
- ;
+ USAGE,;
+
final String key;
Translations() {
@@ -74,9 +67,7 @@ public class CommandHelp extends CommandBase {
@Override
public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) {
p_71515_1_.addChatMessage(new ChatComponentText(POSSIBLE_COMMANDS.get()));
- CommandHandler.commands
- .values()
- .forEach(c ->
- p_71515_1_.addChatMessage(new ChatComponentText("/kubatech " + c.getCommandUsage(p_71515_1_))));
+ CommandHandler.commands.values().forEach(
+ c -> p_71515_1_.addChatMessage(new ChatComponentText("/kubatech " + c.getCommandUsage(p_71515_1_))));
}
}
diff --git a/src/main/java/kubatech/commands/CommandTea.java b/src/main/java/kubatech/commands/CommandTea.java
index 7a34d452ce..726b8ce799 100644
--- a/src/main/java/kubatech/commands/CommandTea.java
+++ b/src/main/java/kubatech/commands/CommandTea.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.commands;
@@ -23,20 +14,23 @@ import static kubatech.commands.CommandTea.Translations.*;
import kubatech.savedata.PlayerData;
import kubatech.savedata.PlayerDataManager;
+
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector;
public class CommandTea extends CommandBase {
+
enum Translations {
+
INVALID_OPTION,
PLAYER_NOT_FOUND,
SUCCESS_GET,
SUCCESS_SET,
SUCCESS_ADD,
- USAGE,
- ;
+ USAGE,;
+
final String key;
Translations() {
diff --git a/src/main/java/kubatech/config/Config.java b/src/main/java/kubatech/config/Config.java
index 86acf47768..7b2520bccc 100644
--- a/src/main/java/kubatech/config/Config.java
+++ b/src/main/java/kubatech/config/Config.java
@@ -1,33 +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.config;
import java.io.File;
+
import kubatech.Tags;
+
import net.minecraftforge.common.config.Configuration;
public class Config {
private enum Category {
+
MOB_HANDLER("MobHandler"),
DEBUG("Debug");
+
final String categoryName;
Category(String s) {
@@ -49,6 +44,7 @@ public class Config {
public static boolean mobHandlerEnabled = true;
public enum _CacheRegenerationTrigger {
+
Never,
ModAdditionRemoval,
ModAdditionRemovalChange,
@@ -59,62 +55,41 @@ public class Config {
}
}
- public static _CacheRegenerationTrigger regenerationTrigger =
- _CacheRegenerationTrigger.ModAdditionRemovalChange;
+ public static _CacheRegenerationTrigger regenerationTrigger = _CacheRegenerationTrigger.ModAdditionRemovalChange;
public static boolean includeEmptyMobs = true;
public static String[] mobBlacklist;
public static double playerOnlyDropsModifier = .1d;
private static void load(Configuration configuration) {
Category category = Category.MOB_HANDLER;
- mobHandlerEnabled = configuration
- .get(
- category.get(),
- "Enabled",
- true,
- "Enable \"Mob Drops\" NEI page and Extreme Extermination Chamber")
- .getBoolean();
+ mobHandlerEnabled = configuration.get(
+ category.get(),
+ "Enabled",
+ true,
+ "Enable \"Mob Drops\" NEI page and Extreme Extermination Chamber").getBoolean();
StringBuilder c = new StringBuilder("When will cache regeneration trigger? ");
for (_CacheRegenerationTrigger value : _CacheRegenerationTrigger.values())
c.append(value.ordinal()).append(" - ").append(value.name()).append(", ");
- regenerationTrigger = _CacheRegenerationTrigger.get(configuration
- .get(
+ regenerationTrigger = _CacheRegenerationTrigger.get(
+ configuration.get(
category.get(),
"CacheRegenerationTrigger",
_CacheRegenerationTrigger.ModAdditionRemovalChange.ordinal(),
- c.toString())
- .getInt());
+ c.toString()).getInt());
includeEmptyMobs = configuration
.get(category.get(), "IncludeEmptyMobs", true, "Include mobs that have no drops in NEI")
.getBoolean();
- mobBlacklist = configuration
- .get(
- category.get(),
- "MobBlacklist",
- new String[] {
- "Giant",
- "Thaumcraft.TravelingTrunk",
- "chisel.snowman",
- "OpenBlocks.Luggage",
- "OpenBlocks.MiniMe",
- "SpecialMobs.SpecialCreeper",
- "SpecialMobs.SpecialZombie",
- "SpecialMobs.SpecialPigZombie",
- "SpecialMobs.SpecialSlime",
- "SpecialMobs.SpecialSkeleton",
- "SpecialMobs.SpecialEnderman",
- "SpecialMobs.SpecialCaveSpider",
- "SpecialMobs.SpecialGhast",
- "SpecialMobs.SpecialWitch",
- "SpecialMobs.SpecialSpider",
- "TwilightForest.HydraHead",
- "TwilightForest.RovingCube",
- "TwilightForest.Harbinger Cube",
- "TwilightForest.Adherent",
- "SpecialMobs.SpecialSilverfish",
- },
- "These mobs will be skipped when generating recipe map")
- .getStringList();
+ mobBlacklist = configuration.get(
+ category.get(),
+ "MobBlacklist",
+ new String[] { "Giant", "Thaumcraft.TravelingTrunk", "chisel.snowman", "OpenBlocks.Luggage",
+ "OpenBlocks.MiniMe", "SpecialMobs.SpecialCreeper", "SpecialMobs.SpecialZombie",
+ "SpecialMobs.SpecialPigZombie", "SpecialMobs.SpecialSlime", "SpecialMobs.SpecialSkeleton",
+ "SpecialMobs.SpecialEnderman", "SpecialMobs.SpecialCaveSpider", "SpecialMobs.SpecialGhast",
+ "SpecialMobs.SpecialWitch", "SpecialMobs.SpecialSpider", "TwilightForest.HydraHead",
+ "TwilightForest.RovingCube", "TwilightForest.Harbinger Cube", "TwilightForest.Adherent",
+ "SpecialMobs.SpecialSilverfish", },
+ "These mobs will be skipped when generating recipe map").getStringList();
playerOnlyDropsModifier = configuration
.get(
category.get(),
@@ -126,12 +101,12 @@ public class Config {
}
public static class Debug {
+
public static boolean showRenderErrors = false;
private static void load(Configuration configuration) {
Category category = Category.DEBUG;
- showRenderErrors =
- configuration.get(category.get(), "ShowRenderErrors", false).getBoolean();
+ showRenderErrors = configuration.get(category.get(), "ShowRenderErrors", false).getBoolean();
}
}
diff --git a/src/main/java/kubatech/config/OverridesConfig.java b/src/main/java/kubatech/config/OverridesConfig.java
index d58d3a27ed..365638727d 100644
--- a/src/main/java/kubatech/config/OverridesConfig.java
+++ b/src/main/java/kubatech/config/OverridesConfig.java
@@ -1,32 +1,15 @@
/*
- * 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.config;
-import com.dreammaster.main.MainRegistry;
-import com.dreammaster.modcustomdrops.CustomDrops;
-import com.google.common.io.Files;
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
-import cpw.mods.fml.common.registry.GameRegistry;
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.Unpooled;
import java.io.File;
import java.io.Reader;
import java.io.Writer;
@@ -35,26 +18,40 @@ 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;
import kubatech.api.helpers.ReflectionHelper;
import kubatech.api.mobhandler.MobDrop;
import kubatech.api.utils.GSONUtils;
+
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.JsonToNBT;
import net.minecraft.nbt.NBTTagCompound;
+
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import com.dreammaster.main.MainRegistry;
+import com.dreammaster.modcustomdrops.CustomDrops;
+import com.google.common.io.Files;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.Unpooled;
+
public class OverridesConfig {
private static final Logger LOG = LogManager.getLogger(Tags.MODID + "[Config-Overrides]");
public static class MobDropSimplified {
+
@GSONUtils.SkipGSON
ItemStack stack;
@@ -97,6 +94,7 @@ public class OverridesConfig {
}
public static class MobOverride {
+
public boolean removeAll = false;
public List<MobDrop> additions = new ArrayList<>();
public List<MobDropSimplified> removals = new ArrayList<>();
@@ -144,12 +142,12 @@ public class OverridesConfig {
overrides.values().forEach(o -> o.additions.forEach(MobDrop::reconstructStack));
if (LoaderReference.GTNHCoreMod) {
LOG.info("Detected GTNH Core Mod, parsing custom drops from there.");
- CustomDrops coredrops =
- ReflectionHelper.getField(MainRegistry.Module_CustomDrops, "_mCustomDrops", null);
+ CustomDrops coredrops = ReflectionHelper
+ .getField(MainRegistry.Module_CustomDrops, "_mCustomDrops", null);
if (coredrops != null) {
@SuppressWarnings("unchecked")
- ArrayList<CustomDrops.CustomDrop> customdrops = (ArrayList<CustomDrops.CustomDrop>)
- ((ArrayList<CustomDrops.CustomDrop>) coredrops.getCustomDrops()).clone();
+ ArrayList<CustomDrops.CustomDrop> customdrops = (ArrayList<CustomDrops.CustomDrop>) ((ArrayList<CustomDrops.CustomDrop>) coredrops
+ .getCustomDrops()).clone();
for (CustomDrops.CustomDrop customdrop : customdrops) {
try {
Class<?> eclass = Class.forName(customdrop.getEntityName());
@@ -166,8 +164,7 @@ public class OverridesConfig {
if (pNBT != null && !pNBT.isEmpty()) {
try {
stack.stackTagCompound = (NBTTagCompound) JsonToNBT.func_150315_a(pNBT);
- } catch (Exception ignored) {
- }
+ } catch (Exception ignored) {}
}
int chance = drop.getChance() * 100;
int amount = drop.getAmount();
@@ -196,11 +193,9 @@ public class OverridesConfig {
} catch (Exception ex) {
ex.printStackTrace();
} finally {
- if (reader != null)
- try {
- reader.close();
- } catch (Exception ignored) {
- }
+ if (reader != null) try {
+ reader.close();
+ } catch (Exception ignored) {}
}
}
@@ -217,19 +212,24 @@ public class OverridesConfig {
exdamages.put(1, 1);
exdamages.put(2, 5);
exdamages.put(3, 10);
- ex1.additions.add(new MobDrop(
- new ItemStack(Items.diamond_sword), MobDrop.DropType.Rare, 500, 20, exdamages, true, false));
+ ex1.additions.add(
+ new MobDrop(
+ new ItemStack(Items.diamond_sword),
+ MobDrop.DropType.Rare,
+ 500,
+ 20,
+ exdamages,
+ true,
+ false));
example.put("ExampleMob", ex1);
gson.toJson(example, writer);
writer.flush();
} catch (Exception ex) {
ex.printStackTrace();
} finally {
- if (writer != null)
- try {
- writer.close();
- } catch (Exception ignored) {
- }
+ if (writer != null) try {
+ writer.close();
+ } catch (Exception ignored) {}
}
}
}
diff --git a/src/main/java/kubatech/kubatech.java b/src/main/java/kubatech/kubatech.java
index 656733701b..b12693dec4 100644
--- a/src/main/java/kubatech/kubatech.java
+++ b/src/main/java/kubatech/kubatech.java
@@ -1,41 +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;
import static kubatech.api.enums.ItemList.LegendaryRedTea;
-import cpw.mods.fml.common.Mod;
-import cpw.mods.fml.common.SidedProxy;
-import cpw.mods.fml.common.event.*;
-import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
-import cpw.mods.fml.relauncher.Side;
import java.util.List;
+
import kubatech.api.enums.ItemList;
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;
+import cpw.mods.fml.common.Mod;
+import cpw.mods.fml.common.SidedProxy;
+import cpw.mods.fml.common.event.*;
+import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
+import cpw.mods.fml.relauncher.Side;
+
@SuppressWarnings("unused")
@Mod(
modid = Tags.MODID,
@@ -43,15 +38,25 @@ import org.apache.logging.log4j.Logger;
name = Tags.MODNAME,
acceptedMinecraftVersions = "[1.7.10]",
dependencies = "required-after: gregtech; " + "required-after: gtnhmixins@[2.0.1,); "
- + "required-after: modularui; " + "after: EnderIO; "
- + "after: AWWayofTime; " + "after: ExtraUtilities; " + "after: InfernalMobs; " + "after: Thaumcraft; "
- + "after: MineTweaker3; " + "after: miscutils; " + "after: harvestcraft; " + "after: Forestry; "
- + "after: DraconicEvolution; " + "after: Avaritia; " + " after: dreamcraft; ")
+ + "required-after: modularui; "
+ + "after: EnderIO; "
+ + "after: AWWayofTime; "
+ + "after: ExtraUtilities; "
+ + "after: InfernalMobs; "
+ + "after: Thaumcraft; "
+ + "after: MineTweaker3; "
+ + "after: miscutils; "
+ + "after: harvestcraft; "
+ + "after: Forestry; "
+ + "after: DraconicEvolution; "
+ + "after: Avaritia; "
+ + " after: dreamcraft; ")
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
diff --git a/src/main/java/kubatech/loaders/BlockLoader.java b/src/main/java/kubatech/loaders/BlockLoader.java
index 10efcb018f..feed715fa7 100644
--- a/src/main/java/kubatech/loaders/BlockLoader.java
+++ b/src/main/java/kubatech/loaders/BlockLoader.java
@@ -1,33 +1,26 @@
/*
- * 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.loaders;
-import cpw.mods.fml.common.registry.GameRegistry;
import kubatech.api.enums.ItemList;
import kubatech.loaders.block.KubaBlock;
import kubatech.loaders.block.KubaItemBlock;
import kubatech.loaders.block.blocks.TeaAcceptor;
import kubatech.tileentity.TeaAcceptorTile;
+
import net.minecraft.block.material.Material;
import net.minecraft.item.ItemBlock;
+import cpw.mods.fml.common.registry.GameRegistry;
+
public class BlockLoader {
public static final KubaBlock kubaBlock = new KubaBlock(Material.anvil);
diff --git a/src/main/java/kubatech/loaders/ItemLoader.java b/src/main/java/kubatech/loaders/ItemLoader.java
index 31bf042794..a0f28dc391 100644
--- a/src/main/java/kubatech/loaders/ItemLoader.java
+++ b/src/main/java/kubatech/loaders/ItemLoader.java
@@ -1,32 +1,24 @@
/*
- * 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.loaders;
import static kubatech.api.enums.ItemList.*;
-import cpw.mods.fml.common.registry.GameRegistry;
import kubatech.loaders.item.ItemProxy;
import kubatech.loaders.item.KubaItems;
import kubatech.loaders.item.items.*;
+import cpw.mods.fml.common.registry.GameRegistry;
public class ItemLoader {
+
public static final KubaItems kubaitems = new KubaItems();
public static void registerItems() {
@@ -74,8 +66,8 @@ public class ItemLoader {
BruisedTeaLeaf.set(kubaitems.registerProxyItem(new TeaIngredient("bruised_tea_leaf")));
PartiallyOxidizedTeaLeaf.set(kubaitems.registerProxyItem(new TeaIngredient("partially_oxidized_tea_leaf")));
- TeaAcceptorResearchNote.set(
- kubaitems.registerProxyItem(new ItemProxy("tea_acceptor_research_note", "research_note")));
+ TeaAcceptorResearchNote
+ .set(kubaitems.registerProxyItem(new ItemProxy("tea_acceptor_research_note", "research_note")));
Beeeeee.set(kubaitems.registerProxyItem(new ItemProxy("beeeeee", "beeeeee")));
}
}
diff --git a/src/main/java/kubatech/loaders/MTLoader.java b/src/main/java/kubatech/loaders/MTLoader.java
index cf0b0b1fd4..d223e83951 100644
--- a/src/main/java/kubatech/loaders/MTLoader.java
+++ b/src/main/java/kubatech/loaders/MTLoader.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.loaders;
@@ -22,6 +13,7 @@ package kubatech.loaders;
import kubatech.Tags;
import kubatech.api.LoaderReference;
import minetweaker.MineTweakerImplementationAPI;
+
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
diff --git a/src/main/java/kubatech/loaders/MobRecipeLoader.java b/src/main/java/kubatech/loaders/MobRecipeLoader.java
index 43fefc2a97..f530b8921b 100644
--- a/src/main/java/kubatech/loaders/MobRecipeLoader.java
+++ b/src/main/java/kubatech/loaders/MobRecipeLoader.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.loaders;
@@ -23,16 +14,6 @@ import static kubatech.api.utils.ModUtils.isClientSided;
import static kubatech.api.utils.ModUtils.isDeobfuscatedEnvironment;
import static kubatech.tileentity.gregtech.multiblock.GT_MetaTileEntity_ExtremeExterminationChamber.*;
-import atomicstryker.infernalmobs.common.InfernalMobsCore;
-import atomicstryker.infernalmobs.common.MobModifier;
-import atomicstryker.infernalmobs.common.mods.api.ModifierLoader;
-import com.google.common.io.Files;
-import com.google.gson.Gson;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.GT_DummyWorld;
import java.io.File;
import java.io.Reader;
import java.io.Writer;
@@ -42,6 +23,7 @@ import java.lang.reflect.Modifier;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.stream.Collectors;
+
import kubatech.Tags;
import kubatech.api.LoaderReference;
import kubatech.api.helpers.EnderIOHelper;
@@ -58,6 +40,7 @@ import minetweaker.MineTweakerAPI;
import minetweaker.api.entity.IEntityDefinition;
import minetweaker.api.item.IItemStack;
import minetweaker.mc1710.item.MCItemStack;
+
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
@@ -78,10 +61,24 @@ import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.client.event.GuiOpenEvent;
import net.minecraftforge.common.MinecraftForge;
+
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+
import stanhebben.zenscript.value.IntRange;
import thaumcraft.common.items.wands.ItemWandCasting;
+import atomicstryker.infernalmobs.common.InfernalMobsCore;
+import atomicstryker.infernalmobs.common.MobModifier;
+import atomicstryker.infernalmobs.common.mods.api.ModifierLoader;
+
+import com.google.common.io.Files;
+import com.google.gson.Gson;
+
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.GT_DummyWorld;
public class MobRecipeLoader {
@@ -108,6 +105,7 @@ public class MobRecipeLoader {
public static final String randomEnchantmentDetectedString = "RandomEnchantmentDetected";
public static class MobRecipe {
+
public final ArrayList<MobDrop> mOutputs;
public final int mEUt = 2000;
public final int mDuration;
@@ -134,15 +132,8 @@ public class MobRecipeLoader {
isUsable);
}
- private MobRecipe(
- ArrayList<MobDrop> mOutputs,
- int mDuration,
- int mMaxDamageChance,
- boolean infernalityAllowed,
- boolean alwaysinfernal,
- boolean isPeacefulAllowed,
- EntityLiving entity,
- float maxEntityHealth,
+ private MobRecipe(ArrayList<MobDrop> mOutputs, int mDuration, int mMaxDamageChance, boolean infernalityAllowed,
+ boolean alwaysinfernal, boolean isPeacefulAllowed, EntityLiving entity, float maxEntityHealth,
boolean isUsable) {
this.mOutputs = mOutputs;
this.mDuration = mDuration;
@@ -164,39 +155,38 @@ public class MobRecipeLoader {
if (infernaldrops == null && LoaderReference.InfernalMobs) {
infernaldrops = new droplist();
LOG.info("Generating Infernal drops");
- ArrayList<ModifierLoader<?>> modifierLoaders = (ArrayList<ModifierLoader<?>>)
- InfernalHelper.getModifierLoaders().clone();
+ ArrayList<ModifierLoader<?>> modifierLoaders = (ArrayList<ModifierLoader<?>>) InfernalHelper
+ .getModifierLoaders().clone();
int i = 0;
for (ModifierLoader<?> modifierLoader : modifierLoaders) {
MobModifier nextMod = modifierLoader.make(null);
- if (nextMod.getBlackListMobClasses() != null)
- for (Class<?> cl : nextMod.getBlackListMobClasses())
- if (e.getClass().isAssignableFrom(cl)) break;
+ if (nextMod.getBlackListMobClasses() != null) for (Class<?> cl : nextMod.getBlackListMobClasses())
+ if (e.getClass().isAssignableFrom(cl)) break;
i++;
}
if (i > 0) {
- double chance =
- InfernalHelper.checkEntityClassForced(e) ? 1d : (1d / InfernalHelper.getEliteRarity());
+ double chance = InfernalHelper.checkEntityClassForced(e) ? 1d
+ : (1d / InfernalHelper.getEliteRarity());
ArrayList<ItemStack> elitelist = InfernalHelper.getDropIdListElite();
for (ItemStack stack : elitelist) {
- dropinstance instance = infernaldrops.add(
- new dropinstance(stack.copy(), infernaldrops), chance / elitelist.size());
+ dropinstance instance = infernaldrops
+ .add(new dropinstance(stack.copy(), infernaldrops), chance / elitelist.size());
instance.isEnchatmentRandomized = true;
instance.enchantmentLevel = stack.getItem().getItemEnchantability();
}
ArrayList<ItemStack> ultralist = InfernalHelper.getDropIdListUltra();
chance *= 1d / InfernalHelper.getUltraRarity();
for (ItemStack stack : ultralist) {
- dropinstance instance = infernaldrops.add(
- new dropinstance(stack.copy(), infernaldrops), chance / ultralist.size());
+ dropinstance instance = infernaldrops
+ .add(new dropinstance(stack.copy(), infernaldrops), chance / ultralist.size());
instance.isEnchatmentRandomized = true;
instance.enchantmentLevel = stack.getItem().getItemEnchantability();
}
ArrayList<ItemStack> infernallist = InfernalHelper.getDropIdListInfernal();
chance *= 1d / InfernalHelper.getInfernoRarity();
for (ItemStack stack : infernallist) {
- dropinstance instance = infernaldrops.add(
- new dropinstance(stack.copy(), infernaldrops), chance / infernallist.size());
+ dropinstance instance = infernaldrops
+ .add(new dropinstance(stack.copy(), infernaldrops), chance / infernallist.size());
instance.isEnchatmentRandomized = true;
instance.enchantmentLevel = stack.getItem().getItemEnchantability();
}
@@ -223,12 +213,8 @@ public class MobRecipeLoader {
mMaxDamageChance = maxdamagechance;
}
- public ItemStack[] generateOutputs(
- Random rnd,
- GT_MetaTileEntity_ExtremeExterminationChamber MTE,
- double attackDamage,
- int lootinglevel,
- boolean preferInfernalDrops) {
+ public ItemStack[] generateOutputs(Random rnd, GT_MetaTileEntity_ExtremeExterminationChamber MTE,
+ double attackDamage, int lootinglevel, boolean preferInfernalDrops) {
MTE.lEUt = mEUt;
MTE.mMaxProgresstime = Math.max(MOB_SPAWN_INTERVAL, (int) ((maxEntityHealth / attackDamage) * 10d));
ArrayList<ItemStack> stacks = new ArrayList<>(mOutputs.size());
@@ -266,8 +252,7 @@ public class MobRecipeLoader {
}
}
- if (infernalityAllowed
- && mEUt * 8 < MTE.getMaxInputVoltage()
+ if (infernalityAllowed && mEUt * 8 < MTE.getMaxInputVoltage()
&& !InfernalHelper.getDimensionBlackList()
.contains(MTE.getBaseMetaTileEntity().getWorld().provider.dimensionId)) {
int p = 0;
@@ -280,23 +265,20 @@ public class MobRecipeLoader {
}
}
ArrayList<ItemStack> infernalstacks = null;
- if (p > 0)
- if (p == 1) {
- infernalstacks = InfernalHelper.getDropIdListElite();
- mods = InfernalHelper.getMinEliteModifiers();
- } else if (p == 2) {
- infernalstacks = InfernalHelper.getDropIdListUltra();
- mods = InfernalHelper.getMinUltraModifiers();
- } else if (p == 3) {
- infernalstacks = InfernalHelper.getDropIdListInfernal();
- mods = InfernalHelper.getMinInfernoModifiers();
- }
+ if (p > 0) if (p == 1) {
+ infernalstacks = InfernalHelper.getDropIdListElite();
+ mods = InfernalHelper.getMinEliteModifiers();
+ } else if (p == 2) {
+ infernalstacks = InfernalHelper.getDropIdListUltra();
+ mods = InfernalHelper.getMinUltraModifiers();
+ } else if (p == 3) {
+ infernalstacks = InfernalHelper.getDropIdListInfernal();
+ mods = InfernalHelper.getMinInfernoModifiers();
+ }
if (infernalstacks != null) {
- ItemStack infernalstack = infernalstacks
- .get(rnd.nextInt(infernalstacks.size()))
- .copy();
- EnchantmentHelper.addRandomEnchantment(
- rnd, infernalstack, infernalstack.getItem().getItemEnchantability());
+ ItemStack infernalstack = infernalstacks.get(rnd.nextInt(infernalstacks.size())).copy();
+ EnchantmentHelper
+ .addRandomEnchantment(rnd, infernalstack, infernalstack.getItem().getItemEnchantability());
stacks.add(infernalstack);
MTE.mEUt *= 8L;
MTE.mMaxProgresstime *= mods * InfernalMobsCore.instance().getMobModHealthFactor();
@@ -308,7 +290,9 @@ public class MobRecipeLoader {
}
public static class fakeRand extends Random {
+
private static class nexter {
+
private final int type;
private final int bound;
private int next;
@@ -413,6 +397,7 @@ public class MobRecipeLoader {
}
private static class dropinstance {
+
public boolean isDamageRandomized = false;
public HashMap<Integer, Integer> damagesPossible = new HashMap<>();
public boolean isEnchatmentRandomized = false;
@@ -441,6 +426,7 @@ public class MobRecipeLoader {
}
public static class droplist {
+
private final ArrayList<dropinstance> drops = new ArrayList<>();
private final HashMap<GT_Utility.ItemId, Integer> dropschecker = new HashMap<>();
@@ -492,6 +478,7 @@ public class MobRecipeLoader {
}
private static class dropCollector {
+
final HashMap<GT_Utility.ItemId, Integer> damagableChecker = new HashMap<>();
private boolean booksAlwaysRandomlyEnchanted = false;
@@ -500,8 +487,8 @@ public class MobRecipeLoader {
ItemStack ostack = entityItem.getEntityItem();
if (ostack == null) continue;
dropinstance drop;
- boolean randomchomenchantdetected =
- ostack.hasTagCompound() && ostack.stackTagCompound.hasKey(randomEnchantmentDetectedString);
+ boolean randomchomenchantdetected = ostack.hasTagCompound()
+ && ostack.stackTagCompound.hasKey(randomEnchantmentDetectedString);
int randomenchantmentlevel = 0;
if (randomchomenchantdetected) {
randomenchantmentlevel = ostack.stackTagCompound.getInteger(randomEnchantmentDetectedString);
@@ -559,6 +546,7 @@ public class MobRecipeLoader {
}
public static class GeneralMappedMob {
+
public final EntityLiving mob;
public final MobRecipe recipe;
public final ArrayList<MobDrop> drops;
@@ -573,11 +561,12 @@ public class MobRecipeLoader {
public static final HashMap<String, GeneralMappedMob> GeneralMobList = new HashMap<>();
private static class MobRecipeLoaderCacheStructure {
+
String version;
Map<String, ArrayList<MobDrop>> moblist;
}
- @SuppressWarnings({"unchecked", "UnstableApiUsage"})
+ @SuppressWarnings({ "unchecked", "UnstableApiUsage" })
public static void generateMobRecipeMap() {
if (alreadyGenerated) return;
@@ -585,6 +574,7 @@ public class MobRecipeLoader {
if (!Config.MobHandler.mobHandlerEnabled) return;
World f = new GT_DummyWorld() {
+
@Override
public boolean blockExists(int p_72899_1_, int p_72899_2_, int p_72899_3_) {
return false;
@@ -598,11 +588,8 @@ public class MobRecipeLoader {
@Override
public Block getBlock(int aX, int aY, int aZ) {
- if (LoaderReference.TwilightForest
- && new Throwable()
- .getStackTrace()[1]
- .getClassName()
- .equals("twilightforest.client.renderer.entity.RenderTFSnowQueenIceShield"))
+ if (LoaderReference.TwilightForest && new Throwable().getStackTrace()[1].getClassName()
+ .equals("twilightforest.client.renderer.entity.RenderTFSnowQueenIceShield"))
return Blocks.packed_ice;
return super.getBlock(aX, aY, aZ);
}
@@ -637,17 +624,14 @@ public class MobRecipeLoader {
&& !EntityList.stringToClassMapping.containsKey("witherSkeleton")) {
e = new EntitySkeleton(f);
((EntitySkeleton) e).setSkeletonType(1);
- } else
- e = (EntityLiving) ((Class<?>) EntityList.stringToClassMapping.get(mobName))
- .getConstructor(new Class[] {World.class})
- .newInstance(new Object[] {f});
+ } else e = (EntityLiving) ((Class<?>) EntityList.stringToClassMapping.get(mobName))
+ .getConstructor(new Class[] { World.class }).newInstance(new Object[] { f });
ArrayList<MobDrop> drops = entry.getValue();
drops.forEach(MobDrop::reconstructStack);
GeneralMobList.put(
mobName,
new GeneralMappedMob(e, MobRecipe.generateMobRecipe(e, mobName, drops), drops));
- } catch (Exception ignored) {
- }
+ } catch (Exception ignored) {}
}
LOG.info("Parsed cached map, skipping generation");
return;
@@ -657,11 +641,9 @@ public class MobRecipeLoader {
} catch (Exception ignored) {
LOG.warn("There was an exception while parsing cached map, generating a new one");
} finally {
- if (reader != null)
- try {
- reader.close();
- } catch (Exception ignored) {
- }
+ if (reader != null) try {
+ reader.close();
+ } catch (Exception ignored) {}
}
} else {
LOG.info("Cached map doesn't exist or config option forced, generating a new one");
@@ -702,8 +684,7 @@ public class MobRecipeLoader {
dropCollector collector = new dropCollector();
// Stupid MC code, I need to cast myself
- Map<String, Class<? extends Entity>> stringToClassMapping =
- (Map<String, Class<? extends Entity>>) EntityList.stringToClassMapping;
+ Map<String, Class<? extends Entity>> stringToClassMapping = (Map<String, Class<? extends Entity>>) EntityList.stringToClassMapping;
boolean registeringWitherSkeleton = !stringToClassMapping.containsKey("witherSkeleton");
if (registeringWitherSkeleton) stringToClassMapping.put("witherSkeleton", EntitySkeleton.class);
@@ -717,7 +698,7 @@ public class MobRecipeLoader {
EntityLiving e;
try {
- e = (EntityLiving) v.getConstructor(new Class[] {World.class}).newInstance(new Object[] {f});
+ e = (EntityLiving) v.getConstructor(new Class[] { World.class }).newInstance(new Object[] { f });
} catch (ClassCastException ex) {
// not a EntityLiving
LOG.info("Entity " + k + " is not a LivingEntity, skipping");
@@ -746,13 +727,12 @@ public class MobRecipeLoader {
// POWERFULL GENERATION
- if (e instanceof EntitySlime)
- try {
- setSlimeSize.invoke(e, 1);
- } catch (Exception ex) {
- ex.printStackTrace();
- return;
- }
+ if (e instanceof EntitySlime) try {
+ setSlimeSize.invoke(e, 1);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ return;
+ }
try {
rand.set(e, frand);
@@ -909,95 +889,94 @@ public class MobRecipeLoader {
int max = Math.max(maxdamage - 25, 1);
for (int d = Math.min(max, 25); d <= max; d++) i.damagesPossible.put(d, 1);
additionaldrops.add(i, 1d);
- } else
- try {
- Class<?> cl = e.getClass();
- boolean detectedException;
- do {
- detectedException = false;
- try {
- cl.getDeclaredMethod(addRandomArmorName);
- } catch (Exception ex) {
- detectedException = true;
- cl = cl.getSuperclass();
- }
- } while (detectedException && !cl.equals(Entity.class));
- if (cl.equals(EntityLiving.class) || cl.equals(Entity.class)) throw new Exception();
- cl = e.getClass();
- do {
- detectedException = false;
- try {
- cl.getDeclaredMethod(enchantEquipmentName);
- } catch (Exception ex) {
- detectedException = true;
- cl = cl.getSuperclass();
- }
- } while (detectedException && !cl.equals(EntityLiving.class));
- boolean usingVanillaEnchantingMethod = cl.equals(EntityLiving.class);
- double chanceModifierLocal = 1f;
- if (v.getName().startsWith("twilightforest.entity")) {
- frand.forceFloatValue = 0f;
- chanceModifierLocal = 0.25f;
+ } else try {
+ Class<?> cl = e.getClass();
+ boolean detectedException;
+ do {
+ detectedException = false;
+ try {
+ cl.getDeclaredMethod(addRandomArmorName);
+ } catch (Exception ex) {
+ detectedException = true;
+ cl = cl.getSuperclass();
+ }
+ } while (detectedException && !cl.equals(Entity.class));
+ if (cl.equals(EntityLiving.class) || cl.equals(Entity.class)) throw new Exception();
+ cl = e.getClass();
+ do {
+ detectedException = false;
+ try {
+ cl.getDeclaredMethod(enchantEquipmentName);
+ } catch (Exception ex) {
+ detectedException = true;
+ cl = cl.getSuperclass();
}
- second = false;
- do {
- addRandomArmor.invoke(e);
- if (!usingVanillaEnchantingMethod) enchantEquipment.invoke(e);
- ItemStack[] lastActiveItems = e.getLastActiveItems();
- for (int j = 0, lastActiveItemsLength = lastActiveItems.length;
- j < lastActiveItemsLength;
- j++) {
- ItemStack stack = lastActiveItems[j];
- if (stack != null) {
- if (LoaderReference.Thaumcraft)
- if (stack.getItem() instanceof ItemWandCasting)
- continue; // crashes the game when rendering in GUI
-
- int randomenchant = -1;
- if (stack.hasTagCompound()
- && stack.stackTagCompound.hasKey(randomEnchantmentDetectedString)) {
- randomenchant = stack.stackTagCompound.getInteger(randomEnchantmentDetectedString);
- stack.stackTagCompound.removeTag("ench");
- }
- dropinstance i = additionaldrops.add(
+ } while (detectedException && !cl.equals(EntityLiving.class));
+ boolean usingVanillaEnchantingMethod = cl.equals(EntityLiving.class);
+ double chanceModifierLocal = 1f;
+ if (v.getName().startsWith("twilightforest.entity")) {
+ frand.forceFloatValue = 0f;
+ chanceModifierLocal = 0.25f;
+ }
+ second = false;
+ do {
+ addRandomArmor.invoke(e);
+ if (!usingVanillaEnchantingMethod) enchantEquipment.invoke(e);
+ ItemStack[] lastActiveItems = e.getLastActiveItems();
+ for (int j = 0, lastActiveItemsLength = lastActiveItems.length; j < lastActiveItemsLength; j++) {
+ ItemStack stack = lastActiveItems[j];
+ if (stack != null) {
+ if (LoaderReference.Thaumcraft) if (stack.getItem() instanceof ItemWandCasting) continue; // crashes
+ // the
+ // game
+ // when
+ // rendering
+ // in
+ // GUI
+
+ int randomenchant = -1;
+ if (stack.hasTagCompound()
+ && stack.stackTagCompound.hasKey(randomEnchantmentDetectedString)) {
+ randomenchant = stack.stackTagCompound.getInteger(randomEnchantmentDetectedString);
+ stack.stackTagCompound.removeTag("ench");
+ }
+ dropinstance i = additionaldrops.add(
+ new dropinstance(stack.copy(), additionaldrops),
+ frand.chance * chanceModifierLocal
+ * (usingVanillaEnchantingMethod ? (j == 0 ? 0.75d : 0.5d) : 1d));
+ if (!i.isDamageRandomized && i.stack.isItemStackDamageable()) {
+ i.isDamageRandomized = true;
+ int maxdamage = i.stack.getMaxDamage();
+ int max = Math.max(maxdamage - 25, 1);
+ for (int d = Math.min(max, 25); d <= max; d++) i.damagesPossible.put(d, 1);
+ }
+ if (!i.isEnchatmentRandomized && randomenchant != -1) {
+ i.isEnchatmentRandomized = true;
+ i.enchantmentLevel = randomenchant;
+ }
+ if (usingVanillaEnchantingMethod) {
+ if (!stack.hasTagCompound()) stack.stackTagCompound = new NBTTagCompound();
+ stack.stackTagCompound.setInteger(randomEnchantmentDetectedString, 14);
+ dropinstance newdrop = additionaldrops.add(
new dropinstance(stack.copy(), additionaldrops),
- frand.chance
- * chanceModifierLocal
- * (usingVanillaEnchantingMethod ? (j == 0 ? 0.75d : 0.5d) : 1d));
- if (!i.isDamageRandomized && i.stack.isItemStackDamageable()) {
- i.isDamageRandomized = true;
- int maxdamage = i.stack.getMaxDamage();
- int max = Math.max(maxdamage - 25, 1);
- for (int d = Math.min(max, 25); d <= max; d++) i.damagesPossible.put(d, 1);
- }
- if (!i.isEnchatmentRandomized && randomenchant != -1) {
- i.isEnchatmentRandomized = true;
- i.enchantmentLevel = randomenchant;
- }
- if (usingVanillaEnchantingMethod) {
- if (!stack.hasTagCompound()) stack.stackTagCompound = new NBTTagCompound();
- stack.stackTagCompound.setInteger(randomEnchantmentDetectedString, 14);
- dropinstance newdrop = additionaldrops.add(
- new dropinstance(stack.copy(), additionaldrops),
- frand.chance * chanceModifierLocal * (j == 0 ? 0.25d : 0.5d));
- newdrop.isEnchatmentRandomized = true;
- newdrop.enchantmentLevel = 14;
- newdrop.isDamageRandomized = i.isDamageRandomized;
- newdrop.damagesPossible = (HashMap<Integer, Integer>) i.damagesPossible.clone();
- }
+ frand.chance * chanceModifierLocal * (j == 0 ? 0.25d : 0.5d));
+ newdrop.isEnchatmentRandomized = true;
+ newdrop.enchantmentLevel = 14;
+ newdrop.isDamageRandomized = i.isDamageRandomized;
+ newdrop.damagesPossible = (HashMap<Integer, Integer>) i.damagesPossible.clone();
}
}
- Arrays.fill(e.getLastActiveItems(), null);
+ }
+ Arrays.fill(e.getLastActiveItems(), null);
- if (second && frand.chance < 0.0000001d) {
- LOG.warn("Skipping " + k + " additional dropmap because it's too randomized");
- break;
- }
- second = true;
+ if (second && frand.chance < 0.0000001d) {
+ LOG.warn("Skipping " + k + " additional dropmap because it's too randomized");
+ break;
+ }
+ second = true;
- } while (frand.nextRound());
- } catch (Exception ignored) {
- }
+ } while (frand.nextRound());
+ } catch (Exception ignored) {}
frand.newRound();
collector.newRound();
@@ -1025,14 +1004,15 @@ public class MobRecipeLoader {
chance = 1;
}
dropinstance dlooting = dropslooting.get(drop);
- moboutputs.add(new MobDrop(
- stack,
- MobDrop.DropType.Normal,
- chance,
- drop.isEnchatmentRandomized ? drop.enchantmentLevel : null,
- drop.isDamageRandomized ? drop.damagesPossible : null,
- dlooting != null && dlooting.dropcount > drop.dropcount,
- false));
+ moboutputs.add(
+ new MobDrop(
+ stack,
+ MobDrop.DropType.Normal,
+ chance,
+ drop.isEnchatmentRandomized ? drop.enchantmentLevel : null,
+ drop.isDamageRandomized ? drop.damagesPossible : null,
+ dlooting != null && dlooting.dropcount > drop.dropcount,
+ false));
}
for (dropinstance drop : raredrops.drops) {
ItemStack stack = drop.stack;
@@ -1047,14 +1027,15 @@ public class MobRecipeLoader {
LOG.warn("Detected 0% loot, setting to 0.01%");
chance = 1;
}
- moboutputs.add(new MobDrop(
- stack,
- MobDrop.DropType.Rare,
- chance,
- drop.isEnchatmentRandomized ? drop.enchantmentLevel : null,
- drop.isDamageRandomized ? drop.damagesPossible : null,
- false,
- false));
+ moboutputs.add(
+ new MobDrop(
+ stack,
+ MobDrop.DropType.Rare,
+ chance,
+ drop.isEnchatmentRandomized ? drop.enchantmentLevel : null,
+ drop.isDamageRandomized ? drop.damagesPossible : null,
+ false,
+ false));
}
for (dropinstance drop : superraredrops.drops) {
if (raredrops.contains(drop)) continue;
@@ -1070,14 +1051,15 @@ public class MobRecipeLoader {
LOG.warn("Detected 0% loot, setting to 0.01%");
chance = 1;
}
- moboutputs.add(new MobDrop(
- stack,
- MobDrop.DropType.Rare,
- chance,
- drop.isEnchatmentRandomized ? drop.enchantmentLevel : null,
- drop.isDamageRandomized ? drop.damagesPossible : null,
- false,
- false));
+ moboutputs.add(
+ new MobDrop(
+ stack,
+ MobDrop.DropType.Rare,
+ chance,
+ drop.isEnchatmentRandomized ? drop.enchantmentLevel : null,
+ drop.isDamageRandomized ? drop.damagesPossible : null,
+ false,
+ false));
}
for (dropinstance drop : additionaldrops.drops) {
ItemStack stack = drop.stack;
@@ -1092,14 +1074,15 @@ public class MobRecipeLoader {
LOG.warn("Detected 0% loot, setting to 0.01%");
chance = 1;
}
- moboutputs.add(new MobDrop(
- stack,
- MobDrop.DropType.Additional,
- chance,
- drop.isEnchatmentRandomized ? drop.enchantmentLevel : null,
- drop.isDamageRandomized ? drop.damagesPossible : null,
- false,
- false));
+ moboutputs.add(
+ new MobDrop(
+ stack,
+ MobDrop.DropType.Additional,
+ chance,
+ drop.isEnchatmentRandomized ? drop.enchantmentLevel : null,
+ drop.isDamageRandomized ? drop.damagesPossible : null,
+ false,
+ false));
}
GeneralMobList.put(k, new GeneralMappedMob(e, MobRecipe.generateMobRecipe(e, k, moboutputs), moboutputs));
@@ -1130,11 +1113,9 @@ public class MobRecipeLoader {
} catch (Exception e) {
e.printStackTrace();
} finally {
- if (writer != null)
- try {
- writer.close();
- } catch (Exception ignored) {
- }
+ if (writer != null) try {
+ writer.close();
+ } catch (Exception ignored) {}
}
}
@@ -1170,11 +1151,10 @@ public class MobRecipeLoader {
if (override.removeAll) {
drops.clear();
recipe.mOutputs.clear();
- } else
- for (OverridesConfig.MobDropSimplified removal : override.removals) {
- drops.removeIf(removal::isMatching);
- recipe.mOutputs.removeIf(removal::isMatching);
- }
+ } else for (OverridesConfig.MobDropSimplified removal : override.removals) {
+ drops.removeIf(removal::isMatching);
+ recipe.mOutputs.removeIf(removal::isMatching);
+ }
drops.addAll(override.additions);
recipe.mOutputs.addAll(override.additions);
LoadConfigPacket.instance.mobsOverrides.put(k, override);
@@ -1195,8 +1175,8 @@ public class MobRecipeLoader {
}
@SideOnly(Side.CLIENT)
- public static void processMobRecipeMap(
- HashSet<String> mobs, HashMap<String, OverridesConfig.MobOverride> overrides) {
+ public static void processMobRecipeMap(HashSet<String> mobs,
+ HashMap<String, OverridesConfig.MobOverride> overrides) {
if (isClientSided) Mob_Handler.clearRecipes();
MobNameToRecipeMap.clear();
mobs.forEach(k -> {
@@ -1216,11 +1196,10 @@ public class MobRecipeLoader {
if (override.removeAll) {
drops.clear();
recipe.mOutputs.clear();
- } else
- for (OverridesConfig.MobDropSimplified removal : override.removals) {
- drops.removeIf(removal::isMatching);
- recipe.mOutputs.removeIf(removal::isMatching);
- }
+ } else for (OverridesConfig.MobDropSimplified removal : override.removals) {
+ drops.removeIf(removal::isMatching);
+ recipe.mOutputs.removeIf(removal::isMatching);
+ }
drops.addAll(override.additions);
recipe.mOutputs.addAll(override.additions);
drops.sort(Comparator.comparing(d -> d.type)); // Fix GUI
@@ -1236,6 +1215,7 @@ public class MobRecipeLoader {
}
private static class Optionals {
+
private static void parseMTAdditions(String k, ArrayList<MobDrop> drops, MobRecipe recipe) {
IEntityDefinition ie = MineTweakerAPI.game.getEntity(k);
if (ie != null) {
@@ -1251,12 +1231,17 @@ public class MobRecipeLoader {
}
ItemStack stack = ((ItemStack) entry.getKey().getInternal()).copy();
MobDrop drop = new MobDrop(
- stack, MobDrop.DropType.Normal, (int) (chance * 10000), null, null, false, false);
+ stack,
+ MobDrop.DropType.Normal,
+ (int) (chance * 10000),
+ null,
+ null,
+ false,
+ false);
drops.add(drop);
recipe.mOutputs.add(drop);
}
- for (Map.Entry<IItemStack, IntRange> entry :
- ie.getDropsToAddPlayerOnly().entrySet()) {
+ for (Map.Entry<IItemStack, IntRange> entry : ie.getDropsToAddPlayerOnly().entrySet()) {
IntRange r = entry.getValue();
// Get average chance
double chance;
@@ -1268,12 +1253,17 @@ public class MobRecipeLoader {
}
ItemStack stack = ((ItemStack) entry.getKey().getInternal()).copy();
MobDrop drop = new MobDrop(
- stack, MobDrop.DropType.Normal, (int) (chance * 10000), null, null, false, true);
+ stack,
+ MobDrop.DropType.Normal,
+ (int) (chance * 10000),
+ null,
+ null,
+ false,
+ true);
drops.add(drop);
}
for (IItemStack istack : ie.getDropsToRemove()) {
- List<MobDrop> toRemove = drops.stream()
- .filter(d -> istack.matches(new MCItemStack(d.stack)))
+ List<MobDrop> toRemove = drops.stream().filter(d -> istack.matches(new MCItemStack(d.stack)))
.collect(Collectors.toList());
drops.removeAll(toRemove);
recipe.mOutputs.removeAll(toRemove);
diff --git a/src/main/java/kubatech/loaders/RecipeLoader.java b/src/main/java/kubatech/loaders/RecipeLoader.java
index 6fbc62c7cc..dc70c183e8 100644
--- a/src/main/java/kubatech/loaders/RecipeLoader.java
+++ b/src/main/java/kubatech/loaders/RecipeLoader.java
@@ -1,53 +1,48 @@
/*
- * 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.loaders;
import static kubatech.api.enums.ItemList.*;
-import com.dreammaster.gthandler.CustomItemList;
-import cpw.mods.fml.common.registry.GameRegistry;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Utility;
-import gtPlusPlus.core.lib.CORE;
import java.lang.reflect.InvocationTargetException;
+
import kubatech.Tags;
import kubatech.api.LoaderReference;
import kubatech.api.enums.ItemList;
import kubatech.tileentity.gregtech.multiblock.GT_MetaTileEntity_ExtremeExterminationChamber;
import kubatech.tileentity.gregtech.multiblock.GT_MetaTileEntity_MegaIndustrialApiary;
+
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
+
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import com.dreammaster.gthandler.CustomItemList;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.lib.CORE;
+
public class RecipeLoader {
private static final Logger LOG = LogManager.getLogger(Tags.MODID + "[Recipe Loader]");
- protected static final long bitsd = GT_ModHandler.RecipeBits.NOT_REMOVABLE
- | GT_ModHandler.RecipeBits.REVERSIBLE
+ protected static final long bitsd = GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE
| GT_ModHandler.RecipeBits.BUFFERED
| GT_ModHandler.RecipeBits.DISMANTLEABLE;
@@ -61,19 +56,12 @@ public class RecipeLoader {
"multimachine.exterminationchamber",
"Extreme Extermination Chamber",
LoaderReference.EnderIO)) {
- GT_ModHandler.addCraftingRecipe(ItemList.ExtremeExterminationChamber.get(1), bitsd, new Object[] {
- "RCR",
- "CHC",
- "VVV",
- 'R',
- gregtech.api.enums.ItemList.Robot_Arm_EV,
- 'C',
- OrePrefixes.circuit.get(Materials.Data),
- 'H',
- gregtech.api.enums.ItemList.Hull_EV,
- 'V',
- GT_ModHandler.getModItem("OpenBlocks", "vacuumhopper", 1, new ItemStack(Blocks.hopper))
- });
+ GT_ModHandler.addCraftingRecipe(
+ ItemList.ExtremeExterminationChamber.get(1),
+ bitsd,
+ new Object[] { "RCR", "CHC", "VVV", 'R', gregtech.api.enums.ItemList.Robot_Arm_EV, 'C',
+ OrePrefixes.circuit.get(Materials.Data), 'H', gregtech.api.enums.ItemList.Hull_EV, 'V',
+ GT_ModHandler.getModItem("OpenBlocks", "vacuumhopper", 1, new ItemStack(Blocks.hopper)) });
}
if (registerMTE(
ExtremeIndustrialApiary,
@@ -84,20 +72,16 @@ public class RecipeLoader {
GT_Values.RA.addAssemblylineRecipe(
gregtech.api.enums.ItemList.Machine_IndustrialApiary.get(1),
10000,
- new Object[] {
- gregtech.api.enums.ItemList.Machine_IndustrialApiary.get(64L),
- gregtech.api.enums.ItemList.IndustrialApiary_Upgrade_Acceleration_8_Upgraded.get(64L),
- gregtech.api.enums.ItemList.IndustrialApiary_Upgrade_STABILIZER.get(64L),
- gregtech.api.enums.ItemList.Robot_Arm_UV.get(16L),
- new Object[] {OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L},
- new Object[] {OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L},
- new Object[] {OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L},
- new Object[] {OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L},
- },
- new FluidStack[] {
- FluidRegistry.getFluidStack("molten.indalloy140", 28800),
- FluidRegistry.getFluidStack("for.honey", 20000)
- },
+ new Object[] { gregtech.api.enums.ItemList.Machine_IndustrialApiary.get(64L),
+ gregtech.api.enums.ItemList.IndustrialApiary_Upgrade_Acceleration_8_Upgraded.get(64L),
+ gregtech.api.enums.ItemList.IndustrialApiary_Upgrade_STABILIZER.get(64L),
+ gregtech.api.enums.ItemList.Robot_Arm_UV.get(16L),
+ new Object[] { OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L },
+ new Object[] { OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L },
+ new Object[] { OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L },
+ new Object[] { OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L }, },
+ new FluidStack[] { FluidRegistry.getFluidStack("molten.indalloy140", 28800),
+ FluidRegistry.getFluidStack("for.honey", 20000) },
ExtremeIndustrialApiary.get(1),
6000,
2_048_000);
@@ -106,30 +90,29 @@ public class RecipeLoader {
if (MTEID > MTEIDMax + 1) throw new RuntimeException("MTE ID's");
}
- private static boolean registerMTE(
- ItemList item, Class<? extends MetaTileEntity> mte, String aName, String aNameRegional) {
+ private static boolean registerMTE(ItemList item, Class<? extends MetaTileEntity> mte, String aName,
+ String aNameRegional) {
return registerMTE(item, mte, aName, aNameRegional, true);
}
- private static boolean registerMTE(
- ItemList item, Class<? extends MetaTileEntity> mte, String aName, String aNameRegional, boolean... deps) {
+ private static boolean registerMTE(ItemList item, Class<? extends MetaTileEntity> mte, String aName,
+ String aNameRegional, boolean... deps) {
boolean dep = true;
- for (boolean i : deps)
- if (!i) {
- dep = false;
- break;
- }
+ for (boolean i : deps) if (!i) {
+ dep = false;
+ break;
+ }
return registerMTE(item, mte, aName, aNameRegional, dep);
}
- private static boolean registerMTE(
- ItemList item, Class<? extends MetaTileEntity> mte, String aName, String aNameRegional, boolean dep) {
+ private static boolean registerMTE(ItemList item, Class<? extends MetaTileEntity> mte, String aName,
+ String aNameRegional, boolean dep) {
if (MTEID > MTEIDMax) throw new RuntimeException("MTE ID's");
if (dep) {
try {
- item.set(mte.getConstructor(int.class, String.class, String.class)
- .newInstance(MTEID, aName, aNameRegional)
- .getStackForm(1));
+ item.set(
+ mte.getConstructor(int.class, String.class, String.class)
+ .newInstance(MTEID, aName, aNameRegional).getStackForm(1));
} catch (InvocationTargetException ex) {
Throwable original_ex = ex.getCause();
if (original_ex instanceof RuntimeException) throw (RuntimeException) original_ex;
@@ -156,81 +139,93 @@ public class RecipeLoader {
}
private static void RegisterTeaLine() {
- // TEA LINE //
+ // TEA LINE //
if (LoaderReference.GTPlusPlus && LoaderReference.HarvestCraft) {
CORE.RA.addDehydratorRecipe(
- new ItemStack[] {GameRegistry.findItemStack("harvestcraft", "tealeafItem", 1)},
+ new ItemStack[] { GameRegistry.findItemStack("harvestcraft", "tealeafItem", 1) },
null,
null,
- new ItemStack[] {TeaLeafDehydrated.get(1)},
+ new ItemStack[] { TeaLeafDehydrated.get(1) },
null,
100,
32);
CORE.RA.addDehydratorRecipe(
- new ItemStack[] {TeaLeafDehydrated.get(1)},
+ new ItemStack[] { TeaLeafDehydrated.get(1) },
null,
null,
- new ItemStack[] {WhiteTeaLeaf.get(1)},
+ new ItemStack[] { WhiteTeaLeaf.get(1) },
null,
100,
32);
GT_Values.RA.addMixerRecipe(
- new ItemStack[] {TeaLeafDehydrated.get(1)},
- new FluidStack[] {FluidRegistry.getFluidStack("water", 50)},
- new ItemStack[] {SteamedTeaLeaf.get(1)},
+ new ItemStack[] { TeaLeafDehydrated.get(1) },
+ new FluidStack[] { FluidRegistry.getFluidStack("water", 50) },
+ new ItemStack[] { SteamedTeaLeaf.get(1) },
null,
100,
32);
CORE.RA.addDehydratorRecipe(
- new ItemStack[] {SteamedTeaLeaf.get(1)},
+ new ItemStack[] { SteamedTeaLeaf.get(1) },
null,
null,
- new ItemStack[] {YellowTeaLeaf.get(1)},
+ new ItemStack[] { YellowTeaLeaf.get(1) },
null,
100,
32);
GT_Values.RA.addBenderRecipe(TeaLeafDehydrated.get(1), RolledTeaLeaf.get(1), 100, 32);
CORE.RA.addDehydratorRecipe(
- new ItemStack[] {RolledTeaLeaf.get(1)},
+ new ItemStack[] { RolledTeaLeaf.get(1) },
null,
null,
- new ItemStack[] {GreenTeaLeaf.get(1)},
+ new ItemStack[] { GreenTeaLeaf.get(1) },
null,
100,
32);
GT_Values.RA.addChemicalRecipe(
- RolledTeaLeaf.get(1), GT_Utility.getIntegratedCircuit(1), OxidizedTeaLeaf.get(1), 100, 32);
+ RolledTeaLeaf.get(1),
+ GT_Utility.getIntegratedCircuit(1),
+ OxidizedTeaLeaf.get(1),
+ 100,
+ 32);
CORE.RA.addDehydratorRecipe(
- new ItemStack[] {OxidizedTeaLeaf.get(1)},
+ new ItemStack[] { OxidizedTeaLeaf.get(1) },
null,
null,
- new ItemStack[] {BlackTeaLeaf.get(1)},
+ new ItemStack[] { BlackTeaLeaf.get(1) },
null,
100,
32);
GT_Values.RA.addChemicalRecipe(
- RolledTeaLeaf.get(1), GT_Utility.getIntegratedCircuit(2), FermentedTeaLeaf.get(1), 200, 32);
+ RolledTeaLeaf.get(1),
+ GT_Utility.getIntegratedCircuit(2),
+ FermentedTeaLeaf.get(1),
+ 200,
+ 32);
CORE.RA.addDehydratorRecipe(
- new ItemStack[] {FermentedTeaLeaf.get(1)},
+ new ItemStack[] { FermentedTeaLeaf.get(1) },
null,
null,
- new ItemStack[] {PuerhTeaLeaf.get(1)},
+ new ItemStack[] { PuerhTeaLeaf.get(1) },
null,
100,
32);
GT_Values.RA.addCutterRecipe(
- new ItemStack[] {TeaLeafDehydrated.get(1)},
- new ItemStack[] {BruisedTeaLeaf.get(1)},
+ new ItemStack[] { TeaLeafDehydrated.get(1) },
+ new ItemStack[] { BruisedTeaLeaf.get(1) },
100,
32,
false);
GT_Values.RA.addChemicalRecipe(
- BruisedTeaLeaf.get(1), GT_Utility.getIntegratedCircuit(1), PartiallyOxidizedTeaLeaf.get(1), 50, 32);
+ BruisedTeaLeaf.get(1),
+ GT_Utility.getIntegratedCircuit(1),
+ PartiallyOxidizedTeaLeaf.get(1),
+ 50,
+ 32);
CORE.RA.addDehydratorRecipe(
- new ItemStack[] {PartiallyOxidizedTeaLeaf.get(1)},
+ new ItemStack[] { PartiallyOxidizedTeaLeaf.get(1) },
null,
null,
- new ItemStack[] {OolongTeaLeaf.get(1)},
+ new ItemStack[] { OolongTeaLeaf.get(1) },
null,
100,
32);
@@ -238,32 +233,32 @@ public class RecipeLoader {
// Tea Assembly
GameRegistry.addSmelting(BlackTeaLeaf.get(1), BlackTea.get(1), 10);
GT_Values.RA.addMixerRecipe(
- new ItemStack[] {BlackTea.get(1), GameRegistry.findItemStack("harvestcraft", "limejuiceItem", 1)},
+ new ItemStack[] { BlackTea.get(1), GameRegistry.findItemStack("harvestcraft", "limejuiceItem", 1) },
null,
- new ItemStack[] {EarlGrayTea.get(1)},
+ new ItemStack[] { EarlGrayTea.get(1) },
null,
100,
32);
GameRegistry.addSmelting(GreenTeaLeaf.get(1), GreenTea.get(1), 10);
GT_Values.RA.addMixerRecipe(
- new ItemStack[] {BlackTea.get(1)},
- new FluidStack[] {FluidRegistry.getFluidStack("potion.lemonjuice", 1000)},
- new ItemStack[] {LemonTea.get(1)},
+ new ItemStack[] { BlackTea.get(1) },
+ new FluidStack[] { FluidRegistry.getFluidStack("potion.lemonjuice", 1000) },
+ new ItemStack[] { LemonTea.get(1) },
null,
100,
32);
GT_Values.RA.addMixerRecipe(
- new ItemStack[] {BlackTea.get(1)},
- new FluidStack[] {FluidRegistry.getFluidStack("milk", 1000)},
- new ItemStack[] {MilkTea.get(1)},
+ new ItemStack[] { BlackTea.get(1) },
+ new FluidStack[] { FluidRegistry.getFluidStack("milk", 1000) },
+ new ItemStack[] { MilkTea.get(1) },
null,
100,
32);
GameRegistry.addSmelting(OolongTeaLeaf.get(1), OolongTea.get(1), 10);
GT_Values.RA.addMixerRecipe(
- new ItemStack[] {GameRegistry.findItemStack("harvestcraft", "peppermintItem", 1)},
- new FluidStack[] {FluidRegistry.getFluidStack("water", 1000)},
- new ItemStack[] {PeppermintTea.get(1)},
+ new ItemStack[] { GameRegistry.findItemStack("harvestcraft", "peppermintItem", 1) },
+ new FluidStack[] { FluidRegistry.getFluidStack("water", 1000) },
+ new ItemStack[] { PeppermintTea.get(1) },
null,
100,
32);
@@ -275,17 +270,15 @@ public class RecipeLoader {
GT_Values.RA.addAssemblylineRecipe(
TeaAcceptorResearchNote.get(1),
10000,
- new Object[] {
- LegendaryUltimateTea.get(0),
- GameRegistry.findItemStack("Avaritia", "Neutronium_Compressor", 1),
- gregtech.api.enums.ItemList.Quantum_Tank_EV.get(1),
- CustomItemList.FluidExtractorUHV.get(10),
- new Object[] {OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L},
- new Object[] {OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L},
- new Object[] {OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L},
- new Object[] {OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L},
- },
- new FluidStack[] {FluidRegistry.getFluidStack("molten.indalloy140", 28800)},
+ new Object[] { LegendaryUltimateTea.get(0),
+ GameRegistry.findItemStack("Avaritia", "Neutronium_Compressor", 1),
+ gregtech.api.enums.ItemList.Quantum_Tank_EV.get(1),
+ CustomItemList.FluidExtractorUHV.get(10),
+ new Object[] { OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L },
+ new Object[] { OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L },
+ new Object[] { OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L },
+ new Object[] { OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L }, },
+ new FluidStack[] { FluidRegistry.getFluidStack("molten.indalloy140", 28800) },
TeaAcceptor.get(1),
6000,
2_048_000);
diff --git a/src/main/java/kubatech/loaders/TCLoader.java b/src/main/java/kubatech/loaders/TCLoader.java
index 2ead8998f9..fb803e0198 100644
--- a/src/main/java/kubatech/loaders/TCLoader.java
+++ b/src/main/java/kubatech/loaders/TCLoader.java
@@ -1,36 +1,29 @@
/*
- * 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.loaders;
-import cpw.mods.fml.common.registry.GameRegistry;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.stream.Collectors;
+
import kubatech.api.LoaderReference;
import kubatech.api.enums.ItemList;
import kubatech.api.utils.ItemID;
import kubatech.loaders.item.items.TeaUltimate;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
+
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.api.ThaumcraftApiHelper;
import thaumcraft.api.aspects.Aspect;
@@ -39,8 +32,10 @@ import thaumcraft.api.crafting.InfusionRecipe;
import thaumcraft.api.research.ResearchCategories;
import thaumcraft.api.research.ResearchItem;
import thaumcraft.api.research.ResearchPage;
+import cpw.mods.fml.common.registry.GameRegistry;
public class TCLoader {
+
private static boolean lateLoaded = false;
public static void load() {}
@@ -56,97 +51,79 @@ public class TCLoader {
private static void registerRecipe() {
if (ultimateTeaRecipe != null) return;
final ItemStack[] components = new ItemStack[] {
- // ItemList.LegendaryBlackTea.get(1),
- // ItemList.LegendaryButterflyTea.get(1),
- ItemList.LegendaryEarlGrayTea.get(1), // MApiary
- ItemList.LegendaryGreenTea.get(1), // EIG
- // ItemList.LegendaryLemonTea.get(1),
- // ItemList.LegendaryMilkTea.get(1),
- // ItemList.LegendaryOolongTea.get(1),
- ItemList.LegendaryPeppermintTea.get(1), // HTGR
- ItemList.LegendaryPuerhTea.get(1), // EEC
- // ItemList.LegendaryRedTea.get(1),
- // ItemList.LegendaryWhiteTea.get(1),
- ItemList.LegendaryYellowTea.get(1), // IApiary
- ItemList.BlackTea.get(1),
- ItemList.EarlGrayTea.get(1),
- ItemList.GreenTea.get(1),
- ItemList.LemonTea.get(1),
- ItemList.MilkTea.get(1),
- ItemList.OolongTea.get(1),
- ItemList.PeppermintTea.get(1),
- ItemList.PuerhTea.get(1),
- ItemList.WhiteTea.get(1),
- ItemList.YellowTea.get(1)
- };
+ // ItemList.LegendaryBlackTea.get(1),
+ // ItemList.LegendaryButterflyTea.get(1),
+ ItemList.LegendaryEarlGrayTea.get(1), // MApiary
+ ItemList.LegendaryGreenTea.get(1), // EIG
+ // ItemList.LegendaryLemonTea.get(1),
+ // ItemList.LegendaryMilkTea.get(1),
+ // ItemList.LegendaryOolongTea.get(1),
+ ItemList.LegendaryPeppermintTea.get(1), // HTGR
+ ItemList.LegendaryPuerhTea.get(1), // EEC
+ // ItemList.LegendaryRedTea.get(1),
+ // ItemList.LegendaryWhiteTea.get(1),
+ ItemList.LegendaryYellowTea.get(1), // IApiary
+ ItemList.BlackTea.get(1), ItemList.EarlGrayTea.get(1), ItemList.GreenTea.get(1),
+ ItemList.LemonTea.get(1), ItemList.MilkTea.get(1), ItemList.OolongTea.get(1),
+ ItemList.PeppermintTea.get(1), ItemList.PuerhTea.get(1), ItemList.WhiteTea.get(1),
+ ItemList.YellowTea.get(1) };
final HashSet<ItemID> componentsHashed = Arrays.stream(components)
.map(stack -> ItemID.create_NoCopy(stack, true, false, true))
.collect(Collectors.toCollection(HashSet::new));
- //noinspection unchecked
- ThaumcraftApi.getCraftingRecipes()
- .add(
- ultimateTeaRecipe =
- new InfusionRecipe(
- "KT_UltimateTea",
- ItemList.LegendaryUltimateTea.get(1),
- 10,
- new AspectList()
- .add(Aspect.MAGIC, 100)
- .add(Aspect.HEAL, 100)
- .add(Aspect.PLANT, 100)
- .add(Aspect.EXCHANGE, 100),
- GameRegistry.findItemStack("DraconicEvolution", "dezilsMarshmallow", 1),
- components) {
- @Override
- public boolean matches(
- ArrayList<ItemStack> input,
- ItemStack central,
- World world,
- EntityPlayer player) {
- if (!central.isItemEqual(getRecipeInput())) return false;
- if (!ThaumcraftApiHelper.isResearchComplete(
- player.getCommandSenderName(), this.research)) return false;
- if (componentsHashed.size() > input.size()) return false;
- HashSet<ItemID> hashedInputs = input.stream()
- .map(stack -> ItemID.create_NoCopy(stack, true, false, true))
- .collect(Collectors.toCollection(HashSet::new));
- return hashedInputs.containsAll(componentsHashed);
- }
- });
+ // noinspection unchecked
+ ThaumcraftApi.getCraftingRecipes().add(
+ ultimateTeaRecipe = new InfusionRecipe(
+ "KT_UltimateTea",
+ ItemList.LegendaryUltimateTea.get(1),
+ 10,
+ new AspectList().add(Aspect.MAGIC, 100).add(Aspect.HEAL, 100).add(Aspect.PLANT, 100)
+ .add(Aspect.EXCHANGE, 100),
+ GameRegistry.findItemStack("DraconicEvolution", "dezilsMarshmallow", 1),
+ components) {
+
+ @Override
+ public boolean matches(ArrayList<ItemStack> input, ItemStack central, World world,
+ EntityPlayer player) {
+ if (!central.isItemEqual(getRecipeInput())) return false;
+ if (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), this.research))
+ return false;
+ if (componentsHashed.size() > input.size()) return false;
+ HashSet<ItemID> hashedInputs = input.stream()
+ .map(stack -> ItemID.create_NoCopy(stack, true, false, true))
+ .collect(Collectors.toCollection(HashSet::new));
+ return hashedInputs.containsAll(componentsHashed);
+ }
+ });
}
private static ResearchItem ultimateTeaResearch = null;
private static void registerResearch() {
if (ultimateTeaResearch == null) {
- ultimateTeaResearch =
- new ResearchItem(
- "KT_UltimateTea",
- "NEWHORIZONS",
- new AspectList()
- .add(Aspect.MAGIC, 1)
- .add(Aspect.HEAL, 1)
- .add(Aspect.PLANT, 1)
- .add(Aspect.EXCHANGE, 1),
- -2,
- 4,
- 2,
- ItemList.LegendaryUltimateTea.get(1)) {
- @Override
- public String getName() {
- return TeaUltimate.getUltimateTeaDisplayName(super.getName());
- }
- };
- ultimateTeaResearch.setPages(
- new ResearchPage("KT.research.ultimatetea") {
- @Override
- public String getTranslatedText() {
- return TeaUltimate.getUltimateTeaDisplayName(super.getTranslatedText());
- }
- },
- new ResearchPage(ultimateTeaRecipe));
+ ultimateTeaResearch = new ResearchItem(
+ "KT_UltimateTea",
+ "NEWHORIZONS",
+ new AspectList().add(Aspect.MAGIC, 1).add(Aspect.HEAL, 1).add(Aspect.PLANT, 1)
+ .add(Aspect.EXCHANGE, 1),
+ -2,
+ 4,
+ 2,
+ ItemList.LegendaryUltimateTea.get(1)) {
+
+ @Override
+ public String getName() {
+ return TeaUltimate.getUltimateTeaDisplayName(super.getName());
+ }
+ };
+ ultimateTeaResearch.setPages(new ResearchPage("KT.research.ultimatetea") {
+
+ @Override
+ public String getTranslatedText() {
+ return TeaUltimate.getUltimateTeaDisplayName(super.getTranslatedText());
+ }
+ }, new ResearchPage(ultimateTeaRecipe));
ultimateTeaResearch.setParents("INFUSION", "DEZILSMARSHMALLOW");
ThaumcraftApi.addWarpToResearch("KT_UltimateTea", 20);
}
diff --git a/src/main/java/kubatech/loaders/block/BlockProxy.java b/src/main/java/kubatech/loaders/block/BlockProxy.java
index a12acc4de7..4ce6aa820d 100644
--- a/src/main/java/kubatech/loaders/block/BlockProxy.java
+++ b/src/main/java/kubatech/loaders/block/BlockProxy.java
@@ -1,29 +1,21 @@
/*
- * 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.loaders.block;
import static kubatech.loaders.block.KubaBlock.defaultTileEntityUI;
-import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI;
import java.util.List;
+
import kubatech.Tags;
+
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
@@ -34,6 +26,8 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
+import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI;
+
public class BlockProxy {
private final String unlocalizedName;
diff --git a/src/main/java/kubatech/loaders/block/IProxyTileEntityProvider.java b/src/main/java/kubatech/loaders/block/IProxyTileEntityProvider.java
index b2a94c09b7..f39887a9ef 100644
--- a/src/main/java/kubatech/loaders/block/IProxyTileEntityProvider.java
+++ b/src/main/java/kubatech/loaders/block/IProxyTileEntityProvider.java
@@ -4,5 +4,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public interface IProxyTileEntityProvider {
+
TileEntity createTileEntity(World world);
}
diff --git a/src/main/java/kubatech/loaders/block/KubaBlock.java b/src/main/java/kubatech/loaders/block/KubaBlock.java
index abf1e91dd7..831757f332 100644
--- a/src/main/java/kubatech/loaders/block/KubaBlock.java
+++ b/src/main/java/kubatech/loaders/block/KubaBlock.java
@@ -1,39 +1,24 @@
/*
- * 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.loaders.block;
import static kubatech.kubatech.KT;
-import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI;
-import com.gtnewhorizons.modularui.api.screen.ModularUIContext;
-import com.gtnewhorizons.modularui.api.screen.ModularWindow;
-import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
-import com.gtnewhorizons.modularui.common.builder.UIBuilder;
-import com.gtnewhorizons.modularui.common.builder.UIInfo;
-import com.gtnewhorizons.modularui.common.internal.wrapper.ModularGui;
-import com.gtnewhorizons.modularui.common.internal.wrapper.ModularUIContainer;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.List;
import java.util.function.Function;
+
import kubatech.loaders.BlockLoader;
+
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -47,32 +32,38 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
+import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI;
+import com.gtnewhorizons.modularui.api.screen.ModularUIContext;
+import com.gtnewhorizons.modularui.api.screen.ModularWindow;
+import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
+import com.gtnewhorizons.modularui.common.builder.UIBuilder;
+import com.gtnewhorizons.modularui.common.builder.UIInfo;
+import com.gtnewhorizons.modularui.common.internal.wrapper.ModularGui;
+import com.gtnewhorizons.modularui.common.internal.wrapper.ModularUIContainer;
+
public class KubaBlock extends Block {
- public static final Function<IModularUIContainerCreator, UIInfo<?, ?>> TileEntityUIFactory =
- containerConstructor -> UIBuilder.of()
- .container((player, world, x, y, z) -> {
- TileEntity te = world.getTileEntity(x, y, z);
- if (te instanceof ITileWithModularUI) {
- UIBuildContext buildContext = new UIBuildContext(player);
- ModularWindow window = ((ITileWithModularUI) te).createWindow(buildContext);
- return containerConstructor.createUIContainer(
- new ModularUIContext(buildContext, te::markDirty), window);
- }
- return null;
- })
- .gui(((player, world, x, y, z) -> {
- if (!world.isRemote) return null;
- TileEntity te = world.getTileEntity(x, y, z);
- if (te instanceof ITileWithModularUI) {
- UIBuildContext buildContext = new UIBuildContext(player);
- ModularWindow window = ((ITileWithModularUI) te).createWindow(buildContext);
- return new ModularGui(containerConstructor.createUIContainer(
- new ModularUIContext(buildContext, null), window));
- }
- return null;
- }))
- .build();
+ public static final Function<IModularUIContainerCreator, UIInfo<?, ?>> TileEntityUIFactory = containerConstructor -> UIBuilder
+ .of().container((player, world, x, y, z) -> {
+ TileEntity te = world.getTileEntity(x, y, z);
+ if (te instanceof ITileWithModularUI) {
+ UIBuildContext buildContext = new UIBuildContext(player);
+ ModularWindow window = ((ITileWithModularUI) te).createWindow(buildContext);
+ return containerConstructor
+ .createUIContainer(new ModularUIContext(buildContext, te::markDirty), window);
+ }
+ return null;
+ }).gui(((player, world, x, y, z) -> {
+ if (!world.isRemote) return null;
+ TileEntity te = world.getTileEntity(x, y, z);
+ if (te instanceof ITileWithModularUI) {
+ UIBuildContext buildContext = new UIBuildContext(player);
+ ModularWindow window = ((ITileWithModularUI) te).createWindow(buildContext);
+ return new ModularGui(
+ containerConstructor.createUIContainer(new ModularUIContext(buildContext, null), window));
+ }
+ return null;
+ })).build();
public static final UIInfo<?, ?> defaultTileEntityUI = TileEntityUIFactory.apply(ModularUIContainer::new);
@@ -137,36 +128,22 @@ public class KubaBlock extends Block {
}
@Override
- public boolean onBlockActivated(
- World p_149727_1_,
- int p_149727_2_,
- int p_149727_3_,
- int p_149727_4_,
- EntityPlayer p_149727_5_,
- int p_149727_6_,
- float p_149727_7_,
- float p_149727_8_,
- float p_149727_9_) {
+ public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_,
+ EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {
return getBlock(p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_))
.onActivated(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, p_149727_5_);
}
@Override
- public void onBlockPlacedBy(
- World p_149689_1_,
- int p_149689_2_,
- int p_149689_3_,
- int p_149689_4_,
- EntityLivingBase p_149689_5_,
- ItemStack p_149689_6_) {
+ public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_,
+ EntityLivingBase p_149689_5_, ItemStack p_149689_6_) {
getBlock(p_149689_6_.getItemDamage())
.onBlockPlaced(p_149689_1_, p_149689_2_, p_149689_3_, p_149689_4_, p_149689_5_, p_149689_6_);
}
@Override
public float getBlockHardness(World p_149712_1_, int p_149712_2_, int p_149712_3_, int p_149712_4_) {
- return getBlock(p_149712_1_.getBlockMetadata(p_149712_2_, p_149712_3_, p_149712_4_))
- .getHardness();
+ return getBlock(p_149712_1_.getBlockMetadata(p_149712_2_, p_149712_3_, p_149712_4_)).getHardness();
}
@Override
@@ -182,25 +159,20 @@ public class KubaBlock extends Block {
}
@Override
- public float getExplosionResistance(
- Entity par1Entity,
- World world,
- int x,
- int y,
- int z,
- double explosionX,
- double explosionY,
- double explosionZ) {
+ public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX,
+ double explosionY, double explosionZ) {
return getBlock(world.getBlockMetadata(x, y, z)).getResistance();
}
@FunctionalInterface
public interface IModularUIContainerCreator {
+
ModularUIContainer createUIContainer(ModularUIContext context, ModularWindow mainWindow);
}
@FunctionalInterface
public interface IModularUIProvider {
+
UIInfo<?, ?> getUI();
}
}
diff --git a/src/main/java/kubatech/loaders/block/KubaItemBlock.java b/src/main/java/kubatech/loaders/block/KubaItemBlock.java
index 1a9d057cd9..64f3124314 100644
--- a/src/main/java/kubatech/loaders/block/KubaItemBlock.java
+++ b/src/main/java/kubatech/loaders/block/KubaItemBlock.java
@@ -1,26 +1,19 @@
/*
- * 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.loaders.block;
import java.util.List;
+
import kubatech.kubatech;
+
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
@@ -28,6 +21,7 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class KubaItemBlock extends ItemBlock {
+
public KubaItemBlock(Block p_i45328_1_) {
super(p_i45328_1_);
setHasSubtypes(true);
diff --git a/src/main/java/kubatech/loaders/block/blocks/TeaAcceptor.java b/src/main/java/kubatech/loaders/block/blocks/TeaAcceptor.java
index 21d1e452f7..2f4f36db53 100644
--- a/src/main/java/kubatech/loaders/block/blocks/TeaAcceptor.java
+++ b/src/main/java/kubatech/loaders/block/blocks/TeaAcceptor.java
@@ -1,28 +1,21 @@
/*
- * 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.loaders.block.blocks;
import java.util.List;
+
import kubatech.loaders.block.BlockProxy;
import kubatech.loaders.block.IProxyTileEntityProvider;
import kubatech.tileentity.TeaAcceptorTile;
+
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
diff --git a/src/main/java/kubatech/loaders/item/IItemProxyGUI.java b/src/main/java/kubatech/loaders/item/IItemProxyGUI.java
index 40020c81e9..6b16630ea1 100644
--- a/src/main/java/kubatech/loaders/item/IItemProxyGUI.java
+++ b/src/main/java/kubatech/loaders/item/IItemProxyGUI.java
@@ -1,9 +1,11 @@
package kubatech.loaders.item;
-import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
+import com.gtnewhorizons.modularui.api.screen.ModularWindow;
+
public interface IItemProxyGUI {
+
ModularWindow createWindow(ItemStack stack, EntityPlayer player);
}
diff --git a/src/main/java/kubatech/loaders/item/ItemProxy.java b/src/main/java/kubatech/loaders/item/ItemProxy.java
index 0545932cf5..a0a841760c 100644
--- a/src/main/java/kubatech/loaders/item/ItemProxy.java
+++ b/src/main/java/kubatech/loaders/item/ItemProxy.java
@@ -1,33 +1,19 @@
/*
- * 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.loaders.item;
-import com.gtnewhorizons.modularui.api.screen.ModularUIContext;
-import com.gtnewhorizons.modularui.api.screen.ModularWindow;
-import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
-import com.gtnewhorizons.modularui.common.builder.UIBuilder;
-import com.gtnewhorizons.modularui.common.builder.UIInfo;
-import com.gtnewhorizons.modularui.common.internal.wrapper.ModularGui;
-import com.gtnewhorizons.modularui.common.internal.wrapper.ModularUIContainer;
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;
@@ -37,26 +23,33 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
+import com.gtnewhorizons.modularui.api.screen.ModularUIContext;
+import com.gtnewhorizons.modularui.api.screen.ModularWindow;
+import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
+import com.gtnewhorizons.modularui.common.builder.UIBuilder;
+import com.gtnewhorizons.modularui.common.builder.UIInfo;
+import com.gtnewhorizons.modularui.common.internal.wrapper.ModularGui;
+import com.gtnewhorizons.modularui.common.internal.wrapper.ModularUIContainer;
+
public class ItemProxy {
- private static final UIInfo<?, ?> HeldItemUIInfo = UIBuilder.of()
- .container((player, w, x, y, z) -> {
- ItemStack stack = player.getHeldItem();
- ItemProxy proxy = KubaItems.getItemProxy(stack);
- if (!(proxy instanceof IItemProxyGUI)) return null;
- UIBuildContext context = new UIBuildContext(player);
- ModularWindow window = ((IItemProxyGUI) proxy).createWindow(stack, player);
- return new ModularUIContainer(
- new ModularUIContext(context, () -> player.inventoryContainer.detectAndSendChanges()), window);
- })
- .gui((player, w, x, y, z) -> {
- ItemStack stack = player.getHeldItem();
- ItemProxy proxy = KubaItems.getItemProxy(stack);
- if (!(proxy instanceof IItemProxyGUI)) return null;
- UIBuildContext context = new UIBuildContext(player);
- ModularWindow window = ((IItemProxyGUI) proxy).createWindow(stack, player);
- return new ModularGui(new ModularUIContainer(new ModularUIContext(context, null), window));
- })
- .build();
+
+ private static final UIInfo<?, ?> HeldItemUIInfo = UIBuilder.of().container((player, w, x, y, z) -> {
+ ItemStack stack = player.getHeldItem();
+ ItemProxy proxy = KubaItems.getItemProxy(stack);
+ if (!(proxy instanceof IItemProxyGUI)) return null;
+ UIBuildContext context = new UIBuildContext(player);
+ ModularWindow window = ((IItemProxyGUI) proxy).createWindow(stack, player);
+ return new ModularUIContainer(
+ new ModularUIContext(context, () -> player.inventoryContainer.detectAndSendChanges()),
+ window);
+ }).gui((player, w, x, y, z) -> {
+ ItemStack stack = player.getHeldItem();
+ ItemProxy proxy = KubaItems.getItemProxy(stack);
+ if (!(proxy instanceof IItemProxyGUI)) return null;
+ UIBuildContext context = new UIBuildContext(player);
+ ModularWindow window = ((IItemProxyGUI) proxy).createWindow(stack, player);
+ return new ModularGui(new ModularUIContainer(new ModularUIContext(context, null), window));
+ }).build();
private final String unlocalizedName;
private final String texturepath;
private IIcon icon;
diff --git a/src/main/java/kubatech/loaders/item/KubaItems.java b/src/main/java/kubatech/loaders/item/KubaItems.java
index cb738d77fa..55d835cb87 100644
--- a/src/main/java/kubatech/loaders/item/KubaItems.java
+++ b/src/main/java/kubatech/loaders/item/KubaItems.java
@@ -1,31 +1,22 @@
/*
- * 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.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 kubatech.loaders.ItemLoader;
+
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
@@ -36,7 +27,11 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
public class KubaItems extends Item {
+
private static final HashMap<Integer, ItemProxy> items = new HashMap<>();
private static int idCounter = 0;
@@ -67,17 +62,8 @@ public class KubaItems extends Item {
}
@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_) {
+ 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;
}
@@ -141,8 +127,8 @@ public class KubaItems extends Item {
}
@Override
- public void onUpdate(
- ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
+ 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
index a810967ed2..c127609cf9 100644
--- a/src/main/java/kubatech/loaders/item/items/Tea.java
+++ b/src/main/java/kubatech/loaders/item/items/Tea.java
@@ -1,32 +1,26 @@
/*
- * 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.loaders.item.items;
import java.util.List;
+
import kubatech.loaders.item.ItemProxy;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class Tea extends ItemProxy {
+
private final int heal;
private final float saturation;
diff --git a/src/main/java/kubatech/loaders/item/items/TeaCollection.java b/src/main/java/kubatech/loaders/item/items/TeaCollection.java
index 8440576fe2..5ef3995301 100644
--- a/src/main/java/kubatech/loaders/item/items/TeaCollection.java
+++ b/src/main/java/kubatech/loaders/item/items/TeaCollection.java
@@ -1,29 +1,22 @@
/*
- * 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.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;
@@ -41,6 +34,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.AchievementPage;
public class TeaCollection extends ItemProxy {
+
protected static TeaPage teapage;
protected static LinkedList<Achievement> achievements;
protected Achievement achievement;
@@ -51,21 +45,8 @@ public class TeaCollection extends ItemProxy {
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}
- };
+ 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 } };
boolean checkTeaOwner(ItemStack stack, String username) {
NBTTagCompound tag = stack.stackTagCompound;
@@ -92,25 +73,34 @@ public class TeaCollection extends ItemProxy {
}
achievements.add(
achievement = new Achievement(
- achievementname,
- achievementname,
- achievement_poses[index][0],
- achievement_poses[index][1],
- new ItemStack(ItemLoader.kubaitems, 1, index),
- null)
- .registerStat());
+ achievementname,
+ achievementname,
+ achievement_poses[index][0],
+ achievement_poses[index][1],
+ new ItemStack(ItemLoader.kubaitems, 1, index),
+ null).registerStat());
}
@Override
public void addInformation(ItemStack stack, EntityPlayer entity, List<String> tooltipList, boolean showDebugInfo) {
if (!checkTeaOwner(stack, entity.getCommandSenderName())) {
- tooltipList.add(EnumChatFormatting.GRAY + "" + EnumChatFormatting.BOLD + "" + EnumChatFormatting.ITALIC
- + StatCollector.translateToLocal("kubaitem.notyours"));
+ tooltipList.add(
+ EnumChatFormatting.GRAY + ""
+ + EnumChatFormatting.BOLD
+ + ""
+ + EnumChatFormatting.ITALIC
+ + StatCollector.translateToLocal("kubaitem.notyours"));
return;
}
tooltipList.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("kubaitem.fromcollection"));
- tooltipList.add(EnumChatFormatting.GRAY + "" + EnumChatFormatting.BOLD + "" + EnumChatFormatting.ITALIC + ""
- + EnumChatFormatting.UNDERLINE + StatCollector.translateToLocal("kubaitem.teacollection"));
+ tooltipList.add(
+ EnumChatFormatting.GRAY + ""
+ + EnumChatFormatting.BOLD
+ + ""
+ + EnumChatFormatting.ITALIC
+ + ""
+ + EnumChatFormatting.UNDERLINE
+ + StatCollector.translateToLocal("kubaitem.teacollection"));
}
@Override
@@ -129,8 +119,9 @@ public class TeaCollection extends ItemProxy {
public ItemStack onEaten(ItemStack stack, World world, EntityPlayer entity) {
if (world.isRemote) return stack;
if (!(entity instanceof EntityPlayerMP)) return stack;
- entity.addChatComponentMessage(new ChatComponentText(
- EnumChatFormatting.GREEN + StatCollector.translateToLocal("kubaitem.teacollection.mmm")));
+ entity.addChatComponentMessage(
+ new ChatComponentText(
+ EnumChatFormatting.GREEN + StatCollector.translateToLocal("kubaitem.teacollection.mmm")));
entity.triggerAchievement(achievement);
return stack;
}
diff --git a/src/main/java/kubatech/loaders/item/items/TeaIngredient.java b/src/main/java/kubatech/loaders/item/items/TeaIngredient.java
index 135129742a..696f004316 100644
--- a/src/main/java/kubatech/loaders/item/items/TeaIngredient.java
+++ b/src/main/java/kubatech/loaders/item/items/TeaIngredient.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.loaders.item.items;
import java.util.List;
+
import kubatech.loaders.item.ItemProxy;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
public class TeaIngredient extends ItemProxy {
+
public TeaIngredient(String unlocalizedName) {
super("teaingredient." + unlocalizedName, "teaingredient/" + unlocalizedName);
}
diff --git a/src/main/java/kubatech/loaders/item/items/TeaUltimate.java b/src/main/java/kubatech/loaders/item/items/TeaUltimate.java
index 6356d30fbb..35b4ae28f1 100644
--- a/src/main/java/kubatech/loaders/item/items/TeaUltimate.java
+++ b/src/main/java/kubatech/loaders/item/items/TeaUltimate.java
@@ -1,39 +1,24 @@
/*
- * 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.loaders.item.items;
-import com.gtnewhorizons.modularui.api.ModularUITextures;
-import com.gtnewhorizons.modularui.api.drawable.IDrawable;
-import com.gtnewhorizons.modularui.api.drawable.ItemDrawable;
-import com.gtnewhorizons.modularui.api.drawable.Text;
-import com.gtnewhorizons.modularui.api.math.Color;
-import com.gtnewhorizons.modularui.api.screen.ModularWindow;
-import com.gtnewhorizons.modularui.api.widget.Widget;
-import com.gtnewhorizons.modularui.common.widget.*;
import java.text.NumberFormat;
+
import kubatech.api.enums.ItemList;
import kubatech.api.utils.ModUtils;
import kubatech.api.utils.StringUtils;
import kubatech.loaders.item.IItemProxyGUI;
import kubatech.savedata.PlayerData;
import kubatech.savedata.PlayerDataManager;
+
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -46,7 +31,17 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
+import com.gtnewhorizons.modularui.api.ModularUITextures;
+import com.gtnewhorizons.modularui.api.drawable.IDrawable;
+import com.gtnewhorizons.modularui.api.drawable.ItemDrawable;
+import com.gtnewhorizons.modularui.api.drawable.Text;
+import com.gtnewhorizons.modularui.api.math.Color;
+import com.gtnewhorizons.modularui.api.screen.ModularWindow;
+import com.gtnewhorizons.modularui.api.widget.Widget;
+import com.gtnewhorizons.modularui.common.widget.*;
+
public class TeaUltimate extends TeaCollection implements IItemProxyGUI {
+
public TeaUltimate() {
super("ultimate_tea");
}
@@ -60,7 +55,9 @@ public class TeaUltimate extends TeaCollection implements IItemProxyGUI {
if (current - timeCounter > 100) {
timeCounter = current;
name = StringUtils.applyRainbow(
- "ULTIMATE", colorCounter++, EnumChatFormatting.BOLD.toString() + EnumChatFormatting.OBFUSCATED);
+ "ULTIMATE",
+ colorCounter++,
+ EnumChatFormatting.BOLD.toString() + EnumChatFormatting.OBFUSCATED);
}
return String.format(displayName, name + EnumChatFormatting.RESET);
}
@@ -82,79 +79,107 @@ public class TeaUltimate extends TeaCollection implements IItemProxyGUI {
IDrawable tab1 = new ItemDrawable(ItemList.LegendaryUltimateTea.get(1)).withFixedSize(18, 18, 4, 6);
IDrawable tab2 = new ItemDrawable(new ItemStack(Blocks.crafting_table)).withFixedSize(18, 18, 4, 6);
IDrawable tab3 = new ItemDrawable(new ItemStack(Items.golden_apple)).withFixedSize(18, 18, 4, 6);
- builder.widget(new TabContainer()
- .setButtonSize(28, 32)
- .addTabButton(new TabButton(0)
- .setBackground(false, ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0, 1f, 0.5f), tab1)
- .setBackground(true, ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0.5f, 1f, 1f), tab1)
- .setPos(0, -28))
- .addTabButton(new TabButton(1)
- .setBackground(false, ModularUITextures.VANILLA_TAB_TOP_MIDDLE.getSubArea(0, 0, 1f, 0.5f), tab2)
- .setBackground(true, ModularUITextures.VANILLA_TAB_TOP_MIDDLE.getSubArea(0, 0.5f, 1f, 1f), tab2)
- .setPos(28, -28))
- .addTabButton(new TabButton(2)
- .setBackground(false, ModularUITextures.VANILLA_TAB_TOP_MIDDLE.getSubArea(0, 0, 1f, 0.5f), tab3)
- .setBackground(true, ModularUITextures.VANILLA_TAB_TOP_MIDDLE.getSubArea(0, 0.5f, 1f, 1f), tab3)
- .setPos(56, -28))
- .addPage(new MultiChildWidget()
- .addChild(new TextWidget(new Text("STATUS")
- .format(EnumChatFormatting.BOLD)
- .format(EnumChatFormatting.GOLD)
- .shadow())
- .setPos(10, 5))
- .addChild(new DynamicTextWidget(() -> new Text("Tea: "
- + (playerData == null
- ? "ERROR"
- : NumberFormat.getInstance()
- .format(playerData.teaAmount)))
- .color(Color.GREEN.normal))
- .setPos(20, 20)))
- .addPage(new MultiChildWidget()
- .addChild(new TextWidget(new Text("EXCHANGE")
- .format(EnumChatFormatting.BOLD)
- .format(EnumChatFormatting.GOLD)
- .shadow())
- .setPos(10, 5))
- .addChild(new ButtonWidget()
- .setOnClick((Widget.ClickData clickData, Widget widget) -> {
- if (!(player instanceof EntityPlayerMP)) return;
- if (playerData == null || playerData.teaAmount < 50_000L) return;
- playerData.teaAmount -= 50_000L;
- playerData.markDirty();
- if (player.inventory.addItemStackToInventory(
- ItemList.TeaAcceptorResearchNote.get(1))) return;
- player.entityDropItem(ItemList.TeaAcceptorResearchNote.get(1), 0.5f);
- })
- .setBackground(new ItemDrawable().setItem(ItemList.TeaAcceptorResearchNote.get(1)))
- .addTooltip("Tea Acceptor Research Note")
- .addTooltip(new Text("Cost: "
- + NumberFormat.getInstance().format(50_000) + " Tea")
- .color(Color.GRAY.normal))
- .setPos(20, 20)))
- .addPage(
- new MultiChildWidget()
- .addChild(new TextWidget(new Text("BENEFITS")
- .format(EnumChatFormatting.BOLD)
- .format(EnumChatFormatting.GOLD)
- .shadow())
- .setPos(10, 5))
- /*.addChild(new ButtonWidget()
- .setOnClick((Widget.ClickData clickData, Widget widget) -> {
- if (!(player instanceof EntityPlayerMP)) return;
- if (playerData == null) return;
- playerData.autoRegen = !playerData.autoRegen;
- playerData.markDirty();
- })
- .setBackground(new ItemDrawable().setItem(new ItemStack(Items.potionitem, 1, 8193)))
- .addTooltip("Regeneration I")
- .addTooltip("For 1 minute")
- .addTooltip(new Text("Cost: "
- + NumberFormat.getInstance().format(75_000) + " Tea")
- .color(Color.GRAY.normal))
- // .addTooltip( //Find a way to run that on server, or different approach
- // new Text("Autobuy: " + (playerData == null ? "ERROR" : playerData.autoRegen))
- // .color(Color.GREY.normal))
- .setPos(20, 20))*/ ));
+ builder.widget(
+ new TabContainer()
+ .setButtonSize(
+ 28,
+ 32)
+ .addTabButton(
+ new TabButton(0)
+ .setBackground(
+ false,
+ ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0, 1f, 0.5f),
+ tab1)
+ .setBackground(
+ true,
+ ModularUITextures.VANILLA_TAB_TOP_START.getSubArea(0, 0.5f, 1f, 1f),
+ tab1)
+ .setPos(0, -28))
+ .addTabButton(
+ new TabButton(1)
+ .setBackground(
+ false,
+ ModularUITextures.VANILLA_TAB_TOP_MIDDLE.getSubArea(0, 0, 1f, 0.5f),
+ tab2)
+ .setBackground(
+ true,
+ ModularUITextures.VANILLA_TAB_TOP_MIDDLE.getSubArea(0, 0.5f, 1f, 1f),
+ tab2)
+ .setPos(28, -28))
+ .addTabButton(
+ new TabButton(2)
+ .setBackground(
+ false,
+ ModularUITextures.VANILLA_TAB_TOP_MIDDLE.getSubArea(0, 0, 1f, 0.5f),
+ tab3)
+ .setBackground(
+ true,
+ ModularUITextures.VANILLA_TAB_TOP_MIDDLE.getSubArea(0, 0.5f, 1f, 1f),
+ tab3)
+ .setPos(56, -28))
+ .addPage(
+ new MultiChildWidget()
+ .addChild(
+ new TextWidget(
+ new Text("STATUS").format(EnumChatFormatting.BOLD)
+ .format(EnumChatFormatting.GOLD).shadow())
+ .setPos(10, 5))
+ .addChild(
+ new DynamicTextWidget(
+ () -> new Text(
+ "Tea: " + (playerData == null ? "ERROR"
+ : NumberFormat.getInstance()
+ .format(playerData.teaAmount)))
+ .color(Color.GREEN.normal))
+ .setPos(20, 20)))
+ .addPage(
+ new MultiChildWidget()
+ .addChild(
+ new TextWidget(
+ new Text("EXCHANGE").format(EnumChatFormatting.BOLD)
+ .format(EnumChatFormatting.GOLD).shadow())
+ .setPos(10, 5))
+ .addChild(
+ new ButtonWidget()
+ .setOnClick((Widget.ClickData clickData, Widget widget) -> {
+ if (!(player instanceof EntityPlayerMP)) return;
+ if (playerData == null || playerData.teaAmount < 50_000L)
+ return;
+ playerData.teaAmount -= 50_000L;
+ playerData.markDirty();
+ if (player.inventory.addItemStackToInventory(
+ ItemList.TeaAcceptorResearchNote.get(1)))
+ return;
+ player.entityDropItem(
+ ItemList.TeaAcceptorResearchNote.get(1),
+ 0.5f);
+ })
+ .setBackground(
+ new ItemDrawable().setItem(
+ ItemList.TeaAcceptorResearchNote.get(1)))
+ .addTooltip("Tea Acceptor Research Note")
+ .addTooltip(
+ new Text(
+ "Cost: " + NumberFormat.getInstance()
+ .format(50_000) + " Tea")
+ .color(Color.GRAY.normal))
+ .setPos(20, 20)))
+ .addPage(
+ new MultiChildWidget().addChild(
+ new TextWidget(
+ new Text("BENEFITS").format(EnumChatFormatting.BOLD)
+ .format(EnumChatFormatting.GOLD).shadow()).setPos(10, 5))
+ /*
+ * .addChild(new ButtonWidget() .setOnClick((Widget.ClickData clickData, Widget widget) -> { if
+ * (!(player instanceof EntityPlayerMP)) return; if (playerData == null) return;
+ * playerData.autoRegen = !playerData.autoRegen; playerData.markDirty(); }) .setBackground(new
+ * ItemDrawable().setItem(new ItemStack(Items.potionitem, 1, 8193)))
+ * .addTooltip("Regeneration I") .addTooltip("For 1 minute") .addTooltip(new Text("Cost: " +
+ * NumberFormat.getInstance().format(75_000) + " Tea") .color(Color.GRAY.normal)) //
+ * .addTooltip( //Find a way to run that on server, or different approach // new
+ * Text("Autobuy: " + (playerData == null ? "ERROR" : playerData.autoRegen)) //
+ * .color(Color.GREY.normal)) .setPos(20, 20))
+ */ ));
return builder.build();
}
diff --git a/src/main/java/kubatech/mixin/Mixin.java b/src/main/java/kubatech/mixin/Mixin.java
index 2a3259ef60..79ae40951f 100644
--- a/src/main/java/kubatech/mixin/Mixin.java
+++ b/src/main/java/kubatech/mixin/Mixin.java
@@ -2,12 +2,14 @@ package kubatech.mixin;
import static kubatech.mixin.TargetedMod.VANILLA;
-import cpw.mods.fml.relauncher.FMLLaunchHandler;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
+import cpw.mods.fml.relauncher.FMLLaunchHandler;
+
public enum Mixin {
+
// Minecraft
EnchantmentHelperMixin("minecraft.EnchantmentHelperMixin", VANILLA),
WorldMixin("minecraft.WorldMixin", VANILLA);
@@ -29,9 +31,8 @@ public enum Mixin {
}
public boolean shouldLoad(List<TargetedMod> loadedMods) {
- return (side == Side.BOTH
- || side == Side.SERVER && FMLLaunchHandler.side().isServer()
- || side == Side.CLIENT && FMLLaunchHandler.side().isClient())
+ return (side == Side.BOTH || side == Side.SERVER && FMLLaunchHandler.side().isServer()
+ || side == Side.CLIENT && FMLLaunchHandler.side().isClient())
&& new HashSet<>(loadedMods).containsAll(targetedMods);
}
}
diff --git a/src/main/java/kubatech/mixin/MixinPlugin.java b/src/main/java/kubatech/mixin/MixinPlugin.java
index be00dc9817..31f1a67a9e 100644
--- a/src/main/java/kubatech/mixin/MixinPlugin.java
+++ b/src/main/java/kubatech/mixin/MixinPlugin.java
@@ -3,7 +3,6 @@ package kubatech.mixin;
import static java.nio.file.Files.walk;
import static kubatech.mixin.TargetedMod.VANILLA;
-import com.gtnewhorizon.gtnhmixins.MinecraftURLClassPath;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -14,14 +13,19 @@ import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+
import kubatech.Tags;
+
import net.minecraft.launchwrapper.Launch;
+
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
import org.spongepowered.libraries.org.objectweb.asm.tree.ClassNode;
+import com.gtnewhorizon.gtnhmixins.MinecraftURLClassPath;
+
@SuppressWarnings("unused")
public class MixinPlugin implements IMixinConfigPlugin {
@@ -92,10 +96,7 @@ public class MixinPlugin implements IMixinConfigPlugin {
public static File findJarOf(final TargetedMod mod) {
try (Stream<Path> stream = walk(MODS_DIRECTORY_PATH)) {
- return stream.filter(mod::isMatchingJar)
- .map(Path::toFile)
- .findFirst()
- .orElse(null);
+ return stream.filter(mod::isMatchingJar).map(Path::toFile).findFirst().orElse(null);
} catch (IOException e) {
e.printStackTrace();
return null;
diff --git a/src/main/java/kubatech/mixin/TargetedMod.java b/src/main/java/kubatech/mixin/TargetedMod.java
index c65fadbde2..60432334be 100644
--- a/src/main/java/kubatech/mixin/TargetedMod.java
+++ b/src/main/java/kubatech/mixin/TargetedMod.java
@@ -1,11 +1,12 @@
package kubatech.mixin;
-import com.google.common.io.Files;
import java.nio.file.Path;
+import com.google.common.io.Files;
+
public enum TargetedMod {
- VANILLA("Minecraft", "unused", true),
- ;
+
+ VANILLA("Minecraft", "unused", true),;
public final String modName;
public final String jarNamePrefixLowercase;
@@ -29,7 +30,11 @@ public enum TargetedMod {
@Override
public String toString() {
return "TargetedMod{" + "modName='"
- + modName + '\'' + ", jarNamePrefixLowercase='"
- + jarNamePrefixLowercase + '\'' + '}';
+ + modName
+ + '\''
+ + ", jarNamePrefixLowercase='"
+ + jarNamePrefixLowercase
+ + '\''
+ + '}';
}
}
diff --git a/src/main/java/kubatech/mixin/mixins/minecraft/EnchantmentHelperMixin.java b/src/main/java/kubatech/mixin/mixins/minecraft/EnchantmentHelperMixin.java
index e07c0d335a..a2fffbcf57 100644
--- a/src/main/java/kubatech/mixin/mixins/minecraft/EnchantmentHelperMixin.java
+++ b/src/main/java/kubatech/mixin/mixins/minecraft/EnchantmentHelperMixin.java
@@ -3,11 +3,14 @@ package kubatech.mixin.mixins.minecraft;
import static kubatech.loaders.MobRecipeLoader.randomEnchantmentDetectedString;
import java.util.Random;
+
import kubatech.api.utils.FastRandom;
import kubatech.loaders.MobRecipeLoader;
+
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagInt;
+
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
@@ -21,10 +24,7 @@ public class EnchantmentHelperMixin {
private static final Random rnd = new FastRandom();
@Inject(method = "addRandomEnchantment", at = @At("HEAD"), require = 1)
- private static void addRandomEnchantmentDetector(
- Random random,
- ItemStack itemStack,
- int enchantabilityLevel,
+ private static void addRandomEnchantmentDetector(Random random, ItemStack itemStack, int enchantabilityLevel,
CallbackInfoReturnable<ItemStack> callbackInfoReturnable) {
if (MobRecipeLoader.isInGenerationProcess && random instanceof MobRecipeLoader.fakeRand) {
itemStack.setTagInfo(randomEnchantmentDetectedString, new NBTTagInt(enchantabilityLevel));
diff --git a/src/main/java/kubatech/mixin/mixins/minecraft/WorldMixin.java b/src/main/java/kubatech/mixin/mixins/minecraft/WorldMixin.java
index 320917c694..8ff7f56a9f 100644
--- a/src/main/java/kubatech/mixin/mixins/minecraft/WorldMixin.java
+++ b/src/main/java/kubatech/mixin/mixins/minecraft/WorldMixin.java
@@ -1,8 +1,10 @@
package kubatech.mixin.mixins.minecraft;
import kubatech.loaders.BlockLoader;
+
import net.minecraft.block.Block;
import net.minecraft.world.World;
+
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
diff --git a/src/main/java/kubatech/nei/IMCForNEI.java b/src/main/java/kubatech/nei/IMCForNEI.java
index 6a3552f2b3..23a60a373b 100644
--- a/src/main/java/kubatech/nei/IMCForNEI.java
+++ b/src/main/java/kubatech/nei/IMCForNEI.java
@@ -1,29 +1,22 @@
/*
- * 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.nei;
-import cpw.mods.fml.common.event.FMLInterModComms;
import kubatech.Tags;
import kubatech.api.LoaderReference;
+
import net.minecraft.nbt.NBTTagCompound;
+import cpw.mods.fml.common.event.FMLInterModComms;
+
public class IMCForNEI {
public static void IMCSender() {
@@ -33,8 +26,8 @@ public class IMCForNEI {
if (LoaderReference.EnderIO) sendCatalyst("kubatech.mobhandler", "gregtech:gt.blockmachines:14201");
}
- private static void sendHandler(
- String aName, String aBlock, int width, int height, int maxrecipesperpage, int yshift) {
+ private static void sendHandler(String aName, String aBlock, int width, int height, int maxrecipesperpage,
+ int yshift) {
NBTTagCompound aNBT = new NBTTagCompound();
aNBT.setString("handler", aName);
aNBT.setString("modName", Tags.MODNAME);
diff --git a/src/main/java/kubatech/nei/Mob_Handler.java b/src/main/java/kubatech/nei/Mob_Handler.java
index e2a619470d..d834640460 100644
--- a/src/main/java/kubatech/nei/Mob_Handler.java
+++ b/src/main/java/kubatech/nei/Mob_Handler.java
@@ -1,34 +1,17 @@
/*
- * 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.nei;
import static kubatech.nei.Mob_Handler.Translations.*;
-import codechicken.lib.gui.GuiDraw;
-import codechicken.nei.NEIClientUtils;
-import codechicken.nei.PositionedStack;
-import codechicken.nei.recipe.*;
-import cpw.mods.fml.common.event.FMLInterModComms;
-import crazypants.enderio.EnderIO;
-import crazypants.enderio.machine.spawner.BlockPoweredSpawner;
-import gregtech.api.util.GT_Utility;
import java.awt.*;
import java.lang.reflect.Field;
import java.nio.FloatBuffer;
@@ -36,6 +19,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Random;
+
import kubatech.Tags;
import kubatech.api.LoaderReference;
import kubatech.api.helpers.InfernalHelper;
@@ -47,6 +31,7 @@ import kubatech.config.Config;
import kubatech.kubatech;
import kubatech.loaders.MobRecipeLoader;
import kubatech.tileentity.gregtech.multiblock.GT_MetaTileEntity_ExtremeExterminationChamber;
+
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.gui.inventory.GuiInventory;
@@ -66,6 +51,7 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
+
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.BufferUtils;
@@ -73,9 +59,19 @@ import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import org.lwjgl.util.glu.GLU;
+import codechicken.lib.gui.GuiDraw;
+import codechicken.nei.NEIClientUtils;
+import codechicken.nei.PositionedStack;
+import codechicken.nei.recipe.*;
+import cpw.mods.fml.common.event.FMLInterModComms;
+import crazypants.enderio.EnderIO;
+import crazypants.enderio.machine.spawner.BlockPoweredSpawner;
+import gregtech.api.util.GT_Utility;
+
public class Mob_Handler extends TemplateRecipeHandler {
enum Translations {
+
NORMAL_DROPS,
RARE_DROPS,
ADDITIONAL_DROPS,
@@ -91,8 +87,8 @@ public class Mob_Handler extends TemplateRecipeHandler {
BOSS,
LOOTABLE,
PLAYER_ONLY,
- EEC_CHANCE,
- ;
+ EEC_CHANCE,;
+
final String key;
Translations() {
@@ -125,12 +121,7 @@ public class Mob_Handler extends TemplateRecipeHandler {
public static void addRecipe(EntityLiving e, List<MobDrop> drop) {
List<MobPositionedStack> positionedStacks = new ArrayList<>();
- int xorigin = 7,
- xoffset = xorigin,
- yoffset = 95,
- normaldrops = 0,
- raredrops = 0,
- additionaldrops = 0,
+ int xorigin = 7, xoffset = xorigin, yoffset = 95, normaldrops = 0, raredrops = 0, additionaldrops = 0,
infernaldrops = 0;
MobDrop.DropType i = null;
for (MobDrop d : drop) {
@@ -150,27 +141,23 @@ public class Mob_Handler extends TemplateRecipeHandler {
else if (d.type == MobDrop.DropType.Rare) raredrops++;
else if (d.type == MobDrop.DropType.Additional) additionaldrops++;
else if (d.type == MobDrop.DropType.Infernal) break; // dont render infernal drops
- positionedStacks.add(new MobPositionedStack(
- d.stack.copy(),
- xoffset,
- yoffset,
- d.type,
- d.chance,
- d.enchantable,
- d.damages != null ? new ArrayList<>(d.damages.keySet()) : null,
- d.lootable,
- d.playerOnly));
+ positionedStacks.add(
+ new MobPositionedStack(
+ d.stack.copy(),
+ xoffset,
+ yoffset,
+ d.type,
+ d.chance,
+ d.enchantable,
+ d.damages != null ? new ArrayList<>(d.damages.keySet()) : null,
+ d.lootable,
+ d.playerOnly));
}
instance.addRecipeInt(e, positionedStacks, normaldrops, raredrops, additionaldrops, infernaldrops);
}
- private void addRecipeInt(
- EntityLiving e,
- List<Mob_Handler.MobPositionedStack> l,
- int normaldrops,
- int raredrops,
- int additionaldrops,
- int infernalDrops) {
+ private void addRecipeInt(EntityLiving e, List<Mob_Handler.MobPositionedStack> l, int normaldrops, int raredrops,
+ int additionaldrops, int infernalDrops) {
cachedRecipes.add(new MobCachedRecipe(e, l, normaldrops, raredrops, additionaldrops, infernalDrops));
}
@@ -221,8 +208,8 @@ public class Mob_Handler extends TemplateRecipeHandler {
static {
try {
- mainmodelfield = RendererLivingEntity.class.getDeclaredField(
- ModUtils.isDeobfuscatedEnvironment ? "mainModel" : "field_77045_g");
+ mainmodelfield = RendererLivingEntity.class
+ .getDeclaredField(ModUtils.isDeobfuscatedEnvironment ? "mainModel" : "field_77045_g");
mainmodelfield.setAccessible(true);
} catch (NoSuchFieldException e) {
throw new RuntimeException(e);
@@ -313,13 +300,17 @@ public class Mob_Handler extends TemplateRecipeHandler {
// ARGS: x, y, scale, rot, rot, entity
GuiInventory.func_147046_a(
- mobx, moby, Math.round(scaled), (x + mobx) - mouseX, y + moby - eheight * scaled - mouseZ, e);
+ mobx,
+ moby,
+ Math.round(scaled),
+ (x + mobx) - mouseX,
+ y + moby - eheight * scaled - mouseZ,
+ e);
} catch (Throwable ex) {
Tessellator tes = Tessellator.instance;
try {
tes.draw();
- } catch (Exception ignored) {
- }
+ } catch (Exception ignored) {}
}
if (BossStatus.statusBarTime > 0 && currentrecipe.isBoss.isEmpty()) currentrecipe.isBoss = BossStatus.bossName;
@@ -337,9 +328,8 @@ public class Mob_Handler extends TemplateRecipeHandler {
GL11.glPopAttrib();
int err;
- while ((err = GL11.glGetError()) != GL11.GL_NO_ERROR)
- if (Config.Debug.showRenderErrors)
- LOG.error(currentrecipe.mobname + " | GL ERROR: " + err + " / " + GLU.gluErrorString(err));
+ while ((err = GL11.glGetError()) != GL11.GL_NO_ERROR) if (Config.Debug.showRenderErrors)
+ LOG.error(currentrecipe.mobname + " | GL ERROR: " + err + " / " + GLU.gluErrorString(err));
GL11.glDisable(GL11.GL_DEPTH_TEST);
}
@@ -370,8 +360,8 @@ public class Mob_Handler extends TemplateRecipeHandler {
if (!currentrecipe.isBoss.isEmpty())
GuiDraw.drawString(EnumChatFormatting.BOLD + "" + BOSS.get(), x, y += yshift, 0xFFD68F00, false);
- MobRecipeLoader.MobRecipe MBRecipe =
- GT_MetaTileEntity_ExtremeExterminationChamber.MobNameToRecipeMap.get(currentrecipe.mobname);
+ MobRecipeLoader.MobRecipe MBRecipe = GT_MetaTileEntity_ExtremeExterminationChamber.MobNameToRecipeMap
+ .get(currentrecipe.mobname);
if (MBRecipe != null) {
if (MBRecipe.isUsable) {
GuiDraw.drawString(
@@ -453,15 +443,13 @@ public class Mob_Handler extends TemplateRecipeHandler {
loadCraftingRecipes(getOverlayIdentifier(), (Object) null);
return;
}
- for (MobCachedRecipe r : cachedRecipes)
- if (r.mInput.stream()
- .anyMatch(s -> s.getItem() == ingredient.getItem()
- && Objects.equals(
- s.getTagCompound().getString("mobType"),
- ingredient.getTagCompound().getString("mobType")))) arecipes.add(r);
- } else
- for (MobCachedRecipe r : cachedRecipes)
- if (r.mInput.stream().anyMatch(ingredient::isItemEqual)) arecipes.add(r);
+ for (MobCachedRecipe r : cachedRecipes) if (r.mInput.stream().anyMatch(
+ s -> s.getItem() == ingredient.getItem() && Objects.equals(
+ s.getTagCompound().getString("mobType"),
+ ingredient.getTagCompound().getString("mobType"))))
+ arecipes.add(r);
+ } else for (MobCachedRecipe r : cachedRecipes)
+ if (r.mInput.stream().anyMatch(ingredient::isItemEqual)) arecipes.add(r);
}
@Override
@@ -479,16 +467,8 @@ public class Mob_Handler extends TemplateRecipeHandler {
public final int enchantmentLevel;
private final Random rand;
- public MobPositionedStack(
- Object object,
- int x,
- int y,
- MobDrop.DropType type,
- int chance,
- Integer enchantable,
- List<Integer> damages,
- boolean lootable,
- boolean isPlayerOnly) {
+ public MobPositionedStack(Object object, int x, int y, MobDrop.DropType type, int chance, Integer enchantable,
+ List<Integer> damages, boolean lootable, boolean isPlayerOnly) {
super(object, x, y, false);
rand = new FastRandom();
this.type = type;
@@ -506,8 +486,10 @@ public class Mob_Handler extends TemplateRecipeHandler {
if (lootable) extratooltip.appendTag(new NBTTagString(EnumChatFormatting.RESET + LOOTABLE.get()));
if (isPlayerOnly) {
extratooltip.appendTag(new NBTTagString(EnumChatFormatting.RESET + PLAYER_ONLY.get()));
- extratooltip.appendTag(new NBTTagString(EnumChatFormatting.RESET
- + EEC_CHANCE.get(((double) chance / 100d) * Config.MobHandler.playerOnlyDropsModifier)));
+ extratooltip.appendTag(
+ new NBTTagString(
+ EnumChatFormatting.RESET + EEC_CHANCE
+ .get(((double) chance / 100d) * Config.MobHandler.playerOnlyDropsModifier)));
}
extratooltip.appendTag(new NBTTagString(EnumChatFormatting.RESET + AVERAGE_REMINDER.get()));
@@ -558,13 +540,8 @@ public class Mob_Handler extends TemplateRecipeHandler {
public final int infernalOutputsCount;
public String isBoss = "";
- public MobCachedRecipe(
- EntityLiving mob,
- List<MobPositionedStack> mOutputs,
- int normalOutputsCount,
- int rareOutputsCount,
- int additionalOutputsCount,
- int infernalOutputsCount) {
+ public MobCachedRecipe(EntityLiving mob, List<MobPositionedStack> mOutputs, int normalOutputsCount,
+ int rareOutputsCount, int additionalOutputsCount, int infernalOutputsCount) {
super();
String classname = mob.getClass().getName();
this.mod = ModUtils.getModNameFromClassName(classname);
diff --git a/src/main/java/kubatech/nei/NEI_Config.java b/src/main/java/kubatech/nei/NEI_Config.java
index a71d462754..0006551f70 100644
--- a/src/main/java/kubatech/nei/NEI_Config.java
+++ b/src/main/java/kubatech/nei/NEI_Config.java
@@ -1,31 +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.nei;
import static kubatech.api.enums.ItemList.*;
+import kubatech.Tags;
import codechicken.nei.api.API;
import codechicken.nei.api.IConfigureNEI;
-import kubatech.Tags;
public class NEI_Config implements IConfigureNEI {
+
public static boolean isAdded = true;
@Override
diff --git a/src/main/java/kubatech/savedata/PlayerData.java b/src/main/java/kubatech/savedata/PlayerData.java
index 6ec21dc1df..a00b7fd0fa 100644
--- a/src/main/java/kubatech/savedata/PlayerData.java
+++ b/src/main/java/kubatech/savedata/PlayerData.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.savedata;
@@ -22,6 +13,7 @@ package kubatech.savedata;
import net.minecraft.nbt.NBTTagCompound;
public class PlayerData {
+
public long teaAmount = 0L;
public boolean autoRegen = false;
diff --git a/src/main/java/kubatech/savedata/PlayerDataManager.java b/src/main/java/kubatech/savedata/PlayerDataManager.java
index 0bb527a4c8..d14a261542 100644
--- a/src/main/java/kubatech/savedata/PlayerDataManager.java
+++ b/src/main/java/kubatech/savedata/PlayerDataManager.java
@@ -1,32 +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.savedata;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import java.util.HashMap;
import java.util.Map;
+
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraft.world.WorldSavedData;
import net.minecraftforge.event.world.WorldEvent;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+
public class PlayerDataManager extends WorldSavedData {
private static final String playerDataName = "KubaTech_PlayerData";
diff --git a/src/main/java/kubatech/tileentity/TeaAcceptorTile.java b/src/main/java/kubatech/tileentity/TeaAcceptorTile.java
index 1f52a00ec9..20b101e70d 100644
--- a/src/main/java/kubatech/tileentity/TeaAcceptorTile.java
+++ b/src/main/java/kubatech/tileentity/TeaAcceptorTile.java
@@ -1,42 +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.tileentity;
-import com.gtnewhorizons.modularui.api.ModularUITextures;
-import com.gtnewhorizons.modularui.api.drawable.Text;
-import com.gtnewhorizons.modularui.api.math.Color;
-import com.gtnewhorizons.modularui.api.math.Pos2d;
-import com.gtnewhorizons.modularui.api.screen.*;
-import com.gtnewhorizons.modularui.api.widget.Widget;
-import com.gtnewhorizons.modularui.common.builder.UIInfo;
-import com.gtnewhorizons.modularui.common.internal.wrapper.ModularUIContainer;
-import com.gtnewhorizons.modularui.common.widget.DynamicTextWidget;
-import com.gtnewhorizons.modularui.common.widget.TextWidget;
import java.text.NumberFormat;
import java.util.function.BiFunction;
+
import kubatech.api.enums.ItemList;
import kubatech.api.utils.StringUtils;
import kubatech.loaders.ItemLoader;
import kubatech.loaders.block.KubaBlock;
import kubatech.savedata.PlayerData;
import kubatech.savedata.PlayerDataManager;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
@@ -44,6 +27,17 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
+import com.gtnewhorizons.modularui.api.ModularUITextures;
+import com.gtnewhorizons.modularui.api.drawable.Text;
+import com.gtnewhorizons.modularui.api.math.Color;
+import com.gtnewhorizons.modularui.api.math.Pos2d;
+import com.gtnewhorizons.modularui.api.screen.*;
+import com.gtnewhorizons.modularui.api.widget.Widget;
+import com.gtnewhorizons.modularui.common.builder.UIInfo;
+import com.gtnewhorizons.modularui.common.internal.wrapper.ModularUIContainer;
+import com.gtnewhorizons.modularui.common.widget.DynamicTextWidget;
+import com.gtnewhorizons.modularui.common.widget.TextWidget;
+
public class TeaAcceptorTile extends TileEntity
implements IInventory, ITileWithModularUI, KubaBlock.IModularUIProvider {
@@ -148,8 +142,7 @@ public class TeaAcceptorTile extends TileEntity
@Override
public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
- return p_94041_2_.getItem() == ItemLoader.kubaitems
- && p_94041_2_.getItemDamage() >= minDamage
+ return p_94041_2_.getItem() == ItemLoader.kubaitems && p_94041_2_.getItemDamage() >= minDamage
&& p_94041_2_.getItemDamage() <= maxDamage;
}
@@ -164,9 +157,9 @@ public class TeaAcceptorTile extends TileEntity
return (TextWidget) textWidget.setPosProvider(posCenteredHorizontallyProvider.apply(textWidget, y));
}
- private static final BiFunction<TextWidget, Integer, Widget.PosProvider> posCenteredHorizontallyProvider =
- (TextWidget widget, Integer y) -> (Widget.PosProvider) (screenSize, window, parent) ->
- new Pos2d((window.getSize().width / 2) - (widget.getSize().width / 2), y);
+ private static final BiFunction<TextWidget, Integer, Widget.PosProvider> posCenteredHorizontallyProvider = (
+ TextWidget widget, Integer y) -> (Widget.PosProvider) (screenSize, window,
+ parent) -> new Pos2d((window.getSize().width / 2) - (widget.getSize().width / 2), y);
@Override
public ModularWindow createWindow(UIBuildContext buildContext) {
@@ -177,26 +170,29 @@ public class TeaAcceptorTile extends TileEntity
builder.widgets(
posCenteredHorizontally(
10,
- new TextWidget(new Text("Tea Acceptor")
- .format(EnumChatFormatting.BOLD)
- .format(EnumChatFormatting.DARK_RED))),
+ new TextWidget(
+ new Text("Tea Acceptor").format(EnumChatFormatting.BOLD)
+ .format(EnumChatFormatting.DARK_RED))),
posCenteredHorizontally(30, new DynamicTextWidget(() -> {
if (player.getCommandSenderName().equals(tileOwner))
return new Text("[Tea]").color(Color.GREEN.normal);
else return new Text("This is not your block").color(Color.RED.normal);
})),
- posCenteredHorizontally(40, new DynamicTextWidget(() -> new Text(
- (playerData == null
- ? "ERROR"
- : StringUtils.applyRainbow(
- NumberFormat.getInstance().format(playerData.teaAmount),
- (int) ((playerData.teaAmount / Math.max(1, averageInput * 10))
- % Integer.MAX_VALUE),
- EnumChatFormatting.BOLD.toString())))
- .shadow())),
- posCenteredHorizontally(50, new DynamicTextWidget(() -> new Text("IN: " + averageInput + "/t")
- .color(Color.BLACK.normal)))
- .addTooltip(new Text("Average input from the last 5 seconds").color(Color.GRAY.normal)));
+ posCenteredHorizontally(
+ 40,
+ new DynamicTextWidget(
+ () -> new Text(
+ (playerData == null ? "ERROR"
+ : StringUtils.applyRainbow(
+ NumberFormat.getInstance().format(playerData.teaAmount),
+ (int) ((playerData.teaAmount / Math.max(1, averageInput * 10))
+ % Integer.MAX_VALUE),
+ EnumChatFormatting.BOLD.toString()))).shadow())),
+ posCenteredHorizontally(
+ 50,
+ new DynamicTextWidget(() -> new Text("IN: " + averageInput + "/t").color(Color.BLACK.normal)))
+ .addTooltip(
+ new Text("Average input from the last 5 seconds").color(Color.GRAY.normal)));
return builder.build();
}
}
diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeExterminationChamber.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeExterminationChamber.java
index b7ef34d6ed..632661a3c7 100644
--- a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeExterminationChamber.java
+++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeExterminationChamber.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.tileentity.gregtech.multiblock;
@@ -26,45 +17,9 @@ import static gregtech.api.util.GT_StructureUtility.*;
import static kubatech.api.Variables.Author;
import static kubatech.api.Variables.StructureHologram;
-import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
-import WayofTime.alchemicalWizardry.api.event.RitualRunEvent;
-import WayofTime.alchemicalWizardry.api.rituals.Rituals;
-import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
-import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
-import WayofTime.alchemicalWizardry.common.rituals.RitualEffectWellOfSuffering;
-import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
-import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass;
-import com.google.common.collect.Multimap;
-import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
-import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
-import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
-import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
-import com.gtnewhorizon.structurelib.structure.StructureDefinition;
-import com.gtnewhorizons.modularui.api.drawable.Text;
-import com.gtnewhorizons.modularui.api.math.Color;
-import com.gtnewhorizons.modularui.api.screen.ModularWindow;
-import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
-import com.gtnewhorizons.modularui.common.widget.*;
-import com.mojang.authlib.GameProfile;
-import cpw.mods.fml.common.eventhandler.EventPriority;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import crazypants.enderio.EnderIO;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.modularui.GT_UITextures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
-import gregtech.api.render.TextureFactory;
-import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
-import gregtech.api.util.GT_Utility;
import java.nio.charset.StandardCharsets;
import java.util.*;
+
import kubatech.Tags;
import kubatech.api.LoaderReference;
import kubatech.api.helpers.ReflectionHelper;
@@ -75,6 +30,7 @@ import kubatech.api.utils.FastRandom;
import kubatech.api.utils.ItemID;
import kubatech.client.effect.EntityRenderer;
import kubatech.loaders.MobRecipeLoader;
+
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.enchantment.Enchantment;
@@ -101,6 +57,46 @@ import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
+import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
+import WayofTime.alchemicalWizardry.api.event.RitualRunEvent;
+import WayofTime.alchemicalWizardry.api.rituals.Rituals;
+import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
+import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
+import WayofTime.alchemicalWizardry.common.rituals.RitualEffectWellOfSuffering;
+import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
+
+import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass;
+import com.google.common.collect.Multimap;
+import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
+import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+import com.gtnewhorizons.modularui.api.drawable.Text;
+import com.gtnewhorizons.modularui.api.math.Color;
+import com.gtnewhorizons.modularui.api.screen.ModularWindow;
+import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
+import com.gtnewhorizons.modularui.common.widget.*;
+import com.mojang.authlib.GameProfile;
+
+import cpw.mods.fml.common.eventhandler.EventPriority;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import crazypants.enderio.EnderIO;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.Textures;
+import gregtech.api.gui.modularui.GT_UITextures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
+import gregtech.api.render.TextureFactory;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
+import gregtech.api.util.GT_Utility;
+
public class GT_MetaTileEntity_ExtremeExterminationChamber
extends KubaTechGTMultiBlockBase<GT_MetaTileEntity_ExtremeExterminationChamber>
implements CustomTileEntityPacketHandler, ISurvivalConstructable {
@@ -134,39 +130,37 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
private static final Item poweredSpawnerItem = Item.getItemFromBlock(EnderIO.blockPoweredSpawner);
private static final int CASING_INDEX = 16;
private static final String STRUCTURE_PIECE_MAIN = "main";
- private static final IStructureDefinition<GT_MetaTileEntity_ExtremeExterminationChamber> STRUCTURE_DEFINITION =
- StructureDefinition.<GT_MetaTileEntity_ExtremeExterminationChamber>builder()
- .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] {
- {"ccccc", "ccccc", "ccccc", "ccccc", "ccccc"},
- {"fgggf", "g---g", "g---g", "g---g", "fgggf"},
- {"fgggf", "g---g", "g---g", "g---g", "fgggf"},
- {"fgggf", "g---g", "g---g", "g---g", "fgggf"},
- {"fgggf", "g---g", "g---g", "g---g", "fgggf"},
- {"fgggf", "gsssg", "gsssg", "gsssg", "fgggf"},
- {"CC~CC", "CCCCC", "CCCCC", "CCCCC", "CCCCC"},
- }))
- .addElement('c', onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings2, 0)))
- .addElement(
- 'C',
- buildHatchAdder(GT_MetaTileEntity_ExtremeExterminationChamber.class)
- .atLeast(InputBus, OutputBus, OutputHatch, Energy, Maintenance)
- .casingIndex(CASING_INDEX)
- .dot(1)
- .buildAndChain(
- onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings2, 0))))
- .addElement(
- 'g',
- LoaderReference.Bartworks
- ? BorosilicateGlass.ofBoroGlass(
- (byte) 0, (t, v) -> t.mGlassTier = v, t -> t.mGlassTier)
- : onElementPass(t -> t.mGlassTier = 100, ofBlock(Blocks.glass, 0)))
- .addElement('f', ofFrame(Materials.Steel))
- .addElement(
- 's',
- LoaderReference.ExtraUtilities
- ? ofBlock(Block.getBlockFromName("ExtraUtilities:spike_base_diamond"), 0)
- : isAir())
- .build();
+ private static final IStructureDefinition<GT_MetaTileEntity_ExtremeExterminationChamber> STRUCTURE_DEFINITION = StructureDefinition
+ .<GT_MetaTileEntity_ExtremeExterminationChamber>builder()
+ .addShape(
+ STRUCTURE_PIECE_MAIN,
+ transpose(
+ new String[][] { { "ccccc", "ccccc", "ccccc", "ccccc", "ccccc" },
+ { "fgggf", "g---g", "g---g", "g---g", "fgggf" },
+ { "fgggf", "g---g", "g---g", "g---g", "fgggf" },
+ { "fgggf", "g---g", "g---g", "g---g", "fgggf" },
+ { "fgggf", "g---g", "g---g", "g---g", "fgggf" },
+ { "fgggf", "gsssg", "gsssg", "gsssg", "fgggf" },
+ { "CC~CC", "CCCCC", "CCCCC", "CCCCC", "CCCCC" }, }))
+ .addElement('c', onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings2, 0)))
+ .addElement(
+ 'C',
+ buildHatchAdder(GT_MetaTileEntity_ExtremeExterminationChamber.class)
+ .atLeast(InputBus, OutputBus, OutputHatch, Energy, Maintenance).casingIndex(CASING_INDEX)
+ .dot(1)
+ .buildAndChain(onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings2, 0))))
+ .addElement(
+ 'g',
+ LoaderReference.Bartworks
+ ? BorosilicateGlass.ofBoroGlass((byte) 0, (t, v) -> t.mGlassTier = v, t -> t.mGlassTier)
+ : onElementPass(t -> t.mGlassTier = 100, ofBlock(Blocks.glass, 0)))
+ .addElement('f', ofFrame(Materials.Steel))
+ .addElement(
+ 's',
+ LoaderReference.ExtraUtilities
+ ? ofBlock(Block.getBlockFromName("ExtraUtilities:spike_base_diamond"), 0)
+ : isAir())
+ .build();
private TileEntity masterStoneRitual = null;
private TileEntity tileAltar = null;
@@ -195,8 +189,8 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
isInRitualMode = aNBT.getBoolean("isInRitualMode");
mAnimationEnabled = !aNBT.hasKey("mAnimationEnabled") || aNBT.getBoolean("mAnimationEnabled");
mGlassTier = aNBT.getByte("mGlassTier");
- mIsProducingInfernalDrops =
- !aNBT.hasKey("mIsProducingInfernalDrops") || aNBT.getBoolean("mIsProducingInfernalDrops");
+ mIsProducingInfernalDrops = !aNBT.hasKey("mIsProducingInfernalDrops")
+ || aNBT.getBoolean("mIsProducingInfernalDrops");
}
@Override
@@ -222,40 +216,33 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
@Override
protected GT_Multiblock_Tooltip_Builder createTooltip() {
GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType("Powered Spawner")
- .addInfo("Controller block for Extreme Extermination Chamber")
- .addInfo(Author)
- .addInfo("Spawns and Exterminates monsters for you")
+ tt.addMachineType("Powered Spawner").addInfo("Controller block for Extreme Extermination Chamber")
+ .addInfo(Author).addInfo("Spawns and Exterminates monsters for you")
.addInfo("You have to insert the powered spawner in controller")
.addInfo("Base energy usage: 2,000 EU/t")
.addInfo("Supports perfect OC and past 1 tick (multiplies outputs)")
.addInfo("Recipe time is based on mob health")
.addInfo("You can additionally put a weapon to the ULV input bus")
.addInfo("It will speed up the process and apply looting level from the weapon")
- .addInfo("Also produces 120 Liquid XP per operation")
- .addInfo("If the mob spawns infernal")
+ .addInfo("Also produces 120 Liquid XP per operation").addInfo("If the mob spawns infernal")
.addInfo("it will drain 8 times more power")
.addInfo("You can prevent infernal spawns by shift clicking with a screwdriver")
.addInfo("Note: If the mob has forced infernal spawn, it will do it anyway")
.addInfo("You can enable ritual mode with a screwdriver")
.addInfo("When in ritual mode and Well Of Suffering ritual is built directly on the machine in center")
.addInfo("The mobs will start to buffer and die very slowly by a ritual")
- .addInfo("You can disable mob animation with a soldering iron")
- .addInfo(StructureHologram)
- .addSeparator()
- .beginStructureBlock(5, 7, 5, true)
- .addController("Front Bottom Center")
+ .addInfo("You can disable mob animation with a soldering iron").addInfo(StructureHologram)
+ .addSeparator().beginStructureBlock(5, 7, 5, true).addController("Front Bottom Center")
.addCasingInfo("Solid Steel Machine Casing", 10)
.addOtherStructurePart("Borosilicate Glass", "All walls without corners")
.addStructureInfo("The glass tier limits the Energy Input tier")
.addOtherStructurePart("Steel Frame Box", "All vertical corners (except top and bottom)")
- .addOtherStructurePart("Diamond spikes", "Inside second layer")
- .addOutputBus("Any casing", 1)
+ .addOtherStructurePart("Diamond spikes", "Inside second layer").addOutputBus("Any casing", 1)
.addOtherStructurePart(
- "1x ULV " + StatCollector.translateToLocal("GT5U.MBTT.InputBus"), "Any casing", 1)
- .addOutputHatch("Any casing", 1)
- .addEnergyHatch("Any casing", 1)
- .addMaintenanceHatch("Any casing", 1)
+ "1x ULV " + StatCollector.translateToLocal("GT5U.MBTT.InputBus"),
+ "Any casing",
+ 1)
+ .addOutputHatch("Any casing", 1).addEnergyHatch("Any casing", 1).addMaintenanceHatch("Any casing", 1)
.toolTipFinisher(Tags.MODNAME);
return tt;
}
@@ -276,49 +263,27 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- if (aActive)
- return new ITexture[] {
- Textures.BlockIcons.getCasingTextureForId(CASING_INDEX),
- TextureFactory.builder()
- .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE)
- .extFacing()
- .build(),
- TextureFactory.builder()
- .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW)
- .extFacing()
- .glow()
- .build()
- };
- return new ITexture[] {
- Textures.BlockIcons.getCasingTextureForId(CASING_INDEX),
- TextureFactory.builder()
- .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER)
- .extFacing()
- .build(),
- TextureFactory.builder()
- .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW)
- .extFacing()
- .glow()
- .build()
- };
+ if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow()
+ .build() };
+ return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow()
+ .build() };
}
- return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)};
+ return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) };
}
@SideOnly(Side.CLIENT)
private void setupEntityRenderer(IGregTechTileEntity aBaseMetaTileEntity, int time) {
if (entityRenderer == null) {
ChunkCoordinates coords = this.getBaseMetaTileEntity().getCoords();
- int[] abc = new int[] {0, -2, 2};
- int[] xyz = new int[] {0, 0, 0};
+ int[] abc = new int[] { 0, -2, 2 };
+ int[] xyz = new int[] { 0, 0, 0 };
this.getExtendedFacing().getWorldOffset(abc, xyz);
xyz[0] += coords.posX;
xyz[1] += coords.posY;
@@ -387,8 +352,8 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
}
@Override
- public boolean onSolderingToolRightClick(
- byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
+ float aZ) {
if (super.onSolderingToolRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ)) return true;
mAnimationEnabled = !mAnimationEnabled;
GT_Utility.sendChatToPlayer(aPlayer, "Animations are " + (mAnimationEnabled ? "enabled" : "disabled"));
@@ -417,11 +382,9 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
if (tileAltar == null || tileAltar.isInvalid()) {
tileAltar = null;
- for (int i = -5; i <= 5; i++)
- for (int j = -5; j <= 5; j++)
- for (int k = -10; k <= 10; k++)
- if (world.getTileEntity(x + i, y + k, z + j) instanceof IBloodAltar)
- tileAltar = world.getTileEntity(x + i, y + k, z + j);
+ for (int i = -5; i <= 5; i++) for (int j = -5; j <= 5; j++) for (int k = -10; k <= 10; k++)
+ if (world.getTileEntity(x + i, y + k, z + j) instanceof IBloodAltar)
+ tileAltar = world.getTileEntity(x + i, y + k, z + j);
}
if (tileAltar == null) return;
@@ -430,25 +393,19 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
return;
}
- ((IBloodAltar) tileAltar)
- .sacrificialDaggerCall(
- 100
- * RitualEffectWellOfSuffering.amount
- * (effect.canDrainReagent(
- event.mrs,
- ReagentRegistry.offensaReagent,
- ReflectionHelper.getField(effect, "offensaDrain", 3),
- true)
- ? 2
- : 1)
- * (effect.canDrainReagent(
- event.mrs,
- ReagentRegistry.tenebraeReagent,
- ReflectionHelper.getField(effect, "tennebraeDrain", 5),
- true)
- ? 2
- : 1),
- true);
+ ((IBloodAltar) tileAltar).sacrificialDaggerCall(
+ 100 * RitualEffectWellOfSuffering.amount
+ * (effect.canDrainReagent(
+ event.mrs,
+ ReagentRegistry.offensaReagent,
+ ReflectionHelper.getField(effect, "offensaDrain", 3),
+ true) ? 2 : 1)
+ * (effect.canDrainReagent(
+ event.mrs,
+ ReagentRegistry.tenebraeReagent,
+ ReflectionHelper.getField(effect, "tennebraeDrain", 5),
+ true) ? 2 : 1),
+ true);
SoulNetworkHandler.syphonFromNetwork(owner, effect.getCostPerRefresh() * 100);
}
@@ -458,6 +415,7 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
private CustomTileEntityPacket mobPacket = null;
private static class WeaponCache {
+
boolean isValid = false;
ItemID id = null;
int looting = 0;
@@ -477,19 +435,20 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
String mobType = aStack.getTagCompound().getString("mobType");
if (mobType.isEmpty()) return false;
- if (mobType.equals("Skeleton")
- && getBaseMetaTileEntity().getWorld().provider instanceof WorldProviderHell
- && rand.nextInt(5) > 0) mobType = "witherSkeleton";
+ if (mobType.equals("Skeleton") && getBaseMetaTileEntity().getWorld().provider instanceof WorldProviderHell
+ && rand.nextInt(5) > 0)
+ mobType = "witherSkeleton";
MobRecipeLoader.MobRecipe recipe = MobNameToRecipeMap.get(mobType);
if (recipe == null) return false;
if (!recipe.isPeacefulAllowed
- && this.getBaseMetaTileEntity().getWorld().difficultySetting == EnumDifficulty.PEACEFUL) return false;
+ && this.getBaseMetaTileEntity().getWorld().difficultySetting == EnumDifficulty.PEACEFUL)
+ return false;
if (isInRitualMode && isRitualValid()) {
if (getMaxInputVoltage() < recipe.mEUt / 4) return false;
- this.mOutputFluids = new FluidStack[] {FluidRegistry.getFluidStack("xpjuice", 5000)};
+ this.mOutputFluids = new FluidStack[] { FluidRegistry.getFluidStack("xpjuice", 5000) };
this.mOutputItems = recipe.generateOutputs(rand, this, 3, 0, mIsProducingInfernalDrops);
this.lEUt /= 4L;
this.mMaxProgresstime = 400;
@@ -500,38 +459,41 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
GT_MetaTileEntity_Hatch_InputBus inputbus = this.mInputBusses.size() == 0 ? null : this.mInputBusses.get(0);
if (inputbus != null && !isValidMetaTileEntity(inputbus)) inputbus = null;
ItemStack lootingHolder = inputbus == null ? null : inputbus.getStackInSlot(0);
- weaponCheck:
- {
- //noinspection EqualsBetweenInconvertibleTypes
+ weaponCheck: {
+ // noinspection EqualsBetweenInconvertibleTypes
if (weaponCache.isValid && weaponCache.id.equals(lootingHolder)) break weaponCheck;
if (lootingHolder == null || !Enchantment.looting.canApply(lootingHolder)) {
weaponCache.isValid = false;
break weaponCheck;
}
try {
- //noinspection unchecked
- weaponCache.attackDamage = ((Multimap<String, AttributeModifier>)
- lootingHolder.getAttributeModifiers())
- .get(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName()).stream()
- .mapToDouble(attr -> attr.getAmount()
- + (double) EnchantmentHelper.func_152377_a(
- lootingHolder, EnumCreatureAttribute.UNDEFINED))
+ // noinspection unchecked
+ weaponCache.attackDamage = ((Multimap<String, AttributeModifier>) lootingHolder
+ .getAttributeModifiers())
+ .get(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName()).stream()
+ .mapToDouble(
+ attr -> attr.getAmount() + (double) EnchantmentHelper
+ .func_152377_a(lootingHolder, EnumCreatureAttribute.UNDEFINED))
.sum();
} catch (Exception ex) {
ex.printStackTrace();
}
weaponCache.isValid = true;
- weaponCache.looting =
- EnchantmentHelper.getEnchantmentLevel(Enchantment.looting.effectId, lootingHolder);
+ weaponCache.looting = EnchantmentHelper
+ .getEnchantmentLevel(Enchantment.looting.effectId, lootingHolder);
weaponCache.id = ItemID.create_NoCopy(lootingHolder, true, true);
}
if (weaponCache.isValid) attackDamage += weaponCache.attackDamage;
this.mOutputItems = recipe.generateOutputs(
- rand, this, attackDamage, weaponCache.isValid ? weaponCache.looting : 0, mIsProducingInfernalDrops);
- this.mOutputFluids = new FluidStack[] {FluidRegistry.getFluidStack("xpjuice", 120)};
+ rand,
+ this,
+ attackDamage,
+ weaponCache.isValid ? weaponCache.looting : 0,
+ mIsProducingInfernalDrops);
+ this.mOutputFluids = new FluidStack[] { FluidRegistry.getFluidStack("xpjuice", 120) };
int times = this.calculatePerfectOverclock(this.lEUt, this.mMaxProgresstime);
- //noinspection ConstantConditions
+ // noinspection ConstantConditions
if (weaponCache.isValid && lootingHolder.isItemStackDamageable()) {
if (EECPlayer == null) EECPlayer = new EECFakePlayer(this);
EECPlayer.currentWeapon = lootingHolder;
@@ -539,7 +501,7 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
for (int i = 0; i < times + 1; i++) {
if (!lootingHolderItem.hitEntity(lootingHolder, recipe.entity, EECPlayer)) break;
if (lootingHolder.stackSize == 0) {
- //noinspection ConstantConditions
+ // noinspection ConstantConditions
inputbus.setInventorySlotContents(0, null);
break;
}
@@ -575,8 +537,8 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
private boolean connectToRitual() {
if (!LoaderReference.BloodMagic) return false;
ChunkCoordinates coords = this.getBaseMetaTileEntity().getCoords();
- int[] abc = new int[] {0, -8, 2};
- int[] xyz = new int[] {0, 0, 0};
+ int[] abc = new int[] { 0, -8, 2 };
+ int[] xyz = new int[] { 0, 0, 0 };
this.getExtendedFacing().getWorldOffset(abc, xyz);
xyz[0] += coords.posX;
xyz[1] += coords.posY;
@@ -595,8 +557,7 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
mGlassTier = 0;
if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 6, 0)) return false;
- if (mCasing < 10
- || mMaintenanceHatches.size() != 1
+ if (mCasing < 10 || mMaintenanceHatches.size() != 1
|| mEnergyHatches.size() == 0
|| !(mInputBusses.size() == 0 || (mInputBusses.size() == 1 && mInputBusses.get(0).mTier == 0)))
return false;
@@ -610,19 +571,21 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
public String[] getInfoData() {
ArrayList<String> info = new ArrayList<>(Arrays.asList(super.getInfoData()));
info.add("Animations: " + EnumChatFormatting.YELLOW + (mAnimationEnabled ? "Enabled" : "Disabled"));
- info.add("Is allowed to produce infernal drops: " + EnumChatFormatting.YELLOW
- + (mIsProducingInfernalDrops ? "Yes" : "No"));
+ info.add(
+ "Is allowed to produce infernal drops: " + EnumChatFormatting.YELLOW
+ + (mIsProducingInfernalDrops ? "Yes" : "No"));
info.add("Is in ritual mode: " + EnumChatFormatting.YELLOW + (isInRitualMode ? "Yes" : "No"));
- if (isInRitualMode)
- info.add("Is connected to ritual: "
- + (isRitualValid() ? EnumChatFormatting.GREEN + "Yes" : EnumChatFormatting.RED + "No"));
+ if (isInRitualMode) info.add(
+ "Is connected to ritual: "
+ + (isRitualValid() ? EnumChatFormatting.GREEN + "Yes" : EnumChatFormatting.RED + "No"));
else {
info.add("Inserted weapon: " + EnumChatFormatting.YELLOW + (weaponCache.isValid ? "Yes" : "No"));
if (weaponCache.isValid) {
info.add("Weapon attack damage: " + EnumChatFormatting.YELLOW + weaponCache.attackDamage);
info.add("Weapon looting level: " + EnumChatFormatting.YELLOW + weaponCache.looting);
- info.add("Total attack damage: " + EnumChatFormatting.YELLOW
- + (DIAMOND_SPIKES_DAMAGE + weaponCache.attackDamage));
+ info.add(
+ "Total attack damage: " + EnumChatFormatting.YELLOW
+ + (DIAMOND_SPIKES_DAMAGE + weaponCache.attackDamage));
} else info.add("Total attack damage: " + EnumChatFormatting.YELLOW + DIAMOND_SPIKES_DAMAGE);
}
return info.toArray(new String[0]);
@@ -635,95 +598,79 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
@Override
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
- builder.widget(new DrawableWidget()
- .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK)
- .setPos(7, 4)
- .setSize(143, 75)
- .setEnabled(widget -> !isFixed.apply(widget)));
- final SlotWidget inventorySlot =
- new SlotWidget(inventoryHandler, 1).setFilter(stack -> stack.getItem() == poweredSpawnerItem);
+ builder.widget(
+ new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(7, 4).setSize(143, 75)
+ .setEnabled(widget -> !isFixed.apply(widget)));
+ final SlotWidget inventorySlot = new SlotWidget(inventoryHandler, 1)
+ .setFilter(stack -> stack.getItem() == poweredSpawnerItem);
DynamicPositionedColumn configurationElements = new DynamicPositionedColumn();
addConfigurationWidgets(configurationElements, buildContext, inventorySlot);
- builder.widget(new DynamicPositionedColumn()
- .setSynced(false)
- .widget(inventorySlot)
- .widget(new CycleButtonWidget()
- .setToggle(() -> getBaseMetaTileEntity().isAllowedToWork(), works -> {
+ builder.widget(
+ new DynamicPositionedColumn().setSynced(false).widget(inventorySlot).widget(
+ new CycleButtonWidget().setToggle(() -> getBaseMetaTileEntity().isAllowedToWork(), works -> {
if (works) getBaseMetaTileEntity().enableWorking();
else getBaseMetaTileEntity().disableWorking();
if (!(buildContext.getPlayer() instanceof EntityPlayerMP)) return;
String tChat = GT_Utility.trans("090", "Machine Processing: ")
- + (works
- ? GT_Utility.trans("088", "Enabled")
+ + (works ? GT_Utility.trans("088", "Enabled")
: GT_Utility.trans("087", "Disabled"));
if (hasAlternativeModeText()) tChat = getAlternativeModeText();
GT_Utility.sendChatToPlayer(buildContext.getPlayer(), tChat);
- })
- .addTooltip(0, new Text("Disabled").color(Color.RED.dark(3)))
- .addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3)))
- .setVariableBackgroundGetter(toggleButtonBackgroundGetter)
- .setSize(18, 18)
- .addTooltip("Working status"))
- .widget(configurationElements.setEnabled(
- widget -> !getBaseMetaTileEntity().isActive()))
- .widget(new DrawableWidget()
- .setDrawable(GT_UITextures.OVERLAY_BUTTON_CROSS)
- .setSize(18, 18)
- .addTooltip(new Text("Please stop the machine to configure it").color(Color.RED.dark(3)))
- .setEnabled(widget -> getBaseMetaTileEntity().isActive()))
- .setPos(151, 4));
+ }).addTooltip(0, new Text("Disabled").color(Color.RED.dark(3)))
+ .addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3)))
+ .setVariableBackgroundGetter(toggleButtonBackgroundGetter).setSize(18, 18)
+ .addTooltip("Working status"))
+ .widget(configurationElements.setEnabled(widget -> !getBaseMetaTileEntity().isActive()))
+ .widget(
+ new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CROSS).setSize(18, 18)
+ .addTooltip(
+ new Text("Please stop the machine to configure it")
+ .color(Color.RED.dark(3)))
+ .setEnabled(widget -> getBaseMetaTileEntity().isActive()))
+ .setPos(151, 4));
final DynamicPositionedColumn screenElements = new DynamicPositionedColumn();
drawTexts(screenElements, inventorySlot);
builder.widget(screenElements);
}
- private void addConfigurationWidgets(
- DynamicPositionedColumn configurationElements, UIBuildContext buildContext, SlotWidget inventorySlot) {
+ private void addConfigurationWidgets(DynamicPositionedColumn configurationElements, UIBuildContext buildContext,
+ SlotWidget inventorySlot) {
configurationElements.setSynced(false);
- configurationElements.widget(new CycleButtonWidget()
- .setToggle(() -> isInRitualMode, v -> {
- if (this.mMaxProgresstime > 0) {
- GT_Utility.sendChatToPlayer(buildContext.getPlayer(), "Can't change mode when running !");
- return;
- }
+ configurationElements.widget(new CycleButtonWidget().setToggle(() -> isInRitualMode, v -> {
+ if (this.mMaxProgresstime > 0) {
+ GT_Utility.sendChatToPlayer(buildContext.getPlayer(), "Can't change mode when running !");
+ return;
+ }
- isInRitualMode = v;
-
- if (!(buildContext.getPlayer() instanceof EntityPlayerMP)) return;
- if (!isInRitualMode) {
- GT_Utility.sendChatToPlayer(buildContext.getPlayer(), "Ritual mode disabled");
- } else {
- GT_Utility.sendChatToPlayer(buildContext.getPlayer(), "Ritual mode enabled");
- if (connectToRitual())
- GT_Utility.sendChatToPlayer(
- buildContext.getPlayer(), "Successfully connected to the ritual");
- else GT_Utility.sendChatToPlayer(buildContext.getPlayer(), "Can't connect to the ritual");
- }
- })
- .setVariableBackgroundGetter(toggleButtonBackgroundGetter)
- .setSize(18, 18)
- .addTooltip("Ritual mode"));
- configurationElements.widget(new CycleButtonWidget()
- .setToggle(() -> mIsProducingInfernalDrops, v -> {
- if (this.mMaxProgresstime > 0) {
- GT_Utility.sendChatToPlayer(buildContext.getPlayer(), "Can't change mode when running !");
- return;
- }
+ isInRitualMode = v;
- mIsProducingInfernalDrops = v;
+ if (!(buildContext.getPlayer() instanceof EntityPlayerMP)) return;
+ if (!isInRitualMode) {
+ GT_Utility.sendChatToPlayer(buildContext.getPlayer(), "Ritual mode disabled");
+ } else {
+ GT_Utility.sendChatToPlayer(buildContext.getPlayer(), "Ritual mode enabled");
+ if (connectToRitual())
+ GT_Utility.sendChatToPlayer(buildContext.getPlayer(), "Successfully connected to the ritual");
+ else GT_Utility.sendChatToPlayer(buildContext.getPlayer(), "Can't connect to the ritual");
+ }
+ }).setVariableBackgroundGetter(toggleButtonBackgroundGetter).setSize(18, 18).addTooltip("Ritual mode"));
+ configurationElements.widget(new CycleButtonWidget().setToggle(() -> mIsProducingInfernalDrops, v -> {
+ if (this.mMaxProgresstime > 0) {
+ GT_Utility.sendChatToPlayer(buildContext.getPlayer(), "Can't change mode when running !");
+ return;
+ }
+
+ mIsProducingInfernalDrops = v;
- if (!(buildContext.getPlayer() instanceof EntityPlayerMP)) return;
- if (!mIsProducingInfernalDrops)
- GT_Utility.sendChatToPlayer(
- buildContext.getPlayer(), "Mobs will now be prevented from spawning infernal");
- else GT_Utility.sendChatToPlayer(buildContext.getPlayer(), "Mobs can spawn infernal now");
- })
- .setVariableBackgroundGetter(toggleButtonBackgroundGetter)
- .setSize(18, 18)
+ if (!(buildContext.getPlayer() instanceof EntityPlayerMP)) return;
+ if (!mIsProducingInfernalDrops) GT_Utility
+ .sendChatToPlayer(buildContext.getPlayer(), "Mobs will now be prevented from spawning infernal");
+ else GT_Utility.sendChatToPlayer(buildContext.getPlayer(), "Mobs can spawn infernal now");
+ }).setVariableBackgroundGetter(toggleButtonBackgroundGetter).setSize(18, 18)
.addTooltip("Is allowed to spawn infernal mobs")
.addTooltip(new Text("Does not affect mobs that are always infernal !").color(Color.GRAY.normal)));
}
@@ -732,75 +679,75 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inventorySlot) {
screenElements.setSynced(false).setSpace(0).setPos(10, 7);
- screenElements.widget(new DynamicPositionedRow()
- .setSynced(false)
- .widget(new TextWidget("Status: ").setDefaultColor(COLOR_TEXT_GRAY.get()))
- .widget(new DynamicTextWidget(() -> {
- if (getBaseMetaTileEntity().isActive()) return new Text("Working !").color(Color.GREEN.dark(3));
- else if (getBaseMetaTileEntity().isAllowedToWork())
- return new Text("Enabled").color(Color.GREEN.dark(3));
- else if (getBaseMetaTileEntity().wasShutdown())
- return new Text("Shutdown (CRITICAL)").color(Color.RED.dark(3));
- else return new Text("Disabled").color(Color.RED.dark(3));
- }))
- .setEnabled(isFixed));
+ screenElements.widget(
+ new DynamicPositionedRow().setSynced(false)
+ .widget(new TextWidget("Status: ").setDefaultColor(COLOR_TEXT_GRAY.get()))
+ .widget(new DynamicTextWidget(() -> {
+ if (getBaseMetaTileEntity().isActive())
+ return new Text("Working !").color(Color.GREEN.dark(3));
+ else if (getBaseMetaTileEntity().isAllowedToWork())
+ return new Text("Enabled").color(Color.GREEN.dark(3));
+ else if (getBaseMetaTileEntity().wasShutdown())
+ return new Text("Shutdown (CRITICAL)").color(Color.RED.dark(3));
+ else return new Text("Disabled").color(Color.RED.dark(3));
+ })).setEnabled(isFixed));
screenElements.widget(new DynamicTextWidget(() -> {
- ItemStack aStack = mInventory[1];
- if (aStack == null) return new Text("Insert Powered Spawner").color(Color.RED.dark(3));
- else {
- Text invalid = new Text("Invalid Spawner").color(Color.RED.dark(3));
- if (aStack.getItem() != poweredSpawnerItem) return invalid;
+ ItemStack aStack = mInventory[1];
+ if (aStack == null) return new Text("Insert Powered Spawner").color(Color.RED.dark(3));
+ else {
+ Text invalid = new Text("Invalid Spawner").color(Color.RED.dark(3));
+ if (aStack.getItem() != poweredSpawnerItem) return invalid;
- if (aStack.getTagCompound() == null) return invalid;
- String mobType = aStack.getTagCompound().getString("mobType");
- if (mobType.isEmpty()) return invalid;
+ if (aStack.getTagCompound() == null) return invalid;
+ String mobType = aStack.getTagCompound().getString("mobType");
+ if (mobType.isEmpty()) return invalid;
- if (!MobNameToRecipeMap.containsKey(mobType)) return invalid;
+ if (!MobNameToRecipeMap.containsKey(mobType)) return invalid;
- return new Text(StatCollector.translateToLocal("entity." + mobType + ".name"))
- .color(Color.GREEN.dark(3));
- }
- })
- .setEnabled(isFixed));
+ return new Text(StatCollector.translateToLocal("entity." + mobType + ".name"))
+ .color(Color.GREEN.dark(3));
+ }
+ }).setEnabled(isFixed));
screenElements
- .widget(new TextWidget(GT_Utility.trans("132", "Pipe is loose."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mWrench))
+ .widget(
+ new TextWidget(GT_Utility.trans("132", "Pipe is loose."))
+ .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mWrench))
.widget(new FakeSyncWidget.BooleanSyncer(() -> mWrench, val -> mWrench = val));
screenElements
- .widget(new TextWidget(GT_Utility.trans("133", "Screws are loose."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mScrewdriver))
+ .widget(
+ new TextWidget(GT_Utility.trans("133", "Screws are loose."))
+ .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mScrewdriver))
.widget(new FakeSyncWidget.BooleanSyncer(() -> mScrewdriver, val -> mScrewdriver = val));
screenElements
- .widget(new TextWidget(GT_Utility.trans("134", "Something is stuck."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mSoftHammer))
+ .widget(
+ new TextWidget(GT_Utility.trans("134", "Something is stuck."))
+ .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mSoftHammer))
.widget(new FakeSyncWidget.BooleanSyncer(() -> mSoftHammer, val -> mSoftHammer = val));
screenElements
- .widget(new TextWidget(GT_Utility.trans("135", "Platings are dented."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mHardHammer))
+ .widget(
+ new TextWidget(GT_Utility.trans("135", "Platings are dented."))
+ .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mHardHammer))
.widget(new FakeSyncWidget.BooleanSyncer(() -> mHardHammer, val -> mHardHammer = val));
screenElements
- .widget(new TextWidget(GT_Utility.trans("136", "Circuitry burned out."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mSolderingTool))
+ .widget(
+ new TextWidget(GT_Utility.trans("136", "Circuitry burned out."))
+ .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mSolderingTool))
.widget(new FakeSyncWidget.BooleanSyncer(() -> mSolderingTool, val -> mSolderingTool = val));
screenElements
- .widget(new TextWidget(GT_Utility.trans("137", "That doesn't belong there."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mCrowbar))
+ .widget(
+ new TextWidget(GT_Utility.trans("137", "That doesn't belong there."))
+ .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mCrowbar))
.widget(new FakeSyncWidget.BooleanSyncer(() -> mCrowbar, val -> mCrowbar = val));
screenElements
- .widget(new TextWidget(GT_Utility.trans("138", "Incomplete Structure."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mMachine))
+ .widget(
+ new TextWidget(GT_Utility.trans("138", "Incomplete Structure."))
+ .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mMachine))
.widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val));
}
private static class EECFakePlayer extends FakePlayer {
+
GT_MetaTileEntity_ExtremeExterminationChamber mte;
ItemStack currentWeapon;
diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java
index 3a79f69275..bee5f1a5f4 100644
--- a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java
+++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.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.tileentity.gregtech.multiblock;
@@ -27,6 +18,29 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import static kubatech.api.Variables.*;
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+import kubatech.Tags;
+import kubatech.api.LoaderReference;
+import kubatech.api.helpers.GTHelper;
+import kubatech.api.implementations.KubaTechGTMultiBlockBase;
+import kubatech.api.network.CustomTileEntityPacket;
+import kubatech.api.tileentity.CustomTileEntityPacketHandler;
+import kubatech.client.effect.MegaApiaryBeesRenderer;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+
import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass;
import com.gtnewhorizon.structurelib.StructureLibAPI;
import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
@@ -43,6 +57,7 @@ import com.gtnewhorizons.modularui.api.math.Color;
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.widget.*;
+
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.apiculture.*;
@@ -61,26 +76,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energ
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Utility;
-import java.io.IOException;
-import java.util.*;
-import java.util.stream.Collectors;
-import java.util.stream.IntStream;
-import kubatech.Tags;
-import kubatech.api.LoaderReference;
-import kubatech.api.helpers.GTHelper;
-import kubatech.api.implementations.KubaTechGTMultiBlockBase;
-import kubatech.api.network.CustomTileEntityPacket;
-import kubatech.api.tileentity.CustomTileEntityPacketHandler;
-import kubatech.client.effect.MegaApiaryBeesRenderer;
-import net.minecraft.client.Minecraft;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
public class GT_MetaTileEntity_MegaIndustrialApiary
extends KubaTechGTMultiBlockBase<GT_MetaTileEntity_MegaIndustrialApiary>
@@ -100,7 +95,8 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
private static final int CONFIGURATION_WINDOW_ID = 999;
private static final int MEGA_APIARY_STORAGE_VERSION = 1;
- private static final String[][] struct = transpose(new String[][] { // spotless:off
+ private static final String[][] struct = transpose(
+ new String[][] { // spotless:off
{" "," "," "," HHH "," HHAAAHH "," HAPLPAH "," HAPAAAPAH "," HALAAALAH "," HAPAAAPAH "," HAPLPAH "," HHAAAHH "," HHH "," "," "," "},
{" "," "," GGG "," GGG GG "," G G "," G G "," G G "," G G "," G G "," G G "," G G "," GG GG "," GGG "," "," "},
{" "," HHH "," HHH HHH "," H GH "," H H "," H H "," H H "," H H "," H H "," H H "," H H "," HG GH "," HHH HHH "," HHH "," "},
@@ -120,75 +116,64 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
{" "," "," "," "," "," "," GGG "," GHG "," GGG "," "," "," "," "," "," "}
});// spotless:on
- private static final IStructureDefinition<GT_MetaTileEntity_MegaIndustrialApiary> STRUCTURE_DEFINITION =
- StructureDefinition.<GT_MetaTileEntity_MegaIndustrialApiary>builder()
- .addShape(STRUCTURE_PIECE_MAIN, struct)
- .addShape(
- STRUCTURE_PIECE_MAIN_SURVIVAL,
- Arrays.stream(struct)
- .map(sa -> Arrays.stream(sa)
- .map(s -> s.replaceAll("W", " ").replaceAll("F", " "))
+ private static final IStructureDefinition<GT_MetaTileEntity_MegaIndustrialApiary> STRUCTURE_DEFINITION = StructureDefinition
+ .<GT_MetaTileEntity_MegaIndustrialApiary>builder().addShape(STRUCTURE_PIECE_MAIN, struct)
+ .addShape(
+ STRUCTURE_PIECE_MAIN_SURVIVAL,
+ Arrays.stream(struct)
+ .map(
+ sa -> Arrays.stream(sa).map(s -> s.replaceAll("W", " ").replaceAll("F", " "))
.toArray(String[]::new))
- .toArray(String[][]::new))
- .addElement(
- 'A',
- LoaderReference.Bartworks
- ? BorosilicateGlass.ofBoroGlass(
- (byte) 0, (t, v) -> t.mGlassTier = v, t -> t.mGlassTier)
- : onElementPass(t -> t.mGlassTier = 100, ofBlock(Blocks.glass, 0)))
- .addElement('B', ofChain(ofBlockAnyMeta(Blocks.dirt, 0), ofBlock(Blocks.grass, 0)))
- .addElement(
- 'G',
- buildHatchAdder(GT_MetaTileEntity_MegaIndustrialApiary.class)
- .atLeast(InputBus, OutputBus, Energy, Maintenance)
- .casingIndex(CASING_INDEX)
- .dot(1)
- .buildAndChain(
- onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings1, 10))))
- .addElement(
- 'H',
- ofBlocksMap(
- Collections.singletonMap(
- Blocks.planks,
- IntStream.rangeClosed(0, 5).boxed().collect(Collectors.toList())),
+ .toArray(String[][]::new))
+ .addElement(
+ 'A',
+ LoaderReference.Bartworks
+ ? BorosilicateGlass.ofBoroGlass((byte) 0, (t, v) -> t.mGlassTier = v, t -> t.mGlassTier)
+ : onElementPass(t -> t.mGlassTier = 100, ofBlock(Blocks.glass, 0)))
+ .addElement('B', ofChain(ofBlockAnyMeta(Blocks.dirt, 0), ofBlock(Blocks.grass, 0)))
+ .addElement(
+ 'G',
+ buildHatchAdder(GT_MetaTileEntity_MegaIndustrialApiary.class)
+ .atLeast(InputBus, OutputBus, Energy, Maintenance).casingIndex(CASING_INDEX).dot(1)
+ .buildAndChain(onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings1, 10))))
+ .addElement(
+ 'H',
+ ofBlocksMap(
+ Collections.singletonMap(
Blocks.planks,
- 5))
- .addElement(
- 'I',
- ofBlocksMap(
- Collections.singletonMap(
- Blocks.wooden_slab,
- IntStream.rangeClosed(0, 5).boxed().collect(Collectors.toList())),
+ IntStream.rangeClosed(0, 5).boxed().collect(Collectors.toList())),
+ Blocks.planks,
+ 5))
+ .addElement(
+ 'I',
+ ofBlocksMap(
+ Collections.singletonMap(
Blocks.wooden_slab,
- 5))
- .addElement('J', ofBlock(PluginApiculture.blocks.apiculture, BlockApicultureType.APIARY.getMeta()))
- .addElement('K', ofBlock(PluginApiculture.blocks.alveary, BlockAlveary.Type.PLAIN.ordinal()))
- .addElement('L', ofBlock(PluginApiculture.blocks.alveary, BlockAlveary.Type.HYGRO.ordinal()))
- .addElement('N', ofBlock(PluginApiculture.blocks.alveary, BlockAlveary.Type.STABILIZER.ordinal()))
- .addElement('O', ofBlock(PluginApiculture.blocks.alveary, BlockAlveary.Type.HEATER.ordinal()))
- .addElement('P', ofBlock(PluginApiculture.blocks.alveary, BlockAlveary.Type.FAN.ordinal()))
- .addElement('W', ofBlock(Blocks.water, 0))
- .addElement('F', new IStructureElementNoPlacement<GT_MetaTileEntity_MegaIndustrialApiary>() {
- @Override
- public boolean check(
- GT_MetaTileEntity_MegaIndustrialApiary mte, World world, int x, int y, int z) {
- mte.flowerCheck(world, x, y, z);
- return true;
- }
+ IntStream.rangeClosed(0, 5).boxed().collect(Collectors.toList())),
+ Blocks.wooden_slab,
+ 5))
+ .addElement('J', ofBlock(PluginApiculture.blocks.apiculture, BlockApicultureType.APIARY.getMeta()))
+ .addElement('K', ofBlock(PluginApiculture.blocks.alveary, BlockAlveary.Type.PLAIN.ordinal()))
+ .addElement('L', ofBlock(PluginApiculture.blocks.alveary, BlockAlveary.Type.HYGRO.ordinal()))
+ .addElement('N', ofBlock(PluginApiculture.blocks.alveary, BlockAlveary.Type.STABILIZER.ordinal()))
+ .addElement('O', ofBlock(PluginApiculture.blocks.alveary, BlockAlveary.Type.HEATER.ordinal()))
+ .addElement('P', ofBlock(PluginApiculture.blocks.alveary, BlockAlveary.Type.FAN.ordinal()))
+ .addElement('W', ofBlock(Blocks.water, 0))
+ .addElement('F', new IStructureElementNoPlacement<GT_MetaTileEntity_MegaIndustrialApiary>() {
+
+ @Override
+ public boolean check(GT_MetaTileEntity_MegaIndustrialApiary mte, World world, int x, int y, int z) {
+ mte.flowerCheck(world, x, y, z);
+ return true;
+ }
- @Override
- public boolean spawnHint(
- GT_MetaTileEntity_MegaIndustrialApiary mte,
- World world,
- int x,
- int y,
- int z,
- ItemStack trigger) {
- StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 2 - 1);
- return true;
- }
- })
- .build();
+ @Override
+ public boolean spawnHint(GT_MetaTileEntity_MegaIndustrialApiary mte, World world, int x, int y, int z,
+ ItemStack trigger) {
+ StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 2 - 1);
+ return true;
+ }
+ }).build();
@SuppressWarnings("unused")
public GT_MetaTileEntity_MegaIndustrialApiary(int aID, String aName, String aNameRegional) {
@@ -247,50 +232,34 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType("Apiary")
.addInfo("Controller block for Industrial Apicultural Acclimatiser and Drone Domestication Station")
- .addInfo(buildAuthorList("kuba6000", "Runakai"))
- .addInfo("The ideal home for your bees")
- .addInfo("AKA. Mega Apiary")
- .addInfo("Use screwdriver to change primary mode (INPUT/OUTPUT/OPERATING)")
+ .addInfo(buildAuthorList("kuba6000", "Runakai")).addInfo("The ideal home for your bees")
+ .addInfo("AKA. Mega Apiary").addInfo("Use screwdriver to change primary mode (INPUT/OUTPUT/OPERATING)")
.addInfo("Use screwdriver + shift to change operation mode (NORMAL/SWARMER)")
- .addInfo("--------------------- INPUT MODE ---------------------")
- .addInfo("- Does not take power")
+ .addInfo("--------------------- INPUT MODE ---------------------").addInfo("- Does not take power")
.addInfo("- Put your queens in the input bus to put them in the internal buffer")
- .addInfo("-------------------- OUTPUT MODE ---------------------")
- .addInfo("- Does not take power")
+ .addInfo("-------------------- OUTPUT MODE ---------------------").addInfo("- Does not take power")
.addInfo("- Will give your bees back to output bus")
- .addInfo("------------------- OPERATING MODE -------------------")
- .addInfo("- NORMAL:")
+ .addInfo("------------------- OPERATING MODE -------------------").addInfo("- NORMAL:")
.addInfo(" - For each " + voltageFormatted(6) + " amp you can insert 1 bee")
.addInfo(" - Processing time: 5 seconds")
.addInfo(" - Uses 1 " + voltageFormatted(6) + " amp per queen")
- .addInfo(" - All bees are accelerated 64 times")
- .addInfo(" - 8 production upgrades are applied")
+ .addInfo(" - All bees are accelerated 64 times").addInfo(" - 8 production upgrades are applied")
.addInfo(" - Genetic Stabilizer upgrade applied")
.addInfo(" - Simulates perfect environment for your bees")
.addInfo(" - Additionally you can provide royal jelly to increase the outputs:")
.addInfo(" - 1 royal jelly grants 5% bonus per bee")
.addInfo(" - They will be consumed on each start of operation")
- .addInfo(" - and be applied to that operation only")
- .addInfo(" - Max bonus: 200%")
- .addInfo("- SWARMER:")
- .addInfo(" - You can only insert 1 queen")
+ .addInfo(" - and be applied to that operation only").addInfo(" - Max bonus: 200%")
+ .addInfo("- SWARMER:").addInfo(" - You can only insert 1 queen")
.addInfo(" - It will slowly produce ignoble princesses")
- .addInfo(" - Consumes 100 royal jelly per operation")
- .addInfo(" - Base processing time: 1 minute")
- .addInfo(" - Uses 1 amp " + voltageFormatted(5))
- .addInfo(" - Can overclock")
- .addInfo(StructureHologram)
- .addSeparator()
- .beginStructureBlock(15, 17, 15, false)
- .addController("Front Bottom Center")
- .addCasingInfo("Bronze Plated Bricks", 190)
+ .addInfo(" - Consumes 100 royal jelly per operation").addInfo(" - Base processing time: 1 minute")
+ .addInfo(" - Uses 1 amp " + voltageFormatted(5)).addInfo(" - Can overclock")
+ .addInfo(StructureHologram).addSeparator().beginStructureBlock(15, 17, 15, false)
+ .addController("Front Bottom Center").addCasingInfo("Bronze Plated Bricks", 190)
.addOtherStructurePart("Borosilicate Glass", "Look at the hologram")
.addStructureInfo("The glass tier limits the Energy Input tier")
- .addOtherStructurePart("Flowers", "On dirt/grass", 2)
- .addInputBus("Any casing", 1)
- .addOutputBus("Any casing", 1)
- .addEnergyHatch("Any casing", 1)
- .addMaintenanceHatch("Any casing", 1)
+ .addOtherStructurePart("Flowers", "On dirt/grass", 2).addInputBus("Any casing", 1)
+ .addOutputBus("Any casing", 1).addEnergyHatch("Any casing", 1).addMaintenanceHatch("Any casing", 1)
.toolTipFinisher(Tags.MODNAME);
return tt;
}
@@ -302,8 +271,7 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
aNBT.setInteger("mPrimaryMode", mPrimaryMode);
aNBT.setInteger("mSecondaryMode", mSecondaryMode);
aNBT.setInteger("mStorageSize", mStorage.size());
- for (int i = 0; i < mStorage.size(); i++)
- aNBT.setTag("mStorage." + i, mStorage.get(i).toNBTTagCompound());
+ for (int i = 0; i < mStorage.size(); i++) aNBT.setTag("mStorage." + i, mStorage.get(i).toNBTTagCompound());
aNBT.setInteger("MEGA_APIARY_STORAGE_VERSION", MEGA_APIARY_STORAGE_VERSION);
}
@@ -385,8 +353,8 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
packet.sendToAllAround(20);
} else {
if (aBaseMetaTileEntity.isActive() && aTick % 100 == 0) {
- int[] abc = new int[] {0, -2, 7};
- int[] xyz = new int[] {0, 0, 0};
+ int[] abc = new int[] { 0, -2, 7 };
+ int[] xyz = new int[] { 0, 0, 0 };
this.getExtendedFacing().getWorldOffset(abc, xyz);
xyz[0] += aBaseMetaTileEntity.getXCoord();
xyz[1] += aBaseMetaTileEntity.getYCoord();
@@ -492,7 +460,7 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
if (this.lEUt > 0) this.lEUt = -this.lEUt;
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
- this.mOutputItems = new ItemStack[] {this.mStorage.get(0).createIgnobleCopy()};
+ this.mOutputItems = new ItemStack[] { this.mStorage.get(0).createIgnobleCopy() };
this.updateSlots();
return true;
}
@@ -505,17 +473,22 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
@Override
public String[] getInfoData() {
ArrayList<String> info = new ArrayList<>(Arrays.asList(super.getInfoData()));
- info.add("Running in mode: " + EnumChatFormatting.GOLD
- + (mPrimaryMode == 0
- ? "Input mode"
- : (mPrimaryMode == 1
- ? "Output mode"
- : (mSecondaryMode == 0 ? "Operating mode (NORMAL)" : "Operating mode (SWARMER)"))));
- info.add("Bee storage (" + EnumChatFormatting.GOLD + mStorage.size() + EnumChatFormatting.RESET + "/"
- + (mStorage.size() > mMaxSlots
- ? EnumChatFormatting.DARK_RED.toString()
- : EnumChatFormatting.GOLD.toString())
- + mMaxSlots + EnumChatFormatting.RESET + "):");
+ info.add(
+ "Running in mode: " + EnumChatFormatting.GOLD
+ + (mPrimaryMode == 0 ? "Input mode"
+ : (mPrimaryMode == 1 ? "Output mode"
+ : (mSecondaryMode == 0 ? "Operating mode (NORMAL)"
+ : "Operating mode (SWARMER)"))));
+ info.add(
+ "Bee storage (" + EnumChatFormatting.GOLD
+ + mStorage.size()
+ + EnumChatFormatting.RESET
+ + "/"
+ + (mStorage.size() > mMaxSlots ? EnumChatFormatting.DARK_RED.toString()
+ : EnumChatFormatting.GOLD.toString())
+ + mMaxSlots
+ + EnumChatFormatting.RESET
+ + "):");
HashMap<String, Integer> infos = new HashMap<>();
for (int i = 0; i < mStorage.size(); i++) {
StringBuilder builder = new StringBuilder();
@@ -556,41 +529,19 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- if (aActive)
- return new ITexture[] {
- Textures.BlockIcons.getCasingTextureForId(CASING_INDEX),
- TextureFactory.builder()
- .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE)
- .extFacing()
- .build(),
- TextureFactory.builder()
- .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW)
- .extFacing()
- .glow()
- .build()
- };
- return new ITexture[] {
- Textures.BlockIcons.getCasingTextureForId(CASING_INDEX),
- TextureFactory.builder()
- .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER)
- .extFacing()
- .build(),
- TextureFactory.builder()
- .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW)
- .extFacing()
- .glow()
- .build()
- };
+ if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow()
+ .build() };
+ return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow()
+ .build() };
}
- return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)};
+ return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) };
}
@Override
@@ -605,93 +556,85 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
@Override
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
- builder.widget(new DrawableWidget()
- .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK)
- .setPos(7, 4)
- .setSize(143, 75)
- .setEnabled(widget -> !isFixed.apply(widget)));
+ builder.widget(
+ new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(7, 4).setSize(143, 75)
+ .setEnabled(widget -> !isFixed.apply(widget)));
buildContext.addSyncedWindow(CONFIGURATION_WINDOW_ID, this::createConfigurationWindow);
EntityPlayer player = buildContext.getPlayer();
// Slot is not needed
- builder.widget(new DynamicPositionedColumn()
- .setSynced(false)
- .widget(new CycleButtonWidget()
- .setToggle(() -> getBaseMetaTileEntity().isAllowedToWork(), works -> {
+ builder.widget(
+ new DynamicPositionedColumn().setSynced(false).widget(
+ new CycleButtonWidget().setToggle(() -> getBaseMetaTileEntity().isAllowedToWork(), works -> {
if (works) getBaseMetaTileEntity().enableWorking();
else getBaseMetaTileEntity().disableWorking();
if (!(player instanceof EntityPlayerMP)) return;
String tChat = GT_Utility.trans("090", "Machine Processing: ")
- + (works
- ? GT_Utility.trans("088", "Enabled")
+ + (works ? GT_Utility.trans("088", "Enabled")
: GT_Utility.trans("087", "Disabled"));
if (hasAlternativeModeText()) tChat = getAlternativeModeText();
GT_Utility.sendChatToPlayer(player, tChat);
- })
- .addTooltip(0, new Text("Disabled").color(Color.RED.dark(3)))
- .addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3)))
- .setVariableBackgroundGetter(toggleButtonBackgroundGetter)
- .setSize(18, 18)
- .addTooltip("Working status"))
- .widget(new ButtonWidget()
- .setOnClick((clickData, widget) -> {
- if (!widget.isClient()) widget.getContext().openSyncedWindow(CONFIGURATION_WINDOW_ID);
- })
- .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CYCLIC)
- .addTooltip("Configuration")
- .setSize(18, 18))
- .setPos(151, 4));
+ }).addTooltip(0, new Text("Disabled").color(Color.RED.dark(3)))
+ .addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3)))
+ .setVariableBackgroundGetter(toggleButtonBackgroundGetter).setSize(18, 18)
+ .addTooltip("Working status"))
+ .widget(
+ new ButtonWidget()
+ .setOnClick(
+ (clickData, widget) -> {
+ if (!widget.isClient())
+ widget.getContext().openSyncedWindow(CONFIGURATION_WINDOW_ID);
+ })
+ .setBackground(
+ GT_UITextures.BUTTON_STANDARD,
+ GT_UITextures.OVERLAY_BUTTON_CYCLIC)
+ .addTooltip("Configuration").setSize(18, 18))
+ .setPos(151, 4));
final List<ItemStack> drawables = new ArrayList<>(mMaxSlots);
final int perRow = 7;
Scrollable beesContainer = new Scrollable().setVerticalScroll();
- if (mMaxSlots > 0)
- for (int i = 0, imax = ((mMaxSlots - 1) / perRow); i <= imax; i++) {
- DynamicPositionedRow row = new DynamicPositionedRow().setSynced(false);
- for (int j = 0, jmax = (i == imax ? (mMaxSlots - 1) % perRow : (perRow - 1)); j <= jmax; j++) {
- final int finalI = i * perRow;
- final int finalJ = j;
- final int ID = finalI + finalJ;
- row.widget(new ButtonWidget()
- .setOnClick((clickData, widget) -> {
- if (!(player instanceof EntityPlayerMP)) return;
- if (mStorage.size() <= ID) return;
- if (this.mMaxProgresstime > 0) {
- GT_Utility.sendChatToPlayer(player, "Can't eject while running !");
- return;
- }
- BeeSimulator removed = mStorage.remove(ID);
- addOutput(removed.queenStack);
- isCacheDirty = true;
- GT_Utility.sendChatToPlayer(player, "Queen ejected !");
- })
- .setBackground(() -> new IDrawable[] {
- getBaseMetaTileEntity().getGUITextureSet().getItemSlot(),
+ if (mMaxSlots > 0) for (int i = 0, imax = ((mMaxSlots - 1) / perRow); i <= imax; i++) {
+ DynamicPositionedRow row = new DynamicPositionedRow().setSynced(false);
+ for (int j = 0, jmax = (i == imax ? (mMaxSlots - 1) % perRow : (perRow - 1)); j <= jmax; j++) {
+ final int finalI = i * perRow;
+ final int finalJ = j;
+ final int ID = finalI + finalJ;
+ row.widget(new ButtonWidget().setOnClick((clickData, widget) -> {
+ if (!(player instanceof EntityPlayerMP)) return;
+ if (mStorage.size() <= ID) return;
+ if (this.mMaxProgresstime > 0) {
+ GT_Utility.sendChatToPlayer(player, "Can't eject while running !");
+ return;
+ }
+ BeeSimulator removed = mStorage.remove(ID);
+ addOutput(removed.queenStack);
+ isCacheDirty = true;
+ GT_Utility.sendChatToPlayer(player, "Queen ejected !");
+ }).setBackground(
+ () -> new IDrawable[] { getBaseMetaTileEntity().getGUITextureSet().getItemSlot(),
GT_UITextures.OVERLAY_SLOT_BEE_QUEEN,
new ItemDrawable(drawables.size() > ID ? drawables.get(ID) : null)
- .withFixedSize(16, 16, 1, 1)
- })
- .dynamicTooltip(() -> {
- if (drawables.size() > ID)
- return Arrays.asList(
- drawables.get(ID).getDisplayName(),
- EnumChatFormatting.GRAY + "Left click to eject");
- return Collections.emptyList();
- })
- .setSize(18, 18));
- }
- beesContainer.widget(row.setPos(0, i * 18).setEnabled(widget -> {
- int y = widget.getPos().y;
- int cy = beesContainer.getVerticalScrollOffset();
- int ch = beesContainer.getVisibleHeight();
- return y >= cy - ch && y <= cy + ch;
- }));
+ .withFixedSize(16, 16, 1, 1) })
+ .dynamicTooltip(() -> {
+ if (drawables.size() > ID) return Arrays.asList(
+ drawables.get(ID).getDisplayName(),
+ EnumChatFormatting.GRAY + "Left click to eject");
+ return Collections.emptyList();
+ }).setSize(18, 18));
}
+ beesContainer.widget(row.setPos(0, i * 18).setEnabled(widget -> {
+ int y = widget.getPos().y;
+ int cy = beesContainer.getVerticalScrollOffset();
+ int ch = beesContainer.getVisibleHeight();
+ return y >= cy - ch && y <= cy + ch;
+ }));
+ }
beesContainer.attachSyncer(
new FakeSyncWidget.ListSyncer<>(
() -> mStorage.stream().map(s -> s.queenStack).collect(Collectors.toList()),
@@ -725,17 +668,13 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
protected ModularWindow createConfigurationWindow(final EntityPlayer player) {
ModularWindow.Builder builder = ModularWindow.builder(200, 100);
builder.setBackground(ModularUITextures.VANILLA_BACKGROUND);
- builder.widget(new DrawableWidget()
- .setDrawable(GT_UITextures.OVERLAY_BUTTON_CYCLIC)
- .setPos(5, 5)
- .setSize(16, 16))
+ builder.widget(
+ new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CYCLIC).setPos(5, 5).setSize(16, 16))
.widget(new TextWidget("Configuration").setPos(25, 9))
.widget(ButtonWidget.closeWindowButton(true).setPos(185, 3))
- .widget(new Column()
- .widget(new CycleButtonWidget()
- .setLength(3)
- .setGetter(() -> mPrimaryMode)
- .setSetter(val -> {
+ .widget(
+ new Column().widget(
+ new CycleButtonWidget().setLength(3).setGetter(() -> mPrimaryMode).setSetter(val -> {
if (this.mMaxProgresstime > 0) {
GT_Utility.sendChatToPlayer(player, "Can't change mode when running !");
return;
@@ -752,81 +691,73 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
break;
case 2:
GT_Utility.sendChatToPlayer(
- player, "Changed primary mode to: Operating mode");
+ player,
+ "Changed primary mode to: Operating mode");
break;
}
- })
- .addTooltip(0, new Text("Input").color(Color.YELLOW.dark(3)))
- .addTooltip(1, new Text("Output").color(Color.YELLOW.dark(3)))
- .addTooltip(2, new Text("Operating").color(Color.GREEN.dark(3)))
- .setVariableBackgroundGetter(i -> new IDrawable[] {
- ModularUITextures.VANILLA_BACKGROUND,
- GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18),
- i == 0
- ? new Text("Input")
- .color(Color.YELLOW.dark(3))
- .withFixedSize(70 - 18, 18, 15, 0)
- : i == 1
- ? new Text("Output")
- .color(Color.YELLOW.dark(3))
- .withFixedSize(70 - 18, 18, 15, 0)
- : new Text("Operating")
- .color(Color.GREEN.dark(3))
- .withFixedSize(70 - 18, 18, 15, 0)
- })
- .setSize(70, 18)
- .addTooltip("Primary mode"))
- .widget(new CycleButtonWidget()
- .setLength(2)
- .setGetter(() -> mSecondaryMode)
- .setSetter(val -> {
- if (this.mMaxProgresstime > 0) {
- GT_Utility.sendChatToPlayer(player, "Can't change mode when running !");
- return;
- }
-
- mSecondaryMode = val;
-
- if (!(player instanceof EntityPlayerMP)) return;
- switch (mSecondaryMode) {
- case 0:
- GT_Utility.sendChatToPlayer(
- player, "Changed secondary mode to: Normal mode");
- break;
- case 1:
- GT_Utility.sendChatToPlayer(
- player, "Changed secondary mode to: Swarmer mode");
- break;
- }
- })
- .addTooltip(0, new Text("Normal").color(Color.GREEN.dark(3)))
- .addTooltip(1, new Text("Swarmer").color(Color.YELLOW.dark(3)))
- .setVariableBackgroundGetter(i -> new IDrawable[] {
- ModularUITextures.VANILLA_BACKGROUND,
- GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18),
- i == 0
- ? new Text("Normal")
- .color(Color.GREEN.dark(3))
- .withFixedSize(70 - 18, 18, 15, 0)
- : new Text("Swarmer")
- .color(Color.YELLOW.dark(3))
- .withFixedSize(70 - 18, 18, 15, 0)
- })
- .setSize(70, 18)
- .addTooltip("Secondary mode"))
- .setEnabled(widget -> !getBaseMetaTileEntity().isActive())
- .setPos(10, 30))
- .widget(new Column()
- .widget(new TextWidget("Primary mode").setSize(100, 18))
- .widget(new TextWidget("Secondary mode").setSize(100, 18))
- .setEnabled(widget -> !getBaseMetaTileEntity().isActive())
- .setPos(80, 30))
- .widget(new DrawableWidget()
- .setDrawable(GT_UITextures.OVERLAY_BUTTON_CROSS)
- .setSize(18, 18)
- .setPos(10, 30)
- .addTooltip(new Text("Can't change configuration when running !").color(Color.RED.dark(3)))
- .setEnabled(widget -> getBaseMetaTileEntity().isActive()));
+ }).addTooltip(0, new Text("Input").color(Color.YELLOW.dark(3)))
+ .addTooltip(1, new Text("Output").color(Color.YELLOW.dark(3)))
+ .addTooltip(2, new Text("Operating").color(Color.GREEN.dark(3)))
+ .setVariableBackgroundGetter(
+ i -> new IDrawable[] { ModularUITextures.VANILLA_BACKGROUND,
+ GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18),
+ i == 0 ? new Text("Input").color(Color.YELLOW.dark(3))
+ .withFixedSize(70 - 18, 18, 15, 0)
+ : i == 1 ? new Text("Output")
+ .color(Color.YELLOW.dark(3))
+ .withFixedSize(70 - 18, 18, 15, 0)
+ : new Text("Operating")
+ .color(Color.GREEN.dark(3))
+ .withFixedSize(70 - 18, 18, 15, 0) })
+ .setSize(70, 18).addTooltip("Primary mode"))
+ .widget(
+ new CycleButtonWidget().setLength(2).setGetter(() -> mSecondaryMode)
+ .setSetter(val -> {
+ if (this.mMaxProgresstime > 0) {
+ GT_Utility.sendChatToPlayer(
+ player,
+ "Can't change mode when running !");
+ return;
+ }
+
+ mSecondaryMode = val;
+
+ if (!(player instanceof EntityPlayerMP)) return;
+ switch (mSecondaryMode) {
+ case 0:
+ GT_Utility.sendChatToPlayer(
+ player,
+ "Changed secondary mode to: Normal mode");
+ break;
+ case 1:
+ GT_Utility.sendChatToPlayer(
+ player,
+ "Changed secondary mode to: Swarmer mode");
+ break;
+ }
+ }).addTooltip(0, new Text("Normal").color(Color.GREEN.dark(3)))
+ .addTooltip(1, new Text("Swarmer").color(Color.YELLOW.dark(3)))
+ .setVariableBackgroundGetter(
+ i -> new IDrawable[] { ModularUITextures.VANILLA_BACKGROUND,
+ GT_UITextures.OVERLAY_BUTTON_CYCLIC
+ .withFixedSize(18, 18),
+ i == 0 ? new Text("Normal").color(Color.GREEN.dark(3))
+ .withFixedSize(70 - 18, 18, 15, 0)
+ : new Text("Swarmer")
+ .color(Color.YELLOW.dark(3))
+ .withFixedSize(70 - 18, 18, 15, 0) })
+ .setSize(70, 18).addTooltip("Secondary mode"))
+ .setEnabled(widget -> !getBaseMetaTileEntity().isActive()).setPos(10, 30))
+ .widget(
+ new Column().widget(new TextWidget("Primary mode").setSize(100, 18))
+ .widget(new TextWidget("Secondary mode").setSize(100, 18))
+ .setEnabled(widget -> !getBaseMetaTileEntity().isActive()).setPos(80, 30))
+ .widget(
+ new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CROSS).setSize(18, 18)
+ .setPos(10, 30)
+ .addTooltip(
+ new Text("Can't change configuration when running !").color(Color.RED.dark(3)))
+ .setEnabled(widget -> getBaseMetaTileEntity().isActive()));
return builder.build();
}
@@ -834,58 +765,59 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inventorySlot) {
screenElements.setSynced(false).setSpace(0).setPos(10, 7);
- screenElements.widget(new DynamicPositionedRow()
- .setSynced(false)
- .widget(new TextWidget("Status: ").setDefaultColor(COLOR_TEXT_GRAY.get()))
- .widget(new DynamicTextWidget(() -> {
- if (flowersError) return new Text("No flowers !").color(Color.RED.dark(3));
- if (getBaseMetaTileEntity().isActive()) return new Text("Working !").color(Color.GREEN.dark(3));
- else if (getBaseMetaTileEntity().isAllowedToWork())
- return new Text("Enabled").color(Color.GREEN.dark(3));
- else if (getBaseMetaTileEntity().wasShutdown())
- return new Text("Shutdown (CRITICAL)").color(Color.RED.dark(3));
- else return new Text("Disabled").color(Color.RED.dark(3));
- }))
- .setEnabled(isFixed));
+ screenElements.widget(
+ new DynamicPositionedRow().setSynced(false)
+ .widget(new TextWidget("Status: ").setDefaultColor(COLOR_TEXT_GRAY.get()))
+ .widget(new DynamicTextWidget(() -> {
+ if (flowersError) return new Text("No flowers !").color(Color.RED.dark(3));
+ if (getBaseMetaTileEntity().isActive())
+ return new Text("Working !").color(Color.GREEN.dark(3));
+ else if (getBaseMetaTileEntity().isAllowedToWork())
+ return new Text("Enabled").color(Color.GREEN.dark(3));
+ else if (getBaseMetaTileEntity().wasShutdown())
+ return new Text("Shutdown (CRITICAL)").color(Color.RED.dark(3));
+ else return new Text("Disabled").color(Color.RED.dark(3));
+ })).setEnabled(isFixed));
screenElements
- .widget(new TextWidget(GT_Utility.trans("132", "Pipe is loose."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mWrench))
+ .widget(
+ new TextWidget(GT_Utility.trans("132", "Pipe is loose."))
+ .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mWrench))
.widget(new FakeSyncWidget.BooleanSyncer(() -> mWrench, val -> mWrench = val));
screenElements
- .widget(new TextWidget(GT_Utility.trans("133", "Screws are loose."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mScrewdriver))
+ .widget(
+ new TextWidget(GT_Utility.trans("133", "Screws are loose."))
+ .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mScrewdriver))
.widget(new FakeSyncWidget.BooleanSyncer(() -> mScrewdriver, val -> mScrewdriver = val));
screenElements
- .widget(new TextWidget(GT_Utility.trans("134", "Something is stuck."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mSoftHammer))
+ .widget(
+ new TextWidget(GT_Utility.trans("134", "Something is stuck."))
+ .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mSoftHammer))
.widget(new FakeSyncWidget.BooleanSyncer(() -> mSoftHammer, val -> mSoftHammer = val));
screenElements
- .widget(new TextWidget(GT_Utility.trans("135", "Platings are dented."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mHardHammer))
+ .widget(
+ new TextWidget(GT_Utility.trans("135", "Platings are dented."))
+ .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mHardHammer))
.widget(new FakeSyncWidget.BooleanSyncer(() -> mHardHammer, val -> mHardHammer = val));
screenElements
- .widget(new TextWidget(GT_Utility.trans("136", "Circuitry burned out."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mSolderingTool))
+ .widget(
+ new TextWidget(GT_Utility.trans("136", "Circuitry burned out."))
+ .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mSolderingTool))
.widget(new FakeSyncWidget.BooleanSyncer(() -> mSolderingTool, val -> mSolderingTool = val));
screenElements
- .widget(new TextWidget(GT_Utility.trans("137", "That doesn't belong there."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mCrowbar))
+ .widget(
+ new TextWidget(GT_Utility.trans("137", "That doesn't belong there."))
+ .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mCrowbar))
.widget(new FakeSyncWidget.BooleanSyncer(() -> mCrowbar, val -> mCrowbar = val));
screenElements
- .widget(new TextWidget(GT_Utility.trans("138", "Incomplete Structure."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mMachine))
+ .widget(
+ new TextWidget(GT_Utility.trans("138", "Incomplete Structure."))
+ .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mMachine))
.widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val));
}
private static class BeeSimulator {
+
ItemStack queenStack;
boolean isValid;
// boolean isBreadingMode;
@@ -919,11 +851,9 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
this.flowerType = genome.getFlowerProvider().getFlowerType();
IAlleleBeeSpecies primary = genome.getPrimary();
beeSpeed = genome.getSpeed() * beeModifier.getProductionModifier(null, 1.f);
- genome.getPrimary()
- .getProductChances()
+ genome.getPrimary().getProductChances()
.forEach((key, value) -> drops.add(new BeeDrop(key, value, beeSpeed, t)));
- genome.getSecondary()
- .getProductChances()
+ genome.getSecondary().getProductChances()
.forEach((key, value) -> drops.add(new BeeDrop(key, value / 2.f, beeSpeed, t)));
primary.getSpecialtyChances()
.forEach((key, value) -> specialDrops.add(new BeeDrop(key, value, beeSpeed, t)));
@@ -953,8 +883,7 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
tag.setTag("queenStack", queenStack.writeToNBT(new NBTTagCompound()));
tag.setBoolean("isValid", isValid);
tag.setInteger("dropssize", drops.size());
- for (int i = 0; i < drops.size(); i++)
- tag.setTag("drops" + i, drops.get(i).toNBTTagCompound());
+ for (int i = 0; i < drops.size(); i++) tag.setTag("drops" + i, drops.get(i).toNBTTagCompound());
tag.setInteger("specialDropssize", specialDrops.size());
for (int i = 0; i < specialDrops.size(); i++)
tag.setTag("specialDrops" + i, specialDrops.get(i).toNBTTagCompound());
@@ -994,6 +923,7 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
}
private static class BeeDrop {
+
ItemStack stack;
double amount;
GT_Utility.ItemId id;