diff options
| author | Raven Szewczyk <git@eigenraven.me> | 2024-05-24 19:50:35 +0100 |
|---|---|---|
| committer | Raven Szewczyk <git@eigenraven.me> | 2024-05-24 19:50:35 +0100 |
| commit | 6d1b2216464d4dad449ac6fcfec476832224a55e (patch) | |
| tree | 526a0c15f7056313c80e6c0386e025e9b3f61781 /src/main/java/gtPlusPlus/xmod/forestry/bees/handler | |
| parent | b5d35f40afa606ed1b07061dad82e0521a59c186 (diff) | |
| download | GT5-Unofficial-6d1b2216464d4dad449ac6fcfec476832224a55e.tar.gz GT5-Unofficial-6d1b2216464d4dad449ac6fcfec476832224a55e.tar.bz2 GT5-Unofficial-6d1b2216464d4dad449ac6fcfec476832224a55e.zip | |
Merge addon sources
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/forestry/bees/handler')
4 files changed, 244 insertions, 0 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java new file mode 100644 index 0000000000..31b14ed4e6 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java @@ -0,0 +1,62 @@ +package gtPlusPlus.xmod.forestry.bees.handler; + +import net.minecraft.item.ItemStack; + +import gregtech.api.util.GT_LanguageManager; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees; + +public enum GTPP_CombType { + + DRAGONBLOOD(0, "Dragon Blood", true, 30, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20)), + FORCE(1, "Force", true, 30, Utils.rgbtoHexValue(250, 250, 20), Utils.rgbtoHexValue(200, 200, 5)); + + public boolean mShowInList; + public final Material mMaterial; + public final int mChance; + public final int mID; + + private final String mName; + private final String mNameUnlocal; + private final int[] mColour; + + private static void map(int aId, GTPP_CombType aType) { + GTPP_Bees.sCombMappings.put(aId, aType); + } + + public static GTPP_CombType get(int aID) { + return GTPP_Bees.sCombMappings.get(aID); + } + + GTPP_CombType(int aID, String aName, boolean aShow, int aChance, int... aColour) { + this.mID = aID; + this.mName = aName; + this.mNameUnlocal = aName.toLowerCase() + .replaceAll(" ", ""); + this.mChance = aChance; + this.mShowInList = aShow; + this.mColour = aColour; + map(aID, this); + this.mMaterial = GTPP_Bees.sMaterialMappings.get( + aName.toLowerCase() + .replaceAll(" ", "")); + GT_LanguageManager.addStringLocalization("gtplusplus.comb." + this.mNameUnlocal, this.mName + " Comb"); + } + + public void setHidden() { + this.mShowInList = false; + } + + public String getName() { + return GT_LanguageManager.getTranslation("gtplusplus.comb." + this.mNameUnlocal); + } + + public int[] getColours() { + return mColour == null || mColour.length != 2 ? new int[] { 0, 0 } : mColour; + } + + public ItemStack getStackForType(int count) { + return new ItemStack(GTPP_Bees.combs, count, mID); + } +} diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java new file mode 100644 index 0000000000..9819c586cd --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java @@ -0,0 +1,61 @@ +package gtPlusPlus.xmod.forestry.bees.handler; + +import net.minecraft.item.ItemStack; + +import gregtech.api.util.GT_LanguageManager; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees; + +public enum GTPP_DropType { + + DRAGONBLOOD(0, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20)), + FORCE(1, "Force", true, Utils.rgbtoHexValue(250, 250, 20), Utils.rgbtoHexValue(200, 200, 5)); + + public boolean mShowInList; + public final Material mMaterial; + public int mChance; + public final int mID; + + private final String mName; + private final String mNameUnlocal; + private final int[] mColour; + + private static void map(int aId, GTPP_DropType aType) { + GTPP_Bees.sDropMappings.put(aId, aType); + } + + public static GTPP_DropType get(int aID) { + return GTPP_Bees.sDropMappings.get(aID); + } + + private GTPP_DropType(int aID, String aName, boolean aShow, int... aColour) { + this.mID = aID; + this.mName = aName; + this.mNameUnlocal = aName.toLowerCase() + .replaceAll(" ", ""); + this.mShowInList = aShow; + this.mColour = aColour; + map(aID, this); + this.mMaterial = GTPP_Bees.sMaterialMappings.get( + aName.toLowerCase() + .replaceAll(" ", "")); + GT_LanguageManager.addStringLocalization("gtplusplus.drop." + this.mNameUnlocal, this.mName + " Drop"); + } + + public void setHidden() { + this.mShowInList = false; + } + + public String getName() { + return GT_LanguageManager.getTranslation("gtplusplus.drop." + this.mNameUnlocal); + } + + public int[] getColours() { + return mColour; + } + + public ItemStack getStackForType(int count) { + return new ItemStack(GTPP_Bees.drop, count, mID); + } +} diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java new file mode 100644 index 0000000000..66451c7581 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java @@ -0,0 +1,60 @@ +package gtPlusPlus.xmod.forestry.bees.handler; + +import net.minecraft.item.ItemStack; + +import gregtech.api.util.GT_LanguageManager; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees; + +public enum GTPP_PollenType { + + DRAGONBLOOD(0, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20)); + + public boolean mShowInList; + public final Material mMaterial; + public int mChance; + public final int mID; + + private final String mName; + private final String mNameUnlocal; + private final int[] mColour; + + private static void map(int aId, GTPP_PollenType aType) { + GTPP_Bees.sPollenMappings.put(aId, aType); + } + + public static GTPP_PollenType get(int aID) { + return GTPP_Bees.sPollenMappings.get(aID); + } + + private GTPP_PollenType(int aID, String aName, boolean aShow, int... aColour) { + this.mID = aID; + this.mName = aName; + this.mNameUnlocal = aName.toLowerCase() + .replaceAll(" ", ""); + this.mShowInList = aShow; + this.mColour = aColour; + map(aID, this); + this.mMaterial = GTPP_Bees.sMaterialMappings.get( + aName.toLowerCase() + .replaceAll(" ", "")); + GT_LanguageManager.addStringLocalization("gtplusplus.pollen." + this.mNameUnlocal, this.mName + " Pollen"); + } + + public void setHidden() { + this.mShowInList = false; + } + + public String getName() { + return GT_LanguageManager.getTranslation("gtplusplus.pollen." + this.mNameUnlocal); + } + + public int[] getColours() { + return mColour; + } + + public ItemStack getStackForType(int count) { + return new ItemStack(GTPP_Bees.pollen, count, mID); + } +} diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java new file mode 100644 index 0000000000..eb3b617077 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java @@ -0,0 +1,61 @@ +package gtPlusPlus.xmod.forestry.bees.handler; + +import net.minecraft.item.ItemStack; + +import gregtech.api.util.GT_LanguageManager; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees; + +public enum GTPP_PropolisType { + + DRAGONBLOOD(0, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20)), + FORCE(1, "Force", true, Utils.rgbtoHexValue(250, 250, 20)); + + public boolean mShowInList; + public final Material mMaterial; + public int mChance; + public final int mID; + + private final String mName; + private final String mNameUnlocal; + private final int mColour; + + private static void map(int aId, GTPP_PropolisType aType) { + GTPP_Bees.sPropolisMappings.put(aId, aType); + } + + public static GTPP_PropolisType get(int aID) { + return GTPP_Bees.sPropolisMappings.get(aID); + } + + private GTPP_PropolisType(int aID, String aName, boolean aShow, int aColour) { + this.mID = aID; + this.mName = aName; + this.mNameUnlocal = aName.toLowerCase() + .replaceAll(" ", ""); + this.mShowInList = aShow; + this.mColour = aColour; + map(aID, this); + this.mMaterial = GTPP_Bees.sMaterialMappings.get( + aName.toLowerCase() + .replaceAll(" ", "")); + GT_LanguageManager.addStringLocalization("gtplusplus.propolis." + this.mNameUnlocal, this.mName + " Propolis"); + } + + public void setHidden() { + this.mShowInList = false; + } + + public String getName() { + return GT_LanguageManager.getTranslation("gtplusplus.propolis." + this.mNameUnlocal); + } + + public int getColours() { + return mColour; + } + + public ItemStack getStackForType(int count) { + return new ItemStack(GTPP_Bees.propolis, count, mID); + } +} |
