From e3a650785887866e4b8533b61044479ecb80aee7 Mon Sep 17 00:00:00 2001 From: Mary <33456283+FourIsTheNumber@users.noreply.github.com> Date: Thu, 18 Jul 2024 09:58:41 -0400 Subject: Add a Multiblock Electromagnetic Separator (#2726) * Built multi template with required methods in gt++. * Filled out template based on gt++ electrolyzer code * Refactored into gregtech. Not supposed to add multis to gt++, whoops! * IntelliJ "smartly" deleted all of the imports in GT_Loader_MetaTileEntities and replaced it with a wildcard import... which caused it to fail checkstyle. Thanks so much, IntelliJ. * Figured out how to make IntelliJ Stop Doing That * Added author tag and vac freezer texture for testing. * Registered casing, working on getting texture functional * Added casing texture * Fixed structure check and added processing logic. Multi now forms and can run EMS recipes * Added overlay textures * Made new Casings10 class and added EMS Casings to it. Texture mesh now functions * Made controller match casing mesh * Shifted Casings10 to an actual page number instead of magic number. Now sits on page 16, following where waterline casings will be implemented in future * Added Electromagnet Housing. Has no texture, but you can place an open its inventory * Added electromagnets and their texture files * Multi now requires EM housing and breaks if there are 2 * Electromagnet Housing has proper texture and can be wrenched. Also has a placeholder overlay * Tooltip updates. Added pollution * Electromagnet tiers modify processing logic. Some issues remaining * Prettier switch & spotlessApply * Multi now validates electromagnet before recipe check. Also added a machine casing texture * Pollution fix * Support for exotic energy hatches added. Recipe check fails if electromagnet is too weak * Stack size of 1 for electromagnets * New electromagnet textures * Final pass on EM textures. Also, EM Housing uses IV hull as base texture instead of ULV * Put in placeholder-ish recipes for controller/casings/EM housing * Placeholder recipes for electromagnets. Also fixed structure check, whoops * Renamed multi to Magnetic Flux Exhibitor * MFE can run as a polarizer * Fixed exotic warning getting stuck * Attempted to add assline recipes, not working * Fixed assembling line recipe templates. Thank you chochem <3 * Fancied up tooltips * Fixed parallel issue * Updated recipes. Will have to move them to coremod * Nerfed speed on all electromagnets * sa * Restricted MFE to multiamp non-laser. * Spotless * Animated Mag hatch * Added glow * Removed pollution. I am a gentle soul * Addition to structure check * Disabled wireless laser compatibility * sa (cherry picked from commit 155cf4dd7284ca84bd9be79f11b6f577b38a4e0d) * spotless * Removed all recipes. These have been replaced in the coremod * -Removed unnecessary structure check -MIN_CASING final -Baps author tag -Refactored mMagHatch to not be a list -Added tooltip builder in MagnetTiers * Forgot to run spotless * Last minute tooltip fix for structure accuracy --------- Co-authored-by: Dream Master --- .../gregtech/common/blocks/GT_Block_Casings10.java | 38 ++++++++++++++++++++++ .../gregtech/common/blocks/GT_Item_Casings10.java | 14 ++++++++ 2 files changed, 52 insertions(+) create mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Casings10.java create mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Casings10.java (limited to 'src/main/java/gregtech/common/blocks') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings10.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings10.java new file mode 100644 index 0000000000..8f5ee9de5b --- /dev/null +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings10.java @@ -0,0 +1,38 @@ +package gregtech.common.blocks; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.util.GT_LanguageManager; + +/** + * The casings are split into separate files because they are registered as regular blocks, and a regular block can have + * 16 subtypes at most. + */ +public class GT_Block_Casings10 extends GT_Block_Casings_Abstract { + + public GT_Block_Casings10() { + super(GT_Item_Casings10.class, "gt.blockcasings10", GT_Material_Casings.INSTANCE, 16); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "MagTech Casing"); + + ItemList.Casing_Electromagnetic_Separator.set(new ItemStack(this, 1, 0)); + } + + @Override + public int getTextureIndex(int aMeta) { + return (16 << 7) | (aMeta + 48); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int ordinalSide, int aMeta) { + return switch (aMeta) { + case 0 -> Textures.BlockIcons.MACHINE_CASING_EMS.getIcon(); + default -> Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + }; + } +} diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings10.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings10.java new file mode 100644 index 0000000000..519549ce6b --- /dev/null +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings10.java @@ -0,0 +1,14 @@ +package gregtech.common.blocks; + +import net.minecraft.block.Block; + +/** + * The casings are split into separate files because they are registered as regular blocks, and a regular block can have + * 16 subtypes at most. + */ +public class GT_Item_Casings10 extends GT_Item_Casings_Abstract { + + public GT_Item_Casings10(Block block) { + super(block); + } +} -- cgit