aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/GoodGenerator/util
diff options
context:
space:
mode:
authorGlodBlock <1356392126@qq.com>2021-08-01 20:16:32 +0800
committerGlodBlock <1356392126@qq.com>2021-08-01 20:16:32 +0800
commitfe5cf0f61f14450ade1f473b0807e28f7450453f (patch)
treebe9d9687b471393efcd0e64a8c832f33724db2ea /src/main/java/GoodGenerator/util
parent96bff401ca9f6db063d14bd2931690baf2260791 (diff)
downloadGT5-Unofficial-fe5cf0f61f14450ade1f473b0807e28f7450453f.tar.gz
GT5-Unofficial-fe5cf0f61f14450ade1f473b0807e28f7450453f.tar.bz2
GT5-Unofficial-fe5cf0f61f14450ade1f473b0807e28f7450453f.zip
add ItemRefer file
Diffstat (limited to 'src/main/java/GoodGenerator/util')
-rw-r--r--src/main/java/GoodGenerator/util/ItemRefer.java115
1 files changed, 73 insertions, 42 deletions
diff --git a/src/main/java/GoodGenerator/util/ItemRefer.java b/src/main/java/GoodGenerator/util/ItemRefer.java
index 0fc605550e..6d20636d1e 100644
--- a/src/main/java/GoodGenerator/util/ItemRefer.java
+++ b/src/main/java/GoodGenerator/util/ItemRefer.java
@@ -1,5 +1,6 @@
package GoodGenerator.util;
+import gregtech.api.util.GT_Utility;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -8,57 +9,87 @@ import static GoodGenerator.Loader.Loaders.*;
public final class ItemRefer {
- public static ItemStack Radiation_Protection_Plate = getItemStack(radiationProtectionPlate);
- public static ItemStack Wrapped_Uranium_Ingot = getItemStack(wrappedUraniumIngot);
- public static ItemStack High_Density_Uranium_Nugget = getItemStack(highDensityUraniumNugget);
- public static ItemStack High_Density_Uranium = getItemStack(highDensityUranium);
- public static ItemStack Wrapped_Thorium_Ingot = getItemStack(wrappedThoriumIngot);
- public static ItemStack High_Density_Thorium_Nugget = getItemStack(highDensityThoriumNugget);
- public static ItemStack High_Density_Thorium = getItemStack(highDensityThorium);
- public static ItemStack Wrapped_Plutonium_Ingot = getItemStack(wrappedPlutoniumIngot);
- public static ItemStack High_Density_Plutonium_Nugget = getItemStack(highDensityPlutoniumNugget);
- public static ItemStack High_Density_Plutonium = getItemStack(highDensityPlutonium);
- public static ItemStack Raw_Atomic_Separation_Catalyst = getItemStack(rawAtomicSeparationCatalyst);
- public static ItemStack Advanced_Radiation_Protection_Plate = getItemStack(advancedRadiationProtectionPlate);
- public static ItemStack Aluminum_Nitride_Dust = getItemStack(aluminumNitride);
- public static ItemStack Special_Ceramics_Dust = getItemStack(specialCeramics);
- public static ItemStack Special_Ceramics_Plate = getItemStack(specialCeramicsPlate);
-
- public static ItemStack Field_Restriction_Casing = getItemStack(MAR_Casing);
- public static ItemStack Naquadah_Fuel_Refinery_Casing = getItemStack(FRF_Casings);
- public static ItemStack Field_Restriction_Coil_T1 = getItemStack(FRF_Coil_1);
- public static ItemStack Field_Restriction_Coil_T2 = getItemStack(FRF_Coil_2);
- public static ItemStack Field_Restriction_Coil_T3 = getItemStack(FRF_Coil_3);
- public static ItemStack Radiation_Proof_Steel_Frame_Box = getItemStack(radiationProtectionSteelFrame);
- public static ItemStack Field_Restriction_Glass = getItemStack(fieldRestrictingGlass);
- public static ItemStack Raw_Cylinder = getItemStack(rawCylinder);
- public static ItemStack Titanium_Plated_Cylinder = getItemStack(titaniumPlatedCylinder);
- public static ItemStack Magic_Casing = getItemStack(magicCasing);
- public static ItemStack Essentia_Cell_T1 = getItemStack(essentiaCell, 0);
- public static ItemStack Essentia_Cell_T2 = getItemStack(essentiaCell, 1);
- public static ItemStack Essentia_Cell_T3 = getItemStack(essentiaCell, 2);
- public static ItemStack Essentia_Hatch = getItemStack(essentiaHatch);
-
- public static ItemStack Large_Naquadah_Reactor = MAR;
- public static ItemStack Naquadah_Fuel_Refinery = FRF;
- public static ItemStack Universal_Chemical_Fuel_Engine = UCFE;
- public static ItemStack Large_Essentia_Generator = LEG;
-
- private static ItemStack getItemStack(Item item) {
+ public static ItemRefer Radiation_Protection_Plate = getItemStack(radiationProtectionPlate);
+ public static ItemRefer Wrapped_Uranium_Ingot = getItemStack(wrappedUraniumIngot);
+ public static ItemRefer High_Density_Uranium_Nugget = getItemStack(highDensityUraniumNugget);
+ public static ItemRefer High_Density_Uranium = getItemStack(highDensityUranium);
+ public static ItemRefer Wrapped_Thorium_Ingot = getItemStack(wrappedThoriumIngot);
+ public static ItemRefer High_Density_Thorium_Nugget = getItemStack(highDensityThoriumNugget);
+ public static ItemRefer High_Density_Thorium = getItemStack(highDensityThorium);
+ public static ItemRefer Wrapped_Plutonium_Ingot = getItemStack(wrappedPlutoniumIngot);
+ public static ItemRefer High_Density_Plutonium_Nugget = getItemStack(highDensityPlutoniumNugget);
+ public static ItemRefer High_Density_Plutonium = getItemStack(highDensityPlutonium);
+ public static ItemRefer Raw_Atomic_Separation_Catalyst = getItemStack(rawAtomicSeparationCatalyst);
+ public static ItemRefer Advanced_Radiation_Protection_Plate = getItemStack(advancedRadiationProtectionPlate);
+ public static ItemRefer Aluminum_Nitride_Dust = getItemStack(aluminumNitride);
+ public static ItemRefer Special_Ceramics_Dust = getItemStack(specialCeramics);
+ public static ItemRefer Special_Ceramics_Plate = getItemStack(specialCeramicsPlate);
+
+ public static ItemRefer Field_Restriction_Casing = getItemStack(MAR_Casing);
+ public static ItemRefer Naquadah_Fuel_Refinery_Casing = getItemStack(FRF_Casings);
+ public static ItemRefer Field_Restriction_Coil_T1 = getItemStack(FRF_Coil_1);
+ public static ItemRefer Field_Restriction_Coil_T2 = getItemStack(FRF_Coil_2);
+ public static ItemRefer Field_Restriction_Coil_T3 = getItemStack(FRF_Coil_3);
+ public static ItemRefer Radiation_Proof_Steel_Frame_Box = getItemStack(radiationProtectionSteelFrame);
+ public static ItemRefer Field_Restriction_Glass = getItemStack(fieldRestrictingGlass);
+ public static ItemRefer Raw_Cylinder = getItemStack(rawCylinder);
+ public static ItemRefer Titanium_Plated_Cylinder = getItemStack(titaniumPlatedCylinder);
+ public static ItemRefer Magic_Casing = getItemStack(magicCasing);
+ public static ItemRefer Essentia_Cell_T1 = getItemStack(essentiaCell, 0);
+ public static ItemRefer Essentia_Cell_T2 = getItemStack(essentiaCell, 1);
+ public static ItemRefer Essentia_Cell_T3 = getItemStack(essentiaCell, 2);
+ public static ItemRefer Essentia_Hatch = getItemStack(essentiaHatch);
+
+ public static ItemRefer Large_Naquadah_Reactor = getItemStack(MAR);
+ public static ItemRefer Naquadah_Fuel_Refinery = getItemStack(FRF);
+ public static ItemRefer Universal_Chemical_Fuel_Engine = getItemStack(UCFE);
+ public static ItemRefer Large_Essentia_Generator = getItemStack(LEG);
+
+ private Item mItem = null;
+ private Block mBlock = null;
+ private ItemStack mItemStack = null;
+ private int mMeta = 0;
+
+ private static ItemRefer getItemStack(ItemStack itemStack) {
+ return new ItemRefer(itemStack);
+ }
+
+ private static ItemRefer getItemStack(Item item) {
return getItemStack(item, 0);
}
- private static ItemStack getItemStack(Item item, int meta) {
+ private static ItemRefer getItemStack(Item item, int meta) {
if (item == null) return null;
- return new ItemStack(item, 1, meta);
+ return new ItemRefer(item, meta);
}
- private static ItemStack getItemStack(Block block) {
+ private static ItemRefer getItemStack(Block block) {
return getItemStack(block, 0);
}
- private static ItemStack getItemStack(Block block, int meta) {
+ private static ItemRefer getItemStack(Block block, int meta) {
if (block == null) return null;
- return new ItemStack(block, 1, meta);
+ return new ItemRefer(block, meta);
+ }
+
+ private ItemRefer(Item item, int meta) {
+ mItem = item;
+ mMeta = meta;
+ }
+
+ private ItemRefer(Block block, int meta) {
+ mBlock = block;
+ mMeta = meta;
+ }
+
+ private ItemRefer(ItemStack itemStack) {
+ mItemStack = itemStack;
+ }
+
+ public ItemStack get(int amount){
+ if (mItem != null) return new ItemStack(mItem, amount, mMeta);
+ if (mBlock != null) return new ItemStack(mBlock, amount, mMeta);
+ if (mItemStack != null) return GT_Utility.copyAmount(amount, mItemStack);
+ return null;
}
}