Merge branch '1.12.2' into 1.12.2-dev
This commit is contained in:
@@ -40,25 +40,18 @@ public final class WizardryBlocks {
|
||||
|
||||
// setSoundType should be public, but in this particular version it isn't... which is a bit of a pain.
|
||||
|
||||
public static final Block arcane_workbench = new BlockArcaneWorkbench().setHardness(1.0F)
|
||||
.setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block crystal_ore = new BlockCrystalOre(Material.ROCK).setHardness(3.0F)
|
||||
.setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block arcane_workbench = new BlockArcaneWorkbench().setHardness(1.0F).setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block crystal_ore = new BlockCrystalOre(Material.ROCK).setHardness(3.0F).setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block petrified_stone = new BlockStatue(Material.ROCK).setHardness(1.5F).setResistance(10.0F);
|
||||
public static final Block ice_statue = new BlockStatue(Material.ICE).setHardness(0.5F).setLightOpacity(3);
|
||||
public static final Block magic_light = new BlockMagicLight(Material.CIRCUITS);
|
||||
public static final Block crystal_flower = new BlockCrystalFlower(Material.PLANTS).setHardness(0.0F)
|
||||
.setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block crystal_flower = new BlockCrystalFlower(Material.PLANTS).setHardness(0.0F).setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block snare = new BlockSnare(Material.PLANTS).setHardness(0.0F);
|
||||
public static final Block transportation_stone = new BlockTransportationStone(Material.ROCK).setHardness(0.0F)
|
||||
.setLightLevel(0.5f).setLightOpacity(0).setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block spectral_block = new BlockSpectral(Material.GLASS).setLightLevel(0.7f).setLightOpacity(0)
|
||||
.setBlockUnbreakable().setResistance(6000000.0F);
|
||||
public static final Block crystal_block = new Block(Material.IRON).setHardness(5.0F).setResistance(10.0F)
|
||||
.setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block transportation_stone = new BlockTransportationStone(Material.ROCK).setHardness(0.3F).setLightLevel(0.5f).setLightOpacity(0).setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block spectral_block = new BlockSpectral(Material.GLASS).setLightLevel(0.7f).setLightOpacity(0).setBlockUnbreakable().setResistance(6000000.0F);
|
||||
public static final Block crystal_block = new Block(Material.IRON).setHardness(5.0F).setResistance(10.0F).setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block meteor = new Block(Material.ROCK).setLightLevel(1);
|
||||
public static final Block vanishing_cobweb = new BlockVanishingCobweb(Material.WEB).setLightOpacity(1)
|
||||
.setHardness(4.0F);
|
||||
public static final Block vanishing_cobweb = new BlockVanishingCobweb(Material.WEB).setLightOpacity(1).setHardness(4.0F);
|
||||
|
||||
static{
|
||||
// This is here because Block#setHarvestLevel isn't chainable.
|
||||
|
||||
@@ -127,7 +127,7 @@ public final class WizardryItems {
|
||||
public static final Item armour_upgrade = new ItemArmourUpgrade();
|
||||
|
||||
public static final ArmorMaterial SILK = EnumHelper.addArmorMaterial("SILK",
|
||||
"wizardry/textures/armour/wizard_armour", 15, new int[]{2, 5, 4, 2}, 0,
|
||||
"wizardry/textures/armour/wizard_armour", 15, new int[]{0, 0, 0, 0}, 0,
|
||||
SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 0.0F);
|
||||
|
||||
// Saw a post somewhere that said you have to put these in the init methods rather than defining them as constants.
|
||||
|
||||
@@ -73,11 +73,10 @@ import electroblob.wizardry.util.WizardryUtilities;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.init.Biomes;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.storage.loot.LootTableList;
|
||||
@@ -89,7 +88,6 @@ import net.minecraftforge.fml.common.registry.EntityRegistry;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
@@ -245,53 +243,18 @@ public final class WizardryRegistry {
|
||||
EntityRegistry.registerEgg(registryName, eggColour, spotColour);
|
||||
}
|
||||
|
||||
/** Called from the init method in the main mod class to register all the recipes. */
|
||||
/** Now only deals with the dynamic crafting recipes and the smelting recipes. */
|
||||
@SubscribeEvent
|
||||
public static void registerRecipes(RegistryEvent.Register<IRecipe> event){
|
||||
|
||||
IForgeRegistry<IRecipe> registry = event.getRegistry();
|
||||
|
||||
ItemStack magicCrystalStack = new ItemStack(WizardryItems.magic_crystal);
|
||||
ItemStack magicWandStack = new ItemStack(WizardryItems.magic_wand, 1, Tier.BASIC.maxCharge);
|
||||
ItemStack goldNuggetStack = new ItemStack(Items.GOLD_NUGGET);
|
||||
ItemStack stickStack = new ItemStack(Items.STICK);
|
||||
ItemStack bookStack = new ItemStack(Items.BOOK);
|
||||
ItemStack spellBookStack = new ItemStack(WizardryItems.spell_book, 1, Spells.magic_missile.id());
|
||||
Ingredient crystalFlowerStack = Ingredient.fromStacks(new ItemStack(WizardryBlocks.crystal_flower));
|
||||
ItemStack magicCrystalStack1 = new ItemStack(WizardryItems.magic_crystal, 2);
|
||||
ItemStack magicCrystalStack2 = new ItemStack(WizardryItems.magic_crystal, 9);
|
||||
Ingredient crystalBlockStack = Ingredient.fromStacks(new ItemStack(WizardryBlocks.crystal_block));
|
||||
ItemStack manaFlaskStack = new ItemStack(WizardryItems.mana_flask);
|
||||
Ingredient bottleStack = Ingredient.fromStacks(new ItemStack(Items.GLASS_BOTTLE));
|
||||
Ingredient gunpowderStack = Ingredient.fromStacks(new ItemStack(Items.GUNPOWDER));
|
||||
Ingredient blazePowderStack = Ingredient.fromStacks(new ItemStack(Items.BLAZE_POWDER));
|
||||
Ingredient spiderEyeStack = Ingredient.fromStacks(new ItemStack(Items.SPIDER_EYE));
|
||||
// Coal or charcoal is equally fine, hence the wildcard value
|
||||
Ingredient coalStack = Ingredient.fromStacks(new ItemStack(Items.COAL, 1, OreDictionary.WILDCARD_VALUE));
|
||||
ItemStack firebombStack = new ItemStack(WizardryItems.firebomb, 3);
|
||||
ItemStack poisonBombStack = new ItemStack(WizardryItems.poison_bomb, 3);
|
||||
ItemStack smokeBombStack = new ItemStack(WizardryItems.smoke_bomb, 3);
|
||||
ItemStack scrollStack = new ItemStack(WizardryItems.blank_scroll);
|
||||
Ingredient paperStack = Ingredient.fromStacks(new ItemStack(Items.PAPER));
|
||||
Ingredient stringStack = Ingredient.fromStacks(new ItemStack(Items.STRING));
|
||||
|
||||
registry.register(new ShapedOreRecipe(null, magicWandStack, " x", " y ", "z ", 'x', magicCrystalStack, 'y', stickStack, 'z', goldNuggetStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/magic_wand")));
|
||||
registry.register(new ShapedOreRecipe(null, spellBookStack, " x ", "xyx", " x ", 'x', magicCrystalStack, 'y', bookStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/spellbook")));
|
||||
|
||||
registry.register(new ShapelessOreRecipe(null, magicCrystalStack1, crystalFlowerStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/magic_crystal_1")));
|
||||
registry.register(new ShapelessOreRecipe(null, magicCrystalStack2, crystalBlockStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/magic_crystal_2")));
|
||||
|
||||
if(Wizardry.settings.firebombIsCraftable) registry.register(new ShapelessOreRecipe(null, firebombStack, bottleStack, gunpowderStack, blazePowderStack, blazePowderStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/fire_bomb")));
|
||||
if(Wizardry.settings.poisonBombIsCraftable) registry.register(new ShapelessOreRecipe(null, poisonBombStack, bottleStack, gunpowderStack, spiderEyeStack, spiderEyeStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/poison_bomb")));
|
||||
if(Wizardry.settings.smokeBombIsCraftable) registry.register(new ShapelessOreRecipe(null, smokeBombStack, bottleStack, gunpowderStack, coalStack, coalStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/smoke_bomb")));
|
||||
|
||||
if(Wizardry.settings.useAlternateScrollRecipe){
|
||||
registry.register(new ShapelessOreRecipe(null, scrollStack, paperStack, stringStack, magicCrystalStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/blank_scroll")));
|
||||
}else{
|
||||
registry.register(new ShapelessOreRecipe(null, scrollStack, paperStack, stringStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/blank_scroll")));
|
||||
}
|
||||
|
||||
|
||||
FurnaceRecipes.instance().addSmeltingRecipeForBlock(WizardryBlocks.crystal_ore, new ItemStack(WizardryItems.magic_crystal), 0.5f);
|
||||
|
||||
// Mana flask recipes
|
||||
|
||||
ItemStack manaFlaskStack = new ItemStack(WizardryItems.mana_flask);
|
||||
|
||||
ItemStack miscWandStack;
|
||||
|
||||
for(Element element : Element.values()){
|
||||
@@ -303,7 +266,6 @@ public final class WizardryRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ItemStack miscArmourStack;
|
||||
|
||||
for(Element element : Element.values()){
|
||||
|
||||
@@ -5,8 +5,6 @@ import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Ordering;
|
||||
|
||||
import electroblob.wizardry.item.ItemScroll;
|
||||
import electroblob.wizardry.item.ItemSpellBook;
|
||||
import electroblob.wizardry.spell.Spell;
|
||||
@@ -44,6 +42,7 @@ public final class WizardryTabs {
|
||||
Collections.sort(items, itemSorter);
|
||||
}
|
||||
};
|
||||
|
||||
public static final CreativeTabs SPELLS = new CreativeTabs("ebwizardryspells"){
|
||||
|
||||
@Override
|
||||
@@ -103,7 +102,14 @@ public final class WizardryTabs {
|
||||
WizardryItems.wizard_boots_sorcery, WizardryItems.wizard_hat_healing, WizardryItems.wizard_robe_healing,
|
||||
WizardryItems.wizard_leggings_healing, WizardryItems.wizard_boots_healing);
|
||||
|
||||
itemSorter = Ordering.explicit(orderedItemList).onResultOf(ItemStack::getItem);
|
||||
itemSorter = (stack1, stack2) -> {
|
||||
// Neither stack is in the creative tab
|
||||
if(!orderedItemList.contains(stack1.getItem()) && !orderedItemList.contains(stack2.getItem())) return 0;
|
||||
if(!orderedItemList.contains(stack1.getItem())) return 1; // Only stack 2 is in the creative tab
|
||||
if(!orderedItemList.contains(stack2.getItem())) return -1; // Only stack 1 is in the creative tab
|
||||
// Both stacks are in the creative tab
|
||||
return orderedItemList.indexOf(stack1.getItem()) - orderedItemList.indexOf(stack2.getItem());
|
||||
};
|
||||
|
||||
spellItemSorter = (stack1, stack2) -> {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user