refactor: Flattened magic crystal item and spectral dust registries

This commit is contained in:
WinDanesz
2022-09-05 22:47:32 +02:00
parent 7888b92129
commit 3eef93b599
24 changed files with 151 additions and 149 deletions
@@ -40,7 +40,7 @@ public class BlockCrystalOre extends Block {
@Override @Override
public Item getItemDropped(IBlockState state, Random random, int fortune){ public Item getItemDropped(IBlockState state, Random random, int fortune){
return WizardryItems.magic_crystal; return WizardryItems.crystal_magic;
} }
@Override @Override
@@ -1,6 +1,7 @@
package electroblob.wizardry.block; package electroblob.wizardry.block;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.constants.Element; import electroblob.wizardry.constants.Element;
import electroblob.wizardry.item.ItemSpectralDust; import electroblob.wizardry.item.ItemSpectralDust;
import electroblob.wizardry.registry.*; import electroblob.wizardry.registry.*;
@@ -20,12 +21,14 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand; import net.minecraft.util.EnumHand;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.Arrays; import java.util.Arrays;
@@ -110,7 +113,7 @@ public class BlockReceptacle extends BlockTorch implements ITileEntityProvider {
if(tileEntity instanceof TileEntityReceptacle){ if(tileEntity instanceof TileEntityReceptacle){
Element element = ((TileEntityReceptacle)tileEntity).getElement(); Element element = ((TileEntityReceptacle)tileEntity).getElement();
if(element != null) drops.add(new ItemStack(WizardryItems.spectral_dust, 1, element.ordinal())); if(element != null) drops.add(new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation(Wizardry.MODID, "spectral_dust_" + element.name().toLowerCase())), 1));
} }
} }
@@ -219,7 +222,7 @@ public class BlockReceptacle extends BlockTorch implements ITileEntityProvider {
((TileEntityReceptacle)tileEntity).setElement(null); ((TileEntityReceptacle)tileEntity).setElement(null);
ItemStack dust = new ItemStack(WizardryItems.spectral_dust, 1, currentElement.ordinal()); ItemStack dust = new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation(Wizardry.MODID, "spectral_dust_" + currentElement.name().toLowerCase())));
if(stack.isEmpty()){ if(stack.isEmpty()){
player.setHeldItem(hand, dust); player.setHeldItem(hand, dust);
@@ -78,7 +78,7 @@ public final class WizardryModels {
// Items // Items
registerMultiTexturedModel((ItemCrystal)WizardryItems.magic_crystal); //registerMultiTexturedModel((ItemCrystal)WizardryItems.magic_crystal);
registerWandModel(WizardryItems.magic_wand); registerWandModel(WizardryItems.magic_wand);
registerWandModel(WizardryItems.apprentice_wand); registerWandModel(WizardryItems.apprentice_wand);
@@ -121,8 +121,6 @@ public final class WizardryModels {
registerWandModel(WizardryItems.master_sorcery_wand); registerWandModel(WizardryItems.master_sorcery_wand);
registerWandModel(WizardryItems.master_healing_wand); registerWandModel(WizardryItems.master_healing_wand);
registerMultiTexturedModel((ItemSpectralDust)WizardryItems.spectral_dust);
// Automatic item model registry // Automatic item model registry
for(Item item : Item.REGISTRY){ for(Item item : Item.REGISTRY){
if(!registeredItems.contains(item) && item.getRegistryName().getNamespace().equals(Wizardry.MODID)){ if(!registeredItems.contains(item) && item.getRegistryName().getNamespace().equals(Wizardry.MODID)){
@@ -341,7 +341,7 @@ public class EntityEvilWizard extends EntityMob implements ISpellCaster, IEntity
int j = 3 + this.rand.nextInt(3) + this.rand.nextInt(1 + lootingLevel); int j = 3 + this.rand.nextInt(3) + this.rand.nextInt(1 + lootingLevel);
for(int k = 0; k < j; k++){ for(int k = 0; k < j; k++){
this.dropItem(WizardryItems.magic_crystal, 1); this.dropItem(WizardryItems.crystal_magic, 1);
} }
// Evil wizards occasionally drop one of their spells as a spell book, but not magic missile. This isn't in // Evil wizards occasionally drop one of their spells as a spell book, but not magic missile. This isn't in
@@ -506,7 +506,7 @@ public class EntityWizard extends EntityCreature implements INpc, IMerchant, ISp
// All wizards will buy spell books // All wizards will buy spell books
ItemStack anySpellBook = new ItemStack(WizardryItems.spell_book, 1, OreDictionary.WILDCARD_VALUE); ItemStack anySpellBook = new ItemStack(WizardryItems.spell_book, 1, OreDictionary.WILDCARD_VALUE);
ItemStack crystalStack = new ItemStack(WizardryItems.magic_crystal, 5); ItemStack crystalStack = new ItemStack(WizardryItems.crystal_magic, 5);
this.trades.add(new MerchantRecipe(anySpellBook, crystalStack)); this.trades.add(new MerchantRecipe(anySpellBook, crystalStack));
@@ -576,7 +576,7 @@ public class EntityWizard extends EntityCreature implements INpc, IMerchant, ISp
if(itemToSell.isEmpty()) return; if(itemToSell.isEmpty()) return;
ItemStack secondItemToBuy = tier == Tier.MASTER ? new ItemStack(WizardryItems.astral_diamond) ItemStack secondItemToBuy = tier == Tier.MASTER ? new ItemStack(WizardryItems.astral_diamond)
: new ItemStack(WizardryItems.magic_crystal, tier.ordinal() * 3 + 1 + rand.nextInt(4)); : new ItemStack(WizardryItems.crystal_magic, tier.ordinal() * 3 + 1 + rand.nextInt(4));
merchantrecipelist.add(new MerchantRecipe(this.getRandomPrice(tier), secondItemToBuy, itemToSell)); merchantrecipelist.add(new MerchantRecipe(this.getRandomPrice(tier), secondItemToBuy, itemToSell));
} }
@@ -1,5 +1,6 @@
package electroblob.wizardry.integration.jei; package electroblob.wizardry.integration.jei;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.client.DrawingUtils; import electroblob.wizardry.client.DrawingUtils;
import electroblob.wizardry.constants.Constants; import electroblob.wizardry.constants.Constants;
import electroblob.wizardry.constants.Element; import electroblob.wizardry.constants.Element;
@@ -11,7 +12,9 @@ import mezz.jei.api.ingredients.VanillaTypes;
import mezz.jei.api.recipe.IRecipeWrapper; import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
@@ -94,9 +97,9 @@ public class ArcaneWorkbenchRecipe implements IRecipeWrapper {
int count = MathHelper.ceil((float)mana / Constants.MANA_PER_CRYSTAL); int count = MathHelper.ceil((float)mana / Constants.MANA_PER_CRYSTAL);
// A stack of crystals will almost certainly be enough mana, but you never know! // A stack of crystals will almost certainly be enough mana, but you never know!
// Using ItemStack.EMPTY to avoid deprecated method; crystals' stack size is not stack-sensitive so it doesn't matter // Using ItemStack.EMPTY to avoid deprecated method; crystals' stack size is not stack-sensitive so it doesn't matter
if(count <= WizardryItems.magic_crystal.getItemStackLimit(ItemStack.EMPTY)){ if(count <= WizardryItems.crystal_magic.getItemStackLimit(ItemStack.EMPTY)){
for(int meta = 0; meta < Element.values().length; meta++){ for (Element element : Element.values()) {
crystalStacks.add(new ItemStack(WizardryItems.magic_crystal, count, meta)); crystalStacks.add(new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation(Wizardry.MODID, "crystal_" + element.name().toLowerCase())), count));
} }
} }
@@ -23,6 +23,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@@ -214,7 +215,9 @@ public class ArcaneWorkbenchRecipeCategory implements IRecipeCategory<ArcaneWork
List<ArcaneWorkbenchRecipe> recipes = new ArrayList<>(); List<ArcaneWorkbenchRecipe> recipes = new ArrayList<>();
List<ItemStack> crystals = new ArrayList<>(); List<ItemStack> crystals = new ArrayList<>();
for(int meta = 0; meta < Element.values().length; meta++) crystals.add(new ItemStack(WizardryItems.magic_crystal, 1, meta)); for (Element element : Element.values()) {
crystals.add(new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation(Wizardry.MODID, "crystal_" + element.name().toLowerCase()))));
}
List<ItemStack> shard = Collections.singletonList(new ItemStack(WizardryItems.crystal_shard)); List<ItemStack> shard = Collections.singletonList(new ItemStack(WizardryItems.crystal_shard));
List<ItemStack> grandCrystal = Collections.singletonList(new ItemStack(WizardryItems.grand_crystal)); List<ItemStack> grandCrystal = Collections.singletonList(new ItemStack(WizardryItems.grand_crystal));
@@ -19,6 +19,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList; import java.util.ArrayList;
@@ -118,7 +119,13 @@ public class ImbuementAltarRecipeCategory implements IRecipeCategory<ImbuementAl
List<ImbuementAltarRecipe> recipes = new ArrayList<>(); List<ImbuementAltarRecipe> recipes = new ArrayList<>();
NonNullList<ItemStack> variants = NonNullList.create(); NonNullList<ItemStack> variants = NonNullList.create();
WizardryItems.spectral_dust.getSubItems(WizardryItems.spectral_dust.getCreativeTab(), variants); variants.add(new ItemStack(WizardryItems.spectral_dust_earth));
variants.add(new ItemStack(WizardryItems.spectral_dust_fire));
variants.add(new ItemStack(WizardryItems.spectral_dust_healing));
variants.add(new ItemStack(WizardryItems.spectral_dust_ice));
variants.add(new ItemStack(WizardryItems.spectral_dust_lightning));
variants.add(new ItemStack(WizardryItems.spectral_dust_necromancy));
variants.add(new ItemStack(WizardryItems.spectral_dust_sorcery));
List<List<ItemStack>> dusts = new ArrayList<>(); List<List<ItemStack>> dusts = new ArrayList<>();
// Generate 4 separate lists, each in a different order to make it obvious they can be any element // Generate 4 separate lists, each in a different order to make it obvious they can be any element
@@ -137,11 +144,12 @@ public class ImbuementAltarRecipeCategory implements IRecipeCategory<ImbuementAl
List<ImbuementAltarRecipe> recipes = new ArrayList<>(); List<ImbuementAltarRecipe> recipes = new ArrayList<>();
ItemStack input = new ItemStack(WizardryItems.magic_crystal); ItemStack input = new ItemStack(WizardryItems.crystal_magic);
for(int meta = 1; meta < Element.values().length; meta++){ for(Element element : Element.values()){
List<List<ItemStack>> dusts = Collections.nCopies(4, Collections.singletonList(new ItemStack(WizardryItems.spectral_dust, 1, meta))); List<List<ItemStack>> dusts = Collections.nCopies(4, Collections.singletonList(new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation(Wizardry.MODID,
ItemStack output = new ItemStack(WizardryItems.magic_crystal, 1, meta); "spectral_dust_" + element.name().toLowerCase())))));
ItemStack output = new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation(Wizardry.MODID, "crystal_" + element.name().toLowerCase())));
recipes.add(new ImbuementAltarRecipe(input, dusts, output)); recipes.add(new ImbuementAltarRecipe(input, dusts, output));
} }
@@ -155,10 +163,14 @@ public class ImbuementAltarRecipeCategory implements IRecipeCategory<ImbuementAl
ItemStack input = new ItemStack(WizardryBlocks.crystal_block); ItemStack input = new ItemStack(WizardryBlocks.crystal_block);
for(int meta = 1; meta < Element.values().length; meta++){ for(Element element : Element.values()){
List<List<ItemStack>> dusts = Collections.nCopies(4, Collections.singletonList(new ItemStack(WizardryItems.spectral_dust, 1, meta))); if(element == Element.MAGIC) continue;
ItemStack output = new ItemStack(WizardryBlocks.crystal_block, 1, meta);
recipes.add(new ImbuementAltarRecipe(input, dusts, output)); int meta = element.ordinal();
List<List<ItemStack>> dusts = Collections.nCopies(4, Collections.singletonList(new ItemStack(ForgeRegistries.ITEMS.getValue(
new ResourceLocation(Wizardry.MODID, "spectral_dust_" + element.name().toLowerCase())))));
ItemStack output = new ItemStack(WizardryBlocks.crystal_block, 1, meta);
recipes.add(new ImbuementAltarRecipe(input, dusts, output));
} }
return recipes; return recipes;
@@ -179,7 +191,8 @@ public class ImbuementAltarRecipeCategory implements IRecipeCategory<ImbuementAl
if(e == Element.MAGIC) continue; if(e == Element.MAGIC) continue;
List<List<ItemStack>> dusts = Collections.nCopies(4, Collections.singletonList(new ItemStack(WizardryItems.spectral_dust, 1, e.ordinal()))); List<List<ItemStack>> dusts = Collections.nCopies(4, Collections.singletonList(new ItemStack(
ForgeRegistries.ITEMS.getValue(new ResourceLocation(Wizardry.MODID, "spectral_dust_" + e.name().toLowerCase())))));
ItemStack output = TileEntityImbuementAltar.getImbuementResult(input, new Element[]{e, e, e, e}, false, null, null); ItemStack output = TileEntityImbuementAltar.getImbuementResult(input, new Element[]{e, e, e, e}, false, null, null);
if(!output.isEmpty()) recipes.add(new ImbuementAltarRecipe(input, dusts, output)); if(!output.isEmpty()) recipes.add(new ImbuementAltarRecipe(input, dusts, output));
@@ -66,7 +66,7 @@ public class WizardryJEIPlugin implements IModPlugin {
} }
} }
addItemInfo(registry, WizardryItems.magic_crystal); addItemInfo(registry, WizardryItems.crystal_magic);
addItemInfo(registry, WizardryItems.wizard_handbook); addItemInfo(registry, WizardryItems.wizard_handbook);
addItemInfo(registry, WizardryItems.crystal_shard); addItemInfo(registry, WizardryItems.crystal_shard);
addItemInfo(registry, WizardryItems.grand_crystal); addItemInfo(registry, WizardryItems.grand_crystal);
@@ -92,7 +92,7 @@ public class ContainerArcaneWorkbench extends Container implements ISpellSortabl
} }
this.addSlotToContainer(new SlotItemList(tileentity, CRYSTAL_SLOT, 13, 101, 64, this.addSlotToContainer(new SlotItemList(tileentity, CRYSTAL_SLOT, 13, 101, 64,
WizardryItems.magic_crystal, WizardryItems.crystal_shard, WizardryItems.grand_crystal)) WizardryItems.crystal_magic, WizardryItems.crystal_shard, WizardryItems.grand_crystal))
.setBackgroundName(EMPTY_SLOT_CRYSTAL.toString()); .setBackgroundName(EMPTY_SLOT_CRYSTAL.toString());
this.addSlotToContainer(new SlotWorkbenchItem(tileentity, CENTRE_SLOT, 80, 64, this)); this.addSlotToContainer(new SlotWorkbenchItem(tileentity, CENTRE_SLOT, 80, 64, this));
@@ -11,34 +11,12 @@ import net.minecraft.util.ResourceLocation;
/** Note that in 1.13, <i>the flattening</i> will make this class redundant, much like ItemCoal, which is probably its /** Note that in 1.13, <i>the flattening</i> will make this class redundant, much like ItemCoal, which is probably its
* closest analog in vanilla. */ * closest analog in vanilla. */
public class ItemCrystal extends Item implements IMultiTexturedItem { public class ItemCrystal extends Item {
public ItemCrystal(){ public ItemCrystal(){
super(); super();
this.setHasSubtypes(true);
this.setMaxDamage(0); this.setMaxDamage(0);
this.setCreativeTab(WizardryTabs.WIZARDRY); this.setCreativeTab(WizardryTabs.WIZARDRY);
} }
@Override
public ResourceLocation getModelName(ItemStack stack){
int metadata = stack.getMetadata();
if(metadata >= Element.values().length) metadata = 0;
return new ResourceLocation(Wizardry.MODID, "crystal_" + Element.values()[metadata].getName());
}
@Override
public String getTranslationKey(ItemStack stack){
return "item." + this.getModelName(stack).toString();
}
@Override
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items){
if(tab == WizardryTabs.WIZARDRY){
for(Element element : Element.values()){
items.add(new ItemStack(this, 1, element.ordinal()));
}
}
}
} }
@@ -1,39 +1,13 @@
package electroblob.wizardry.item; package electroblob.wizardry.item;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.constants.Element;
import electroblob.wizardry.registry.WizardryTabs; import electroblob.wizardry.registry.WizardryTabs;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import java.util.Arrays; public class ItemSpectralDust extends Item {
public class ItemSpectralDust extends Item implements IMultiTexturedItem {
public ItemSpectralDust(){ public ItemSpectralDust(){
super(); super();
this.setHasSubtypes(true);
this.setMaxDamage(0); this.setMaxDamage(0);
this.setCreativeTab(WizardryTabs.WIZARDRY); this.setCreativeTab(WizardryTabs.WIZARDRY);
} }
@Override
public ResourceLocation getModelName(ItemStack stack){
int metadata = stack.getMetadata();
if(metadata >= Element.values().length) metadata = 0;
return new ResourceLocation(Wizardry.MODID, "spectral_dust_" + Element.values()[metadata].getName());
}
@Override
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items){
if(tab == WizardryTabs.WIZARDRY){
for(Element element : Arrays.copyOfRange(Element.values(), 1, Element.values().length)){
items.add(new ItemStack(this, 1, element.ordinal()));
}
}
}
} }
@@ -26,11 +26,13 @@ import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.BannerPattern; import net.minecraft.tileentity.BannerPattern;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder; import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
import net.minecraftforge.registries.IForgeRegistry; import net.minecraftforge.registries.IForgeRegistry;
@@ -78,7 +80,14 @@ public final class WizardryItems {
// point where all the items were listed, but that's not possible within the current system unless you use an array, // point where all the items were listed, but that's not possible within the current system unless you use an array,
// which means you lose the individual fields... // which means you lose the individual fields...
public static final Item magic_crystal = placeholder(); public static final Item crystal_magic = placeholder();
public static final Item crystal_earth = placeholder();
public static final Item crystal_fire = placeholder();
public static final Item crystal_healing = placeholder();
public static final Item crystal_ice = placeholder();
public static final Item crystal_lightning = placeholder();
public static final Item crystal_necromancy = placeholder();
public static final Item crystal_sorcery = placeholder();
public static final Item grand_crystal = placeholder(); public static final Item grand_crystal = placeholder();
public static final Item crystal_shard = placeholder(); public static final Item crystal_shard = placeholder();
@@ -162,7 +171,13 @@ public final class WizardryItems {
public static final Item smoke_bomb = placeholder(); public static final Item smoke_bomb = placeholder();
public static final Item spark_bomb = placeholder(); public static final Item spark_bomb = placeholder();
public static final Item spectral_dust = placeholder(); public static final Item spectral_dust_earth = placeholder();
public static final Item spectral_dust_fire = placeholder();
public static final Item spectral_dust_healing = placeholder();
public static final Item spectral_dust_ice = placeholder();
public static final Item spectral_dust_lightning = placeholder();
public static final Item spectral_dust_necromancy = placeholder();
public static final Item spectral_dust_sorcery = placeholder();
public static final Item wizard_hat = placeholder(); public static final Item wizard_hat = placeholder();
public static final Item wizard_robe = placeholder(); public static final Item wizard_robe = placeholder();
@@ -567,7 +582,14 @@ public final class WizardryItems {
// Items // Items
registerItem(registry, "magic_crystal", new ItemCrystal()); registerItem(registry, "crystal_magic", new ItemCrystal());
registerItem(registry, "crystal_earth", new ItemCrystal());
registerItem(registry, "crystal_fire", new ItemCrystal());
registerItem(registry, "crystal_healing", new ItemCrystal());
registerItem(registry, "crystal_ice", new ItemCrystal());
registerItem(registry, "crystal_lightning", new ItemCrystal());
registerItem(registry, "crystal_necromancy", new ItemCrystal());
registerItem(registry, "crystal_sorcery", new ItemCrystal());
registerItem(registry, "crystal_shard", new Item().setCreativeTab(WizardryTabs.WIZARDRY)); registerItem(registry, "crystal_shard", new Item().setCreativeTab(WizardryTabs.WIZARDRY));
registerItem(registry, "grand_crystal", new Item().setCreativeTab(WizardryTabs.WIZARDRY)); registerItem(registry, "grand_crystal", new Item().setCreativeTab(WizardryTabs.WIZARDRY));
@@ -654,7 +676,13 @@ public final class WizardryItems {
registerItem(registry, "smoke_bomb", new ItemSmokeBomb()); registerItem(registry, "smoke_bomb", new ItemSmokeBomb());
registerItem(registry, "spark_bomb", new ItemSparkBomb()); registerItem(registry, "spark_bomb", new ItemSparkBomb());
registerItem(registry, "spectral_dust", new ItemSpectralDust()); registerItem(registry, "spectral_dust_earth", new ItemSpectralDust());
registerItem(registry, "spectral_dust_fire", new ItemSpectralDust());
registerItem(registry, "spectral_dust_healing", new ItemSpectralDust());
registerItem(registry, "spectral_dust_ice", new ItemSpectralDust());
registerItem(registry, "spectral_dust_lightning", new ItemSpectralDust());
registerItem(registry, "spectral_dust_necromancy", new ItemSpectralDust());
registerItem(registry, "spectral_dust_sorcery", new ItemSpectralDust());
registerItem(registry, "wizard_hat", new ItemWizardArmour(ArmourClass.WIZARD, EntityEquipmentSlot.HEAD, null), true); registerItem(registry, "wizard_hat", new ItemWizardArmour(ArmourClass.WIZARD, EntityEquipmentSlot.HEAD, null), true);
registerItem(registry, "wizard_robe", new ItemWizardArmour(ArmourClass.WIZARD, EntityEquipmentSlot.CHEST, null)); registerItem(registry, "wizard_robe", new ItemWizardArmour(ArmourClass.WIZARD, EntityEquipmentSlot.CHEST, null));
@@ -991,9 +1019,11 @@ public final class WizardryItems {
/** Called from init() in the main mod class to register wizardry's banner patterns. */ /** Called from init() in the main mod class to register wizardry's banner patterns. */
public static void registerBannerPatterns(){ public static void registerBannerPatterns(){
for(Element element : Element.values()){ for(Element element : Element.values()){
if(element != Element.MAGIC) addBannerPattern("WIZARDRY_" + element.getName().toUpperCase(Locale.ROOT), if (element != Element.MAGIC) {
"wizardry_" + element.getName(), "eb" + element.getName().charAt(0), addBannerPattern("WIZARDRY_" + element.getName().toUpperCase(Locale.ROOT),
new ItemStack(WizardryItems.magic_crystal, 1, element.ordinal())); "wizardry_" + element.getName(), "eb" + element.getName().charAt(0),
new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation(Wizardry.MODID, "crystal_" + element.name().toLowerCase()))));
}
} }
} }
@@ -59,7 +59,7 @@ public final class WizardryRecipes {
IForgeRegistry<IRecipe> registry = event.getRegistry(); IForgeRegistry<IRecipe> registry = event.getRegistry();
FurnaceRecipes.instance().addSmeltingRecipeForBlock(WizardryBlocks.crystal_ore, new ItemStack(WizardryItems.magic_crystal), 0.5f); FurnaceRecipes.instance().addSmeltingRecipeForBlock(WizardryBlocks.crystal_ore, new ItemStack(WizardryItems.crystal_magic), 0.5f);
// Mana flask recipes // Mana flask recipes
@@ -256,7 +256,7 @@ public class TileEntityImbuementAltar extends TileEntity implements ITickable {
} }
} }
if((input.getItem() == WizardryItems.magic_crystal || input.getItem() == Item.getItemFromBlock(WizardryBlocks.crystal_block)) if((input.getItem() == WizardryItems.crystal_magic || input.getItem() == Item.getItemFromBlock(WizardryBlocks.crystal_block))
&& input.getMetadata() == 0){ && input.getMetadata() == 0){
if(Arrays.stream(receptacleElements).distinct().count() == 1 && receptacleElements[0] != null){ // All the same element if(Arrays.stream(receptacleElements).distinct().count() == 1 && receptacleElements[0] != null){ // All the same element
@@ -216,6 +216,13 @@ item.ebwizardry\:ethereal_crystalweave.desc_extended=An enchanted fabric that is
item.ebwizardry\:magic_silk.name=Magical Silk item.ebwizardry\:magic_silk.name=Magical Silk
item.ebwizardry\:spectral_dust.name=Spectral Dust item.ebwizardry\:spectral_dust.name=Spectral Dust
item.ebwizardry\:spectral_dust_earth.name=Spectral Dust
item.ebwizardry\:spectral_dust_fire.name=Spectral Dust
item.ebwizardry\:spectral_dust_healing.name=Spectral Dust
item.ebwizardry\:spectral_dust_ice.name=Spectral Dust
item.ebwizardry\:spectral_dust_lightning.name=Spectral Dust
item.ebwizardry\:spectral_dust_necromancy.name=Spectral Dust
item.ebwizardry\:spectral_dust_sorcery.name=Spectral Dust
item.ebwizardry\:wizard_armour.element_cost_reduction=-%1$s%% %2$s cost item.ebwizardry\:wizard_armour.element_cost_reduction=-%1$s%% %2$s cost
item.ebwizardry\:wizard_armour.cooldown_reduction=-%1$s%% Cooldown item.ebwizardry\:wizard_armour.cooldown_reduction=-%1$s%% Cooldown
@@ -6,7 +6,7 @@
"entries": [ "entries": [
{ {
"type": "item", "type": "item",
"name": "ebwizardry:spectral_dust", "name": "ebwizardry:spectral_dust_earth",
"weight": 1, "weight": 1,
"functions": [ "functions": [
{ {
@@ -15,11 +15,7 @@
"min": 0, "min": 0,
"max": 1 "max": 1
} }
}, }
{
"function": "minecraft:set_data",
"data": 5
}
] ]
} }
] ]
@@ -6,7 +6,7 @@
"entries": [ "entries": [
{ {
"type": "item", "type": "item",
"name": "ebwizardry:spectral_dust", "name": "ebwizardry:spectral_dust_fire",
"weight": 1, "weight": 1,
"functions": [ "functions": [
{ {
@@ -15,11 +15,7 @@
"min": 0, "min": 0,
"max": 1 "max": 1
} }
}, }
{
"function": "minecraft:set_data",
"data": 1
}
] ]
} }
] ]
@@ -6,7 +6,7 @@
"entries": [ "entries": [
{ {
"type": "item", "type": "item",
"name": "ebwizardry:spectral_dust", "name": "ebwizardry:spectral_dust_healing",
"weight": 1, "weight": 1,
"functions": [ "functions": [
{ {
@@ -15,11 +15,7 @@
"min": 0, "min": 0,
"max": 1 "max": 1
} }
}, }
{
"function": "minecraft:set_data",
"data": 7
}
] ]
} }
] ]
@@ -6,7 +6,7 @@
"entries": [ "entries": [
{ {
"type": "item", "type": "item",
"name": "ebwizardry:spectral_dust", "name": "ebwizardry:spectral_dust_ice",
"weight": 1, "weight": 1,
"functions": [ "functions": [
{ {
@@ -15,11 +15,7 @@
"min": 0, "min": 0,
"max": 1 "max": 1
} }
}, }
{
"function": "minecraft:set_data",
"data": 2
}
] ]
} }
] ]
@@ -6,7 +6,7 @@
"entries": [ "entries": [
{ {
"type": "item", "type": "item",
"name": "ebwizardry:spectral_dust", "name": "ebwizardry:spectral_dust_lightning",
"weight": 1, "weight": 1,
"functions": [ "functions": [
{ {
@@ -15,11 +15,7 @@
"min": 0, "min": 0,
"max": 1 "max": 1
} }
}, }
{
"function": "minecraft:set_data",
"data": 3
}
] ]
} }
] ]
@@ -6,7 +6,7 @@
"entries": [ "entries": [
{ {
"type": "item", "type": "item",
"name": "ebwizardry:spectral_dust", "name": "ebwizardry:spectral_dust_necromancy",
"weight": 1, "weight": 1,
"functions": [ "functions": [
{ {
@@ -15,11 +15,7 @@
"min": 0, "min": 0,
"max": 1 "max": 1
} }
}, }
{
"function": "minecraft:set_data",
"data": 4
}
] ]
} }
] ]
@@ -6,7 +6,7 @@
"entries": [ "entries": [
{ {
"type": "item", "type": "item",
"name": "ebwizardry:spectral_dust", "name": "ebwizardry:spectral_dust_sorcery",
"weight": 1, "weight": 1,
"functions": [ "functions": [
{ {
@@ -15,11 +15,7 @@
"min": 0, "min": 0,
"max": 1 "max": 1
} }
}, }
{
"function": "minecraft:set_data",
"data": 6
}
] ]
} }
] ]
@@ -6,17 +6,38 @@
"entries": [ "entries": [
{ {
"type": "item", "type": "item",
"name": "ebwizardry:magic_crystal", "name": "ebwizardry:crystal_earth",
"weight": 1, "weight": 1
"functions": [ },
{ {
"function": "set_data", "type": "item",
"data": { "name": "ebwizardry:crystal_fire",
"min": 1, "weight": 1
"max": 7 },
} {
} "type": "item",
] "name": "ebwizardry:crystal_healing",
"weight": 1
},
{
"type": "item",
"name": "ebwizardry:crystal_ice",
"weight": 1
},
{
"type": "item",
"name": "ebwizardry:crystal_lightning",
"weight": 1
},
{
"type": "item",
"name": "ebwizardry:crystal_necromancy",
"weight": 1
},
{
"type": "item",
"name": "ebwizardry:crystal_sorcery",
"weight": 1
} }
] ]
} }