diff options
Diffstat (limited to 'src/main/java/gregtech/api/enums/OrePrefixes.java')
-rw-r--r-- | src/main/java/gregtech/api/enums/OrePrefixes.java | 287 |
1 files changed, 120 insertions, 167 deletions
diff --git a/src/main/java/gregtech/api/enums/OrePrefixes.java b/src/main/java/gregtech/api/enums/OrePrefixes.java index 4139f90db1..8d3201f6ca 100644 --- a/src/main/java/gregtech/api/enums/OrePrefixes.java +++ b/src/main/java/gregtech/api/enums/OrePrefixes.java @@ -863,87 +863,79 @@ public enum OrePrefixes { itemCasing.mGeneratedItems.addAll(itemCasing.mGeneratedItems); // ----- - toolHeadFile.mCondition = new ICondition.And<ISubTagContainer>( - new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), - new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY)); - toolHeadSaw.mCondition = new ICondition.And<ISubTagContainer>( - new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), - new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY)); - toolHeadDrill.mCondition = new ICondition.And<ISubTagContainer>( - new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), - new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY)); - toolHeadChainsaw.mCondition = new ICondition.And<ISubTagContainer>( - new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), - new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY)); - toolHeadWrench.mCondition = new ICondition.And<ISubTagContainer>( - new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), - new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY)); - toolHeadBuzzSaw.mCondition = new ICondition.And<ISubTagContainer>( - new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), - new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY)); - turbineBlade.mCondition = new ICondition.And<ISubTagContainer>( - new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING), - new ICondition.Not<ISubTagContainer>(SubTag.BOUNCY)); - - rotor.mCondition = new ICondition.Nor<ISubTagContainer>(SubTag.CRYSTAL, SubTag.STONE, SubTag.BOUNCY); - - spring.mCondition = new ICondition.Or<ISubTagContainer>( + toolHeadFile.mCondition = new ICondition.And<>( + new ICondition.Not<>(SubTag.NO_SMASHING), + new ICondition.Not<>(SubTag.BOUNCY)); + toolHeadSaw.mCondition = new ICondition.And<>( + new ICondition.Not<>(SubTag.NO_SMASHING), + new ICondition.Not<>(SubTag.BOUNCY)); + toolHeadDrill.mCondition = new ICondition.And<>( + new ICondition.Not<>(SubTag.NO_SMASHING), + new ICondition.Not<>(SubTag.BOUNCY)); + toolHeadChainsaw.mCondition = new ICondition.And<>( + new ICondition.Not<>(SubTag.NO_SMASHING), + new ICondition.Not<>(SubTag.BOUNCY)); + toolHeadWrench.mCondition = new ICondition.And<>( + new ICondition.Not<>(SubTag.NO_SMASHING), + new ICondition.Not<>(SubTag.BOUNCY)); + toolHeadBuzzSaw.mCondition = new ICondition.And<>( + new ICondition.Not<>(SubTag.NO_SMASHING), + new ICondition.Not<>(SubTag.BOUNCY)); + turbineBlade.mCondition = new ICondition.And<>( + new ICondition.Not<>(SubTag.NO_SMASHING), + new ICondition.Not<>(SubTag.BOUNCY)); + + rotor.mCondition = new ICondition.Nor<>(SubTag.CRYSTAL, SubTag.STONE, SubTag.BOUNCY); + + spring.mCondition = new ICondition.Or<>( SubTag.STRETCHY, SubTag.BOUNCY, - new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING)); - springSmall.mCondition = new ICondition.Or<ISubTagContainer>( + new ICondition.Not<>(SubTag.NO_SMASHING)); + springSmall.mCondition = new ICondition.Or<>( SubTag.STRETCHY, SubTag.BOUNCY, - new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING)); + new ICondition.Not<>(SubTag.NO_SMASHING)); - gemChipped.mCondition = new ICondition.And<ISubTagContainer>( + gemChipped.mCondition = new ICondition.And<>( SubTag.TRANSPARENT, SubTag.CRYSTAL, - new ICondition.Not<ISubTagContainer>(SubTag.QUARTZ), - new ICondition.Not<ISubTagContainer>(SubTag.PEARL), - new ICondition.Not<ISubTagContainer>(SubTag.MAGICAL)); - gemFlawed.mCondition = new ICondition.And<ISubTagContainer>( + new ICondition.Not<>(SubTag.QUARTZ), + new ICondition.Not<>(SubTag.PEARL), + new ICondition.Not<>(SubTag.MAGICAL)); + gemFlawed.mCondition = new ICondition.And<>( SubTag.TRANSPARENT, SubTag.CRYSTAL, - new ICondition.Not<ISubTagContainer>(SubTag.QUARTZ), - new ICondition.Not<ISubTagContainer>(SubTag.PEARL), - new ICondition.Not<ISubTagContainer>(SubTag.MAGICAL)); - gemFlawless.mCondition = new ICondition.And<ISubTagContainer>( + new ICondition.Not<>(SubTag.QUARTZ), + new ICondition.Not<>(SubTag.PEARL), + new ICondition.Not<>(SubTag.MAGICAL)); + gemFlawless.mCondition = new ICondition.And<>( SubTag.TRANSPARENT, SubTag.CRYSTAL, - new ICondition.Not<ISubTagContainer>(SubTag.QUARTZ), - new ICondition.Not<ISubTagContainer>(SubTag.PEARL), - new ICondition.Not<ISubTagContainer>(SubTag.MAGICAL)); - gemExquisite.mCondition = new ICondition.And<ISubTagContainer>( + new ICondition.Not<>(SubTag.QUARTZ), + new ICondition.Not<>(SubTag.PEARL), + new ICondition.Not<>(SubTag.MAGICAL)); + gemExquisite.mCondition = new ICondition.And<>( SubTag.TRANSPARENT, SubTag.CRYSTAL, - new ICondition.Not<ISubTagContainer>(SubTag.QUARTZ), - new ICondition.Not<ISubTagContainer>(SubTag.PEARL), - new ICondition.Not<ISubTagContainer>(SubTag.MAGICAL)); + new ICondition.Not<>(SubTag.QUARTZ), + new ICondition.Not<>(SubTag.PEARL), + new ICondition.Not<>(SubTag.MAGICAL)); - lens.mCondition = new ICondition.Or<ISubTagContainer>( + lens.mCondition = new ICondition.Or<>( SubTag.MAGICAL, - new ICondition.And<ISubTagContainer>(SubTag.TRANSPARENT, SubTag.HAS_COLOR)); - - plateDouble.mCondition = new ICondition.Or<ISubTagContainer>( - SubTag.PAPER, - new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING)); - plateTriple.mCondition = new ICondition.Or<ISubTagContainer>( - SubTag.PAPER, - new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING)); - plateQuadruple.mCondition = new ICondition.Or<ISubTagContainer>( - SubTag.PAPER, - new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING)); - plateQuintuple.mCondition = new ICondition.Or<ISubTagContainer>( - SubTag.PAPER, - new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING)); - - plateDense.mCondition = new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING); - - ingotDouble.mCondition = new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING); - ingotTriple.mCondition = new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING); - ingotQuadruple.mCondition = new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING); - ingotQuintuple.mCondition = new ICondition.Not<ISubTagContainer>(SubTag.NO_SMASHING); + new ICondition.And<>(SubTag.TRANSPARENT, SubTag.HAS_COLOR)); + + plateDouble.mCondition = new ICondition.Or<>(SubTag.PAPER, new ICondition.Not<>(SubTag.NO_SMASHING)); + plateTriple.mCondition = new ICondition.Or<>(SubTag.PAPER, new ICondition.Not<>(SubTag.NO_SMASHING)); + plateQuadruple.mCondition = new ICondition.Or<>(SubTag.PAPER, new ICondition.Not<>(SubTag.NO_SMASHING)); + plateQuintuple.mCondition = new ICondition.Or<>(SubTag.PAPER, new ICondition.Not<>(SubTag.NO_SMASHING)); + + plateDense.mCondition = new ICondition.Not<>(SubTag.NO_SMASHING); + + ingotDouble.mCondition = new ICondition.Not<>(SubTag.NO_SMASHING); + ingotTriple.mCondition = new ICondition.Not<>(SubTag.NO_SMASHING); + ingotQuadruple.mCondition = new ICondition.Not<>(SubTag.NO_SMASHING); + ingotQuintuple.mCondition = new ICondition.Not<>(SubTag.NO_SMASHING); wireFine.mCondition = SubTag.METAL; @@ -998,18 +990,17 @@ public enum OrePrefixes { public final String mRegularLocalName, mLocalizedMaterialPre, mLocalizedMaterialPost; public final boolean mIsUsedForOreProcessing, mIsEnchantable, mIsUnificatable, mIsMaterialBased, mIsSelfReferencing, mIsContainer, mDontUnificateActively, mIsUsedForBlocks, mAllowNormalRecycling, mGenerateDefaultItem; - public final List<TC_AspectStack> mAspects = new ArrayList<TC_AspectStack>(); - public final Collection<OrePrefixes> mFamiliarPrefixes = new HashSet<OrePrefixes>(); + public final List<TC_AspectStack> mAspects = new ArrayList<>(); + public final Collection<OrePrefixes> mFamiliarPrefixes = new HashSet<>(); /** * Used to determine the amount of Material this Prefix contains. Multiply or Divide GregTech_API.MATERIAL_UNIT to * get the Amounts in comparision to one Ingot. 0 = Null Negative = Undefined Amount */ public final long mMaterialAmount; - public final Collection<Materials> mDisabledItems = new HashSet<Materials>(), - mNotGeneratedItems = new HashSet<Materials>(), mIgnoredMaterials = new HashSet<Materials>(), - mGeneratedItems = new HashSet<Materials>(); - private final ArrayList<IOreRecipeRegistrator> mOreProcessing = new ArrayList<IOreRecipeRegistrator>(); + public final Collection<Materials> mDisabledItems = new HashSet<>(), mNotGeneratedItems = new HashSet<>(), + mIgnoredMaterials = new HashSet<>(), mGeneratedItems = new HashSet<>(); + private final ArrayList<IOreRecipeRegistrator> mOreProcessing = new ArrayList<>(); public ItemStack mContainerItem = null; public ICondition<ISubTagContainer> mCondition = null; public byte mDefaultStackSize = 64; @@ -1508,8 +1499,6 @@ public enum OrePrefixes { || aMaterial == Materials.Uranium235 || aMaterial == Materials.Plutonium241 || aMaterial == Materials.Americium - || aMaterial == Materials.Neutronium - || aMaterial == Materials.Bronze || aMaterial == Materials.Brass || aMaterial == Materials.Electrum || aMaterial == Materials.NaquadahEnriched @@ -1576,7 +1565,7 @@ public enum OrePrefixes { !aPrefix.mDisabledItems.contains(aMaterial)); if (!aEnableComponent) { // Disable component if false and is not already in disabled list aPrefix.disableComponent(aMaterial); - } else if (aEnableComponent) { // Enable component if true and is not already in enabled list + } else { // Enable component if true and is not already in enabled list aPrefix.enableComponent(aMaterial); } } @@ -1742,151 +1731,115 @@ public enum OrePrefixes { public String getDefaultLocalNameFormatForItem(Materials aMaterial) { // Certain Materials have slightly different Localizations. switch (this) { - case crateGtDust: + case crateGtDust -> { return mLocalizedMaterialPre + OrePrefixes.dust.getDefaultLocalNameFormatForItem(aMaterial); - case crateGtIngot: + } + case crateGtIngot -> { return mLocalizedMaterialPre + OrePrefixes.ingot.getDefaultLocalNameFormatForItem(aMaterial); - case crateGtGem: + } + case crateGtGem -> { return mLocalizedMaterialPre + OrePrefixes.gem.getDefaultLocalNameFormatForItem(aMaterial); - case crateGtPlate: + } + case crateGtPlate -> { return mLocalizedMaterialPre + OrePrefixes.plate.getDefaultLocalNameFormatForItem(aMaterial); + } } switch (aMaterial.mName) { - case "Glass": - case "BorosilicateGlass": + case "Glass", "BorosilicateGlass" -> { if (name().startsWith("gem")) return mLocalizedMaterialPre + "%material" + " Crystal"; if (name().startsWith("plate")) return mLocalizedMaterialPre + "%material" + " Pane"; if (name().startsWith("ingot")) return mLocalizedMaterialPre + "%material" + " Bar"; if (name().startsWith("nugget")) return mLocalizedMaterialPre + "%material" + " Chip"; - break; - case "Wheat": + } + case "Wheat" -> { if (name().startsWith("dust")) return mLocalizedMaterialPre + "Flour"; - break; - case "Ice": + } + case "Ice" -> { if (name().startsWith("dust")) return mLocalizedMaterialPre + "Crushed Ice"; - break; - case "Wood": - case "WoodSealed": + } + case "Wood", "WoodSealed" -> { if (name().startsWith("bolt")) return "Short " + "%material" + " Stick"; if (name().startsWith("stick")) return mLocalizedMaterialPre + "%material" + " Stick"; if (name().startsWith("dust")) return mLocalizedMaterialPre + "%material" + " Pulp"; if (name().startsWith("nugget")) return mLocalizedMaterialPre + "%material" + " Chip"; if (name().startsWith("plate")) return mLocalizedMaterialPre + "%material" + " Plank"; - break; - case "Plastic": - case "Rubber": - case "Polyethylene": - case "Epoxid": - case "EpoxidFiberReinforced": - case "Polydimethylsiloxane": - case "Silicone": - case "Polysiloxane": - case "Polycaprolactam": - case "Polytetrafluoroethylene": - case "PolyvinylChloride": - case "Polystyrene": - case "StyreneButadieneRubber": + } + case "Plastic", "Rubber", "Polyethylene", "Epoxid", "EpoxidFiberReinforced", "Polydimethylsiloxane", "Silicone", "Polysiloxane", "Polycaprolactam", "Polytetrafluoroethylene", "PolyvinylChloride", "Polystyrene", "StyreneButadieneRubber" -> { if (name().startsWith("dust")) return mLocalizedMaterialPre + "%material" + " Pulp"; if (name().startsWith("plate")) return mLocalizedMaterialPre + "%material" + " Sheet"; if (name().startsWith("ingot")) return mLocalizedMaterialPre + "%material" + " Bar"; if (name().startsWith("nugget")) return mLocalizedMaterialPre + "%material" + " Chip"; if (name().startsWith("foil")) return "Thin " + "%material" + " Sheet"; - break; - case "FierySteel": + } + case "FierySteel" -> { if (mIsContainer) return mLocalizedMaterialPre + "Fiery Blood" + mLocalizedMaterialPost; - break; - case "Steeleaf": + } + case "Steeleaf" -> { if (name().startsWith("ingot")) return mLocalizedMaterialPre + "%material"; - break; - case "Bone": + } + case "Bone" -> { if (name().startsWith("dust")) return mLocalizedMaterialPre + "Bone Meal"; - break; - case "Blaze": - case "Milk": - case "Cocoa": - case "Chocolate": - case "Coffee": - case "Chili": - case "Cheese": - case "Snow": + } + case "Blaze", "Milk", "Cocoa", "Chocolate", "Coffee", "Chili", "Cheese", "Snow" -> { if (name().startsWith("dust")) return mLocalizedMaterialPre + "%material" + " Powder"; - break; - case "Paper": + } + case "Paper" -> { if (name().startsWith("dust")) return mLocalizedMaterialPre + "Chad"; switch (this) { - case plate: + case plate -> { return "Sheet of Paper"; - case plateDouble: + } + case plateDouble -> { return "Paperboard"; - case plateTriple: + } + case plateTriple -> { return "Carton"; - case plateQuadruple: + } + case plateQuadruple -> { return "Cardboard"; - case plateQuintuple: + } + case plateQuintuple -> { return "Thick Cardboard"; - case plateDense: + } + case plateDense -> { return "Strong Cardboard"; + } } - break; - case "MeatRaw": + } + case "MeatRaw" -> { if (name().startsWith("dust")) return mLocalizedMaterialPre + "Mince Meat"; - break; - case "MeatCooked": + } + case "MeatCooked" -> { if (name().startsWith("dust")) return mLocalizedMaterialPre + "Cooked Mince Meat"; - break; - case "Ash": - case "DarkAsh": - case "Gunpowder": - case "Sugar": - case "Salt": - case "RockSalt": - case "VolcanicAsh": - case "RareEarth": + } + case "Ash", "DarkAsh", "Gunpowder", "Sugar", "Salt", "RockSalt", "VolcanicAsh", "RareEarth" -> { if (name().startsWith("dust")) return mLocalizedMaterialPre + "%material"; - break; - case "Vermiculite": - case "Bentonite": - case "Kaolinite": - case "Talc": - case "BasalticMineralSand": - case "GraniticMineralSand": - case "GlauconiteSand": - case "CassiteriteSand": - case "GarnetSand": - case "QuartzSand": - case "Pitchblende": - case "FullersEarth": + } + case "Vermiculite", "Bentonite", "Kaolinite", "Talc", "BasalticMineralSand", "GraniticMineralSand", "GlauconiteSand", "CassiteriteSand", "GarnetSand", "QuartzSand", "Pitchblende", "FullersEarth" -> { if (name().startsWith("dust")) return mLocalizedMaterialPre + "%material"; switch (this) { - case crushedCentrifuged: - case crushedPurified: + case crushedCentrifuged, crushedPurified -> { return mLocalizedMaterialPre + "%material"; - case crushed: + } + case crushed -> { return "Ground " + "%material"; + } } - break; + } } if (ProcessingModSupport.aEnableThaumcraftMats) { switch (aMaterial.mName) { - case "InfusedAir": - case "InfusedDull": - case "InfusedEarth": - case "InfusedEntropy": - case "InfusedFire": - case "InfusedOrder": - case "InfusedVis": - case "InfusedWater": + case "InfusedAir", "InfusedDull", "InfusedEarth", "InfusedEntropy", "InfusedFire", "InfusedOrder", "InfusedVis", "InfusedWater" -> { if (name().startsWith("gem")) return mLocalizedMaterialPre + "Shard of " + "%material"; if (name().startsWith("crystal")) return mLocalizedMaterialPre + "Shard of " + "%material"; if (name().startsWith("plate")) return mLocalizedMaterialPre + "%material" + " Crystal Plate"; if (name().startsWith("dust")) return mLocalizedMaterialPre + "%material" + " Crystal Powder"; switch (this) { - case crushedCentrifuged: - case crushedPurified: - case crushed: + case crushedCentrifuged, crushedPurified, crushed -> { return mLocalizedMaterialPre + "%material" + " Crystals"; + } } - break; + } } } // Use Standard Localization |