Oredict/tag cleanup

This commit is contained in:
Vincent Lee committed 2019-03-12 19:28:17 -05:00
1 parent 3a8be04fa7
commit d6bd0c021b
91 files changed
+552 -83

No files matched your search

@@ -95,7 +95,6 @@ public final class BotaniaAPI {
public static final Map<ResourceLocation, Integer> oreWeights = new HashMap<>();
public static final Map<ResourceLocation, Integer> oreWeightsNether = new HashMap<>();
public static final Set<Item> looniumBlacklist = new LinkedHashSet<>();
public static final Map<Block, EnumProperty<EnumDyeColor>> paintableBlocks = new LinkedHashMap<>();
public static final Set<Class<? extends Entity>> gravityRodBlacklist = new LinkedHashSet<>();
public static final Set<Block> gaiaBreakBlacklist = new HashSet<>();
@@ -776,13 +775,6 @@ public final class BotaniaAPI {
return oreWeightsNether.get(tag);
}
/**
* Blacklists an item from the Loonium drop table.
*/
public static void blackListItemFromLoonium(Item item) {
looniumBlacklist.add(item);
}
/**
* Registers a Wiki provider for a mod so it uses that instead of the fallback
* FTB wiki.
@@ -811,20 +811,6 @@ public final class ModBlocks {
}
private static void initOreDict() {
for(int i = 0; i < 16; i++) {
OreDictionary.registerOre(LibOreDict.FLOWER[i], new ItemStack(flower, 1, i));
OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(mushroom, 1, i));
}
OreDictionary.registerOre(LibOreDict.LIVING_ROCK, livingrock);
OreDictionary.registerOre(LibOreDict.LIVING_WOOD, livingwood);
OreDictionary.registerOre(LibOreDict.DREAM_WOOD, dreamwood);
for(int i = 0; i < 8; i++) {
OreDictionary.registerOre(LibOreDict.DOUBLE_FLOWER[i], new ItemStack(doubleFlower1, 1, i));
OreDictionary.registerOre(LibOreDict.DOUBLE_FLOWER[i + 8], new ItemStack(doubleFlower2, 1, i));
}
OreDictionary.registerOre(LibOreDict.BLAZE_BLOCK, blazeBlock);
}
@@ -26,9 +26,12 @@ import net.minecraft.entity.monster.EntitySpider;
import net.minecraft.entity.monster.EntityStray;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.init.MobEffects;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.PotionEffect;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.Tag;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -39,7 +42,6 @@ import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.subtile.RadiusDescriptor;
import vazkii.botania.api.subtile.SubTileFunctional;
@@ -57,6 +59,7 @@ public class SubTileLoonuim extends SubTileFunctional {
private static final int RANGE = 5;
private static final String TAG_LOOT_TABLE = "lootTable";
private static final String TAG_ITEMSTACK_TO_DROP = "botania:looniumItemStackToDrop";
private static final Tag<Item> BLACKLIST = new ItemTags.Wrapper(new ResourceLocation(LibMisc.MOD_ID, "loonium_blacklist"));
private ResourceLocation lootTable = new ResourceLocation("minecraft", "chests/simple_dungeon");
@@ -77,7 +80,7 @@ public class SubTileLoonuim extends SubTileFunctional {
Collections.shuffle(stacks);
stack = stacks.get(0);
}
} while(stack.isEmpty() || BotaniaAPI.looniumBlacklist.contains(stack.getItem()));
} while(stack.isEmpty() || BLACKLIST.contains(stack.getItem()));
int bound = RANGE * 2 + 1;
int xp = supertile.getPos().getX() - RANGE + rand.nextInt(bound);
@@ -12,14 +12,14 @@ package vazkii.botania.common.crafting.recipe;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraftforge.items.IItemHandler;
import vazkii.botania.api.recipe.RecipeRuneAltar;
import vazkii.botania.common.core.helper.ItemNBTHelper;
public class HeadRecipe extends RecipeRuneAltar {
String name = "";
private String name = "";
public HeadRecipe(ItemStack output, int mana, Object... inputs) {
super(output, mana, inputs);
@@ -36,8 +36,9 @@ public class HeadRecipe extends RecipeRuneAltar {
break;
if(stack.getItem() == Items.NAME_TAG) {
name = stack.getDisplayName();
if(name.equals(I18n.translateToLocal("item.nameTag.name")))
String defaultName = new TextComponentTranslation(Items.NAME_TAG.getTranslationKey()).getString();
name = stack.getDisplayName().getString();
if(name.equals(defaultName))
return false;
}
}
@@ -48,7 +49,7 @@ public class HeadRecipe extends RecipeRuneAltar {
@Override
public ItemStack getOutput() {
ItemStack stack = new ItemStack(Items.SKULL, 1, 3);
ItemStack stack = new ItemStack(Items.PLAYER_HEAD);
if(!name.isEmpty())
ItemNBTHelper.setString(stack, "SkullOwner", name);
return stack;
@@ -636,30 +636,7 @@ public final class ModItems {
}
private static void registerOreDictionary() {
/* todo 1.13
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
for(EnumDyeColor color : EnumDyeColor.values()) {
OreDictionary.registerOre(LibOreDict.PETAL[color.getMetadata()], new ItemStack(petals.get(color)));
OreDictionary.registerOre(LibOreDict.DYE[color.getMetadata()], new ItemStack(dyes.get(color)));
OreDictionary.registerOre(LibOreDict.DYE_WILDCARD, new ItemStack(dyes.get(color)));
}
OreDictionary.registerOre(LibOreDict.RUNE[0], new ItemStack(runeWater));
OreDictionary.registerOre(LibOreDict.RUNE[1], new ItemStack(runeFire));
OreDictionary.registerOre(LibOreDict.RUNE[2], new ItemStack(runeEarth));
OreDictionary.registerOre(LibOreDict.RUNE[3], new ItemStack(runeAir));
OreDictionary.registerOre(LibOreDict.RUNE[4], new ItemStack(runeSpring));
OreDictionary.registerOre(LibOreDict.RUNE[5], new ItemStack(runeSummer));
OreDictionary.registerOre(LibOreDict.RUNE[6], new ItemStack(runeAutumn));
OreDictionary.registerOre(LibOreDict.RUNE[7], new ItemStack(runeWinter));
OreDictionary.registerOre(LibOreDict.RUNE[8], new ItemStack(runeMana));
OreDictionary.registerOre(LibOreDict.RUNE[9], new ItemStack(runeLust));
OreDictionary.registerOre(LibOreDict.RUNE[10], new ItemStack(runeGluttony));
OreDictionary.registerOre(LibOreDict.RUNE[11], new ItemStack(runeGreed));
OreDictionary.registerOre(LibOreDict.RUNE[12], new ItemStack(runeSloth));
OreDictionary.registerOre(LibOreDict.RUNE[13], new ItemStack(runeWrath));
OreDictionary.registerOre(LibOreDict.RUNE[14], new ItemStack(runeEnvy));
OreDictionary.registerOre(LibOreDict.RUNE[15], new ItemStack(runePride));
OreDictionary.registerOre(LibOreDict.QUARTZ[0], new ItemStack(darkQuartz));
OreDictionary.registerOre(LibOreDict.QUARTZ[1], new ItemStack(manaQuartz));
@@ -697,18 +674,7 @@ public final class ModItems {
OreDictionary.registerOre(LibOreDict.VIAL, new ItemStack(vial));
OreDictionary.registerOre(LibOreDict.FLASK, new ItemStack(flask));
BotaniaAPI.blackListItemFromLoonium(lexicon);
BotaniaAPI.blackListItemFromLoonium(overgrowthSeed);
BotaniaAPI.blackListItemFromLoonium(blackLotus);
BotaniaAPI.blackListItemFromLoonium(blackerLotus);
for(Item i : Item.REGISTRY) {
if("minecraft".equals(i.getRegistryName().getNamespace()) & i instanceof ItemRecord) {
BotaniaAPI.blackListItemFromLoonium(i);
}
}
OreDictionary.registerOre("rodBlaze", Items.BLAZE_ROD);
OreDictionary.registerOre("powderBlaze", Items.BLAZE_POWDER);
*/
}
}
@@ -15,8 +15,6 @@ public final class LibOreDict {
public static final String LEXICON = "lexicaBotania";
public static final String PESTLE_AND_MORTAR = "pestleAndMortar";
public static final String TWIG_WAND = "twigWand";
public static final String LIVING_WOOD = "livingwood";
public static final String LIVING_ROCK = "livingrock";
public static final String MANA_STEEL = "ingotManasteel";
public static final String MANA_PEARL = "manaPearl";
public static final String MANA_DIAMOND = "manaDiamond";
@@ -24,7 +22,6 @@ public final class LibOreDict {
public static final String TERRA_STEEL = "ingotTerrasteel";
public static final String LIFE_ESSENCE = "eternalLifeEssence";
public static final String REDSTONE_ROOT = "redstoneRoot";
public static final String DREAM_WOOD = "dreamwood";
public static final String ELEMENTIUM = "ingotElvenElementium";
public static final String PIXIE_DUST = "elvenPixieDust";
public static final String DRAGONSTONE = "elvenDragonstone";
@@ -45,11 +42,8 @@ public final class LibOreDict {
public static final String VIAL = "bVial";
public static final String FLASK = "bFlask";
public static final String PRISMARINE_BLOCK = "blockPrismarine";
public static final String BLAZE_BLOCK = "blockBlaze";
public static final String DYE_WILDCARD = "dye";
public static final String[] FLOWER = new String[] {
"mysticFlowerWhite", "mysticFlowerOrange", "mysticFlowerMagenta", "mysticFlowerLightBlue",
"mysticFlowerYellow", "mysticFlowerLime", "mysticFlowerPink", "mysticFlowerGray",
@@ -57,13 +51,6 @@ public final class LibOreDict {
"mysticFlowerBrown", "mysticFlowerGreen", "mysticFlowerRed", "mysticFlowerBlack"
};
public static final String[] DOUBLE_FLOWER = new String[] {
"mysticFlowerWhiteDouble", "mysticFlowerOrangeDouble", "mysticFlowerMagentaDouble", "mysticFlowerLightBlueDouble",
"mysticFlowerYellowDouble", "mysticFlowerLimeDouble", "mysticFlowerPinkDouble", "mysticFlowerGrayDouble",
"mysticFlowerLightGrayDouble", "mysticFlowerCyanDouble", "mysticFlowerPurpleDouble", "mysticFlowerBlueDouble",
"mysticFlowerBrownDouble", "mysticFlowerGreenDouble", "mysticFlowerRedDouble", "mysticFlowerBlackDouble"
};
public static final String[] PETAL = new String[] {
"petalWhite", "petalOrange", "petalMagenta", "petalLightBlue",
"petalYellow", "petalLime", "petalPink", "petalGray",
@@ -71,13 +58,6 @@ public final class LibOreDict {
"petalBrown", "petalGreen", "petalRed", "petalBlack"
};
public static final String[] DYE = new String[] {
"dyeWhite", "dyeOrange", "dyeMagenta", "dyeLightBlue",
"dyeYellow", "dyeLime", "dyePink", "dyeGray",
"dyeLightGray", "dyeCyan", "dyePurple", "dyeBlue",
"dyeBrown", "dyeGreen", "dyeRed", "dyeBlack"
};
public static final String[] RUNE = new String[] {
"runeWaterB", "runeFireB", "runeEarthB", "runeAirB",
"runeSpringB", "runeSummerB", "runeAutumnB", "runeWinterB",