mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-20 04:19:44 +00:00
Also changes like all packages inb4 "jared changes a package name in ModTweaker2 breaking compatability with everything" drama tweet.
This commit is contained in:
1 parent
4fd2551072
commit
ec562b62ea
187 files changed
+977
-991
No files matched your search
@@ -0,0 +1,49 @@
|
||||
package modtweaker2.mods.mariculture;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import mariculture.api.core.MaricultureHandlers;
|
||||
import mariculture.api.fishery.Fishing;
|
||||
import mariculture.api.fishery.Loot;
|
||||
import mariculture.api.fishery.Loot.Rarity;
|
||||
import modtweaker2.helpers.ReflectionHelper;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class MaricultureHelper {
|
||||
public static Map fuels = null;
|
||||
public static HashMap<Rarity, ArrayList<Loot>> loot = null;
|
||||
|
||||
static {
|
||||
try {
|
||||
fuels = ReflectionHelper.getFinalObject(MaricultureHandlers.crucible, "fuels");
|
||||
loot = ReflectionHelper.getFinalObject(Fishing.fishing, "fishing_loot");
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
|
||||
private MaricultureHelper() {}
|
||||
|
||||
//Helper for getting the key that is used when adding/removing fuels
|
||||
public static String getKey(Object o) {
|
||||
if (o instanceof String) return (String) o;
|
||||
else if (o instanceof ItemStack) {
|
||||
String name = "";
|
||||
ItemStack stack = (ItemStack) o;
|
||||
if (OreDictionary.getOreIDs(stack).length > 0) {
|
||||
name = OreDictionary.getOreName(OreDictionary.getOreIDs(stack)[0]);
|
||||
} else if (stack.isItemStackDamageable()) {
|
||||
name = Item.itemRegistry.getNameForObject(stack.getItem()) + "|ignore";
|
||||
} else {
|
||||
name = Item.itemRegistry.getNameForObject(stack.getItem()) + "|" + stack.getItemDamage();
|
||||
}
|
||||
|
||||
return name;
|
||||
} else if (o instanceof FluidStack) {
|
||||
return ((FluidStack) o).getFluid().getName();
|
||||
} else return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user