diff options
| author | NotAPenguin <michiel.vandeginste@gmail.com> | 2024-09-02 23:17:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-02 23:17:17 +0200 |
| commit | 1b820de08a05070909a267e17f033fcf58ac8710 (patch) | |
| tree | 02831a025986a06b20f87e5bcc69d1e0c639a342 /src/main/java/gtnhlanth/common/item | |
| parent | afd3fd92b6a6ab9ab0d0dc3214e6bc8ff7a86c9b (diff) | |
| download | GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.gz GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.bz2 GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.zip | |
The Great Renaming (#3014)
* move kekztech to a single root dir
* move detrav to a single root dir
* move gtnh-lanthanides to a single root dir
* move tectech and delete some gross reflection in gt++
* remove more reflection inside gt5u
* delete more reflection in gt++
* fix imports
* move bartworks and bwcrossmod
* fix proxies
* move galactigreg and ggfab
* move gtneioreplugin
* try to fix gt++ bee loader
* apply the rename rules to BW
* apply rename rules to bwcrossmod
* apply rename rules to detrav scanner mod
* apply rename rules to galacticgreg
* apply rename rules to ggfab
* apply rename rules to goodgenerator
* apply rename rules to gtnh-lanthanides
* apply rename rules to gt++
* apply rename rules to kekztech
* apply rename rules to kubatech
* apply rename rules to tectech
* apply rename rules to gt
apply the rename rules to gt
* fix tt import
* fix mui hopefully
* fix coremod except intergalactic
* rename assline recipe class
* fix a class name i stumbled on
* rename StructureUtility to GTStructureUtility to prevent conflict with structurelib
* temporary rename of GTTooltipDataCache to old name
* fix gt client/server proxy names
Diffstat (limited to 'src/main/java/gtnhlanth/common/item')
5 files changed, 347 insertions, 0 deletions
diff --git a/src/main/java/gtnhlanth/common/item/ICanFocus.java b/src/main/java/gtnhlanth/common/item/ICanFocus.java new file mode 100644 index 0000000000..7b372ee1c9 --- /dev/null +++ b/src/main/java/gtnhlanth/common/item/ICanFocus.java @@ -0,0 +1,5 @@ +package gtnhlanth.common.item; + +public interface ICanFocus { + +} diff --git a/src/main/java/gtnhlanth/common/item/ItemLanth.java b/src/main/java/gtnhlanth/common/item/ItemLanth.java new file mode 100644 index 0000000000..74f863a24a --- /dev/null +++ b/src/main/java/gtnhlanth/common/item/ItemLanth.java @@ -0,0 +1,15 @@ +package gtnhlanth.common.item; + +import net.minecraft.item.Item; + +import gtnhlanth.Tags; + +public class ItemLanth extends Item { + + public ItemLanth(String name) { + super(); + this.setUnlocalizedName(name); + this.setTextureName(Tags.MODID + ":" + name); + } + +} diff --git a/src/main/java/gtnhlanth/common/item/ItemParticle.java b/src/main/java/gtnhlanth/common/item/ItemParticle.java new file mode 100644 index 0000000000..07286e8f45 --- /dev/null +++ b/src/main/java/gtnhlanth/common/item/ItemParticle.java @@ -0,0 +1,123 @@ +package gtnhlanth.common.item; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtnhlanth.Tags; +import gtnhlanth.common.beamline.Particle; + +public class ItemParticle extends Item { + + public static final int NUMBER_OF_SUBTYPES = Particle.values().length; + + private static String[] names = new String[NUMBER_OF_SUBTYPES]; + + static { + populateNamesArray(); + } + + @SideOnly(Side.CLIENT) + private IIcon[] iconArray; + + public ItemParticle() { + + this.setHasSubtypes(true); + this.setMaxDamage(0); + + } + + @SideOnly(Side.CLIENT) + @Override + public IIcon getIconFromDamage(int damage) { + int j = MathHelper.clamp_int(damage, 0, NUMBER_OF_SUBTYPES - 1); + return this.iconArray[j]; + } + + public String getUnlocalizedName(ItemStack stack) { + int i = MathHelper.clamp_int(stack.getItemDamage(), 0, NUMBER_OF_SUBTYPES - 1); + return super.getUnlocalizedName() + "." + names[i]; + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @SideOnly(Side.CLIENT) + @Override + public void getSubItems(Item item, CreativeTabs tab, List list) { + for (int i = 0; i < NUMBER_OF_SUBTYPES; ++i) { + list.add(new ItemStack(item, 1, i)); + } + } + + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister register) { + this.iconArray = new IIcon[NUMBER_OF_SUBTYPES]; + + for (int i = 0; i < NUMBER_OF_SUBTYPES; ++i) { + this.iconArray[i] = register.registerIcon(Tags.MODID + ":" + "particle/" + names[i]); + } + } + + @SideOnly(Side.CLIENT) + @Override + public String getItemStackDisplayName(ItemStack stack) { + + int i = MathHelper.clamp_int(stack.getItemDamage(), 0, NUMBER_OF_SUBTYPES - 1); + + Particle particle = Particle.values()[i]; + + return particle.getLocalisedName(); + + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { + + int i = MathHelper.clamp_int(stack.getItemDamage(), 0, NUMBER_OF_SUBTYPES - 1); + + Particle particle = Particle.values()[i]; + + float restMass = particle.getMass(); + + float charge = particle.getCharge(); + + String chargeSpecial = particle.getChargeSpecial(); + + String chargeStringToAppend; + if (chargeSpecial != null) { + + chargeStringToAppend = chargeSpecial; + + } else { + + if (charge > 0) chargeStringToAppend = "+" + charge; + else chargeStringToAppend = "" + charge; + } + + list.add("Rest Mass: " + restMass + " MeV"); + list.add("Charge: " + chargeStringToAppend + "e"); + + } + + private static void populateNamesArray() { + + for (int i = 0; i < NUMBER_OF_SUBTYPES; i++) { + + Particle particle = Particle.values()[i]; + + names[i] = particle.getName(); + + } + + } + +} diff --git a/src/main/java/gtnhlanth/common/item/ItemPhotolithographicMask.java b/src/main/java/gtnhlanth/common/item/ItemPhotolithographicMask.java new file mode 100644 index 0000000000..d39c74b602 --- /dev/null +++ b/src/main/java/gtnhlanth/common/item/ItemPhotolithographicMask.java @@ -0,0 +1,42 @@ +package gtnhlanth.common.item; + +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +import gtnhlanth.Tags; + +public class ItemPhotolithographicMask extends Item implements ICanFocus { + + private String name; + private String descSpectrum; + + public ItemPhotolithographicMask(String name, int maxDamage, String descSpectrum) { + super(); + this.name = name; + this.descSpectrum = descSpectrum; + this.setUnlocalizedName("photomask." + name); + this.setMaxStackSize(1); + this.setMaxDamage(maxDamage); + this.setTextureName(Tags.MODID + ":photomask/" + name); + } + + /* + * @Override public String getUnlocalizedName() { return "item.photomask." + this.name; } + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { + + if (!this.descSpectrum.isEmpty()) + list.add("Suitable for the " + this.descSpectrum + " segment of the electromagnetic spectrum and lower"); + + } + + public String getDescSpectrum() { + return descSpectrum; + } + +} diff --git a/src/main/java/gtnhlanth/common/item/MaskList.java b/src/main/java/gtnhlanth/common/item/MaskList.java new file mode 100644 index 0000000000..b41e2cb886 --- /dev/null +++ b/src/main/java/gtnhlanth/common/item/MaskList.java @@ -0,0 +1,162 @@ +package gtnhlanth.common.item; + +import net.minecraft.item.ItemStack; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.TierEU; + +public enum MaskList { + + // There are absolutely better ways of doing this than a GT Materials-esque Enum, some method of automatically + // scraping the wafer types would be preferable in particular + // Use Dyes._NULL to indicate a wafer's lack of a dedicated lens instead of null, if the wafer's mask is to be + // generated + // Ignore last argument if using all wafers + ERROR("error", "ERROR", 0, "", null, null, 0, 0, 0, 0, 0, null), + BLANK1("blank1", "T1 Blank", 0, "VISIBLE", null, null, 0, 0, 0, 0, 0, null), + BLANK2("blank2", "T2 Blank", 0, "UV", null, null, 0, 0, 0, 0, 0, null), + BLANK3("blank3", "T3 Blank", 0, "X-RAY", null, null, 0, 0, 0, 0, 0, null), + ILC("ilc", "Integrated Logic Circuit", 100, "", BLANK1, Dyes.dyeRed, TierEU.RECIPE_MV, 0.5e-3f, 4e-3f, 35, 1, + ItemList.Circuit_Wafer_ILC.get(1)), + RAM("ram", "Random Access Memory", 200, "", BLANK1, Dyes.dyeCyan, TierEU.RECIPE_MV, 2e-3f, 4e-3f, 40, 2, + ItemList.Circuit_Wafer_Ram.get(1), ItemList.Circuit_Silicon_Wafer), + NAND("nand", "NAND", 200, "", BLANK2, Dyes._NULL, TierEU.RECIPE_HV, 7e-3f, 12e-3f, 40, 1, + ItemList.Circuit_Wafer_NAND.get(1), ItemList.Circuit_Silicon_Wafer), // NAND uses only Ender Pearl lens, don't + // ask me why + NOR("nor", "NOR", 100, "", BLANK2, Dyes._NULL, TierEU.RECIPE_LuV, 8e-3f, 10e-3f, 40, 1, + ItemList.Circuit_Wafer_NOR.get(1), ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2), // Same as + // above, + // but with + // ender + // eye + CPU("cpu", "Central Processing Unit", 10, "", BLANK2, Dyes.dyeWhite, TierEU.RECIPE_MV, 6e-3f, 12e-3f, 45, 2, + ItemList.Circuit_Wafer_CPU.get(1)), + SOC("soc", "SoC", 150, "", BLANK2, Dyes.dyeYellow, TierEU.RECIPE_EV, 3e-3f, 10e-3f, 45, 2, + ItemList.Circuit_Wafer_SoC.get(1), ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2), + ASOC("asoc", "Advanced SoC", 120, "", BLANK2, Dyes.dyeGreen, TierEU.RECIPE_EV, 100e-3f, 200e-3f, 50, 2, + ItemList.Circuit_Wafer_SoC2.get(1), ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2), + PIC("pic", "Power IC", 100, "", BLANK2, Dyes.dyeBlue, TierEU.RECIPE_HV, 5e-3f, 10e-3f, 50, 4, + ItemList.Circuit_Wafer_PIC.get(1), ItemList.Circuit_Silicon_Wafer), + HPIC("hpic", "High Power IC", 80, "", BLANK3, null, TierEU.RECIPE_IV, 100e-3f, 200e-3f, 50, 6, + ItemList.Circuit_Wafer_HPIC.get(1), ItemList.Circuit_Silicon_Wafer), // Different, made in chemical reactor. + // Figure out something for + // this later? + NCPU("ncpu", "NanoCPU", 60, "", BLANK2, null, TierEU.RECIPE_EV, 5e-3f, 10e-3f, 50, 4, + ItemList.Circuit_Wafer_NanoCPU.get(1), ItemList.Circuit_Silicon_Wafer), // Same as above + QBIT("qbit", "QBit", 50, "", BLANK2, null, TierEU.RECIPE_EV, 3e-3f, 10e-3f, 50, 4, + ItemList.Circuit_Wafer_QuantumCPU.get(1), ItemList.Circuit_Silicon_Wafer), // ^ + UHPIC("uhpic", "Ultra High Power IC", 60, "", BLANK3, null, TierEU.RECIPE_LuV, 200e-3f, 400e-3f, 50, 8, + ItemList.Circuit_Wafer_UHPIC.get(1), ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2), // You + // get + // the + // gist + SSOC("ssoc", "Simple SoC", 150, "", BLANK1, Dyes.dyeOrange, TierEU.RECIPE_MV, 2e-3f, 4e-3f, 25, 1, + ItemList.Circuit_Wafer_Simple_SoC.get(1)), + ULPIC("ulpic", "Ultra Low Power IC", 200, "", BLANK1, Dyes.dyeGreen, TierEU.RECIPE_LV, 2e-3f, 4e-3f, 30, 1, + ItemList.Circuit_Wafer_ULPIC.get(1)), // Can use green for this as well as asoc, given + // the latter uses a different base mask + LPIC("lpic", "Low Power IC", 150, "", BLANK1, Dyes.dyeYellow, TierEU.RECIPE_MV, 2e-3f, 4e-3f, 30, 2, + ItemList.Circuit_Wafer_LPIC.get(1)), // Same as above, except for yellow + NPIC("npic", "Nano Power IC", 70, "", BLANK3, Dyes.dyeRed, TierEU.RECIPE_LuV, 1, 100000, 50, 4, + ItemList.Circuit_Wafer_NPIC.get(1), ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2, + ItemList.Circuit_Silicon_Wafer3), // Same + PPIC("ppic", "PPIC", 50, "", BLANK3, null, TierEU.RECIPE_ZPM, 10, 15, 50, 6, ItemList.Circuit_Wafer_PPIC.get(1), + ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2, ItemList.Circuit_Silicon_Wafer3), // CR + // recipe + QPIC("qpic", "QPIC", 50, "", BLANK3, Dyes.dyeBlue, TierEU.RECIPE_UV, 5, 9, 50, 6, + ItemList.Circuit_Wafer_QPIC.get(1), ItemList.Circuit_Silicon_Wafer, ItemList.Circuit_Silicon_Wafer2, + ItemList.Circuit_Silicon_Wafer3, ItemList.Circuit_Silicon_Wafer4); // Different base mask to PIC + + String name; + String englishName; + String spectrum; + + int maxDamage; + + MaskList precursor; + Dyes lensColour; + + long engraverEUt; + + float minEnergy; + float maxEnergy; + + float minFocus; + int baselineAmount; + + ItemStack producedItem; + + ItemList[] forbiddenWafers; + + MaskList(String name, String englishName, int maxDamage, String spectrum, MaskList precursor, Dyes lensColour, + long engraverEUt, float minEnergy, float maxEnergy, float minFocus, int baselineAmount, ItemStack producedItem, + ItemList... forbiddenWafers) { + this.name = name; + this.englishName = englishName; + this.spectrum = spectrum; + this.maxDamage = maxDamage; + this.precursor = precursor; + this.lensColour = lensColour; + this.engraverEUt = engraverEUt; + this.minFocus = minFocus; + this.minEnergy = minEnergy; + this.maxEnergy = maxEnergy; + this.baselineAmount = baselineAmount; + this.producedItem = producedItem; + this.forbiddenWafers = forbiddenWafers; + } + + public String getName() { + return this.name; + } + + public String getEnglishName() { + return this.englishName; + } + + public String getSpectrum() { + return this.spectrum; + } + + public int getDamage() { + return this.maxDamage; + } + + public MaskList getPrecursor() { + return this.precursor; + } + + public Dyes getLensColour() { + return this.lensColour; + } + + public long getEngraverEUt() { + return this.engraverEUt; + } + + public float getMinEnergy() { + return this.minEnergy; + } + + public float getMaxEnergy() { + return this.maxEnergy; + } + + public float getMinFocus() { + return this.minFocus; + } + + public int getBaselineAmount() { + return this.baselineAmount; + } + + public ItemStack getProducedItem() { + return this.producedItem; + } + + public ItemList[] getForbiddenWafers() { + return this.forbiddenWafers; + } + +} |
