Add advancements for library update features
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package electroblob.wizardry.block;
|
||||
|
||||
import electroblob.wizardry.item.ItemWizardArmour;
|
||||
import electroblob.wizardry.registry.WizardryAdvancementTriggers;
|
||||
import electroblob.wizardry.registry.WizardryBlocks;
|
||||
import electroblob.wizardry.registry.WizardryTabs;
|
||||
import electroblob.wizardry.tileentity.TileEntityArcaneWorkbench;
|
||||
@@ -148,6 +150,11 @@ public class BlockImbuementAltar extends Block implements ITileEntityProvider {
|
||||
}
|
||||
|
||||
((TileEntityImbuementAltar)tileEntity).setStack(ItemStack.EMPTY);
|
||||
|
||||
if(currentStack.getItem() instanceof ItemWizardArmour && ((ItemWizardArmour)currentStack.getItem()).element != null){
|
||||
// Not perfect since we don't know if the player actually imbued the armour, but it's good enough for now
|
||||
WizardryAdvancementTriggers.create_elemental_armour.triggerFor(player);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -3,9 +3,7 @@ package electroblob.wizardry.block;
|
||||
import com.google.common.collect.Maps;
|
||||
import electroblob.wizardry.constants.Element;
|
||||
import electroblob.wizardry.item.ItemSpectralDust;
|
||||
import electroblob.wizardry.registry.WizardryItems;
|
||||
import electroblob.wizardry.registry.WizardrySounds;
|
||||
import electroblob.wizardry.registry.WizardryTabs;
|
||||
import electroblob.wizardry.registry.*;
|
||||
import electroblob.wizardry.tileentity.TileEntityReceptacle;
|
||||
import electroblob.wizardry.util.GeometryUtils;
|
||||
import electroblob.wizardry.util.ParticleBuilder;
|
||||
@@ -13,6 +11,7 @@ import net.minecraft.block.BlockTorch;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -27,6 +26,7 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
@@ -200,6 +200,17 @@ public class BlockReceptacle extends BlockTorch implements ITileEntityProvider {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack){
|
||||
if(placer instanceof EntityPlayer){
|
||||
BlockPos centre = pos.offset(world.getBlockState(pos).getValue(FACING).getOpposite());
|
||||
if(world.getBlockState(centre).getBlock() == WizardryBlocks.imbuement_altar
|
||||
&& Arrays.stream(EnumFacing.HORIZONTALS).allMatch(f -> world.getBlockState(centre.offset(f)).getBlock() == WizardryBlocks.receptacle)){
|
||||
WizardryAdvancementTriggers.restore_imbuement_altar.triggerFor((EntityPlayer)placer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta){
|
||||
|
||||
@@ -25,6 +25,8 @@ public final class WizardryAdvancementTriggers {
|
||||
public static final CustomAdvancementTrigger wizard_trade = new CustomAdvancementTrigger("trigger_wizard_trade");
|
||||
public static final CustomAdvancementTrigger spell_failure = new CustomAdvancementTrigger("trigger_spell_failure");
|
||||
public static final CustomAdvancementTrigger wand_levelup = new CustomAdvancementTrigger("trigger_wand_levelup");
|
||||
public static final CustomAdvancementTrigger restore_imbuement_altar = new CustomAdvancementTrigger("restore_imbuement_altar");
|
||||
public static final CustomAdvancementTrigger create_elemental_armour = new CustomAdvancementTrigger("create_elemental_armour");
|
||||
|
||||
public static final StructureTrigger visit_structure = new StructureTrigger(new ResourceLocation(Wizardry.MODID, "visit_structure"));
|
||||
public static final ArcaneWorkbenchTrigger arcane_workbench = new ArcaneWorkbenchTrigger(new ResourceLocation(Wizardry.MODID, "arcane_workbench"));
|
||||
@@ -41,6 +43,8 @@ public final class WizardryAdvancementTriggers {
|
||||
CriteriaTriggers.register(wizard_trade);
|
||||
CriteriaTriggers.register(spell_failure);
|
||||
CriteriaTriggers.register(wand_levelup);
|
||||
CriteriaTriggers.register(restore_imbuement_altar);
|
||||
CriteriaTriggers.register(create_elemental_armour);
|
||||
|
||||
CriteriaTriggers.register(visit_structure);
|
||||
CriteriaTriggers.register(arcane_workbench);
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"display": {
|
||||
"title": {
|
||||
"translate": "advancement.ebwizardry:craft_lectern"
|
||||
},
|
||||
"description": {
|
||||
"translate": "advancement.ebwizardry:craft_lectern.desc"
|
||||
},
|
||||
"icon": {
|
||||
"item": "ebwizardry:spruce_lectern"
|
||||
}
|
||||
},
|
||||
"parent": "ebwizardry:find_library_ruins",
|
||||
"criteria": {
|
||||
"oak": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "ebwizardry:oak_lectern"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"spruce": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "ebwizardry:spruce_lectern"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"birch": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "ebwizardry:birch_lectern"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"jungle": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "ebwizardry:jungle_lectern"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"acacia": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "ebwizardry:acacia_lectern"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"dark_oak": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "ebwizardry:dark_oak_lectern"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"oak",
|
||||
"spruce",
|
||||
"birch",
|
||||
"jungle",
|
||||
"acacia",
|
||||
"dark_oak"
|
||||
]
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"display": {
|
||||
"title": {
|
||||
"translate": "advancement.ebwizardry:create_elemental_armour"
|
||||
},
|
||||
"description": {
|
||||
"translate": "advancement.ebwizardry:create_elemental_armour.desc"
|
||||
},
|
||||
"icon": {
|
||||
"item": "ebwizardry:wizard_hat_lightning"
|
||||
}
|
||||
},
|
||||
"parent": "ebwizardry:restore_imbuement_altar",
|
||||
"criteria": {
|
||||
"criteria_0": {
|
||||
"trigger": "ebwizardry:create_elemental_armour"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
{
|
||||
"display": {
|
||||
"title": {
|
||||
"translate": "advancement.ebwizardry:defeat_remnant"
|
||||
},
|
||||
"description": {
|
||||
"translate": "advancement.ebwizardry:defeat_remnant.desc"
|
||||
},
|
||||
"icon": {
|
||||
"item": "ebwizardry:spectral_dust",
|
||||
"data": 6
|
||||
}
|
||||
},
|
||||
"parent": "ebwizardry:arcane_initiate",
|
||||
"criteria": {
|
||||
"fire": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "ebwizardry:spectral_dust",
|
||||
"data": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"ice": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "ebwizardry:spectral_dust",
|
||||
"data": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"lightning": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "ebwizardry:spectral_dust",
|
||||
"data": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"necromancy": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "ebwizardry:spectral_dust",
|
||||
"data": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"earth": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "ebwizardry:spectral_dust",
|
||||
"data": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sorcery": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "ebwizardry:spectral_dust",
|
||||
"data": 6
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"healing": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "ebwizardry:spectral_dust",
|
||||
"data": 7
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"fire",
|
||||
"ice",
|
||||
"lightning",
|
||||
"necromancy",
|
||||
"earth",
|
||||
"sorcery",
|
||||
"healing"
|
||||
]
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"display": {
|
||||
"title": {
|
||||
"translate": "advancement.ebwizardry:find_library_ruins"
|
||||
},
|
||||
"description": {
|
||||
"translate": "advancement.ebwizardry:find_library_ruins.desc"
|
||||
},
|
||||
"icon": {
|
||||
"item": "ebwizardry:spruce_bookshelf"
|
||||
}
|
||||
},
|
||||
"parent": "ebwizardry:defeat_remnant",
|
||||
"criteria": {
|
||||
"surface": {
|
||||
"trigger": "ebwizardry:visit_structure",
|
||||
"conditions": {
|
||||
"structure_type": "library_ruins"
|
||||
}
|
||||
},
|
||||
"underground": {
|
||||
"trigger": "ebwizardry:visit_structure",
|
||||
"conditions": {
|
||||
"structure_type": "underground_library_ruins"
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"surface",
|
||||
"underground"
|
||||
]
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"display": {
|
||||
"title": {
|
||||
"translate": "advancement.ebwizardry:restore_imbuement_altar"
|
||||
},
|
||||
"description": {
|
||||
"translate": "advancement.ebwizardry:restore_imbuement_altar.desc"
|
||||
},
|
||||
"icon": {
|
||||
"item": "ebwizardry:imbuement_altar"
|
||||
}
|
||||
},
|
||||
"parent": "ebwizardry:find_library_ruins",
|
||||
"criteria": {
|
||||
"criteria_0": {
|
||||
"trigger": "ebwizardry:restore_imbuement_altar"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -678,7 +678,18 @@ advancement.ebwizardry\:artefact.desc=Lift the protective enchantments from a sh
|
||||
advancement.ebwizardry\:all_artefacts=A Veritable Museum
|
||||
advancement.ebwizardry\:all_artefacts.desc=Collect all of the rings, amulets and charms
|
||||
|
||||
advancement.ebwizardry\:armour_set=Now You're a Proper Wizard
|
||||
advancement.ebwizardry\:defeat_remnant=Dust Off Your Arrows
|
||||
advancement.ebwizardry\:defeat_remnant.desc=Hunt down the remnants guarding an obelisk and collect their spectral dust
|
||||
advancement.ebwizardry\:find_library_ruins=I Think My Books Are Overdue
|
||||
advancement.ebwizardry\:find_library_ruins.desc=Uncover the ruins of a forgotten library
|
||||
advancement.ebwizardry\:restore_imbuement_altar=Good As New
|
||||
advancement.ebwizardry\:restore_imbuement_altar.desc=Restore an imbuement altar to its former glory
|
||||
advancement.ebwizardry\:create_elemental_armour=Changing Clothes
|
||||
advancement.ebwizardry\:create_elemental_armour.desc=Imbue a piece of wizard armour with the power of one of the arcane elements
|
||||
advancement.ebwizardry\:craft_lectern=Arcane Encyclopaedia
|
||||
advancement.ebwizardry\:craft_lectern.desc=Craft a lectern to keep track of your spell library
|
||||
|
||||
advancement.ebwizardry\:armour_set=Now You're A Proper Wizard
|
||||
advancement.ebwizardry\:armour_set.desc=Craft and equip a full set of wizard armour
|
||||
advancement.ebwizardry\:legendary=Legendary
|
||||
advancement.ebwizardry\:legendary.desc=Obtain a piece of legendary wizard armour
|
||||
|
||||
@@ -678,7 +678,18 @@ advancement.ebwizardry\:artefact.desc=Lift the protective enchantments from a sh
|
||||
advancement.ebwizardry\:all_artefacts=A Veritable Museum
|
||||
advancement.ebwizardry\:all_artefacts.desc=Collect all of the rings, amulets and charms
|
||||
|
||||
advancement.ebwizardry\:armour_set=Now You're a Proper Wizard
|
||||
advancement.ebwizardry\:defeat_remnant=Dust Off Your Arrows
|
||||
advancement.ebwizardry\:defeat_remnant.desc=Hunt down the remnants guarding an obelisk and collect their spectral dust
|
||||
advancement.ebwizardry\:find_library_ruins=I Think My Books Are Overdue
|
||||
advancement.ebwizardry\:find_library_ruins.desc=Uncover the ruins of a forgotten library
|
||||
advancement.ebwizardry\:restore_imbuement_altar=Good As New
|
||||
advancement.ebwizardry\:restore_imbuement_altar.desc=Restore an imbuement altar to its former glory
|
||||
advancement.ebwizardry\:create_elemental_armour=Changing Clothes
|
||||
advancement.ebwizardry\:create_elemental_armour.desc=Imbue a piece of wizard armor with the power of one of the arcane elements
|
||||
advancement.ebwizardry\:craft_lectern=Arcane Encyclopedia
|
||||
advancement.ebwizardry\:craft_lectern.desc=Craft a lectern to keep track of your spell library
|
||||
|
||||
advancement.ebwizardry\:armour_set=Now You're A Proper Wizard
|
||||
advancement.ebwizardry\:armour_set.desc=Craft and equip a full set of wizard armor
|
||||
advancement.ebwizardry\:legendary=Legendary
|
||||
advancement.ebwizardry\:legendary.desc=Obtain a piece of legendary wizard armor
|
||||
|
||||
Reference in New Issue
Block a user