Merge branch '1.12.2-dev' into 1.12.2
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
package electroblob.wizardry.registry;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.entity.construct.*;
|
||||
import electroblob.wizardry.entity.living.*;
|
||||
import electroblob.wizardry.entity.projectile.*;
|
||||
import electroblob.wizardry.spell.*;
|
||||
import net.minecraft.init.MobEffects;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
@@ -10,29 +15,26 @@ import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
import net.minecraftforge.registries.RegistryBuilder;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* Class responsible for defining, storing and registering all of wizardry's spells.
|
||||
* Class responsible for defining, storing and registering all of wizardry's spells. Use this to access individual
|
||||
* spell instances, similar to the {@code Blocks} and {@code Items} classes.
|
||||
*
|
||||
* @author Electroblob
|
||||
* @since Wizardry 2.1
|
||||
*/
|
||||
// In case anyone was wondering, the reason @ObjectHolder is useful within one mod is that it allows you to initialise
|
||||
// stuff during the registry events (or whenever), whilst still having a final field (which is important, not only
|
||||
// because it makes the text go bold, but also because it stops anyone fiddling with your fields). "Why would I want to
|
||||
// initialise things within the registry events?", I hear you ask - well, for one, custom registries don't like it if
|
||||
// you haven't created the registry before you start calling constructors of classes extending IForgeRegistryEntry.Impl,
|
||||
// and secondly, you might want to initialise objects based on certain conditions - perhaps a config option, or whether
|
||||
// another mod is installed. This, presumably, is why everyone at forge is encouraging us to use @ObjectHolder.
|
||||
@ObjectHolder(Wizardry.MODID)
|
||||
@Mod.EventBusSubscriber
|
||||
public final class Spells {
|
||||
|
||||
private Spells(){} // No instances!
|
||||
|
||||
// This is here because this class is already an event handler.
|
||||
@SubscribeEvent
|
||||
public static void createRegistry(RegistryEvent.NewRegistry event){
|
||||
|
||||
// Beats me why we need both of these. Surely the type parameter means it already knows?
|
||||
RegistryBuilder<Spell> builder = new RegistryBuilder<Spell>();
|
||||
RegistryBuilder<Spell> builder = new RegistryBuilder<>();
|
||||
builder.setType(Spell.class);
|
||||
builder.setName(new ResourceLocation(Wizardry.MODID, "spells"));
|
||||
builder.setIDRange(0, 5000); // Is there any penalty for using a larger number?
|
||||
@@ -40,194 +42,235 @@ public final class Spells {
|
||||
Spell.registry = builder.create();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
private static <T> T placeholder(){ return null; }
|
||||
|
||||
// Wizardry 1.0 spells
|
||||
|
||||
public static final Spell none = null;
|
||||
public static final Spell magic_missile = null;
|
||||
public static final Spell ignite = null;
|
||||
public static final Spell freeze = null;
|
||||
public static final Spell snowball = null;
|
||||
public static final Spell arc = null;
|
||||
public static final Spell thunderbolt = null;
|
||||
public static final Spell summon_zombie = null;
|
||||
public static final Spell snare = null;
|
||||
public static final Spell dart = null;
|
||||
public static final Spell light = null;
|
||||
public static final Spell telekinesis = null;
|
||||
public static final Spell heal = null;
|
||||
public static final Spell none = placeholder();
|
||||
public static final Spell magic_missile = placeholder();
|
||||
public static final Spell ignite = placeholder();
|
||||
public static final Spell freeze = placeholder();
|
||||
public static final Spell snowball = placeholder();
|
||||
public static final Spell arc = placeholder();
|
||||
public static final Spell thunderbolt = placeholder();
|
||||
public static final Spell summon_zombie = placeholder();
|
||||
public static final Spell snare = placeholder();
|
||||
public static final Spell dart = placeholder();
|
||||
public static final Spell light = placeholder();
|
||||
public static final Spell telekinesis = placeholder();
|
||||
public static final Spell heal = placeholder();
|
||||
|
||||
public static final Spell fireball = null;
|
||||
public static final Spell flame_ray = null;
|
||||
public static final Spell firebomb = null;
|
||||
public static final Spell fire_sigil = null;
|
||||
public static final Spell firebolt = null;
|
||||
public static final Spell frost_ray = null;
|
||||
public static final Spell summon_snow_golem = null;
|
||||
public static final Spell ice_shard = null;
|
||||
public static final Spell ice_statue = null;
|
||||
public static final Spell frost_sigil = null;
|
||||
public static final Spell lightning_ray = null;
|
||||
public static final Spell spark_bomb = null;
|
||||
public static final Spell homing_spark = null;
|
||||
public static final Spell lightning_sigil = null;
|
||||
public static final Spell lightning_arrow = null;
|
||||
public static final Spell life_drain = null;
|
||||
public static final Spell summon_skeleton = null;
|
||||
public static final Spell metamorphosis = null;
|
||||
public static final Spell wither = null;
|
||||
public static final Spell poison = null;
|
||||
public static final Spell growth_aura = null;
|
||||
public static final Spell bubble = null;
|
||||
public static final Spell whirlwind = null;
|
||||
public static final Spell poison_bomb = null;
|
||||
public static final Spell summon_spirit_wolf = null;
|
||||
public static final Spell blink = null;
|
||||
public static final Spell agility = null;
|
||||
public static final Spell conjure_sword = null;
|
||||
public static final Spell conjure_pickaxe = null;
|
||||
public static final Spell conjure_bow = null;
|
||||
public static final Spell force_arrow = null;
|
||||
public static final Spell shield = null;
|
||||
public static final Spell replenish_hunger = null;
|
||||
public static final Spell cure_effects = null;
|
||||
public static final Spell heal_ally = null;
|
||||
public static final Spell fireball = placeholder();
|
||||
public static final Spell flame_ray = placeholder();
|
||||
public static final Spell firebomb = placeholder();
|
||||
public static final Spell fire_sigil = placeholder();
|
||||
public static final Spell firebolt = placeholder();
|
||||
public static final Spell frost_ray = placeholder();
|
||||
public static final Spell summon_snow_golem = placeholder();
|
||||
public static final Spell ice_shard = placeholder();
|
||||
public static final Spell ice_statue = placeholder();
|
||||
public static final Spell frost_sigil = placeholder();
|
||||
public static final Spell lightning_ray = placeholder();
|
||||
public static final Spell spark_bomb = placeholder();
|
||||
public static final Spell homing_spark = placeholder();
|
||||
public static final Spell lightning_sigil = placeholder();
|
||||
public static final Spell lightning_arrow = placeholder();
|
||||
public static final Spell life_drain = placeholder();
|
||||
public static final Spell summon_skeleton = placeholder();
|
||||
public static final Spell metamorphosis = placeholder();
|
||||
public static final Spell wither = placeholder();
|
||||
public static final Spell poison = placeholder();
|
||||
public static final Spell growth_aura = placeholder();
|
||||
public static final Spell bubble = placeholder();
|
||||
public static final Spell whirlwind = placeholder();
|
||||
public static final Spell poison_bomb = placeholder();
|
||||
public static final Spell summon_spirit_wolf = placeholder();
|
||||
public static final Spell blink = placeholder();
|
||||
public static final Spell agility = placeholder();
|
||||
public static final Spell conjure_sword = placeholder();
|
||||
public static final Spell conjure_pickaxe = placeholder();
|
||||
public static final Spell conjure_bow = placeholder();
|
||||
public static final Spell force_arrow = placeholder();
|
||||
public static final Spell shield = placeholder();
|
||||
public static final Spell replenish_hunger = placeholder();
|
||||
public static final Spell cure_effects = placeholder();
|
||||
public static final Spell heal_ally = placeholder();
|
||||
|
||||
public static final Spell summon_blaze = null;
|
||||
public static final Spell ring_of_fire = null;
|
||||
public static final Spell detonate = null;
|
||||
public static final Spell fire_resistance = null;
|
||||
public static final Spell fireskin = null;
|
||||
public static final Spell flaming_axe = null;
|
||||
public static final Spell blizzard = null;
|
||||
public static final Spell summon_ice_wraith = null;
|
||||
public static final Spell ice_shroud = null;
|
||||
public static final Spell ice_charge = null;
|
||||
public static final Spell frost_axe = null;
|
||||
public static final Spell invoke_weather = null;
|
||||
public static final Spell chain_lightning = null;
|
||||
public static final Spell lightning_bolt = null;
|
||||
public static final Spell summon_lightning_wraith = null;
|
||||
public static final Spell static_aura = null;
|
||||
public static final Spell lightning_disc = null;
|
||||
public static final Spell mind_control = null;
|
||||
public static final Spell summon_wither_skeleton = null;
|
||||
public static final Spell entrapment = null;
|
||||
public static final Spell wither_skull = null;
|
||||
public static final Spell darkness_orb = null;
|
||||
public static final Spell shadow_ward = null;
|
||||
public static final Spell decay = null;
|
||||
public static final Spell water_breathing = null;
|
||||
public static final Spell tornado = null;
|
||||
public static final Spell glide = null;
|
||||
public static final Spell summon_spirit_horse = null;
|
||||
public static final Spell spider_swarm = null;
|
||||
public static final Spell slime = null;
|
||||
public static final Spell petrify = null;
|
||||
public static final Spell invisibility = null;
|
||||
public static final Spell levitation = null;
|
||||
public static final Spell force_orb = null;
|
||||
public static final Spell transportation = null;
|
||||
public static final Spell spectral_pathway = null;
|
||||
public static final Spell phase_step = null;
|
||||
public static final Spell vanishing_box = null;
|
||||
public static final Spell greater_heal = null;
|
||||
public static final Spell healing_aura = null;
|
||||
public static final Spell forcefield = null;
|
||||
public static final Spell ironflesh = null;
|
||||
public static final Spell transience = null;
|
||||
public static final Spell summon_blaze = placeholder();
|
||||
public static final Spell ring_of_fire = placeholder();
|
||||
public static final Spell detonate = placeholder();
|
||||
public static final Spell fire_resistance = placeholder();
|
||||
public static final Spell fireskin = placeholder();
|
||||
public static final Spell flaming_axe = placeholder();
|
||||
public static final Spell blizzard = placeholder();
|
||||
public static final Spell summon_ice_wraith = placeholder();
|
||||
public static final Spell ice_shroud = placeholder();
|
||||
public static final Spell ice_charge = placeholder();
|
||||
public static final Spell frost_axe = placeholder();
|
||||
public static final Spell invoke_weather = placeholder();
|
||||
public static final Spell chain_lightning = placeholder();
|
||||
public static final Spell lightning_bolt = placeholder();
|
||||
public static final Spell summon_lightning_wraith = placeholder();
|
||||
public static final Spell static_aura = placeholder();
|
||||
public static final Spell lightning_disc = placeholder();
|
||||
public static final Spell mind_control = placeholder();
|
||||
public static final Spell summon_wither_skeleton = placeholder();
|
||||
public static final Spell entrapment = placeholder();
|
||||
public static final Spell wither_skull = placeholder();
|
||||
public static final Spell darkness_orb = placeholder();
|
||||
public static final Spell shadow_ward = placeholder();
|
||||
public static final Spell decay = placeholder();
|
||||
public static final Spell water_breathing = placeholder();
|
||||
public static final Spell tornado = placeholder();
|
||||
public static final Spell glide = placeholder();
|
||||
public static final Spell summon_spirit_horse = placeholder();
|
||||
public static final Spell spider_swarm = placeholder();
|
||||
public static final Spell slime = placeholder();
|
||||
public static final Spell petrify = placeholder();
|
||||
public static final Spell invisibility = placeholder();
|
||||
public static final Spell levitation = placeholder();
|
||||
public static final Spell force_orb = placeholder();
|
||||
public static final Spell transportation = placeholder();
|
||||
public static final Spell spectral_pathway = placeholder();
|
||||
public static final Spell phase_step = placeholder();
|
||||
public static final Spell vanishing_box = placeholder();
|
||||
public static final Spell greater_heal = placeholder();
|
||||
public static final Spell healing_aura = placeholder();
|
||||
public static final Spell forcefield = placeholder();
|
||||
public static final Spell ironflesh = placeholder();
|
||||
public static final Spell transience = placeholder();
|
||||
|
||||
public static final Spell meteor = null;
|
||||
public static final Spell firestorm = null;
|
||||
public static final Spell summon_phoenix = null;
|
||||
public static final Spell ice_age = null;
|
||||
public static final Spell wall_of_frost = null;
|
||||
public static final Spell summon_ice_giant = null;
|
||||
public static final Spell thunderstorm = null;
|
||||
public static final Spell lightning_hammer = null;
|
||||
public static final Spell plague_of_darkness = null;
|
||||
public static final Spell summon_skeleton_legion = null;
|
||||
public static final Spell summon_shadow_wraith = null;
|
||||
public static final Spell forests_curse = null;
|
||||
public static final Spell flight = null;
|
||||
public static final Spell silverfish_swarm = null;
|
||||
public static final Spell black_hole = null;
|
||||
public static final Spell shockwave = null;
|
||||
public static final Spell summon_iron_golem = null;
|
||||
public static final Spell arrow_rain = null;
|
||||
public static final Spell diamondflesh = null;
|
||||
public static final Spell font_of_vitality = null;
|
||||
public static final Spell meteor = placeholder();
|
||||
public static final Spell fire_breath = placeholder();
|
||||
public static final Spell summon_phoenix = placeholder();
|
||||
public static final Spell ice_age = placeholder();
|
||||
public static final Spell wall_of_frost = placeholder();
|
||||
public static final Spell summon_ice_giant = placeholder();
|
||||
public static final Spell thunderstorm = placeholder();
|
||||
public static final Spell lightning_hammer = placeholder();
|
||||
public static final Spell plague_of_darkness = placeholder();
|
||||
public static final Spell summon_skeleton_legion = placeholder();
|
||||
public static final Spell summon_shadow_wraith = placeholder();
|
||||
public static final Spell forests_curse = placeholder();
|
||||
public static final Spell flight = placeholder();
|
||||
public static final Spell silverfish_swarm = placeholder();
|
||||
public static final Spell black_hole = placeholder();
|
||||
public static final Spell shockwave = placeholder();
|
||||
public static final Spell summon_iron_golem = placeholder();
|
||||
public static final Spell arrow_rain = placeholder();
|
||||
public static final Spell diamondflesh = placeholder();
|
||||
public static final Spell font_of_vitality = placeholder();
|
||||
|
||||
// Wizardry 1.1 spells
|
||||
|
||||
public static final Spell smoke_bomb = null;
|
||||
public static final Spell mind_trick = null;
|
||||
public static final Spell leap = null;
|
||||
public static final Spell smoke_bomb = placeholder();
|
||||
public static final Spell mind_trick = placeholder();
|
||||
public static final Spell leap = placeholder();
|
||||
|
||||
public static final Spell pocket_furnace = null;
|
||||
public static final Spell intimidate = null;
|
||||
public static final Spell banish = null;
|
||||
public static final Spell sixth_sense = null;
|
||||
public static final Spell darkvision = null;
|
||||
public static final Spell clairvoyance = null;
|
||||
public static final Spell pocket_workbench = null;
|
||||
public static final Spell imbue_weapon = null;
|
||||
public static final Spell invigorating_presence = null;
|
||||
public static final Spell oakflesh = null;
|
||||
public static final Spell pocket_furnace = placeholder();
|
||||
public static final Spell intimidate = placeholder();
|
||||
public static final Spell banish = placeholder();
|
||||
public static final Spell sixth_sense = placeholder();
|
||||
public static final Spell darkvision = placeholder();
|
||||
public static final Spell clairvoyance = placeholder();
|
||||
public static final Spell pocket_workbench = placeholder();
|
||||
public static final Spell imbue_weapon = placeholder();
|
||||
public static final Spell invigorating_presence = placeholder();
|
||||
public static final Spell oakflesh = placeholder();
|
||||
|
||||
public static final Spell greater_fireball = null;
|
||||
public static final Spell flaming_weapon = null;
|
||||
public static final Spell ice_lance = null;
|
||||
public static final Spell freezing_weapon = null;
|
||||
public static final Spell ice_spikes = null;
|
||||
public static final Spell lightning_pulse = null;
|
||||
public static final Spell curse_of_soulbinding = null;
|
||||
public static final Spell cobwebs = null;
|
||||
public static final Spell decoy = null;
|
||||
public static final Spell arcane_jammer = null;
|
||||
public static final Spell conjure_armour = null;
|
||||
public static final Spell group_heal = null;
|
||||
public static final Spell greater_fireball = placeholder();
|
||||
public static final Spell flaming_weapon = placeholder();
|
||||
public static final Spell ice_lance = placeholder();
|
||||
public static final Spell freezing_weapon = placeholder();
|
||||
public static final Spell ice_spikes = placeholder();
|
||||
public static final Spell lightning_pulse = placeholder();
|
||||
public static final Spell curse_of_soulbinding = placeholder();
|
||||
public static final Spell cobwebs = placeholder();
|
||||
public static final Spell decoy = placeholder();
|
||||
public static final Spell arcane_jammer = placeholder();
|
||||
public static final Spell conjure_armour = placeholder();
|
||||
public static final Spell group_heal = placeholder();
|
||||
|
||||
public static final Spell hailstorm = null;
|
||||
public static final Spell lightning_web = null;
|
||||
public static final Spell summon_storm_elemental = null;
|
||||
public static final Spell earthquake = null;
|
||||
public static final Spell font_of_mana = null;
|
||||
public static final Spell hailstorm = placeholder();
|
||||
public static final Spell lightning_web = placeholder();
|
||||
public static final Spell summon_storm_elemental = placeholder();
|
||||
public static final Spell earthquake = placeholder();
|
||||
public static final Spell font_of_mana = placeholder();
|
||||
|
||||
// Wizardry 4.2 spells
|
||||
|
||||
public static final Spell mine = placeholder();
|
||||
public static final Spell conjure_block = placeholder();
|
||||
public static final Spell muffle = placeholder();
|
||||
public static final Spell ward = placeholder();
|
||||
public static final Spell evade = placeholder();
|
||||
|
||||
public static final Spell iceball = placeholder();
|
||||
public static final Spell charge = placeholder();
|
||||
public static final Spell reversal = placeholder();
|
||||
public static final Spell grapple = placeholder();
|
||||
public static final Spell divination = placeholder();
|
||||
public static final Spell empowering_presence = placeholder();
|
||||
|
||||
public static final Spell disintegration = placeholder();
|
||||
public static final Spell combustion_rune = placeholder();
|
||||
public static final Spell frost_step = placeholder();
|
||||
public static final Spell paralysis = placeholder();
|
||||
public static final Spell shulker_bullet = placeholder();
|
||||
public static final Spell curse_of_undeath = placeholder();
|
||||
public static final Spell dragon_fireball = placeholder();
|
||||
public static final Spell greater_telekinesis = placeholder();
|
||||
public static final Spell vex_swarm = placeholder();
|
||||
public static final Spell arcane_lock = placeholder();
|
||||
public static final Spell containment = placeholder();
|
||||
public static final Spell satiety = placeholder();
|
||||
public static final Spell greater_ward = placeholder();
|
||||
public static final Spell ray_of_purification = placeholder();
|
||||
public static final Spell remove_curse = placeholder();
|
||||
|
||||
public static final Spell possession = placeholder();
|
||||
public static final Spell curse_of_enfeeblement = placeholder();
|
||||
public static final Spell forest_of_thorns = placeholder();
|
||||
public static final Spell speed_time = placeholder();
|
||||
public static final Spell slow_time = placeholder();
|
||||
public static final Spell resurrection = placeholder();
|
||||
|
||||
@SubscribeEvent
|
||||
public static void register(RegistryEvent.Register<Spell> event){
|
||||
|
||||
IForgeRegistry<Spell> registry = event.getRegistry();
|
||||
|
||||
// event.getRegistry should always equal Spell.registry.
|
||||
registry.register(new None());
|
||||
registry.register(new MagicMissile());
|
||||
registry.register(new SpellArrow<>("magic_missile", EntityMagicMissile::new).addProperties(Spell.DAMAGE).soundValues(1, 1.4f, 0.4f));
|
||||
registry.register(new Ignite());
|
||||
registry.register(new Freeze());
|
||||
registry.register(new Snowball());
|
||||
registry.register(new Arc());
|
||||
registry.register(new Thunderbolt());
|
||||
registry.register(new SpellProjectile<>("thunderbolt", EntityThunderbolt::new).addProperties(Spell.DAMAGE, EntityThunderbolt.KNOCKBACK_STRENGTH).soundValues(0.8f, 0.9f, 0.2f));
|
||||
registry.register(new SummonZombie());
|
||||
registry.register(new Snare());
|
||||
registry.register(new Dart());
|
||||
registry.register(new SpellArrow<>("dart", EntityDart::new).addProperties(Spell.DAMAGE, Spell.EFFECT_DURATION, Spell.EFFECT_STRENGTH).soundValues(0.5f, 0.4f, 0.2f));
|
||||
registry.register(new Light());
|
||||
registry.register(new Telekinesis());
|
||||
registry.register(new Heal());
|
||||
|
||||
registry.register(new Fireball());
|
||||
registry.register(new SpellProjectile<>("fireball", EntityMagicFireball::new).addProperties(Spell.DAMAGE, Spell.BURN_DURATION));//new Fireball());
|
||||
registry.register(new FlameRay());
|
||||
registry.register(new Firebomb());
|
||||
registry.register(new FireSigil());
|
||||
registry.register(new Firebolt());
|
||||
registry.register(new SpellProjectile<>("firebomb", EntityFirebomb::new).addProperties(Spell.DIRECT_DAMAGE, Spell.SPLASH_DAMAGE, Spell.BLAST_RADIUS, Spell.BURN_DURATION).soundValues(0.5f, 0.4f, 0.2f));
|
||||
registry.register(new SpellConstructRanged<>("fire_sigil", EntityFireSigil::new, true).floor(true).addProperties(Spell.DAMAGE, Spell.BURN_DURATION));
|
||||
registry.register(new SpellProjectile<>("firebolt", EntityFirebolt::new).addProperties(Spell.DAMAGE, Spell.BURN_DURATION));
|
||||
registry.register(new FrostRay());
|
||||
registry.register(new SummonSnowGolem());
|
||||
registry.register(new IceShard());
|
||||
registry.register(new SpellArrow<>("ice_shard", EntityIceShard::new).addProperties(Spell.DAMAGE, Spell.EFFECT_DURATION, Spell.EFFECT_STRENGTH).soundValues(1, 1.6f, 0.4f));
|
||||
registry.register(new IceStatue());
|
||||
registry.register(new FrostSigil());
|
||||
registry.register(new SpellConstructRanged<>("frost_sigil", EntityFrostSigil::new, true).floor(true).addProperties(Spell.DAMAGE, Spell.EFFECT_DURATION, Spell.EFFECT_STRENGTH));
|
||||
registry.register(new LightningRay());
|
||||
registry.register(new SparkBomb());
|
||||
registry.register(new HomingSpark());
|
||||
registry.register(new LightningSigil());
|
||||
registry.register(new LightningArrow());
|
||||
registry.register(new SpellProjectile<>("spark_bomb", EntitySparkBomb::new).addProperties(Spell.DIRECT_DAMAGE, Spell.EFFECT_RADIUS, EntitySparkBomb.SECONDARY_MAX_TARGETS, Spell.SPLASH_DAMAGE).soundValues(0.5f, 0.4f, 0.2f));
|
||||
registry.register(new SpellProjectile<>("homing_spark", EntitySpark::new).addProperties(Spell.DAMAGE, Spell.SEEKING_STRENGTH).soundValues(1.0f, 0.4f, 0.2f));
|
||||
registry.register(new SpellConstructRanged<>("lightning_sigil", EntityLightningSigil::new, true).floor(true).addProperties(Spell.DIRECT_DAMAGE, Spell.EFFECT_RADIUS, EntityLightningSigil.SECONDARY_MAX_TARGETS, Spell.SPLASH_DAMAGE));
|
||||
registry.register(new SpellArrow<>("lightning_arrow", EntityLightningArrow::new).addProperties(Spell.DAMAGE).soundValues(1, 1.45f, 0.3f));
|
||||
registry.register(new LifeDrain());
|
||||
registry.register(new SummonSkeleton());
|
||||
registry.register(new Metamorphosis());
|
||||
@@ -236,69 +279,69 @@ public final class Spells {
|
||||
registry.register(new GrowthAura());
|
||||
registry.register(new Bubble());
|
||||
registry.register(new Whirlwind());
|
||||
registry.register(new PoisonBomb());
|
||||
registry.register(new SpellProjectile<>("poison_bomb", EntityPoisonBomb::new).addProperties(Spell.DIRECT_DAMAGE, Spell.EFFECT_RADIUS, Spell.DIRECT_EFFECT_DURATION, Spell.DIRECT_EFFECT_STRENGTH, Spell.SPLASH_DAMAGE, Spell.SPLASH_EFFECT_DURATION, Spell.SPLASH_EFFECT_STRENGTH).soundValues(0.5f, 0.4f, 0.2f));
|
||||
registry.register(new SummonSpiritWolf());
|
||||
registry.register(new Blink());
|
||||
registry.register(new Agility());
|
||||
registry.register(new ConjureSword());
|
||||
registry.register(new ConjurePickaxe());
|
||||
registry.register(new ConjureBow());
|
||||
registry.register(new SpellBuff("agility", 0.4f, 1.0f, 0.8f, () -> MobEffects.SPEED, () -> MobEffects.JUMP_BOOST).soundValues(0.7f, 1.2f, 0.4f));
|
||||
registry.register(new SpellConjuration("conjure_sword", WizardryItems.spectral_sword));
|
||||
registry.register(new SpellConjuration("conjure_pickaxe", WizardryItems.spectral_pickaxe));
|
||||
registry.register(new SpellConjuration("conjure_bow", WizardryItems.spectral_bow));
|
||||
registry.register(new ForceArrow());
|
||||
registry.register(new Shield());
|
||||
registry.register(new ReplenishHunger());
|
||||
registry.register(new CureEffects());
|
||||
registry.register(new HealAlly());
|
||||
|
||||
registry.register(new SummonBlaze());
|
||||
registry.register(new RingOfFire());
|
||||
registry.register(new SpellMinion<>("summon_blaze", EntityBlazeMinion::new).soundValues(1, 1.1f, 0.2f));
|
||||
registry.register(new SpellConstruct<>("ring_of_fire", EnumAction.BOW, EntityFireRing::new, false).floor(true).addProperties(Spell.DAMAGE, Spell.BURN_DURATION));
|
||||
registry.register(new Detonate());
|
||||
registry.register(new FireResistance());
|
||||
registry.register(new Fireskin());
|
||||
registry.register(new SpellBuff("fire_resistance", 1, 0.5f, 0, () -> MobEffects.FIRE_RESISTANCE).soundValues(0.7f, 1.2f, 0.4f));
|
||||
registry.register(new SpellBuff("fireskin", 1, 0.5f, 0, () -> WizardryPotions.fireskin).addProperties(Spell.BURN_DURATION));
|
||||
registry.register(new FlamingAxe());
|
||||
registry.register(new Blizzard());
|
||||
registry.register(new SummonIceWraith());
|
||||
registry.register(new IceShroud());
|
||||
registry.register(new IceCharge());
|
||||
registry.register(new SpellConstructRanged<>("blizzard", EntityBlizzard::new, false).addProperties(Spell.EFFECT_RADIUS));
|
||||
registry.register(new SpellMinion<>("summon_ice_wraith", EntityIceWraith::new).soundValues(1, 1.1f, 0.2f));
|
||||
registry.register(new SpellBuff("ice_shroud", 0.3f, 0.5f, 1, () -> WizardryPotions.ice_shroud).addProperties(Spell.EFFECT_DURATION, Spell.EFFECT_STRENGTH).soundValues(1, 1.6f, 0.4f));
|
||||
registry.register(new SpellProjectile<>("ice_charge", EntityIceCharge::new).addProperties(Spell.DAMAGE, Spell.EFFECT_RADIUS, Spell.DIRECT_EFFECT_DURATION, Spell.DIRECT_EFFECT_STRENGTH, Spell.SPLASH_EFFECT_DURATION, Spell.SPLASH_EFFECT_STRENGTH, EntityIceCharge.ICE_SHARDS).soundValues(1, 1.6f, 0.4f));
|
||||
registry.register(new FrostAxe());
|
||||
registry.register(new InvokeWeather());
|
||||
registry.register(new ChainLightning());
|
||||
registry.register(new LightningBolt());
|
||||
registry.register(new SummonLightningWraith());
|
||||
registry.register(new StaticAura());
|
||||
registry.register(new LightningDisc());
|
||||
registry.register(new SpellMinion<>("summon_lightning_wraith", EntityLightningWraith::new).soundValues(1, 1.1f, 0.2f));
|
||||
registry.register(new SpellBuff("static_aura", 0, 0.5f, 0.7f, () -> WizardryPotions.static_aura).addProperties(Spell.DAMAGE).soundValues(1, 1.6f, 0.4f));
|
||||
registry.register(new SpellProjectile<>("lightning_disc", EntityLightningDisc::new).addProperties(Spell.DAMAGE, Spell.SEEKING_STRENGTH).soundValues(1, 0.95f, 0.3f));
|
||||
registry.register(new MindControl());
|
||||
registry.register(new SummonWitherSkeleton());
|
||||
registry.register(new Entrapment());
|
||||
registry.register(new WitherSkull());
|
||||
registry.register(new DarknessOrb());
|
||||
registry.register(new SpellProjectile<>("darkness_orb", EntityDarknessOrb::new).addProperties(Spell.DAMAGE, Spell.EFFECT_DURATION, Spell.EFFECT_STRENGTH).soundValues(0.5f, 0.4f, 0.2f));
|
||||
registry.register(new ShadowWard());
|
||||
registry.register(new Decay());
|
||||
registry.register(new WaterBreathing());
|
||||
registry.register(new SpellBuff("water_breathing", 0.3f, 0.3f, 1, () -> MobEffects.WATER_BREATHING){ @Override public boolean canBeCastByNPCs(){ return false; } }.soundValues(0.7f, 1.2f, 0.4f));
|
||||
registry.register(new Tornado());
|
||||
registry.register(new Glide());
|
||||
registry.register(new SummonSpiritHorse());
|
||||
registry.register(new SpiderSwarm());
|
||||
registry.register(new SpellMinion<>("spider_swarm", EntitySpiderMinion::new).soundValues(1, 1.1f, 0.1f));
|
||||
registry.register(new Slime());
|
||||
registry.register(new Petrify());
|
||||
registry.register(new Invisibility());
|
||||
registry.register(new SpellBuff("invisibility", 0.7f, 1, 1, () -> MobEffects.INVISIBILITY).soundValues(0.7f, 1.2f, 0.4f));
|
||||
registry.register(new Levitation());
|
||||
registry.register(new ForceOrb());
|
||||
registry.register(new SpellProjectile<>("force_orb", EntityForceOrb::new).addProperties(Spell.DAMAGE, Spell.BLAST_RADIUS).soundValues(0.5f, 0.4f, 0.2f));
|
||||
registry.register(new Transportation());
|
||||
registry.register(new SpectralPathway());
|
||||
registry.register(new PhaseStep());
|
||||
registry.register(new VanishingBox());
|
||||
registry.register(new GreaterHeal());
|
||||
registry.register(new HealingAura());
|
||||
registry.register(new SpellConstruct<>("healing_aura", EnumAction.BOW, EntityHealAura::new, false).addProperties(Spell.DAMAGE, Spell.HEALTH));
|
||||
registry.register(new Forcefield());
|
||||
registry.register(new Ironflesh());
|
||||
registry.register(new SpellBuff("ironflesh", 0.4f, 0.5f, 0.6f, () -> MobEffects.RESISTANCE).soundValues(0.7f, 1.2f, 0.4f));
|
||||
registry.register(new Transience());
|
||||
|
||||
registry.register(new Meteor());
|
||||
registry.register(new Firestorm());
|
||||
registry.register(new SummonPhoenix());
|
||||
registry.register(new FireBreath());
|
||||
registry.register(new SpellMinion<>("summon_phoenix", EntityPhoenix::new).flying(true).soundValues(1, 1.1f, 0.1f));
|
||||
registry.register(new IceAge());
|
||||
registry.register(new WallOfFrost());
|
||||
registry.register(new SummonIceGiant());
|
||||
registry.register(new SpellMinion<>("summon_ice_giant", EntityIceGiant::new).soundValues(1, 0.15f, 0.1f));
|
||||
registry.register(new Thunderstorm());
|
||||
registry.register(new LightningHammer());
|
||||
registry.register(new PlagueOfDarkness());
|
||||
@@ -306,17 +349,17 @@ public final class Spells {
|
||||
registry.register(new SummonShadowWraith());
|
||||
registry.register(new ForestsCurse());
|
||||
registry.register(new Flight());
|
||||
registry.register(new SilverfishSwarm());
|
||||
registry.register(new BlackHole());
|
||||
registry.register(new SpellMinion<>("silverfish_swarm", EntitySilverfishMinion::new).soundValues(1, 1.1f, 0.1f));
|
||||
registry.register(new SpellConstructRanged<>("black_hole", EntityBlackHole::new, false).soundValues(2, 0.7f, 0));
|
||||
registry.register(new Shockwave());
|
||||
registry.register(new SummonIronGolem());
|
||||
registry.register(new ArrowRain());
|
||||
registry.register(new Diamondflesh());
|
||||
registry.register(new FontOfVitality());
|
||||
registry.register(new SpellBuff("diamondflesh", 0.1f, 0.7f, 1, () -> MobEffects.RESISTANCE).soundValues(0.7f, 1.2f, 0.4f));
|
||||
registry.register(new SpellBuff("font_of_vitality", 1, 0.8f, 0.3f, () -> MobEffects.ABSORPTION, () -> MobEffects.REGENERATION).soundValues(0.7f, 1.2f, 0.4f));
|
||||
|
||||
// Wizardry 1.1 spells
|
||||
|
||||
registry.register(new SmokeBomb());
|
||||
registry.register(new SpellProjectile<>("smoke_bomb", EntitySmokeBomb::new).addProperties(Spell.BLAST_RADIUS, Spell.EFFECT_DURATION).soundValues(0.5f, 0.4f, 0.2f));
|
||||
registry.register(new MindTrick());
|
||||
registry.register(new Leap());
|
||||
|
||||
@@ -324,16 +367,16 @@ public final class Spells {
|
||||
registry.register(new Intimidate());
|
||||
registry.register(new Banish());
|
||||
registry.register(new SixthSense());
|
||||
registry.register(new Darkvision());
|
||||
registry.register(new SpellBuff("darkvision", 0, 0.4f, 0.7f, () -> MobEffects.NIGHT_VISION){ @Override public boolean canBeCastByNPCs(){ return false; } }.soundValues(0.7f, 1.2f, 0.4f));
|
||||
registry.register(new Clairvoyance());
|
||||
registry.register(new PocketWorkbench());
|
||||
registry.register(new ImbueWeapon());
|
||||
registry.register(new InvigoratingPresence());
|
||||
registry.register(new Oakflesh());
|
||||
registry.register(new SpellBuff("oakflesh", 0.6f, 0.5f, 0.4f, () -> MobEffects.RESISTANCE).soundValues(0.7f, 1.2f, 0.4f));
|
||||
|
||||
registry.register(new GreaterFireball());
|
||||
registry.register(new SpellProjectile<>("greater_fireball", EntityLargeMagicFireball::new).addProperties(Spell.DAMAGE, EntityLargeMagicFireball.EXPLOSION_POWER));//new GreaterFireball());
|
||||
registry.register(new FlamingWeapon());
|
||||
registry.register(new IceLance());
|
||||
registry.register(new SpellArrow<>("ice_lance", EntityIceLance::new).addProperties(Spell.DAMAGE, Spell.EFFECT_DURATION, Spell.EFFECT_STRENGTH).soundValues(1, 1, 0.4f));
|
||||
registry.register(new FreezingWeapon());
|
||||
registry.register(new IceSpikes());
|
||||
registry.register(new LightningPulse());
|
||||
@@ -346,9 +389,47 @@ public final class Spells {
|
||||
|
||||
registry.register(new Hailstorm());
|
||||
registry.register(new LightningWeb());
|
||||
registry.register(new SummonStormElemental());
|
||||
registry.register(new SpellMinion<>("summon_storm_elemental", EntityStormElemental::new).soundValues(1, 1.1f, 0.1f));
|
||||
registry.register(new Earthquake());
|
||||
registry.register(new FontOfMana());
|
||||
|
||||
// Wizardry 4.2 spells
|
||||
|
||||
registry.register(new Mine());
|
||||
registry.register(new ConjureBlock());
|
||||
registry.register(new SpellBuff("muffle", 0.3f, 0.4f, 0.8f, () -> WizardryPotions.muffle).soundValues(0.7f, 1.2f, 0.4f));
|
||||
registry.register(new SpellBuff("ward", 0.75f, 0.6f, 0.8f, () -> WizardryPotions.ward).soundValues(0.7f, 1.2f, 0.4f));
|
||||
registry.register(new Evade());
|
||||
|
||||
registry.register(new SpellProjectile<>("iceball", EntityIceball::new).addProperties(Spell.DAMAGE, Spell.EFFECT_DURATION, Spell.EFFECT_STRENGTH));
|
||||
registry.register(new Charge());
|
||||
registry.register(new Reversal());
|
||||
registry.register(new Grapple());
|
||||
registry.register(new Divination());
|
||||
registry.register(new EmpoweringPresence());
|
||||
|
||||
registry.register(new Disintegration());
|
||||
registry.register(new SpellConstructRanged<>("combustion_rune", EntityCombustionRune::new, true).floor(true).addProperties(Spell.BLAST_RADIUS));
|
||||
registry.register(new SpellBuff("frost_step", 0.3f, 0.4f, 0.8f, () -> WizardryPotions.frost_step).soundValues(0.7f, 1.2f, 0.4f));
|
||||
registry.register(new Paralysis());
|
||||
registry.register(new ShulkerBullet());
|
||||
registry.register(new CurseOfUndeath());
|
||||
registry.register(new DragonFireball());
|
||||
registry.register(new GreaterTelekinesis());
|
||||
registry.register(new SpellMinion<>("vex_swarm", EntityVexMinion::new).flying(true).soundValues(1, 1.1f, 0.1f));
|
||||
registry.register(new ArcaneLock());
|
||||
registry.register(new Containment());
|
||||
registry.register(new Satiety());
|
||||
registry.register(new SpellBuff("greater_ward", 0.75f, 0.6f, 0.8f, () -> WizardryPotions.ward).soundValues(0.7f, 1.2f, 0.4f));
|
||||
registry.register(new RayOfPurification());
|
||||
registry.register(new RemoveCurse());
|
||||
|
||||
registry.register(new Possession());
|
||||
registry.register(new CurseOfEnfeeblement());
|
||||
registry.register(new ForestOfThorns());
|
||||
registry.register(new SpeedTime());
|
||||
registry.register(new SlowTime());
|
||||
registry.register(new Resurrection());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,59 +1,48 @@
|
||||
package electroblob.wizardry.registry;
|
||||
|
||||
import electroblob.wizardry.util.CustomAdvancementTrigger;
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.advancement.*;
|
||||
import net.minecraft.advancements.CriteriaTriggers;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
/**
|
||||
* This class stores a collection of custom advancement triggers, for advancements that cannot be triggered
|
||||
* from plain vanilla JSON definitions. It replaces the old WizardryAchievements class.
|
||||
* Class responsible for defining, storing and registering all of wizardry's advancement triggers. As of wizardry 4.2,
|
||||
* the 'dummy' advancement triggers are being phased out in favour of proper custom triggers with JSON parameters, or
|
||||
* where possible, existing triggers in Minecraft.
|
||||
*
|
||||
* @author 12foo
|
||||
* @author 12foo, Electroblob
|
||||
* @since Wizardry 4.1.0
|
||||
*/
|
||||
public final class WizardryAdvancementTriggers {
|
||||
|
||||
public static final CustomAdvancementTrigger armour_set = new CustomAdvancementTrigger("trigger_armour_set");
|
||||
public static final CustomAdvancementTrigger jam_wizard = new CustomAdvancementTrigger("trigger_jam_wizard");
|
||||
public static final CustomAdvancementTrigger self_destruct = new CustomAdvancementTrigger("trigger_self_destruct");
|
||||
public static final CustomAdvancementTrigger all_spells = new CustomAdvancementTrigger("trigger_all_spells");
|
||||
public static final CustomAdvancementTrigger element_master = new CustomAdvancementTrigger("trigger_element_master");
|
||||
public static final CustomAdvancementTrigger identify_spell = new CustomAdvancementTrigger("trigger_identify_spell");
|
||||
public static final CustomAdvancementTrigger elemental = new CustomAdvancementTrigger("trigger_elemental");
|
||||
|
||||
private WizardryAdvancementTriggers(){} // No instances!
|
||||
|
||||
public static final CustomAdvancementTrigger legendary = new CustomAdvancementTrigger("trigger_legendary");
|
||||
public static final CustomAdvancementTrigger max_out_wand = new CustomAdvancementTrigger("trigger_max_out_wand");
|
||||
public static final CustomAdvancementTrigger special_upgrade = new CustomAdvancementTrigger("trigger_special_upgrade");
|
||||
public static final CustomAdvancementTrigger pig_tornado = new CustomAdvancementTrigger("trigger_pig_tornado");
|
||||
public static final CustomAdvancementTrigger master = new CustomAdvancementTrigger("trigger_master");
|
||||
public static final CustomAdvancementTrigger apprentice = new CustomAdvancementTrigger("trigger_apprentice");
|
||||
public static final CustomAdvancementTrigger anger_wizard = new CustomAdvancementTrigger("trigger_anger_wizard");
|
||||
public static final CustomAdvancementTrigger buy_master_spell = new CustomAdvancementTrigger("trigger_buy_master_spell");
|
||||
public static final CustomAdvancementTrigger wizard_trade = new CustomAdvancementTrigger("trigger_wizard_trade");
|
||||
public static final CustomAdvancementTrigger slime_skeleton = new CustomAdvancementTrigger("trigger_slime_skeleton");
|
||||
public static final CustomAdvancementTrigger freeze_blaze = new CustomAdvancementTrigger("trigger_freeze_blaze");
|
||||
public static final CustomAdvancementTrigger frankenstein = new CustomAdvancementTrigger("trigger_frankenstein");
|
||||
public static final CustomAdvancementTrigger charge_creeper = new CustomAdvancementTrigger("trigger_charge_creeper");
|
||||
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 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"));
|
||||
public static final SpellCastTrigger cast_spell = new SpellCastTrigger(new ResourceLocation(Wizardry.MODID, "cast_spell"));
|
||||
public static final SpellDiscoveryTrigger discover_spell = new SpellDiscoveryTrigger(new ResourceLocation(Wizardry.MODID, "discover_spell"));
|
||||
|
||||
public static void register(){
|
||||
|
||||
CriteriaTriggers.register(armour_set);
|
||||
CriteriaTriggers.register(jam_wizard);
|
||||
CriteriaTriggers.register(self_destruct);
|
||||
CriteriaTriggers.register(all_spells);
|
||||
CriteriaTriggers.register(element_master);
|
||||
CriteriaTriggers.register(identify_spell);
|
||||
CriteriaTriggers.register(elemental);
|
||||
|
||||
CriteriaTriggers.register(legendary);
|
||||
CriteriaTriggers.register(max_out_wand);
|
||||
CriteriaTriggers.register(special_upgrade);
|
||||
CriteriaTriggers.register(pig_tornado);
|
||||
CriteriaTriggers.register(master);
|
||||
CriteriaTriggers.register(apprentice);
|
||||
CriteriaTriggers.register(anger_wizard);
|
||||
CriteriaTriggers.register(buy_master_spell);
|
||||
CriteriaTriggers.register(wizard_trade);
|
||||
CriteriaTriggers.register(slime_skeleton);
|
||||
CriteriaTriggers.register(freeze_blaze);
|
||||
CriteriaTriggers.register(frankenstein);
|
||||
CriteriaTriggers.register(charge_creeper);
|
||||
CriteriaTriggers.register(spell_failure);
|
||||
|
||||
CriteriaTriggers.register(visit_structure);
|
||||
CriteriaTriggers.register(arcane_workbench);
|
||||
CriteriaTriggers.register(cast_spell);
|
||||
CriteriaTriggers.register(discover_spell);
|
||||
}
|
||||
}
|
||||
@@ -1,37 +1,32 @@
|
||||
package electroblob.wizardry.registry;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.block.BlockArcaneWorkbench;
|
||||
import electroblob.wizardry.block.BlockCrystalFlower;
|
||||
import electroblob.wizardry.block.BlockCrystalOre;
|
||||
import electroblob.wizardry.block.BlockMagicLight;
|
||||
import electroblob.wizardry.block.BlockSnare;
|
||||
import electroblob.wizardry.block.BlockSpectral;
|
||||
import electroblob.wizardry.block.BlockStatue;
|
||||
import electroblob.wizardry.block.BlockTransportationStone;
|
||||
import electroblob.wizardry.block.BlockVanishingCobweb;
|
||||
import electroblob.wizardry.block.*;
|
||||
import electroblob.wizardry.tileentity.*;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* Class responsible for defining, storing and registering all of wizardry's blocks.
|
||||
* Class responsible for defining, storing and registering all of wizardry's blocks. Also handles registry of the
|
||||
* tile entities.
|
||||
*
|
||||
* @author Electroblob
|
||||
* @since Wizardry 2.1
|
||||
*/
|
||||
@ObjectHolder(Wizardry.MODID)
|
||||
@Mod.EventBusSubscriber
|
||||
public final class WizardryBlocks {
|
||||
|
||||
// I get registry events, they make sense - even I doubted myself with when to do various things in the load
|
||||
// process,
|
||||
// so I can see why the folks at Forge wanted to save us having to think about it.
|
||||
// What I do not understand is why you would use @ObjectHolder for your own blocks and items. What's the point in
|
||||
// making your code longer and more complicated, when you can just define the blocks as constants and register them
|
||||
// later?
|
||||
private WizardryBlocks(){} // No instances!
|
||||
|
||||
// Found a very nice way of registering things using arrays, which might make @ObjectHolder actually useful.
|
||||
// http://www.minecraftforge.net/forum/topic/49497-1112-is-using-registryevent-this-way-ok/
|
||||
@@ -40,23 +35,27 @@ 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 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 snare = new BlockSnare(Material.PLANTS).setHardness(0.0F);
|
||||
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);
|
||||
@Nonnull
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
private static <T> T placeholder(){ return null; }
|
||||
|
||||
static{
|
||||
// This is here because Block#setHarvestLevel isn't chainable.
|
||||
crystal_block.setHarvestLevel("pickaxe", 2);
|
||||
}
|
||||
public static final Block arcane_workbench = placeholder();
|
||||
public static final Block crystal_ore = placeholder();
|
||||
public static final Block petrified_stone = placeholder();
|
||||
public static final Block ice_statue = placeholder();
|
||||
public static final Block magic_light = placeholder();
|
||||
public static final Block crystal_flower = placeholder();
|
||||
public static final Block snare = placeholder();
|
||||
public static final Block transportation_stone = placeholder();
|
||||
public static final Block spectral_block = placeholder();
|
||||
public static final Block crystal_block = placeholder();
|
||||
public static final Block meteor = placeholder();
|
||||
public static final Block vanishing_cobweb = placeholder();
|
||||
public static final Block runestone = placeholder();
|
||||
public static final Block runestone_pedestal = placeholder();
|
||||
public static final Block thorns = placeholder();
|
||||
public static final Block obsidian_crust = placeholder();
|
||||
public static final Block dry_frosted_ice = placeholder();
|
||||
|
||||
/**
|
||||
* Sets both the registry and unlocalised names of the given block, then registers it with the given registry. Use
|
||||
@@ -64,11 +63,11 @@ public final class WizardryBlocks {
|
||||
* construction, for convenience and consistency.
|
||||
*
|
||||
* @param registry The registry to register the given block to.
|
||||
* @param block The block to register.
|
||||
* @param name The name of the block, without the mod ID or the .name stuff. The registry name will be
|
||||
* {@code ebwizardry:[name]}. The unlocalised name will be {@code tile.ebwizardry:[name].name}.
|
||||
* @param block The block to register.
|
||||
*/
|
||||
public static void registerBlock(IForgeRegistry<Block> registry, Block block, String name){
|
||||
public static void registerBlock(IForgeRegistry<Block> registry, String name, Block block){
|
||||
block.setRegistryName(Wizardry.MODID, name);
|
||||
block.setTranslationKey(block.getRegistryName().toString());
|
||||
registry.register(block);
|
||||
@@ -79,17 +78,35 @@ public final class WizardryBlocks {
|
||||
|
||||
IForgeRegistry<Block> registry = event.getRegistry();
|
||||
|
||||
registerBlock(registry, arcane_workbench, "arcane_workbench");
|
||||
registerBlock(registry, crystal_ore, "crystal_ore");
|
||||
registerBlock(registry, petrified_stone, "petrified_stone");
|
||||
registerBlock(registry, ice_statue, "ice_statue");
|
||||
registerBlock(registry, magic_light, "magic_light");
|
||||
registerBlock(registry, crystal_flower, "crystal_flower");
|
||||
registerBlock(registry, snare, "snare");
|
||||
registerBlock(registry, transportation_stone, "transportation_stone");
|
||||
registerBlock(registry, spectral_block, "spectral_block");
|
||||
registerBlock(registry, crystal_block, "crystal_block");
|
||||
registerBlock(registry, meteor, "meteor");
|
||||
registerBlock(registry, vanishing_cobweb, "vanishing_cobweb");
|
||||
registerBlock(registry, "arcane_workbench", new BlockArcaneWorkbench().setHardness(1.0F).setCreativeTab(WizardryTabs.WIZARDRY));
|
||||
registerBlock(registry, "crystal_ore", new BlockCrystalOre(Material.ROCK).setHardness(3.0F).setCreativeTab(WizardryTabs.WIZARDRY));
|
||||
registerBlock(registry, "petrified_stone", new BlockStatue(Material.ROCK).setHardness(1.5F).setResistance(10.0F));
|
||||
registerBlock(registry, "ice_statue", new BlockStatue(Material.ICE).setHardness(0.5F).setLightOpacity(3));
|
||||
registerBlock(registry, "magic_light", new BlockMagicLight(Material.CIRCUITS));
|
||||
registerBlock(registry, "crystal_flower", new BlockCrystalFlower(Material.PLANTS).setHardness(0.0F).setCreativeTab(WizardryTabs.WIZARDRY));
|
||||
registerBlock(registry, "snare", new BlockSnare(Material.PLANTS).setHardness(0.0F));
|
||||
registerBlock(registry, "transportation_stone", new BlockTransportationStone(Material.ROCK).setHardness(0.3F).setLightLevel(0.5f).setLightOpacity(0).setCreativeTab(WizardryTabs.WIZARDRY));
|
||||
registerBlock(registry, "spectral_block", new BlockSpectral(Material.GLASS).setLightLevel(0.7f).setLightOpacity(0).setBlockUnbreakable().setResistance(6000000.0F));
|
||||
registerBlock(registry, "crystal_block", new BlockCrystal(Material.IRON).setHardness(5.0F).setResistance(10.0F).setCreativeTab(WizardryTabs.WIZARDRY));
|
||||
registerBlock(registry, "meteor", new Block(Material.ROCK).setLightLevel(1));
|
||||
registerBlock(registry, "vanishing_cobweb", new BlockVanishingCobweb(Material.WEB).setLightOpacity(1).setHardness(4.0F));
|
||||
registerBlock(registry, "runestone", new BlockRunestone(Material.ROCK));
|
||||
registerBlock(registry, "runestone_pedestal", new BlockPedestal(Material.ROCK));
|
||||
registerBlock(registry, "thorns", new BlockThorns());
|
||||
registerBlock(registry, "obsidian_crust", new BlockObsidianCrust());
|
||||
registerBlock(registry, "dry_frosted_ice", new BlockDryFrostedIce());
|
||||
|
||||
}
|
||||
|
||||
/** Called from the preInit method in the main mod class to register all the tile entities. */
|
||||
public static void registerTileEntities(){
|
||||
// Nope, these still don't have their own registry...
|
||||
GameRegistry.registerTileEntity(TileEntityArcaneWorkbench.class, new ResourceLocation(Wizardry.MODID, "arcane_workbench"));
|
||||
GameRegistry.registerTileEntity(TileEntityStatue.class, new ResourceLocation(Wizardry.MODID, "petrified_stone"));
|
||||
GameRegistry.registerTileEntity(TileEntityMagicLight.class, new ResourceLocation(Wizardry.MODID, "magic_light"));
|
||||
GameRegistry.registerTileEntity(TileEntityTimer.class, new ResourceLocation(Wizardry.MODID, "timer"));
|
||||
GameRegistry.registerTileEntity(TileEntityPlayerSave.class, new ResourceLocation(Wizardry.MODID, "player_save"));
|
||||
GameRegistry.registerTileEntity(TileEntityPlayerSaveTimed.class, new ResourceLocation(Wizardry.MODID, "player_save_timed"));
|
||||
GameRegistry.registerTileEntity(TileEntityShrineCore.class, new ResourceLocation(Wizardry.MODID, "shrine_core"));
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,17 @@
|
||||
package electroblob.wizardry.registry;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.enchantment.EnchantmentMagicProtection;
|
||||
import electroblob.wizardry.enchantment.EnchantmentMagicSword;
|
||||
import electroblob.wizardry.enchantment.EnchantmentTimed;
|
||||
import electroblob.wizardry.util.WizardryUtilities;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* Class responsible for defining, storing and registering all of wizardry's enchantments.
|
||||
*
|
||||
@@ -17,30 +21,42 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
@Mod.EventBusSubscriber
|
||||
public final class WizardryEnchantments {
|
||||
|
||||
// At the moment these enchantments generate on books in dungeon chests due to a bad bit of code
|
||||
// (EnchantRandomly:50).
|
||||
private WizardryEnchantments(){} // No instances!
|
||||
|
||||
// At the moment these enchantments generate on books in dungeon chests due to a bad bit of code (EnchantRandomly:49).
|
||||
// No idea how to fix this because I have no way of hooking into that code... removing the enchantments from the
|
||||
// registry works, but breaks everything else!
|
||||
|
||||
// TODO: For the time being, a dynamic solution will have to do, i.e. intercept the book when it is generated and
|
||||
// For the time being, a dynamic solution will have to do, i.e. intercept the book when it is generated and
|
||||
// reassign its enchantment.
|
||||
|
||||
// All of these have custom classes, so the unlocalised name (referred to simply as 'name' for enchantments) is
|
||||
// dealt with inside those classes.
|
||||
public static final Enchantment magic_sword = new EnchantmentMagicSword().setRegistryName(Wizardry.MODID,
|
||||
"magic_sword");
|
||||
public static final Enchantment magic_bow = new EnchantmentTimed().setRegistryName(Wizardry.MODID, "magic_bow");
|
||||
public static final Enchantment flaming_weapon = new EnchantmentTimed().setRegistryName(Wizardry.MODID,
|
||||
"flaming_weapon");
|
||||
public static final Enchantment freezing_weapon = new EnchantmentTimed().setRegistryName(Wizardry.MODID,
|
||||
"freezing_weapon");
|
||||
|
||||
@Nonnull
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
private static <T> T placeholder(){ return null; }
|
||||
|
||||
public static final Enchantment magic_sword = placeholder();
|
||||
public static final Enchantment magic_bow = placeholder();
|
||||
public static final Enchantment flaming_weapon = placeholder();
|
||||
public static final Enchantment freezing_weapon = placeholder();
|
||||
|
||||
public static final Enchantment magic_protection = placeholder();
|
||||
public static final Enchantment frost_protection = placeholder();
|
||||
public static final Enchantment shock_protection = placeholder();
|
||||
|
||||
@SubscribeEvent
|
||||
public static void register(RegistryEvent.Register<Enchantment> event){
|
||||
event.getRegistry().register(magic_sword);
|
||||
event.getRegistry().register(magic_bow);
|
||||
event.getRegistry().register(flaming_weapon);
|
||||
event.getRegistry().register(freezing_weapon);
|
||||
|
||||
event.getRegistry().register(new EnchantmentMagicSword().setRegistryName(Wizardry.MODID, "magic_sword"));
|
||||
event.getRegistry().register(new EnchantmentTimed().setRegistryName(Wizardry.MODID, "magic_bow"));
|
||||
event.getRegistry().register(new EnchantmentTimed().setRegistryName(Wizardry.MODID, "flaming_weapon"));
|
||||
event.getRegistry().register(new EnchantmentTimed().setRegistryName(Wizardry.MODID, "freezing_weapon"));
|
||||
|
||||
event.getRegistry().register(new EnchantmentMagicProtection(Enchantment.Rarity.UNCOMMON, EnchantmentMagicProtection.Type.MAGIC, WizardryUtilities.ARMOUR_SLOTS).setRegistryName(Wizardry.MODID, "magic_protection"));
|
||||
event.getRegistry().register(new EnchantmentMagicProtection(Enchantment.Rarity.RARE, EnchantmentMagicProtection.Type.FROST, WizardryUtilities.ARMOUR_SLOTS).setRegistryName(Wizardry.MODID, "frost_protection"));
|
||||
event.getRegistry().register(new EnchantmentMagicProtection(Enchantment.Rarity.RARE, EnchantmentMagicProtection.Type.SHOCK, WizardryUtilities.ARMOUR_SLOTS).setRegistryName(Wizardry.MODID, "shock_protection"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
package electroblob.wizardry.registry;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.entity.EntityLevitatingBlock;
|
||||
import electroblob.wizardry.entity.EntityMeteor;
|
||||
import electroblob.wizardry.entity.EntityShield;
|
||||
import electroblob.wizardry.entity.construct.*;
|
||||
import electroblob.wizardry.entity.living.*;
|
||||
import electroblob.wizardry.entity.projectile.*;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.EntityEntry;
|
||||
import net.minecraftforge.fml.common.registry.EntityEntryBuilder;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Class responsible for registering all of wizardry's entities and their spawning conditions.
|
||||
*
|
||||
* @author Electroblob
|
||||
* @since Wizardry 4.2
|
||||
*/
|
||||
@Mod.EventBusSubscriber
|
||||
public class WizardryEntities {
|
||||
|
||||
private WizardryEntities(){} // No instances!
|
||||
|
||||
/** Most entity trackers fall into one of a few categories, so they are defined here for convenience. This
|
||||
* generally follows the values used in vanilla for each entity type. */
|
||||
enum TrackingType {
|
||||
|
||||
LIVING(80, 3, true),
|
||||
PROJECTILE(64, 10, true),
|
||||
CONSTRUCT(160, 10, false);
|
||||
|
||||
int range;
|
||||
int interval;
|
||||
boolean trackVelocity;
|
||||
|
||||
TrackingType(int range, int interval, boolean trackVelocity){
|
||||
this.range = range;
|
||||
this.interval = interval;
|
||||
this.trackVelocity = trackVelocity;
|
||||
}
|
||||
}
|
||||
|
||||
/** Incrementing index for the mod-specific entity network ID. */
|
||||
private static int id = 0;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void register(RegistryEvent.Register<EntityEntry> event){
|
||||
|
||||
IForgeRegistry<EntityEntry> registry = event.getRegistry();
|
||||
|
||||
// Vanilla summoned creatures
|
||||
registry.register(createEntry(EntityZombieMinion.class, "zombie_minion", TrackingType.LIVING).build());
|
||||
registry.register(createEntry(EntityHuskMinion.class, "husk_minion", TrackingType.LIVING).build());
|
||||
registry.register(createEntry(EntitySkeletonMinion.class, "skeleton_minion", TrackingType.LIVING).build());
|
||||
registry.register(createEntry(EntityStrayMinion.class, "stray_minion", TrackingType.LIVING).build());
|
||||
registry.register(createEntry(EntitySpiderMinion.class, "spider_minion", TrackingType.LIVING).build());
|
||||
registry.register(createEntry(EntityBlazeMinion.class, "blaze_minion", TrackingType.LIVING).build());
|
||||
registry.register(createEntry(EntityWitherSkeletonMinion.class, "wither_skeleton_minion", TrackingType.LIVING).build());
|
||||
registry.register(createEntry(EntitySilverfishMinion.class, "silverfish_minion", TrackingType.LIVING).build());
|
||||
registry.register(createEntry(EntityVexMinion.class, "vex_minion", TrackingType.LIVING).build());
|
||||
|
||||
// Custom summoned creatures
|
||||
registry.register(createEntry(EntityIceWraith.class, "ice_wraith", TrackingType.LIVING).egg(0xaafaff, 0x001ce1)
|
||||
.spawn(EnumCreatureType.MONSTER, Wizardry.settings.iceWraithSpawnRate, 1, 1, ForgeRegistries.BIOMES.getValuesCollection().stream()
|
||||
.filter(b -> !Arrays.asList(Wizardry.settings.mobSpawnBiomeBlacklist).contains(b.getRegistryName())
|
||||
&& BiomeDictionary.hasType(b, BiomeDictionary.Type.SNOWY)
|
||||
&& !BiomeDictionary.hasType(b, BiomeDictionary.Type.FOREST))
|
||||
.collect(Collectors.toSet())).build());
|
||||
|
||||
registry.register(createEntry(EntityLightningWraith.class, "lightning_wraith", TrackingType.LIVING).egg(0x35424b, 0x27b9d9)
|
||||
.spawn(EnumCreatureType.MONSTER, Wizardry.settings.lightningWraithSpawnRate, 1, 1, ForgeRegistries.BIOMES.getValuesCollection().stream()
|
||||
.filter(b -> !Arrays.asList(Wizardry.settings.mobSpawnBiomeBlacklist).contains(b.getRegistryName()))
|
||||
.collect(Collectors.toSet())).build());
|
||||
|
||||
registry.register(createEntry(EntitySpiritWolf.class, "spirit_wolf", TrackingType.LIVING).egg(0xbcc2e8, 0x5464c6).build());
|
||||
registry.register(createEntry(EntitySpiritHorse.class, "spirit_horse", TrackingType.LIVING).egg(0x5464c6, 0xbcc2e8).build());
|
||||
registry.register(createEntry(EntityPhoenix.class, "phoenix", TrackingType.LIVING).egg(0xff4900, 0xfde535).build());
|
||||
registry.register(createEntry(EntityIceGiant.class, "ice_giant", TrackingType.LIVING).egg(0x5bacd9, 0xeffaff).build());
|
||||
|
||||
registry.register(createEntry(EntityMagicSlime.class, "magic_slime", TrackingType.LIVING).build());
|
||||
registry.register(createEntry(EntityDecoy.class, "decoy", TrackingType.LIVING).build());
|
||||
|
||||
// These two are only made of particles, so we can afford a lower update frequency
|
||||
registry.register(createEntry(EntityShadowWraith.class, "shadow_wraith") .tracker(80, 10, true).egg(0x11071c, 0x421384).build());
|
||||
registry.register(createEntry(EntityStormElemental.class, "storm_elemental") .tracker(80, 10, true).egg(0x162128, 0x135279).build());
|
||||
|
||||
// Other living entities
|
||||
registry.register(createEntry(EntityWizard.class, "wizard", TrackingType.LIVING).egg(0x19295e, 0xee9312).build());
|
||||
registry.register(createEntry(EntityEvilWizard.class, "evil_wizard", TrackingType.LIVING).egg(0x290404, 0xee9312)
|
||||
// For reference: 5, 1, 1 are the parameters for the witch in vanilla
|
||||
.spawn(EnumCreatureType.MONSTER, Wizardry.settings.evilWizardSpawnRate, 1, 1, ForgeRegistries.BIOMES.getValuesCollection().stream()
|
||||
.filter(b -> !Arrays.asList(Wizardry.settings.mobSpawnBiomeBlacklist).contains(b.getRegistryName()))
|
||||
.collect(Collectors.toSet())).build());
|
||||
|
||||
// Directed projectiles
|
||||
registry.register(createEntry(EntityMagicMissile.class, "magic_missile", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntityIceShard.class, "ice_shard", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntityLightningArrow.class, "lightning_arrow", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntityForceArrow.class, "force_arrow", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntityDart.class, "dart", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntityIceLance.class, "ice_lance", TrackingType.PROJECTILE).build());
|
||||
|
||||
// Directionless projectiles
|
||||
registry.register(createEntry(EntityFirebomb.class, "firebomb", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntityPoisonBomb.class, "poison_bomb", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntitySparkBomb.class, "spark_bomb", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntitySmokeBomb.class, "smoke_bomb", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntityIceCharge.class, "ice_charge", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntityForceOrb.class, "force_orb", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntitySpark.class, "spark", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntityDarknessOrb.class, "darkness_orb", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntityFirebolt.class, "firebolt", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntityThunderbolt.class, "thunderbolt", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntityLightningDisc.class, "lightning_disc", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntityEmber.class, "ember", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntityMagicFireball.class, "magic_fireball", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntityLargeMagicFireball.class, "large_magic_fireball", TrackingType.PROJECTILE).build());
|
||||
registry.register(createEntry(EntityIceball.class, "iceball", TrackingType.PROJECTILE).build());
|
||||
|
||||
// These are effectively projectiles, but since they're bigger and start high up they need updating from further away
|
||||
registry.register(createEntry(EntityMeteor.class, "meteor") .tracker(160, 3, true).build());
|
||||
registry.register(createEntry(EntityHammer.class, "lightning_hammer") .tracker(160, 3, true).build());
|
||||
registry.register(createEntry(EntityLevitatingBlock.class, "levitating_block") .tracker(160, 3, true).build());
|
||||
|
||||
// Constructs
|
||||
registry.register(createEntry(EntityBlackHole.class, "black_hole", TrackingType.CONSTRUCT).build());
|
||||
registry.register(createEntry(EntityBlizzard.class, "blizzard", TrackingType.CONSTRUCT).build());
|
||||
registry.register(createEntry(EntityForcefield.class, "forcefield", TrackingType.CONSTRUCT).build());
|
||||
registry.register(createEntry(EntityFireSigil.class, "fire_sigil", TrackingType.CONSTRUCT).build());
|
||||
registry.register(createEntry(EntityFrostSigil.class, "frost_sigil", TrackingType.CONSTRUCT).build());
|
||||
registry.register(createEntry(EntityLightningSigil.class, "lightning_sigil", TrackingType.CONSTRUCT).build());
|
||||
registry.register(createEntry(EntityCombustionRune.class, "combustion_rune", TrackingType.CONSTRUCT).build());
|
||||
registry.register(createEntry(EntityFireRing.class, "ring_of_fire", TrackingType.CONSTRUCT).build());
|
||||
registry.register(createEntry(EntityHealAura.class, "healing_aura", TrackingType.CONSTRUCT).build());
|
||||
registry.register(createEntry(EntityDecay.class, "decay", TrackingType.CONSTRUCT).build());
|
||||
|
||||
// These ones don't render, currently that makes no difference here but we might as well separate them
|
||||
registry.register(createEntry(EntityArrowRain.class, "arrow_rain", TrackingType.CONSTRUCT).build());
|
||||
registry.register(createEntry(EntityEarthquake.class, "earthquake", TrackingType.CONSTRUCT).build());
|
||||
registry.register(createEntry(EntityHailstorm.class, "hailstorm", TrackingType.CONSTRUCT).build());
|
||||
|
||||
// These ones move, velocity updates are sent if that's not at constant velocity
|
||||
registry.register(createEntry(EntityShield.class, "shield") .tracker(160, 10, true).build());
|
||||
registry.register(createEntry(EntityBubble.class, "bubble") .tracker(160, 3, false).build());
|
||||
registry.register(createEntry(EntityTornado.class, "tornado") .tracker(160, 3, false).build());
|
||||
registry.register(createEntry(EntityIceSpike.class, "ice_spike") .tracker(160, 1, true).build());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Private helper method that simplifies the parts of an {@link EntityEntry} that are common to all entities.
|
||||
* This automatically assigns a network id, and accepts a {@link TrackingType} for automatic tracker assignment.
|
||||
* @param entityClass The entity class to use.
|
||||
* @param name The name of the entity. This will form the path of a {@code ResourceLocation} with domain
|
||||
* {@code ebwizardry}, which in turn will be used as both the registry name and the 'command' name.
|
||||
* @param tracking The {@link TrackingType} to use for this entity.
|
||||
* @param <T> The type of entity.
|
||||
* @return The (part-built) builder instance, allowing other builder methods to be added as necessary.
|
||||
*/
|
||||
private static <T extends Entity> EntityEntryBuilder<T> createEntry(Class<T> entityClass, String name, TrackingType tracking){
|
||||
return createEntry(entityClass, name).tracker(tracking.range, tracking.interval, tracking.trackVelocity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Private helper method that simplifies the parts of an {@link EntityEntry} that are common to all entities.
|
||||
* This automatically assigns a network id.
|
||||
* @param entityClass The entity class to use.
|
||||
* @param name The name of the entity. This will form the path of a {@code ResourceLocation} with domain
|
||||
* {@code ebwizardry}, which in turn will be used as both the registry name and the 'command' name.
|
||||
* @param <T> The type of entity.
|
||||
* @return The (part-built) builder instance, allowing other builder methods to be added as necessary.
|
||||
*/
|
||||
private static <T extends Entity> EntityEntryBuilder<T> createEntry(Class<T> entityClass, String name){
|
||||
ResourceLocation registryName = new ResourceLocation(Wizardry.MODID, name);
|
||||
return EntityEntryBuilder.<T>create().entity(entityClass).id(registryName, id++).name(registryName.toString());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,45 +1,42 @@
|
||||
package electroblob.wizardry.registry;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.constants.Element;
|
||||
import electroblob.wizardry.constants.Tier;
|
||||
import electroblob.wizardry.item.ItemArcaneTome;
|
||||
import electroblob.wizardry.item.ItemArmourUpgrade;
|
||||
import electroblob.wizardry.item.ItemFirebomb;
|
||||
import electroblob.wizardry.item.ItemFlamingAxe;
|
||||
import electroblob.wizardry.item.ItemFrostAxe;
|
||||
import electroblob.wizardry.item.ItemIdentificationScroll;
|
||||
import electroblob.wizardry.item.ItemPoisonBomb;
|
||||
import electroblob.wizardry.item.ItemScroll;
|
||||
import electroblob.wizardry.item.ItemSmokeBomb;
|
||||
import electroblob.wizardry.item.ItemSpectralArmour;
|
||||
import electroblob.wizardry.item.ItemSpectralBow;
|
||||
import electroblob.wizardry.item.ItemSpectralPickaxe;
|
||||
import electroblob.wizardry.item.ItemSpectralSword;
|
||||
import electroblob.wizardry.item.ItemSpellBook;
|
||||
import electroblob.wizardry.item.ItemWand;
|
||||
import electroblob.wizardry.item.ItemWizardArmour;
|
||||
import electroblob.wizardry.item.ItemWizardHandbook;
|
||||
import electroblob.wizardry.entity.projectile.EntityFirebomb;
|
||||
import electroblob.wizardry.entity.projectile.EntityPoisonBomb;
|
||||
import electroblob.wizardry.entity.projectile.EntitySmokeBomb;
|
||||
import electroblob.wizardry.entity.projectile.EntitySparkBomb;
|
||||
import electroblob.wizardry.item.*;
|
||||
import electroblob.wizardry.misc.BehaviourSpellDispense;
|
||||
import electroblob.wizardry.registry.WizardryTabs.CreativeTabListed;
|
||||
import electroblob.wizardry.registry.WizardryTabs.CreativeTabSorted;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.dispenser.BehaviorProjectileDispense;
|
||||
import net.minecraft.dispenser.IPosition;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot.Type;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Item.ToolMaterial;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Class responsible for defining, storing and registering all of wizardry's items. Also registers the ItemBlocks for
|
||||
@@ -48,158 +45,616 @@ import net.minecraftforge.registries.IForgeRegistry;
|
||||
* @author Electroblob
|
||||
* @since Wizardry 2.1
|
||||
*/
|
||||
@ObjectHolder(Wizardry.MODID)
|
||||
@Mod.EventBusSubscriber
|
||||
public final class WizardryItems {
|
||||
|
||||
public static final Item magic_crystal = new Item().setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
private WizardryItems(){} // No instances!
|
||||
|
||||
public static final Item magic_wand = new ItemWand(Tier.BASIC, null);
|
||||
public static final Item apprentice_wand = new ItemWand(Tier.APPRENTICE, null);
|
||||
public static final Item advanced_wand = new ItemWand(Tier.ADVANCED, null);
|
||||
public static final Item master_wand = new ItemWand(Tier.MASTER, null);
|
||||
/** Keeping the material fields in here means {@code @ObjectHolder} ignores them. In actual fact, I could have just
|
||||
* made them private since wizardry only uses them within this class, but in case someone needs them elsewhere I've
|
||||
* used this trick instead to keep them public. */
|
||||
public static final class Materials {
|
||||
|
||||
public static final Item arcane_tome = new ItemArcaneTome();
|
||||
public static final Item wizard_handbook = new ItemWizardHandbook();
|
||||
public static final Item spell_book = new ItemSpellBook();
|
||||
public static final ToolMaterial MAGICAL = EnumHelper.addToolMaterial("MAGICAL", 3, 1000, 8.0f, 4.0f, 0);
|
||||
|
||||
public static final Item basic_fire_wand = new ItemWand(Tier.BASIC, Element.FIRE);
|
||||
public static final Item basic_ice_wand = new ItemWand(Tier.BASIC, Element.ICE);
|
||||
public static final Item basic_lightning_wand = new ItemWand(Tier.BASIC, Element.LIGHTNING);
|
||||
public static final Item basic_necromancy_wand = new ItemWand(Tier.BASIC, Element.NECROMANCY);
|
||||
public static final Item basic_earth_wand = new ItemWand(Tier.BASIC, Element.EARTH);
|
||||
public static final Item basic_sorcery_wand = new ItemWand(Tier.BASIC, Element.SORCERY);
|
||||
public static final Item basic_healing_wand = new ItemWand(Tier.BASIC, Element.HEALING);
|
||||
public static final ArmorMaterial SILK = EnumHelper.addArmorMaterial("SILK", "wizardry/textures/armour/wizard_armour",
|
||||
15, new int[]{0, 0, 0, 0}, 15, WizardrySounds.ITEM_ARMOUR_EQUIP_SILK, 0.0F);
|
||||
|
||||
public static final Item apprentice_fire_wand = new ItemWand(Tier.APPRENTICE, Element.FIRE);
|
||||
public static final Item apprentice_ice_wand = new ItemWand(Tier.APPRENTICE, Element.ICE);
|
||||
public static final Item apprentice_lightning_wand = new ItemWand(Tier.APPRENTICE, Element.LIGHTNING);
|
||||
public static final Item apprentice_necromancy_wand = new ItemWand(Tier.APPRENTICE, Element.NECROMANCY);
|
||||
public static final Item apprentice_earth_wand = new ItemWand(Tier.APPRENTICE, Element.EARTH);
|
||||
public static final Item apprentice_sorcery_wand = new ItemWand(Tier.APPRENTICE, Element.SORCERY);
|
||||
public static final Item apprentice_healing_wand = new ItemWand(Tier.APPRENTICE, Element.HEALING);
|
||||
}
|
||||
|
||||
public static final Item advanced_fire_wand = new ItemWand(Tier.ADVANCED, Element.FIRE);
|
||||
public static final Item advanced_ice_wand = new ItemWand(Tier.ADVANCED, Element.ICE);
|
||||
public static final Item advanced_lightning_wand = new ItemWand(Tier.ADVANCED, Element.LIGHTNING);
|
||||
public static final Item advanced_necromancy_wand = new ItemWand(Tier.ADVANCED, Element.NECROMANCY);
|
||||
public static final Item advanced_earth_wand = new ItemWand(Tier.ADVANCED, Element.EARTH);
|
||||
public static final Item advanced_sorcery_wand = new ItemWand(Tier.ADVANCED, Element.SORCERY);
|
||||
public static final Item advanced_healing_wand = new ItemWand(Tier.ADVANCED, Element.HEALING);
|
||||
@Nonnull
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
private static <T> T placeholder(){ return null; }
|
||||
|
||||
public static final Item master_fire_wand = new ItemWand(Tier.MASTER, Element.FIRE);
|
||||
public static final Item master_ice_wand = new ItemWand(Tier.MASTER, Element.ICE);
|
||||
public static final Item master_lightning_wand = new ItemWand(Tier.MASTER, Element.LIGHTNING);
|
||||
public static final Item master_necromancy_wand = new ItemWand(Tier.MASTER, Element.NECROMANCY);
|
||||
public static final Item master_earth_wand = new ItemWand(Tier.MASTER, Element.EARTH);
|
||||
public static final Item master_sorcery_wand = new ItemWand(Tier.MASTER, Element.SORCERY);
|
||||
public static final Item master_healing_wand = new ItemWand(Tier.MASTER, Element.HEALING);
|
||||
// This is the most concise way I can think of to register the items. Really, I'd prefer it if there was only one
|
||||
// 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...
|
||||
|
||||
public static final Item spectral_sword = new ItemSpectralSword(ToolMaterial.IRON);
|
||||
public static final Item spectral_pickaxe = new ItemSpectralPickaxe(ToolMaterial.IRON);
|
||||
public static final Item spectral_bow = new ItemSpectralBow();
|
||||
public static final Item magic_crystal = placeholder();
|
||||
|
||||
public static final Item mana_flask = new Item().setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Item grand_crystal = placeholder();
|
||||
public static final Item crystal_shard = placeholder();
|
||||
|
||||
public static final Item storage_upgrade = new Item().setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Item siphon_upgrade = new Item().setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Item condenser_upgrade = new Item().setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Item range_upgrade = new Item().setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Item duration_upgrade = new Item().setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Item cooldown_upgrade = new Item().setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Item blast_upgrade = new Item().setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Item attunement_upgrade = new Item().setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Item wizard_handbook = placeholder();
|
||||
public static final Item arcane_tome = placeholder();
|
||||
public static final Item spell_book = placeholder();
|
||||
public static final Item scroll = placeholder();
|
||||
|
||||
public static final Item magic_silk = new Item().setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Item magic_wand = placeholder();
|
||||
public static final Item apprentice_wand = placeholder();
|
||||
public static final Item advanced_wand = placeholder();
|
||||
public static final Item master_wand = placeholder();
|
||||
|
||||
public static final Item.ToolMaterial MAGICAL = EnumHelper.addToolMaterial("MAGICAL", 3, 1000, 8.0f, 4.0f, 0);
|
||||
public static final Item novice_fire_wand = placeholder();
|
||||
public static final Item novice_ice_wand = placeholder();
|
||||
public static final Item novice_lightning_wand = placeholder();
|
||||
public static final Item novice_necromancy_wand = placeholder();
|
||||
public static final Item novice_earth_wand = placeholder();
|
||||
public static final Item novice_sorcery_wand = placeholder();
|
||||
public static final Item novice_healing_wand = placeholder();
|
||||
|
||||
public static final Item flaming_axe = new ItemFlamingAxe(MAGICAL);
|
||||
public static final Item frost_axe = new ItemFrostAxe(MAGICAL);
|
||||
public static final Item apprentice_fire_wand = placeholder();
|
||||
public static final Item apprentice_ice_wand = placeholder();
|
||||
public static final Item apprentice_lightning_wand = placeholder();
|
||||
public static final Item apprentice_necromancy_wand = placeholder();
|
||||
public static final Item apprentice_earth_wand = placeholder();
|
||||
public static final Item apprentice_sorcery_wand = placeholder();
|
||||
public static final Item apprentice_healing_wand = placeholder();
|
||||
|
||||
public static final Item firebomb = new ItemFirebomb();
|
||||
public static final Item poison_bomb = new ItemPoisonBomb();
|
||||
public static final Item advanced_fire_wand = placeholder();
|
||||
public static final Item advanced_ice_wand = placeholder();
|
||||
public static final Item advanced_lightning_wand = placeholder();
|
||||
public static final Item advanced_necromancy_wand = placeholder();
|
||||
public static final Item advanced_earth_wand = placeholder();
|
||||
public static final Item advanced_sorcery_wand = placeholder();
|
||||
public static final Item advanced_healing_wand = placeholder();
|
||||
|
||||
public static final Item blank_scroll = new Item().setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Item scroll = new ItemScroll().setCreativeTab(WizardryTabs.SPELLS);
|
||||
public static final Item master_fire_wand = placeholder();
|
||||
public static final Item master_ice_wand = placeholder();
|
||||
public static final Item master_lightning_wand = placeholder();
|
||||
public static final Item master_necromancy_wand = placeholder();
|
||||
public static final Item master_earth_wand = placeholder();
|
||||
public static final Item master_sorcery_wand = placeholder();
|
||||
public static final Item master_healing_wand = placeholder();
|
||||
|
||||
// The only way to get these is in dungeon chests (They are legendary, after all. Wizards don't just have them.
|
||||
// Also if they were sold you could buy four from the same wizard - and that's no fun at all!)
|
||||
public static final Item armour_upgrade = new ItemArmourUpgrade();
|
||||
public static final Item spectral_sword = placeholder();
|
||||
public static final Item spectral_pickaxe = placeholder();
|
||||
public static final Item spectral_bow = placeholder();
|
||||
|
||||
public static final ArmorMaterial SILK = EnumHelper.addArmorMaterial("SILK",
|
||||
"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.
|
||||
// I *think* that's because the post was for a newer Minecraft version, where custom armour has its own renderer or
|
||||
// something, meaning it would be done a lot like the entity rendering registry in ClientProxy. This is all working
|
||||
// fine it seems, so I'm not going to fiddle with it, but it might be useful to know if I update versions again.
|
||||
public static final Item wizard_hat = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.HEAD, null);
|
||||
public static final Item wizard_robe = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.CHEST, null);
|
||||
public static final Item wizard_leggings = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.LEGS, null);
|
||||
public static final Item wizard_boots = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.FEET, null);
|
||||
public static final Item blank_scroll = placeholder();
|
||||
public static final Item magic_silk = placeholder();
|
||||
|
||||
public static final Item wizard_hat_fire = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.HEAD, Element.FIRE);
|
||||
public static final Item wizard_robe_fire = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.CHEST, Element.FIRE);
|
||||
public static final Item wizard_leggings_fire = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.LEGS, Element.FIRE);
|
||||
public static final Item wizard_boots_fire = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.FEET, Element.FIRE);
|
||||
public static final Item small_mana_flask = placeholder();
|
||||
public static final Item medium_mana_flask = placeholder();
|
||||
public static final Item large_mana_flask = placeholder();
|
||||
|
||||
public static final Item wizard_hat_ice = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.HEAD, Element.ICE);
|
||||
public static final Item wizard_robe_ice = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.CHEST, Element.ICE);
|
||||
public static final Item wizard_leggings_ice = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.LEGS, Element.ICE);
|
||||
public static final Item wizard_boots_ice = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.FEET, Element.ICE);
|
||||
public static final Item storage_upgrade = placeholder();
|
||||
public static final Item siphon_upgrade = placeholder();
|
||||
public static final Item condenser_upgrade = placeholder();
|
||||
public static final Item range_upgrade = placeholder();
|
||||
public static final Item duration_upgrade = placeholder();
|
||||
public static final Item cooldown_upgrade = placeholder();
|
||||
public static final Item blast_upgrade = placeholder();
|
||||
public static final Item attunement_upgrade = placeholder();
|
||||
public static final Item melee_upgrade = placeholder();
|
||||
|
||||
public static final Item wizard_hat_lightning = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.HEAD, Element.LIGHTNING);
|
||||
public static final Item wizard_robe_lightning = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.CHEST, Element.LIGHTNING);
|
||||
public static final Item wizard_leggings_lightning = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.LEGS, Element.LIGHTNING);
|
||||
public static final Item wizard_boots_lightning = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.FEET, Element.LIGHTNING);
|
||||
public static final Item flaming_axe = placeholder();
|
||||
public static final Item frost_axe = placeholder();
|
||||
|
||||
public static final Item wizard_hat_necromancy = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.HEAD, Element.NECROMANCY);
|
||||
public static final Item wizard_robe_necromancy = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.CHEST, Element.NECROMANCY);
|
||||
public static final Item wizard_leggings_necromancy = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.LEGS, Element.NECROMANCY);
|
||||
public static final Item wizard_boots_necromancy = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.FEET, Element.NECROMANCY);
|
||||
public static final Item identification_scroll = placeholder();
|
||||
public static final Item armour_upgrade = placeholder();
|
||||
public static final Item astral_diamond = placeholder();
|
||||
public static final Item purifying_elixir = placeholder();
|
||||
|
||||
public static final Item wizard_hat_earth = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.HEAD, Element.EARTH);
|
||||
public static final Item wizard_robe_earth = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.CHEST, Element.EARTH);
|
||||
public static final Item wizard_leggings_earth = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.LEGS, Element.EARTH);
|
||||
public static final Item wizard_boots_earth = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.FEET, Element.EARTH);
|
||||
public static final Item firebomb = placeholder();
|
||||
public static final Item poison_bomb = placeholder();
|
||||
public static final Item smoke_bomb = placeholder();
|
||||
public static final Item spark_bomb = placeholder();
|
||||
|
||||
public static final Item wizard_hat_sorcery = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.HEAD, Element.SORCERY);
|
||||
public static final Item wizard_robe_sorcery = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.CHEST, Element.SORCERY);
|
||||
public static final Item wizard_leggings_sorcery = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.LEGS, Element.SORCERY);
|
||||
public static final Item wizard_boots_sorcery = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.FEET, Element.SORCERY);
|
||||
public static final Item wizard_hat = placeholder();
|
||||
public static final Item wizard_robe = placeholder();
|
||||
public static final Item wizard_leggings = placeholder();
|
||||
public static final Item wizard_boots = placeholder();
|
||||
|
||||
public static final Item wizard_hat_healing = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.HEAD, Element.HEALING);
|
||||
public static final Item wizard_robe_healing = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.CHEST, Element.HEALING);
|
||||
public static final Item wizard_leggings_healing = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.LEGS, Element.HEALING);
|
||||
public static final Item wizard_boots_healing = new ItemWizardArmour(SILK, 1, EntityEquipmentSlot.FEET, Element.HEALING);
|
||||
public static final Item wizard_hat_fire = placeholder();
|
||||
public static final Item wizard_robe_fire = placeholder();
|
||||
public static final Item wizard_leggings_fire = placeholder();
|
||||
public static final Item wizard_boots_fire = placeholder();
|
||||
|
||||
public static final Item spectral_helmet = new ItemSpectralArmour(ArmorMaterial.IRON, 1, EntityEquipmentSlot.HEAD);
|
||||
public static final Item spectral_chestplate = new ItemSpectralArmour(ArmorMaterial.IRON, 1, EntityEquipmentSlot.CHEST);
|
||||
public static final Item spectral_leggings = new ItemSpectralArmour(ArmorMaterial.IRON, 1, EntityEquipmentSlot.LEGS);
|
||||
public static final Item spectral_boots = new ItemSpectralArmour(ArmorMaterial.IRON, 1, EntityEquipmentSlot.FEET);
|
||||
public static final Item wizard_hat_ice = placeholder();
|
||||
public static final Item wizard_robe_ice = placeholder();
|
||||
public static final Item wizard_leggings_ice = placeholder();
|
||||
public static final Item wizard_boots_ice = placeholder();
|
||||
|
||||
public static final Map<EntityEquipmentSlot, Item> SPECTRAL_ARMOUR_MAP = ImmutableMap.of(
|
||||
EntityEquipmentSlot.HEAD, spectral_helmet, EntityEquipmentSlot.CHEST, spectral_chestplate,
|
||||
EntityEquipmentSlot.LEGS, spectral_leggings, EntityEquipmentSlot.FEET, spectral_boots);
|
||||
|
||||
public static final Item smoke_bomb = new ItemSmokeBomb();
|
||||
public static final Item wizard_hat_lightning = placeholder();
|
||||
public static final Item wizard_robe_lightning = placeholder();
|
||||
public static final Item wizard_leggings_lightning = placeholder();
|
||||
public static final Item wizard_boots_lightning = placeholder();
|
||||
|
||||
public static final Item identification_scroll = new ItemIdentificationScroll();
|
||||
public static final Item wizard_hat_necromancy = placeholder();
|
||||
public static final Item wizard_robe_necromancy = placeholder();
|
||||
public static final Item wizard_leggings_necromancy = placeholder();
|
||||
public static final Item wizard_boots_necromancy = placeholder();
|
||||
|
||||
public static final Map<Pair<Tier, Element>, Item> WAND_MAP = new HashMap<>();
|
||||
public static final Map<Pair<EntityEquipmentSlot, Element>, Item> ARMOUR_MAP = new HashMap<>();
|
||||
public static final Item wizard_hat_earth = placeholder();
|
||||
public static final Item wizard_robe_earth = placeholder();
|
||||
public static final Item wizard_leggings_earth = placeholder();
|
||||
public static final Item wizard_boots_earth = placeholder();
|
||||
|
||||
static {
|
||||
public static final Item wizard_hat_sorcery = placeholder();
|
||||
public static final Item wizard_robe_sorcery = placeholder();
|
||||
public static final Item wizard_leggings_sorcery = placeholder();
|
||||
public static final Item wizard_boots_sorcery = placeholder();
|
||||
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.BASIC, Element.MAGIC), magic_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.BASIC, Element.FIRE), basic_fire_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.BASIC, Element.ICE), basic_ice_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.BASIC, Element.LIGHTNING), basic_lightning_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.BASIC, Element.NECROMANCY), basic_necromancy_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.BASIC, Element.EARTH), basic_earth_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.BASIC, Element.SORCERY), basic_sorcery_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.BASIC, Element.HEALING), basic_healing_wand);
|
||||
public static final Item wizard_hat_healing = placeholder();
|
||||
public static final Item wizard_robe_healing = placeholder();
|
||||
public static final Item wizard_leggings_healing = placeholder();
|
||||
public static final Item wizard_boots_healing = placeholder();
|
||||
|
||||
public static final Item spectral_helmet = placeholder();
|
||||
public static final Item spectral_chestplate = placeholder();
|
||||
public static final Item spectral_leggings = placeholder();
|
||||
public static final Item spectral_boots = placeholder();
|
||||
|
||||
public static final Item lightning_hammer = placeholder();
|
||||
|
||||
public static final Item ring_condensing = placeholder();
|
||||
public static final Item ring_siphoning = placeholder();
|
||||
public static final Item ring_battlemage = placeholder();
|
||||
public static final Item ring_combustion = placeholder();
|
||||
public static final Item ring_fire_melee = placeholder();
|
||||
public static final Item ring_fire_biome = placeholder();
|
||||
public static final Item ring_disintegration = placeholder();
|
||||
public static final Item ring_ice_melee = placeholder();
|
||||
public static final Item ring_ice_biome = placeholder();
|
||||
public static final Item ring_arcane_frost = placeholder();
|
||||
public static final Item ring_shattering = placeholder();
|
||||
public static final Item ring_lightning_melee = placeholder();
|
||||
public static final Item ring_storm = placeholder();
|
||||
public static final Item ring_seeking = placeholder();
|
||||
public static final Item ring_hammer = placeholder();
|
||||
public static final Item ring_soulbinding = placeholder();
|
||||
public static final Item ring_leeching = placeholder();
|
||||
public static final Item ring_necromancy_melee = placeholder();
|
||||
public static final Item ring_mind_control = placeholder();
|
||||
public static final Item ring_poison = placeholder();
|
||||
public static final Item ring_earth_melee = placeholder();
|
||||
public static final Item ring_earth_biome = placeholder();
|
||||
public static final Item ring_full_moon = placeholder();
|
||||
public static final Item ring_extraction = placeholder();
|
||||
public static final Item ring_mana_return = placeholder();
|
||||
public static final Item ring_blockwrangler = placeholder();
|
||||
public static final Item ring_conjurer = placeholder();
|
||||
public static final Item ring_defender = placeholder();
|
||||
public static final Item ring_paladin = placeholder();
|
||||
public static final Item ring_interdiction = placeholder();
|
||||
|
||||
public static final Item amulet_arcane_defence = placeholder();
|
||||
public static final Item amulet_warding = placeholder();
|
||||
public static final Item amulet_wisdom = placeholder();
|
||||
public static final Item amulet_fire_protection = placeholder();
|
||||
public static final Item amulet_fire_cloaking = placeholder();
|
||||
public static final Item amulet_ice_immunity = placeholder();
|
||||
public static final Item amulet_ice_protection = placeholder();
|
||||
public static final Item amulet_potential = placeholder();
|
||||
public static final Item amulet_channeling = placeholder();
|
||||
public static final Item amulet_lich = placeholder();
|
||||
public static final Item amulet_wither_immunity = placeholder();
|
||||
public static final Item amulet_glide = placeholder();
|
||||
public static final Item amulet_banishing = placeholder();
|
||||
public static final Item amulet_anchoring = placeholder();
|
||||
public static final Item amulet_recovery = placeholder();
|
||||
public static final Item amulet_transience = placeholder();
|
||||
public static final Item amulet_resurrection = placeholder();
|
||||
public static final Item amulet_auto_shield = placeholder();
|
||||
|
||||
public static final Item charm_haggler = placeholder();
|
||||
public static final Item charm_experience_tome = placeholder();
|
||||
public static final Item charm_auto_smelt = placeholder();
|
||||
public static final Item charm_lava_walking = placeholder();
|
||||
public static final Item charm_storm = placeholder();
|
||||
public static final Item charm_minion_health = placeholder();
|
||||
public static final Item charm_minion_variants = placeholder();
|
||||
public static final Item charm_flight = placeholder();
|
||||
public static final Item charm_growth = placeholder();
|
||||
public static final Item charm_abseiling = placeholder();
|
||||
public static final Item charm_silk_touch = placeholder();
|
||||
public static final Item charm_stop_time = placeholder();
|
||||
public static final Item charm_light = placeholder();
|
||||
public static final Item charm_transportation = placeholder();
|
||||
public static final Item charm_feeding = placeholder();
|
||||
|
||||
private static final Map<Pair<Tier, Element>, Item> WAND_MAP = new HashMap<>();
|
||||
private static final Map<Pair<EntityEquipmentSlot, Element>, Item> ARMOUR_MAP = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Helper method to return the appropriate wand based on tier and element. As of Wizardry 2.1, this uses the
|
||||
* immutable map stored in {@link WizardryItems#WAND_MAP}. Currently used for upgrading wands, for chest generation
|
||||
* and to iterate through wands for charging recipes.
|
||||
*
|
||||
* @param tier The tier of the wand required.
|
||||
* @param element The element of the wand required. Null will be converted to {@link Element#MAGIC}.
|
||||
* @return The wand item which corresponds to the given tier and element, or null if no such item exists.
|
||||
* @throws NullPointerException if the given tier is null.
|
||||
* @deprecated This is being phased out; it is now only used for wizard gear and trades. To add an item to
|
||||
* charging recipes, use {@link WizardryRecipes#addToManaFlaskCharging(Item)}.
|
||||
*/
|
||||
@Deprecated
|
||||
public static Item getWand(Tier tier, Element element){
|
||||
if(tier == null) throw new NullPointerException("The given tier cannot be null.");
|
||||
if(element == null) element = Element.MAGIC;
|
||||
return WAND_MAP.get(ImmutablePair.of(tier, element));
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to return the appropriate armour item based on element and slot. As of Wizardry 2.1, this uses the
|
||||
* immutable map stored in {@link WizardryItems#ARMOUR_MAP}. Currently used to iterate through armour for
|
||||
* registering charging recipes and for chest generation.
|
||||
*
|
||||
* @param element The EnumElement of the armour required. Null will be converted to {@link Element#MAGIC}.
|
||||
* @param slot EntityEquipmentSlot of the armour piece required
|
||||
* @return The armour item which corresponds to the given element and slot, or null if no such item exists.
|
||||
* @throws IllegalArgumentException if the given slot is not an armour slot.
|
||||
* @deprecated This is being phased out; it is now only used for wizard gear and trades. To add an item to
|
||||
* charging recipes, use {@link WizardryRecipes#addToManaFlaskCharging(Item)}.
|
||||
*/
|
||||
@Deprecated
|
||||
public static Item getArmour(Element element, EntityEquipmentSlot slot){
|
||||
if(slot == null || slot.getSlotType() != Type.ARMOR)
|
||||
throw new IllegalArgumentException("Must be a valid armour slot");
|
||||
if(element == null) element = Element.MAGIC;
|
||||
return ARMOUR_MAP.get(ImmutablePair.of(slot, element));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets both the registry and unlocalised names of the given item, then registers it with the given registry. Use
|
||||
* this instead of {@link Item#setRegistryName(String)} and {@link Item#setTranslationKey(String)} during
|
||||
* construction, for convenience and consistency. As of wizardry 4.2, this also automatically adds it to the order
|
||||
* list for its creative tab if that tab is a {@link CreativeTabListed}, meaning the order can be defined simply
|
||||
* by the order in which the items are registered in this class.
|
||||
*
|
||||
* @param registry The registry to register the given item to.
|
||||
* @param name The name of the item, without the mod ID or the .name stuff. The registry name will be
|
||||
* {@code ebwizardry:[name]}. The unlocalised name will be {@code item.ebwizardry:[name].name}.
|
||||
* @param item The item to register.
|
||||
*/
|
||||
// It now makes sense to have the name first, since it's shorter than an entire item declaration.
|
||||
public static void registerItem(IForgeRegistry<Item> registry, String name, Item item){
|
||||
registerItem(registry, name, item, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets both the registry and unlocalised names of the given item, then registers it with the given registry. Use
|
||||
* this instead of {@link Item#setRegistryName(String)} and {@link Item#setTranslationKey(String)} during
|
||||
* construction, for convenience and consistency. As of wizardry 4.2, this also automatically adds it to the order
|
||||
* list for its creative tab if that tab is a {@link CreativeTabListed}, meaning the order can be defined simply
|
||||
* by the order in which the items are registered in this class.
|
||||
*
|
||||
* @param registry The registry to register the given item to.
|
||||
* @param name The name of the item, without the mod ID or the .name stuff. The registry name will be
|
||||
* {@code ebwizardry:[name]}. The unlocalised name will be {@code item.ebwizardry:[name].name}.
|
||||
* @param item The item to register.
|
||||
* @param setTabIcon True to set this item as the icon for its creative tab.
|
||||
*/
|
||||
// It now makes sense to have the name first, since it's shorter than an entire item declaration.
|
||||
public static void registerItem(IForgeRegistry<Item> registry, String name, Item item, boolean setTabIcon){
|
||||
|
||||
item.setRegistryName(Wizardry.MODID, name);
|
||||
item.setTranslationKey(item.getRegistryName().toString());
|
||||
registry.register(item);
|
||||
|
||||
if(setTabIcon && item.getCreativeTab() instanceof CreativeTabSorted){
|
||||
((CreativeTabSorted)item.getCreativeTab()).setIconItem(new ItemStack(item));
|
||||
}
|
||||
|
||||
if(item.getCreativeTab() instanceof CreativeTabListed){
|
||||
((CreativeTabListed)item.getCreativeTab()).order.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
/** Registers an ItemBlock for the given block, with the same registry name as that block. As of wizardry 4.2, this
|
||||
* also automatically adds it to the order list for its creative tab if that tab is a {@link CreativeTabListed},
|
||||
* meaning the order can be defined simply by the order in which the items are registered in this class. */
|
||||
private static void registerItemBlock(IForgeRegistry<Item> registry, Block block){
|
||||
// We don't need to keep a reference to the ItemBlock
|
||||
Item itemblock = new ItemBlock(block).setRegistryName(block.getRegistryName());
|
||||
registry.register(itemblock);
|
||||
|
||||
if(block.getCreativeTab() instanceof CreativeTabListed){
|
||||
((CreativeTabListed)block.getCreativeTab()).order.add(itemblock);
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerMultiTexturedItemBlock(IForgeRegistry<Item> registry, Block block, boolean separateNames){
|
||||
// We don't need to keep a reference to the ItemBlock
|
||||
Item itemblock = new ItemBlockMultiTexturedElemental(block, separateNames).setRegistryName(block.getRegistryName());
|
||||
registry.register(itemblock);
|
||||
|
||||
if(block.getCreativeTab() instanceof CreativeTabListed){
|
||||
((CreativeTabListed)block.getCreativeTab()).order.add(itemblock);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public static void register(RegistryEvent.Register<Item> event){
|
||||
|
||||
IForgeRegistry<Item> registry = event.getRegistry();
|
||||
|
||||
// ItemBlocks
|
||||
|
||||
// Not all blocks need an ItemBlock
|
||||
registerItemBlock(registry, WizardryBlocks.arcane_workbench);
|
||||
registerItemBlock(registry, WizardryBlocks.crystal_ore);
|
||||
registerItemBlock(registry, WizardryBlocks.crystal_flower);
|
||||
registerItemBlock(registry, WizardryBlocks.transportation_stone);
|
||||
registerMultiTexturedItemBlock(registry, WizardryBlocks.crystal_block, true);
|
||||
registerMultiTexturedItemBlock(registry, WizardryBlocks.runestone, false);
|
||||
registerMultiTexturedItemBlock(registry, WizardryBlocks.runestone_pedestal, false);
|
||||
|
||||
// Items
|
||||
|
||||
registerItem(registry, "magic_crystal", new ItemCrystal());
|
||||
|
||||
registerItem(registry, "crystal_shard", new Item().setCreativeTab(WizardryTabs.WIZARDRY));
|
||||
registerItem(registry, "grand_crystal", new Item().setCreativeTab(WizardryTabs.WIZARDRY));
|
||||
|
||||
registerItem(registry, "wizard_handbook", new ItemWizardHandbook(), true);
|
||||
registerItem(registry, "arcane_tome", new ItemArcaneTome());
|
||||
registerItem(registry, "spell_book", new ItemSpellBook(), true);
|
||||
registerItem(registry, "scroll", new ItemScroll());
|
||||
|
||||
registerItem(registry, "magic_wand", new ItemWand(Tier.NOVICE, null));
|
||||
registerItem(registry, "apprentice_wand", new ItemWand(Tier.APPRENTICE, null));
|
||||
registerItem(registry, "advanced_wand", new ItemWand(Tier.ADVANCED, null));
|
||||
registerItem(registry, "master_wand", new ItemWand(Tier.MASTER, null));
|
||||
|
||||
registerItem(registry, "novice_fire_wand", new ItemWand(Tier.NOVICE, Element.FIRE));
|
||||
registerItem(registry, "apprentice_fire_wand", new ItemWand(Tier.APPRENTICE, Element.FIRE));
|
||||
registerItem(registry, "advanced_fire_wand", new ItemWand(Tier.ADVANCED, Element.FIRE));
|
||||
registerItem(registry, "master_fire_wand", new ItemWand(Tier.MASTER, Element.FIRE));
|
||||
|
||||
registerItem(registry, "novice_ice_wand", new ItemWand(Tier.NOVICE, Element.ICE));
|
||||
registerItem(registry, "apprentice_ice_wand", new ItemWand(Tier.APPRENTICE, Element.ICE));
|
||||
registerItem(registry, "advanced_ice_wand", new ItemWand(Tier.ADVANCED, Element.ICE));
|
||||
registerItem(registry, "master_ice_wand", new ItemWand(Tier.MASTER, Element.ICE));
|
||||
|
||||
registerItem(registry, "novice_lightning_wand", new ItemWand(Tier.NOVICE, Element.LIGHTNING));
|
||||
registerItem(registry, "apprentice_lightning_wand", new ItemWand(Tier.APPRENTICE, Element.LIGHTNING));
|
||||
registerItem(registry, "advanced_lightning_wand", new ItemWand(Tier.ADVANCED, Element.LIGHTNING));
|
||||
registerItem(registry, "master_lightning_wand", new ItemWand(Tier.MASTER, Element.LIGHTNING));
|
||||
|
||||
registerItem(registry, "novice_necromancy_wand", new ItemWand(Tier.NOVICE, Element.NECROMANCY));
|
||||
registerItem(registry, "apprentice_necromancy_wand", new ItemWand(Tier.APPRENTICE, Element.NECROMANCY));
|
||||
registerItem(registry, "advanced_necromancy_wand", new ItemWand(Tier.ADVANCED, Element.NECROMANCY));
|
||||
registerItem(registry, "master_necromancy_wand", new ItemWand(Tier.MASTER, Element.NECROMANCY));
|
||||
|
||||
registerItem(registry, "novice_earth_wand", new ItemWand(Tier.NOVICE, Element.EARTH));
|
||||
registerItem(registry, "apprentice_earth_wand", new ItemWand(Tier.APPRENTICE, Element.EARTH));
|
||||
registerItem(registry, "advanced_earth_wand", new ItemWand(Tier.ADVANCED, Element.EARTH));
|
||||
registerItem(registry, "master_earth_wand", new ItemWand(Tier.MASTER, Element.EARTH));
|
||||
|
||||
registerItem(registry, "novice_sorcery_wand", new ItemWand(Tier.NOVICE, Element.SORCERY));
|
||||
registerItem(registry, "apprentice_sorcery_wand", new ItemWand(Tier.APPRENTICE, Element.SORCERY));
|
||||
registerItem(registry, "advanced_sorcery_wand", new ItemWand(Tier.ADVANCED, Element.SORCERY));
|
||||
registerItem(registry, "master_sorcery_wand", new ItemWand(Tier.MASTER, Element.SORCERY));
|
||||
|
||||
registerItem(registry, "novice_healing_wand", new ItemWand(Tier.NOVICE, Element.HEALING));
|
||||
registerItem(registry, "apprentice_healing_wand", new ItemWand(Tier.APPRENTICE, Element.HEALING));
|
||||
registerItem(registry, "advanced_healing_wand", new ItemWand(Tier.ADVANCED, Element.HEALING));
|
||||
registerItem(registry, "master_healing_wand", new ItemWand(Tier.MASTER, Element.HEALING));
|
||||
|
||||
registerItem(registry, "spectral_sword", new ItemSpectralSword(ToolMaterial.IRON));
|
||||
registerItem(registry, "spectral_pickaxe", new ItemSpectralPickaxe(ToolMaterial.IRON));
|
||||
registerItem(registry, "spectral_bow", new ItemSpectralBow());
|
||||
|
||||
registerItem(registry, "blank_scroll", new ItemBlankScroll());
|
||||
registerItem(registry, "magic_silk", new Item().setCreativeTab(WizardryTabs.WIZARDRY));
|
||||
|
||||
registerItem(registry, "small_mana_flask", new ItemManaFlask(ItemManaFlask.Size.SMALL));
|
||||
registerItem(registry, "medium_mana_flask", new ItemManaFlask(ItemManaFlask.Size.MEDIUM));
|
||||
registerItem(registry, "large_mana_flask", new ItemManaFlask(ItemManaFlask.Size.LARGE));
|
||||
|
||||
registerItem(registry, "storage_upgrade", new ItemWandUpgrade());
|
||||
registerItem(registry, "siphon_upgrade", new ItemWandUpgrade());
|
||||
registerItem(registry, "condenser_upgrade", new ItemWandUpgrade());
|
||||
registerItem(registry, "range_upgrade", new ItemWandUpgrade());
|
||||
registerItem(registry, "duration_upgrade", new ItemWandUpgrade());
|
||||
registerItem(registry, "cooldown_upgrade", new ItemWandUpgrade());
|
||||
registerItem(registry, "blast_upgrade", new ItemWandUpgrade());
|
||||
registerItem(registry, "attunement_upgrade", new ItemWandUpgrade());
|
||||
registerItem(registry, "melee_upgrade", new ItemWandUpgrade());
|
||||
|
||||
registerItem(registry, "flaming_axe", new ItemFlamingAxe(Materials.MAGICAL));
|
||||
registerItem(registry, "frost_axe", new ItemFrostAxe(Materials.MAGICAL));
|
||||
|
||||
registerItem(registry, "identification_scroll", new ItemIdentificationScroll());
|
||||
registerItem(registry, "armour_upgrade", new ItemArmourUpgrade());
|
||||
registerItem(registry, "astral_diamond", new Item(){ @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.RARE; }}.setCreativeTab(WizardryTabs.WIZARDRY));
|
||||
registerItem(registry, "purifying_elixir", new ItemPurifyingElixir());
|
||||
|
||||
registerItem(registry, "firebomb", new ItemFirebomb());
|
||||
registerItem(registry, "poison_bomb", new ItemPoisonBomb());
|
||||
registerItem(registry, "smoke_bomb", new ItemSmokeBomb());
|
||||
registerItem(registry, "spark_bomb", new ItemSparkBomb());
|
||||
|
||||
registerItem(registry, "wizard_hat", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.HEAD, null), true);
|
||||
registerItem(registry, "wizard_robe", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.CHEST, null));
|
||||
registerItem(registry, "wizard_leggings", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.LEGS, null));
|
||||
registerItem(registry, "wizard_boots", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.FEET, null));
|
||||
|
||||
registerItem(registry, "wizard_hat_fire", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.HEAD, Element.FIRE));
|
||||
registerItem(registry, "wizard_robe_fire", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.CHEST, Element.FIRE));
|
||||
registerItem(registry, "wizard_leggings_fire", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.LEGS, Element.FIRE));
|
||||
registerItem(registry, "wizard_boots_fire", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.FEET, Element.FIRE));
|
||||
|
||||
registerItem(registry, "wizard_hat_ice", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.HEAD, Element.ICE));
|
||||
registerItem(registry, "wizard_robe_ice", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.CHEST, Element.ICE));
|
||||
registerItem(registry, "wizard_leggings_ice", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.LEGS, Element.ICE));
|
||||
registerItem(registry, "wizard_boots_ice", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.FEET, Element.ICE));
|
||||
|
||||
registerItem(registry, "wizard_hat_lightning", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.HEAD, Element.LIGHTNING));
|
||||
registerItem(registry, "wizard_robe_lightning", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.CHEST, Element.LIGHTNING));
|
||||
registerItem(registry, "wizard_leggings_lightning", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.LEGS, Element.LIGHTNING));
|
||||
registerItem(registry, "wizard_boots_lightning", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.FEET, Element.LIGHTNING));
|
||||
|
||||
registerItem(registry, "wizard_hat_necromancy", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.HEAD, Element.NECROMANCY));
|
||||
registerItem(registry, "wizard_robe_necromancy", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.CHEST, Element.NECROMANCY));
|
||||
registerItem(registry, "wizard_leggings_necromancy", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.LEGS, Element.NECROMANCY));
|
||||
registerItem(registry, "wizard_boots_necromancy", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.FEET, Element.NECROMANCY));
|
||||
|
||||
registerItem(registry, "wizard_hat_earth", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.HEAD, Element.EARTH));
|
||||
registerItem(registry, "wizard_robe_earth", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.CHEST, Element.EARTH));
|
||||
registerItem(registry, "wizard_leggings_earth", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.LEGS, Element.EARTH));
|
||||
registerItem(registry, "wizard_boots_earth", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.FEET, Element.EARTH));
|
||||
|
||||
registerItem(registry, "wizard_hat_sorcery", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.HEAD, Element.SORCERY));
|
||||
registerItem(registry, "wizard_robe_sorcery", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.CHEST, Element.SORCERY));
|
||||
registerItem(registry, "wizard_leggings_sorcery", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.LEGS, Element.SORCERY));
|
||||
registerItem(registry, "wizard_boots_sorcery", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.FEET, Element.SORCERY));
|
||||
|
||||
registerItem(registry, "wizard_hat_healing", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.HEAD, Element.HEALING));
|
||||
registerItem(registry, "wizard_robe_healing", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.CHEST, Element.HEALING));
|
||||
registerItem(registry, "wizard_leggings_healing", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.LEGS, Element.HEALING));
|
||||
registerItem(registry, "wizard_boots_healing", new ItemWizardArmour(Materials.SILK, 1, EntityEquipmentSlot.FEET, Element.HEALING));
|
||||
|
||||
registerItem(registry, "spectral_helmet", new ItemSpectralArmour(ArmorMaterial.IRON, 1, EntityEquipmentSlot.HEAD));
|
||||
registerItem(registry, "spectral_chestplate", new ItemSpectralArmour(ArmorMaterial.IRON, 1, EntityEquipmentSlot.CHEST));
|
||||
registerItem(registry, "spectral_leggings", new ItemSpectralArmour(ArmorMaterial.IRON, 1, EntityEquipmentSlot.LEGS));
|
||||
registerItem(registry, "spectral_boots", new ItemSpectralArmour(ArmorMaterial.IRON, 1, EntityEquipmentSlot.FEET));
|
||||
|
||||
registerItem(registry, "lightning_hammer", new ItemLightningHammer());
|
||||
|
||||
registerItem(registry, "ring_condensing", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_siphoning", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_battlemage", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_combustion", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_fire_melee", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_fire_biome", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_disintegration", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_ice_melee", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_ice_biome", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_arcane_frost", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_shattering", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_lightning_melee", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_storm", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_seeking", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_hammer", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_soulbinding", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_leeching", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_necromancy_melee", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_mind_control", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_poison", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_earth_melee", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_earth_biome", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_full_moon", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_extraction", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_mana_return", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_blockwrangler", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_conjurer", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_defender", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_paladin", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.RING));
|
||||
registerItem(registry, "ring_interdiction", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.RING));
|
||||
|
||||
registerItem(registry, "amulet_arcane_defence", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.AMULET));
|
||||
registerItem(registry, "amulet_warding", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.AMULET));
|
||||
registerItem(registry, "amulet_wisdom", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.AMULET));
|
||||
registerItem(registry, "amulet_fire_protection", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.AMULET));
|
||||
registerItem(registry, "amulet_fire_cloaking", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.AMULET));
|
||||
registerItem(registry, "amulet_ice_immunity", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.AMULET));
|
||||
registerItem(registry, "amulet_ice_protection", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.AMULET));
|
||||
registerItem(registry, "amulet_potential", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.AMULET));
|
||||
registerItem(registry, "amulet_channeling", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.AMULET));
|
||||
registerItem(registry, "amulet_lich", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.AMULET));
|
||||
registerItem(registry, "amulet_wither_immunity", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.AMULET));
|
||||
registerItem(registry, "amulet_glide", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.AMULET));
|
||||
registerItem(registry, "amulet_banishing", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.AMULET));
|
||||
registerItem(registry, "amulet_anchoring", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.AMULET));
|
||||
registerItem(registry, "amulet_recovery", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.AMULET));
|
||||
registerItem(registry, "amulet_transience", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.AMULET));
|
||||
registerItem(registry, "amulet_resurrection", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.AMULET));
|
||||
registerItem(registry, "amulet_auto_shield", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.AMULET));
|
||||
|
||||
registerItem(registry, "charm_haggler", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.CHARM));
|
||||
registerItem(registry, "charm_experience_tome", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.CHARM));
|
||||
registerItem(registry, "charm_auto_smelt", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.CHARM));
|
||||
registerItem(registry, "charm_lava_walking", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.CHARM));
|
||||
registerItem(registry, "charm_storm", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.CHARM));
|
||||
registerItem(registry, "charm_minion_health", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.CHARM));
|
||||
registerItem(registry, "charm_minion_variants", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.CHARM));
|
||||
registerItem(registry, "charm_flight", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.CHARM));
|
||||
registerItem(registry, "charm_growth", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.CHARM));
|
||||
registerItem(registry, "charm_abseiling", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.CHARM));
|
||||
registerItem(registry, "charm_silk_touch", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.CHARM));
|
||||
registerItem(registry, "charm_stop_time", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.CHARM));
|
||||
registerItem(registry, "charm_light", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.CHARM));
|
||||
registerItem(registry, "charm_transportation", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.CHARM));
|
||||
registerItem(registry, "charm_feeding", new ItemArtefact(EnumRarity.UNCOMMON, ItemArtefact.Type.CHARM));
|
||||
|
||||
}
|
||||
|
||||
/** Called from init() in the main mod class to register wizardry's dispenser behaviours. */
|
||||
public static void registerDispenseBehaviours(){
|
||||
|
||||
BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(firebomb, new BehaviorProjectileDispense(){
|
||||
|
||||
@Override
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position, ItemStack stack){
|
||||
EntityFirebomb entity = new EntityFirebomb(world);
|
||||
entity.setPosition(position.getX(), position.getY(), position.getZ());
|
||||
return entity;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(poison_bomb, new BehaviorProjectileDispense(){
|
||||
|
||||
@Override
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position, ItemStack stack){
|
||||
EntityPoisonBomb entity = new EntityPoisonBomb(world);
|
||||
entity.setPosition(position.getX(), position.getY(), position.getZ());
|
||||
return entity;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(smoke_bomb, new BehaviorProjectileDispense(){
|
||||
|
||||
@Override
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position, ItemStack stack){
|
||||
EntitySmokeBomb entity = new EntitySmokeBomb(world);
|
||||
entity.setPosition(position.getX(), position.getY(), position.getZ());
|
||||
return entity;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(spark_bomb, new BehaviorProjectileDispense(){
|
||||
|
||||
@Override
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position, ItemStack stack){
|
||||
EntitySparkBomb entity = new EntitySparkBomb(world);
|
||||
entity.setPosition(position.getX(), position.getY(), position.getZ());
|
||||
return entity;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(scroll, new BehaviourSpellDispense());
|
||||
|
||||
}
|
||||
|
||||
public static void populateWandMap(){
|
||||
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.NOVICE, Element.MAGIC), magic_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.NOVICE, Element.FIRE), novice_fire_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.NOVICE, Element.ICE), novice_ice_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.NOVICE, Element.LIGHTNING), novice_lightning_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.NOVICE, Element.NECROMANCY), novice_necromancy_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.NOVICE, Element.EARTH), novice_earth_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.NOVICE, Element.SORCERY), novice_sorcery_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.NOVICE, Element.HEALING), novice_healing_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.APPRENTICE, Element.MAGIC), apprentice_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.APPRENTICE, Element.FIRE), apprentice_fire_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.APPRENTICE, Element.ICE), apprentice_ice_wand);
|
||||
@@ -224,6 +679,9 @@ public final class WizardryItems {
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.MASTER, Element.EARTH), master_earth_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.MASTER, Element.SORCERY), master_sorcery_wand);
|
||||
WAND_MAP.put(ImmutablePair.of(Tier.MASTER, Element.HEALING), master_healing_wand);
|
||||
}
|
||||
|
||||
public static void populateArmourMap(){
|
||||
|
||||
ARMOUR_MAP.put(ImmutablePair.of(EntityEquipmentSlot.HEAD, Element.MAGIC), wizard_hat);
|
||||
ARMOUR_MAP.put(ImmutablePair.of(EntityEquipmentSlot.HEAD, Element.FIRE), wizard_hat_fire);
|
||||
@@ -259,162 +717,4 @@ public final class WizardryItems {
|
||||
ARMOUR_MAP.put(ImmutablePair.of(EntityEquipmentSlot.FEET, Element.HEALING), wizard_boots_healing);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets both the registry and unlocalised names of the given item, then registers it with the given registry. Use
|
||||
* this instead of {@link Item#setRegistryName(String)} and {@link Item#setTranslationKey(String)} during
|
||||
* construction, for convenience and consistency.
|
||||
*
|
||||
* @param registry The registry to register the given item to.
|
||||
* @param item The item to register.
|
||||
* @param name The name of the item, without the mod ID or the .name stuff. The registry name will be
|
||||
* {@code ebwizardry:[name]}. The unlocalised name will be {@code item.ebwizardry:[name].name}.
|
||||
*/
|
||||
public static void registerItem(IForgeRegistry<Item> registry, Item item, String name){
|
||||
item.setRegistryName(Wizardry.MODID, name);
|
||||
item.setTranslationKey(item.getRegistryName().toString());
|
||||
registry.register(item);
|
||||
}
|
||||
|
||||
/** Registers an ItemBlock afor the given block, with the same registry name as that block. */
|
||||
private static void registerItemBlock(IForgeRegistry<Item> registry, Block block){
|
||||
// We don't need to keep a reference to the ItemBlock, so this can all be done in one line.
|
||||
registry.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void register(RegistryEvent.Register<Item> event){
|
||||
IForgeRegistry<Item> registry = event.getRegistry();
|
||||
|
||||
// ItemBlocks
|
||||
|
||||
// Not all blocks need an ItemBlock
|
||||
registerItemBlock(registry, WizardryBlocks.arcane_workbench);
|
||||
registerItemBlock(registry, WizardryBlocks.crystal_ore);
|
||||
registerItemBlock(registry, WizardryBlocks.crystal_flower);
|
||||
registerItemBlock(registry, WizardryBlocks.transportation_stone);
|
||||
registerItemBlock(registry, WizardryBlocks.crystal_block);
|
||||
|
||||
// Items
|
||||
|
||||
registerItem(registry, magic_crystal, "magic_crystal");
|
||||
|
||||
registerItem(registry, magic_wand, "magic_wand");
|
||||
registerItem(registry, apprentice_wand, "apprentice_wand");
|
||||
registerItem(registry, advanced_wand, "advanced_wand");
|
||||
registerItem(registry, master_wand, "master_wand");
|
||||
|
||||
registerItem(registry, spell_book, "spell_book");
|
||||
registerItem(registry, arcane_tome, "arcane_tome");
|
||||
registerItem(registry, wizard_handbook, "wizard_handbook");
|
||||
|
||||
registerItem(registry, basic_fire_wand, "basic_fire_wand");
|
||||
registerItem(registry, basic_ice_wand, "basic_ice_wand");
|
||||
registerItem(registry, basic_lightning_wand, "basic_lightning_wand");
|
||||
registerItem(registry, basic_necromancy_wand, "basic_necromancy_wand");
|
||||
registerItem(registry, basic_earth_wand, "basic_earth_wand");
|
||||
registerItem(registry, basic_sorcery_wand, "basic_sorcery_wand");
|
||||
registerItem(registry, basic_healing_wand, "basic_healing_wand");
|
||||
|
||||
registerItem(registry, apprentice_fire_wand, "apprentice_fire_wand");
|
||||
registerItem(registry, apprentice_ice_wand, "apprentice_ice_wand");
|
||||
registerItem(registry, apprentice_lightning_wand, "apprentice_lightning_wand");
|
||||
registerItem(registry, apprentice_necromancy_wand, "apprentice_necromancy_wand");
|
||||
registerItem(registry, apprentice_earth_wand, "apprentice_earth_wand");
|
||||
registerItem(registry, apprentice_sorcery_wand, "apprentice_sorcery_wand");
|
||||
registerItem(registry, apprentice_healing_wand, "apprentice_healing_wand");
|
||||
|
||||
registerItem(registry, advanced_fire_wand, "advanced_fire_wand");
|
||||
registerItem(registry, advanced_ice_wand, "advanced_ice_wand");
|
||||
registerItem(registry, advanced_lightning_wand, "advanced_lightning_wand");
|
||||
registerItem(registry, advanced_necromancy_wand, "advanced_necromancy_wand");
|
||||
registerItem(registry, advanced_earth_wand, "advanced_earth_wand");
|
||||
registerItem(registry, advanced_sorcery_wand, "advanced_sorcery_wand");
|
||||
registerItem(registry, advanced_healing_wand, "advanced_healing_wand");
|
||||
|
||||
registerItem(registry, master_fire_wand, "master_fire_wand");
|
||||
registerItem(registry, master_ice_wand, "master_ice_wand");
|
||||
registerItem(registry, master_lightning_wand, "master_lightning_wand");
|
||||
registerItem(registry, master_necromancy_wand, "master_necromancy_wand");
|
||||
registerItem(registry, master_earth_wand, "master_earth_wand");
|
||||
registerItem(registry, master_sorcery_wand, "master_sorcery_wand");
|
||||
registerItem(registry, master_healing_wand, "master_healing_wand");
|
||||
|
||||
registerItem(registry, spectral_sword, "spectral_sword");
|
||||
registerItem(registry, spectral_pickaxe, "spectral_pickaxe");
|
||||
registerItem(registry, spectral_bow, "spectral_bow");
|
||||
|
||||
registerItem(registry, mana_flask, "mana_flask");
|
||||
|
||||
registerItem(registry, storage_upgrade, "storage_upgrade");
|
||||
registerItem(registry, siphon_upgrade, "siphon_upgrade");
|
||||
registerItem(registry, condenser_upgrade, "condenser_upgrade");
|
||||
registerItem(registry, range_upgrade, "range_upgrade");
|
||||
registerItem(registry, duration_upgrade, "duration_upgrade");
|
||||
registerItem(registry, cooldown_upgrade, "cooldown_upgrade");
|
||||
registerItem(registry, blast_upgrade, "blast_upgrade");
|
||||
registerItem(registry, attunement_upgrade, "attunement_upgrade");
|
||||
|
||||
registerItem(registry, flaming_axe, "flaming_axe");
|
||||
registerItem(registry, frost_axe, "frost_axe");
|
||||
|
||||
registerItem(registry, firebomb, "firebomb");
|
||||
registerItem(registry, poison_bomb, "poison_bomb");
|
||||
|
||||
registerItem(registry, blank_scroll, "blank_scroll");
|
||||
registerItem(registry, scroll, "scroll");
|
||||
|
||||
registerItem(registry, armour_upgrade, "armour_upgrade");
|
||||
|
||||
registerItem(registry, magic_silk, "magic_silk");
|
||||
|
||||
registerItem(registry, wizard_hat, "wizard_hat");
|
||||
registerItem(registry, wizard_robe, "wizard_robe");
|
||||
registerItem(registry, wizard_leggings, "wizard_leggings");
|
||||
registerItem(registry, wizard_boots, "wizard_boots");
|
||||
|
||||
registerItem(registry, wizard_hat_fire, "wizard_hat_fire");
|
||||
registerItem(registry, wizard_robe_fire, "wizard_robe_fire");
|
||||
registerItem(registry, wizard_leggings_fire, "wizard_leggings_fire");
|
||||
registerItem(registry, wizard_boots_fire, "wizard_boots_fire");
|
||||
|
||||
registerItem(registry, wizard_hat_ice, "wizard_hat_ice");
|
||||
registerItem(registry, wizard_robe_ice, "wizard_robe_ice");
|
||||
registerItem(registry, wizard_leggings_ice, "wizard_leggings_ice");
|
||||
registerItem(registry, wizard_boots_ice, "wizard_boots_ice");
|
||||
|
||||
registerItem(registry, wizard_hat_lightning, "wizard_hat_lightning");
|
||||
registerItem(registry, wizard_robe_lightning, "wizard_robe_lightning");
|
||||
registerItem(registry, wizard_leggings_lightning, "wizard_leggings_lightning");
|
||||
registerItem(registry, wizard_boots_lightning, "wizard_boots_lightning");
|
||||
|
||||
registerItem(registry, wizard_hat_necromancy, "wizard_hat_necromancy");
|
||||
registerItem(registry, wizard_robe_necromancy, "wizard_robe_necromancy");
|
||||
registerItem(registry, wizard_leggings_necromancy, "wizard_leggings_necromancy");
|
||||
registerItem(registry, wizard_boots_necromancy, "wizard_boots_necromancy");
|
||||
|
||||
registerItem(registry, wizard_hat_earth, "wizard_hat_earth");
|
||||
registerItem(registry, wizard_robe_earth, "wizard_robe_earth");
|
||||
registerItem(registry, wizard_leggings_earth, "wizard_leggings_earth");
|
||||
registerItem(registry, wizard_boots_earth, "wizard_boots_earth");
|
||||
|
||||
registerItem(registry, wizard_hat_sorcery, "wizard_hat_sorcery");
|
||||
registerItem(registry, wizard_robe_sorcery, "wizard_robe_sorcery");
|
||||
registerItem(registry, wizard_leggings_sorcery, "wizard_leggings_sorcery");
|
||||
registerItem(registry, wizard_boots_sorcery, "wizard_boots_sorcery");
|
||||
|
||||
registerItem(registry, wizard_hat_healing, "wizard_hat_healing");
|
||||
registerItem(registry, wizard_robe_healing, "wizard_robe_healing");
|
||||
registerItem(registry, wizard_leggings_healing, "wizard_leggings_healing");
|
||||
registerItem(registry, wizard_boots_healing, "wizard_boots_healing");
|
||||
|
||||
registerItem(registry, spectral_helmet, "spectral_helmet");
|
||||
registerItem(registry, spectral_chestplate, "spectral_chestplate");
|
||||
registerItem(registry, spectral_leggings, "spectral_leggings");
|
||||
registerItem(registry, spectral_boots, "spectral_boots");
|
||||
|
||||
registerItem(registry, smoke_bomb, "smoke_bomb");
|
||||
|
||||
registerItem(registry, identification_scroll, "identification_scroll");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package electroblob.wizardry.registry;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.constants.Tier;
|
||||
import electroblob.wizardry.loot.RandomSpell;
|
||||
import electroblob.wizardry.loot.WizardSpell;
|
||||
import electroblob.wizardry.spell.Spell;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.storage.loot.*;
|
||||
import net.minecraft.world.storage.loot.conditions.LootCondition;
|
||||
import net.minecraft.world.storage.loot.functions.LootFunctionManager;
|
||||
import net.minecraftforge.event.LootTableLoadEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.EntityEntry;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/**
|
||||
* Class responsible for registering wizardry's loot functions and loot tables. Also handles loot injection and the
|
||||
* standard weighting.
|
||||
*
|
||||
* @author Electroblob
|
||||
* @since Wizardry 1.0
|
||||
*/
|
||||
@Mod.EventBusSubscriber
|
||||
public final class WizardryLoot {
|
||||
|
||||
//public static final String FROM_SPAWNER_NBT_FLAG = "fromSpawner";
|
||||
|
||||
private WizardryLoot(){} // No instances!
|
||||
|
||||
/** Called from the preInit method in the main mod class to register the custom dungeon loot. */
|
||||
public static void register(){
|
||||
|
||||
/* Loot tables work as follows: Minecraft goes through each pool in turn. For each pool, it does a certain
|
||||
* number of rolls, which can either be set to always be one number or a random number from a range. Each roll,
|
||||
* it generates one stack of a single random entry in that pool, weighted according to the weights of the
|
||||
* entries. Functions allow properties of that stack (stack size, damage, nbt) to be set, and even allow it to
|
||||
* be replaced dynamically with a completely different item (though there's very little point in doing that as
|
||||
* it could be achieved just as easily with more entries, which makes me think it would be bad practice). You
|
||||
* can also use conditions to control whether an entry or pool is used at all, which is mostly for mob drops
|
||||
* under specific conditions, but one of them is simply a random chance, meaning you could use it to make a pool
|
||||
* that only gets rolled sometimes. All in all, this can get rather confusing, because stackable items can have
|
||||
* 5 stages of randomness applied to them at once: a random chance for the pool, a random number of rolls for
|
||||
* the pool, the weighted random chance of choosing that particular entry, a random chance for that entry, and a
|
||||
* random stack size, and that's before you take functions into account.
|
||||
*
|
||||
* ...oh, and entries can be entire loot tables in themselves, allowing for potentially infinite levels of
|
||||
* randomness. Yeah. */
|
||||
|
||||
// Always registers the loot tables, but only injects the additions into vanilla if the appropriate option is
|
||||
// enabled in the config (see WizardryEventHandler).
|
||||
LootFunctionManager.registerFunction(new RandomSpell.Serializer());
|
||||
LootFunctionManager.registerFunction(new WizardSpell.Serializer());
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "chests/wizard_tower"));
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "chests/obelisk"));
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "chests/shrine"));
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "chests/dungeon_additions"));
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "chests/jungle_dispenser_additions"));
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "subsets/elemental_crystals"));
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "subsets/wizard_armour"));
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "subsets/arcane_tomes"));
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "subsets/wand_upgrades"));
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "entities/evil_wizard"));
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "entities/mob_additions"));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method which gets a spell id according to the standard weighting. The tier is a weighted random value; the
|
||||
* actual spell within that tier is completely random. Will not return the id of a spell which has been disabled in
|
||||
* the config. This is for simple stuff like chests and drops; more complex generators like wizard trades don't use
|
||||
* this method.
|
||||
* <p></p>
|
||||
* For reference, the standard weighting is as follows: Novice: 60%, Apprentice: 25%, Advanced: 10%, Master: 5%
|
||||
*
|
||||
* @param random An instance of {@link Random} to use for RNG
|
||||
* @param filter A {@link Predicate} specifying any requirements the chosen spell must fulfil
|
||||
* @return A random spell id number, or -1 if no spell exists that satisfies the given filter
|
||||
* @deprecated Everything uses loot tables now, I may remove this as some point
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getStandardWeightedRandomSpellId(Random random, Predicate<Spell> filter){
|
||||
|
||||
Tier tier = Tier.getWeightedRandomTier(random);
|
||||
|
||||
List<Spell> spells = Spell.getSpells(new Spell.TierElementFilter(tier, null));
|
||||
spells.removeIf(filter.negate());
|
||||
|
||||
// Ensures the tier chosen actually has spells in it, and if not uses NOVICE instead.
|
||||
if(spells.isEmpty()){
|
||||
spells = Spell.getSpells(new Spell.TierElementFilter(Tier.NOVICE, null));
|
||||
spells.removeIf(filter.negate());
|
||||
}
|
||||
|
||||
if(spells.isEmpty()) return -1;
|
||||
|
||||
// Finds a random spell in the list and returns its id.
|
||||
return spells.get(random.nextInt(spells.size())).metadata();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onLootTableLoadEvent(LootTableLoadEvent event){
|
||||
// General dungeon loot
|
||||
if(Arrays.asList(Wizardry.settings.lootInjectionLocations).contains(event.getName())){
|
||||
event.getTable().addPool(getAdditive(Wizardry.MODID + ":chests/dungeon_additions", Wizardry.MODID + "_additional_dungeon_loot"));
|
||||
}
|
||||
// Jungle temple dispensers
|
||||
if(event.getName().toString().matches("minecraft:chests/jungle_temple_dispenser")){
|
||||
event.getTable().addPool(getAdditive(Wizardry.MODID + ":chests/jungle_dispenser_additions", Wizardry.MODID + "_additional_dispenser_loot"));
|
||||
}
|
||||
// Mob drops
|
||||
// Let's hope mods will play nice and store their entity loot tables under 'entities' or 'entity'
|
||||
// If not, packmakers will have to sort it out themselves using the whitelist/blacklist
|
||||
if(Arrays.asList(Wizardry.settings.mobLootTableWhitelist).contains(event.getName())){
|
||||
event.getTable().addPool(getAdditive(Wizardry.MODID + ":entities/mob_additions", Wizardry.MODID + "_additional_mob_drops"));
|
||||
|
||||
}else if(!Arrays.asList(Wizardry.settings.mobLootTableBlacklist).contains(event.getName())
|
||||
&& event.getName().getPath().contains("entities") || event.getName().getPath().contains("entity")){
|
||||
// Get the filename of the loot table json, for well-behaved mods this will be the entity name
|
||||
String[] split = event.getName().getPath().split("/");
|
||||
String entityName = split[split.length - 1];
|
||||
|
||||
EntityEntry entry = ForgeRegistries.ENTITIES.getValue(new ResourceLocation(entityName));
|
||||
if(entry == null) return; // If this is true it didn't work :(
|
||||
Class entityClass = entry.getEntityClass();
|
||||
|
||||
if(EnumCreatureType.MONSTER.getCreatureClass().isAssignableFrom(entityClass)){
|
||||
event.getTable().addPool(getAdditive(Wizardry.MODID + ":entities/mob_additions", Wizardry.MODID + "_additional_mob_drops"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static LootPool getAdditive(String entryName, String poolName){
|
||||
return new LootPool(new LootEntry[]{getAdditiveEntry(entryName, 1)}, new LootCondition[0],
|
||||
new RandomValueRange(1), new RandomValueRange(0, 1), Wizardry.MODID + "_" + poolName);
|
||||
}
|
||||
|
||||
private static LootEntryTable getAdditiveEntry(String name, int weight){
|
||||
return new LootEntryTable(new ResourceLocation(name), weight, 0, new LootCondition[0],
|
||||
Wizardry.MODID + "_additive_entry");
|
||||
}
|
||||
|
||||
// @SubscribeEvent
|
||||
// public static void onLivingSpawnEvent(LivingSpawnEvent.SpecialSpawn event){
|
||||
// if(event.getSpawner() != null) event.getEntityLiving().getEntityData().setBoolean(FROM_SPAWNER_NBT_FLAG, true);
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -1,96 +1,72 @@
|
||||
package electroblob.wizardry.registry;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.potion.PotionDecay;
|
||||
import electroblob.wizardry.potion.PotionFrost;
|
||||
import electroblob.wizardry.potion.PotionMagicEffect;
|
||||
import electroblob.wizardry.potion.PotionMagicEffectParticles;
|
||||
import electroblob.wizardry.util.WizardryParticleType;
|
||||
import electroblob.wizardry.potion.*;
|
||||
import electroblob.wizardry.util.ParticleBuilder;
|
||||
import electroblob.wizardry.util.ParticleBuilder.Type;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* Class responsible for defining, storing and registering all of wizardry's potion effects.
|
||||
*
|
||||
* @author Electroblob
|
||||
* @since Wizardry 2.1
|
||||
*/
|
||||
@ObjectHolder(Wizardry.MODID)
|
||||
@Mod.EventBusSubscriber
|
||||
public final class WizardryPotions {
|
||||
|
||||
/* Interestingly, setting the colour to black stops the particles from rendering. This is great, however, the black
|
||||
* colour then 'mixes' with other potions that are applied. Whilst this is a bit annoying, for the amount it is
|
||||
* likely to get noticed it is certainly preferable to always making showParticles false, because now I can give the
|
||||
* user the option (via commands) of having one of my potion effects without particles, and more importantly the
|
||||
* potion effect HUD still gets displayed. TODO: Backport to 1.7.10, assuming it also works in that version. This
|
||||
* means also changing whenever the potion effect is added such that it is NOT ambient. */
|
||||
private WizardryPotions(){} // No instances!
|
||||
|
||||
public static final Potion frost = new PotionFrost(true, 0); // Colour was 0x38ddec (was arbitrary anyway)
|
||||
@Nonnull
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
private static <T> T placeholder(){ return null; }
|
||||
|
||||
public static final Potion transience = new PotionMagicEffectParticles(false, 0, 0){
|
||||
@Override
|
||||
public void spawnCustomParticle(World world, double x, double y, double z){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DUST, world, x, y, z, 0, 0, 0,
|
||||
(int)(16.0D / (Math.random() * 0.8D + 0.2D)), 0.8f, 0.8f, 1.0f);
|
||||
}
|
||||
}.setBeneficial(); // 0xffe89b
|
||||
|
||||
public static final Potion fireskin = new PotionMagicEffectParticles(false, 0, 1){
|
||||
@Override
|
||||
public void spawnCustomParticle(World world, double x, double y, double z){
|
||||
world.spawnParticle(EnumParticleTypes.FLAME, x, y, z, 0, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performEffect(EntityLivingBase entitylivingbase, int strength){
|
||||
entitylivingbase.extinguish(); // Stops melee mobs that are on fire from setting the player on fire,
|
||||
// without allowing the player to actually stand in fire or swim in lava without taking damage.
|
||||
};
|
||||
}.setBeneficial(); // 0xff2f02
|
||||
|
||||
public static final Potion ice_shroud = new PotionMagicEffectParticles(false, 0, 2){
|
||||
@Override
|
||||
public void spawnCustomParticle(World world, double x, double y, double z){
|
||||
float brightness = 0.5f + (world.rand.nextFloat() / 2);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x, y, z, 0, 0, 0,
|
||||
48 + world.rand.nextInt(12), brightness, brightness + 0.1f, 1.0f, true, 0);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SNOW, world, x, y, z, 0, -0.02, 0,
|
||||
40 + world.rand.nextInt(10));
|
||||
}
|
||||
}.setBeneficial(); // 0x52f1ff
|
||||
|
||||
public static final Potion static_aura = new PotionMagicEffectParticles(false, 0, 3){
|
||||
@Override
|
||||
public void spawnCustomParticle(World world, double x, double y, double z){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, x, y, z, 0, 0, 0, 3);
|
||||
}
|
||||
}.setBeneficial(); // 0x0070ff
|
||||
|
||||
public static final Potion decay = new PotionDecay(true, 0x3c006c);
|
||||
public static final Potion sixth_sense = new PotionMagicEffect(false, 0xc6ff01, 4).setBeneficial();
|
||||
public static final Potion arcane_jammer = new PotionMagicEffect(false, 0xcf4aa2, 5);
|
||||
public static final Potion mind_trick = new PotionMagicEffect(true, 0x601683, 6);
|
||||
public static final Potion mind_control = new PotionMagicEffect(true, 0x320b44, 7);
|
||||
public static final Potion font_of_mana = new PotionMagicEffect(false, 0xffe5bb, 8).setBeneficial();
|
||||
public static final Potion fear = new PotionMagicEffect(true, 0xbd0100, 9);
|
||||
public static final Potion frost = placeholder();
|
||||
public static final Potion transience = placeholder();
|
||||
public static final Potion fireskin = placeholder();
|
||||
public static final Potion ice_shroud = placeholder();
|
||||
public static final Potion static_aura = placeholder();
|
||||
public static final Potion decay = placeholder();
|
||||
public static final Potion sixth_sense = placeholder();
|
||||
public static final Potion arcane_jammer = placeholder();
|
||||
public static final Potion mind_trick = placeholder();
|
||||
public static final Potion mind_control = placeholder();
|
||||
public static final Potion font_of_mana = placeholder();
|
||||
public static final Potion fear = placeholder();
|
||||
public static final Potion curse_of_soulbinding = placeholder();
|
||||
public static final Potion paralysis = placeholder();
|
||||
public static final Potion muffle = placeholder();
|
||||
public static final Potion ward = placeholder();
|
||||
public static final Potion slow_time = placeholder();
|
||||
public static final Potion empowerment = placeholder();
|
||||
public static final Potion curse_of_enfeeblement = placeholder();
|
||||
public static final Potion curse_of_undeath = placeholder();
|
||||
public static final Potion containment = placeholder();
|
||||
public static final Potion frost_step = placeholder();
|
||||
|
||||
/**
|
||||
* Sets both the registry and unlocalised names of the given potion, then registers it with the given registry. Use
|
||||
* this instead of {@link Potion#setRegistryName(String)} and {@link Potion#setUnlocalizedName(String)} during
|
||||
* this instead of {@link Potion#setRegistryName(String)} and {@link Potion#setPotionName(String)} during
|
||||
* construction, for convenience and consistency.
|
||||
*
|
||||
* @param registry The registry to register the given potion to.
|
||||
* @param potion The potion to register.
|
||||
* @param name The name of the potion, without the mod ID or the .name stuff. The registry name will be
|
||||
* {@code ebwizardry:[name]}. The unlocalised name will be {@code potion.ebwizardry:[name].name}.
|
||||
* @param potion The potion to register.
|
||||
*/
|
||||
public static void registerPotion(IForgeRegistry<Potion> registry, Potion potion, String name){
|
||||
public static void registerPotion(IForgeRegistry<Potion> registry, String name, Potion potion){
|
||||
potion.setRegistryName(Wizardry.MODID, name);
|
||||
// For some reason, Potion#getName() doesn't prepend "potion." itself, so it has to be done here.
|
||||
potion.setPotionName("potion." + potion.getRegistryName().toString());
|
||||
@@ -102,18 +78,115 @@ public final class WizardryPotions {
|
||||
|
||||
IForgeRegistry<Potion> registry = event.getRegistry();
|
||||
|
||||
registerPotion(registry, frost, "frost");
|
||||
registerPotion(registry, transience, "transience");
|
||||
registerPotion(registry, fireskin, "fireskin");
|
||||
registerPotion(registry, ice_shroud, "ice_shroud");
|
||||
registerPotion(registry, static_aura, "static_aura");
|
||||
registerPotion(registry, decay, "decay");
|
||||
registerPotion(registry, sixth_sense, "sixth_sense");
|
||||
registerPotion(registry, arcane_jammer, "arcane_jammer");
|
||||
registerPotion(registry, mind_trick, "mind_trick");
|
||||
registerPotion(registry, mind_control, "mind_control");
|
||||
registerPotion(registry, font_of_mana, "font_of_mana");
|
||||
registerPotion(registry, fear, "fear");
|
||||
// Interestingly, setting the colour to black stops the particles from rendering.
|
||||
|
||||
registerPotion(registry, "frost", new PotionFrost(true, 0)); // Colour was 0x38ddec (was arbitrary anyway)
|
||||
|
||||
registerPotion(registry, "transience", new PotionMagicEffectParticles(false, 0,
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icon_transience.png")){
|
||||
@Override
|
||||
public void spawnCustomParticle(World world, double x, double y, double z){
|
||||
ParticleBuilder.create(Type.DUST).pos(x, y, z).clr(0.8f, 0.8f, 1.0f).shaded(true).spawn(world);
|
||||
}
|
||||
}.setBeneficial()); // 0xffe89b
|
||||
|
||||
registerPotion(registry, "fireskin", new PotionMagicEffectParticles(false, 0,
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icon_fireskin.png")){
|
||||
@Override
|
||||
public void spawnCustomParticle(World world, double x, double y, double z){
|
||||
world.spawnParticle(EnumParticleTypes.FLAME, x, y, z, 0, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performEffect(EntityLivingBase entitylivingbase, int strength){
|
||||
entitylivingbase.extinguish(); // Stops melee mobs that are on fire from setting the player on fire,
|
||||
// without allowing the player to actually stand in fire or swim in lava without taking damage.
|
||||
}
|
||||
}.setBeneficial()); // 0xff2f02
|
||||
|
||||
registerPotion(registry, "ice_shroud", new PotionMagicEffectParticles(false, 0,
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icon_ice_shroud.png")){
|
||||
@Override
|
||||
public void spawnCustomParticle(World world, double x, double y, double z){
|
||||
float brightness = 0.5f + (world.rand.nextFloat() / 2);
|
||||
ParticleBuilder.create(Type.SPARKLE).pos(x, y, z).clr(brightness, brightness + 0.1f, 1.0f).gravity(true).spawn(world);
|
||||
ParticleBuilder.create(Type.SNOW).pos(x, y, z).spawn(world);
|
||||
}
|
||||
}.setBeneficial()); // 0x52f1ff
|
||||
|
||||
registerPotion(registry, "static_aura", new PotionMagicEffectParticles(false, 0,
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icon_static_aura.png")){
|
||||
@Override
|
||||
public void spawnCustomParticle(World world, double x, double y, double z){
|
||||
ParticleBuilder.create(Type.SPARK).pos(x, y, z).spawn(world);
|
||||
}
|
||||
}.setBeneficial()); // 0x0070ff
|
||||
|
||||
registerPotion(registry, "decay", new PotionDecay(true, 0x3c006c));
|
||||
|
||||
registerPotion(registry, "sixth_sense", new PotionMagicEffect(false, 0xc6ff01,
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icon_sixth_sense.png")){
|
||||
@Override
|
||||
public void performEffect(EntityLivingBase target, int strength){
|
||||
// Reset the shader (a bit dirty but both the potion expiry hooks are only fired server-side, and
|
||||
// there's no point sending packets unnecessarily if we can just do this instead)
|
||||
if(target.getActivePotionEffect(this).getDuration() <= 1 && target.world.isRemote
|
||||
&& target == net.minecraft.client.Minecraft.getMinecraft().player){
|
||||
net.minecraft.client.Minecraft.getMinecraft().entityRenderer.stopUseShader();
|
||||
}
|
||||
}
|
||||
}.setBeneficial());
|
||||
|
||||
registerPotion(registry, "arcane_jammer", new PotionMagicEffect(true, 0xcf4aa2,
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icon_arcane_jammer.png")));
|
||||
|
||||
registerPotion(registry, "mind_trick", new PotionMagicEffect(true, 0x601683,
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icon_mind_trick.png")));
|
||||
|
||||
registerPotion(registry, "mind_control", new PotionMagicEffect(true, 0x320b44,
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icon_mind_control.png")));
|
||||
|
||||
registerPotion(registry, "font_of_mana", new PotionMagicEffect(false, 0xffe5bb,
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icon_font_of_mana.png")).setBeneficial());
|
||||
|
||||
registerPotion(registry, "fear", new PotionMagicEffect(true, 0xbd0100,
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icon_fear.png")));
|
||||
|
||||
registerPotion(registry, "curse_of_soulbinding", new Curse(true, 0x0f000f,
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icon_curse_of_soulbinding.png")){
|
||||
@Override // We're not removing any attributes, but it's called when we want it to be so...
|
||||
public void removeAttributesModifiersFromEntity(EntityLivingBase entity, net.minecraft.entity.ai.attributes.AbstractAttributeMap attributeMapIn, int amplifier){
|
||||
// TODO: Hmmmm...
|
||||
}
|
||||
});
|
||||
|
||||
registerPotion(registry, "paralysis", new PotionMagicEffectParticles(true, 0,
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icon_paralysis.png")){
|
||||
@Override
|
||||
public void spawnCustomParticle(World world, double x, double y, double z){
|
||||
ParticleBuilder.create(Type.SPARK).pos(x, y, z).spawn(world);
|
||||
}
|
||||
});
|
||||
|
||||
registerPotion(registry, "muffle", new PotionMagicEffect(false, 0x4464d9,
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icon_muffle.png")).setBeneficial());
|
||||
|
||||
registerPotion(registry, "ward", new PotionMagicEffect(false, 0xc991d0,
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icon_ward.png")).setBeneficial());
|
||||
|
||||
registerPotion(registry, "slow_time", new PotionSlowTime(false, 0x5be3bb).setBeneficial());
|
||||
|
||||
registerPotion(registry, "empowerment", new PotionMagicEffect(false, 0x8367bd,
|
||||
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icon_empowerment.png")).setBeneficial());
|
||||
|
||||
registerPotion(registry, "curse_of_enfeeblement", new CurseEnfeeblement(true, 0x36000b));
|
||||
|
||||
registerPotion(registry, "curse_of_undeath", new CurseUndeath(true, 0x685c00));
|
||||
|
||||
registerPotion(registry, "containment", new PotionContainment(true, 0x7988cc));
|
||||
|
||||
registerPotion(registry, "frost_step", new PotionFrostStep(false, 0).setBeneficial());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package electroblob.wizardry.registry;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.item.IManaStoringItem;
|
||||
import electroblob.wizardry.item.ItemManaFlask;
|
||||
import net.minecraft.inventory.ContainerPlayer;
|
||||
import net.minecraft.inventory.ContainerWorkbench;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.Queue;
|
||||
|
||||
/**
|
||||
* Class responsible for defining and registering wizardry's non-JSON recipes (i.e. smelting recipes and dynamic
|
||||
* crafting recipes). Also handles dynamic recipe display and usage.
|
||||
*
|
||||
* @author Electroblob
|
||||
* @since Wizardry 4.2
|
||||
*/
|
||||
@Mod.EventBusSubscriber
|
||||
public final class WizardryRecipes {
|
||||
|
||||
private WizardryRecipes(){} // No instances!
|
||||
|
||||
private static final Queue<Item> chargingRecipeQueue = new LinkedList<>();
|
||||
|
||||
/** Adds the given item to the list of items that can be charged using mana flasks. Dynamic charging recipes
|
||||
* will be added for these items during {@code RegistryEvent.Register<IRecipe>}. The item must implement
|
||||
* {@link IManaStoringItem} for the recipes to work correctly. This method should be called from the item's
|
||||
* constructor. */
|
||||
public static void addToManaFlaskCharging(Item item){
|
||||
chargingRecipeQueue.offer(item);
|
||||
}
|
||||
|
||||
/** 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();
|
||||
|
||||
FurnaceRecipes.instance().addSmeltingRecipeForBlock(WizardryBlocks.crystal_ore, new ItemStack(WizardryItems.magic_crystal), 0.5f);
|
||||
|
||||
// Mana flask recipes
|
||||
|
||||
ItemStack smallFlaskStack = new ItemStack(WizardryItems.small_mana_flask);
|
||||
ItemStack mediumFlaskStack = new ItemStack(WizardryItems.medium_mana_flask);
|
||||
ItemStack largeFlaskStack = new ItemStack(WizardryItems.large_mana_flask);
|
||||
|
||||
ItemStack chargeable;
|
||||
|
||||
while(!chargingRecipeQueue.isEmpty()){
|
||||
// Use remove() and not poll() because the queue shouldn't be empty in here
|
||||
chargeable = new ItemStack(chargingRecipeQueue.remove(), 1, OreDictionary.WILDCARD_VALUE);
|
||||
|
||||
registry.register(new ShapelessOreRecipe(null, chargeable, chargeable, smallFlaskStack){
|
||||
@Override public boolean isDynamic(){ return true; } // Stops it appearing in the recipe book
|
||||
}.setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/small_flask_" + chargeable.getItem().getRegistryName().getPath())));
|
||||
|
||||
registry.register(new ShapelessOreRecipe(null, chargeable, chargeable, mediumFlaskStack){
|
||||
@Override public boolean isDynamic(){ return true; }
|
||||
}.setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/medium_flask_" + chargeable.getItem().getRegistryName().getPath())));
|
||||
|
||||
registry.register(new ShapelessOreRecipe(null, chargeable, chargeable, largeFlaskStack){
|
||||
@Override public boolean isDynamic(){ return true; }
|
||||
}.setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/large_flask_" + chargeable.getItem().getRegistryName().getPath())));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onPlayerTickEvent(TickEvent.PlayerTickEvent event){
|
||||
|
||||
if(event.phase == TickEvent.Phase.START){
|
||||
|
||||
if(event.player.openContainer instanceof ContainerWorkbench){
|
||||
|
||||
IInventory craftMatrix = ((ContainerWorkbench)event.player.openContainer).craftMatrix;
|
||||
ItemStack output = ((ContainerWorkbench)event.player.openContainer).craftResult.getStackInSlot(0);
|
||||
processManaFlaskCrafting(craftMatrix, output);
|
||||
|
||||
}else if(event.player.openContainer instanceof ContainerPlayer){
|
||||
|
||||
IInventory craftMatrix = ((ContainerPlayer)event.player.openContainer).craftMatrix;
|
||||
ItemStack output = ((ContainerPlayer)event.player.openContainer).craftResult.getStackInSlot(0);
|
||||
// Unfortunately I have no choice but to call this method every tick when the player isn't using another
|
||||
// inventory, since the only thing tracking whether the player is looking at their inventory is the GUI
|
||||
// itself, which is client-side only.
|
||||
processManaFlaskCrafting(craftMatrix, output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void processManaFlaskCrafting(IInventory craftMatrix, ItemStack output){
|
||||
|
||||
// Charges wand using mana flask
|
||||
|
||||
ItemManaFlask flask = null;
|
||||
ItemStack input = ItemStack.EMPTY;
|
||||
|
||||
for(int i = 0; i < craftMatrix.getSizeInventory(); i++){
|
||||
|
||||
ItemStack stack = craftMatrix.getStackInSlot(i);
|
||||
|
||||
if(stack.getItem() instanceof ItemManaFlask){
|
||||
flask = (ItemManaFlask)stack.getItem();
|
||||
}
|
||||
|
||||
if(stack.getItem() instanceof IManaStoringItem){
|
||||
input = stack;
|
||||
}
|
||||
}
|
||||
|
||||
if(flask == null) return;
|
||||
|
||||
if(output.getItem() instanceof IManaStoringItem && !input.isEmpty()){
|
||||
|
||||
output.setTagCompound((input.getTagCompound()));
|
||||
|
||||
int currentMana = ((IManaStoringItem)input.getItem()).getMana(input);
|
||||
|
||||
((IManaStoringItem)output.getItem()).setMana(output, Math.min(currentMana + flask.size.capacity,
|
||||
((IManaStoringItem)input.getItem()).getManaCapacity(input)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,254 +0,0 @@
|
||||
package electroblob.wizardry.registry;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.entity.EntityArc;
|
||||
import electroblob.wizardry.entity.EntityMeteor;
|
||||
import electroblob.wizardry.entity.EntityShield;
|
||||
import electroblob.wizardry.entity.construct.EntityArrowRain;
|
||||
import electroblob.wizardry.entity.construct.EntityBlackHole;
|
||||
import electroblob.wizardry.entity.construct.EntityBlizzard;
|
||||
import electroblob.wizardry.entity.construct.EntityBubble;
|
||||
import electroblob.wizardry.entity.construct.EntityDecay;
|
||||
import electroblob.wizardry.entity.construct.EntityEarthquake;
|
||||
import electroblob.wizardry.entity.construct.EntityFireRing;
|
||||
import electroblob.wizardry.entity.construct.EntityFireSigil;
|
||||
import electroblob.wizardry.entity.construct.EntityForcefield;
|
||||
import electroblob.wizardry.entity.construct.EntityFrostSigil;
|
||||
import electroblob.wizardry.entity.construct.EntityHailstorm;
|
||||
import electroblob.wizardry.entity.construct.EntityHammer;
|
||||
import electroblob.wizardry.entity.construct.EntityHealAura;
|
||||
import electroblob.wizardry.entity.construct.EntityIceSpike;
|
||||
import electroblob.wizardry.entity.construct.EntityLightningPulse;
|
||||
import electroblob.wizardry.entity.construct.EntityLightningSigil;
|
||||
import electroblob.wizardry.entity.construct.EntityTornado;
|
||||
import electroblob.wizardry.entity.living.EntityBlazeMinion;
|
||||
import electroblob.wizardry.entity.living.EntityDecoy;
|
||||
import electroblob.wizardry.entity.living.EntityEvilWizard;
|
||||
import electroblob.wizardry.entity.living.EntityIceGiant;
|
||||
import electroblob.wizardry.entity.living.EntityIceWraith;
|
||||
import electroblob.wizardry.entity.living.EntityLightningWraith;
|
||||
import electroblob.wizardry.entity.living.EntityMagicSlime;
|
||||
import electroblob.wizardry.entity.living.EntityPhoenix;
|
||||
import electroblob.wizardry.entity.living.EntityShadowWraith;
|
||||
import electroblob.wizardry.entity.living.EntitySilverfishMinion;
|
||||
import electroblob.wizardry.entity.living.EntitySkeletonMinion;
|
||||
import electroblob.wizardry.entity.living.EntitySpiderMinion;
|
||||
import electroblob.wizardry.entity.living.EntitySpiritHorse;
|
||||
import electroblob.wizardry.entity.living.EntitySpiritWolf;
|
||||
import electroblob.wizardry.entity.living.EntityStormElemental;
|
||||
import electroblob.wizardry.entity.living.EntityWitherSkeletonMinion;
|
||||
import electroblob.wizardry.entity.living.EntityWizard;
|
||||
import electroblob.wizardry.entity.living.EntityZombieMinion;
|
||||
import electroblob.wizardry.entity.projectile.EntityDarknessOrb;
|
||||
import electroblob.wizardry.entity.projectile.EntityDart;
|
||||
import electroblob.wizardry.entity.projectile.EntityFirebolt;
|
||||
import electroblob.wizardry.entity.projectile.EntityFirebomb;
|
||||
import electroblob.wizardry.entity.projectile.EntityForceArrow;
|
||||
import electroblob.wizardry.entity.projectile.EntityForceOrb;
|
||||
import electroblob.wizardry.entity.projectile.EntityIceCharge;
|
||||
import electroblob.wizardry.entity.projectile.EntityIceLance;
|
||||
import electroblob.wizardry.entity.projectile.EntityIceShard;
|
||||
import electroblob.wizardry.entity.projectile.EntityLightningArrow;
|
||||
import electroblob.wizardry.entity.projectile.EntityLightningDisc;
|
||||
import electroblob.wizardry.entity.projectile.EntityMagicMissile;
|
||||
import electroblob.wizardry.entity.projectile.EntityPoisonBomb;
|
||||
import electroblob.wizardry.entity.projectile.EntitySmokeBomb;
|
||||
import electroblob.wizardry.entity.projectile.EntitySpark;
|
||||
import electroblob.wizardry.entity.projectile.EntitySparkBomb;
|
||||
import electroblob.wizardry.entity.projectile.EntityThunderbolt;
|
||||
import electroblob.wizardry.loot.RandomSpell;
|
||||
import electroblob.wizardry.loot.WizardSpell;
|
||||
import electroblob.wizardry.recipe.RecipeRechargeWithFlask;
|
||||
import electroblob.wizardry.tileentity.TileEntityArcaneWorkbench;
|
||||
import electroblob.wizardry.tileentity.TileEntityMagicLight;
|
||||
import electroblob.wizardry.tileentity.TileEntityPlayerSave;
|
||||
import electroblob.wizardry.tileentity.TileEntityStatue;
|
||||
import electroblob.wizardry.tileentity.TileEntityTimer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.init.Biomes;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.storage.loot.LootTableList;
|
||||
import net.minecraft.world.storage.loot.functions.LootFunctionManager;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.EntityRegistry;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
/**
|
||||
* Class responsible for registering all the things that don't have (or need) instances: entities, loot tables, recipes,
|
||||
* etc.
|
||||
*
|
||||
* @author Electroblob
|
||||
* @since Wizardry 1.0
|
||||
*/
|
||||
@Mod.EventBusSubscriber
|
||||
public final class WizardryRegistry {
|
||||
|
||||
// NOTE: In 1.12, recipes have a registry (they can still stay here though since we don't keep references to them)
|
||||
|
||||
/** Called from the preInit method in the main mod class to register the custom dungeon loot. */
|
||||
public static void registerLoot(){
|
||||
|
||||
/* Loot tables work as follows: Minecraft goes through each pool in turn. For each pool, it does a certain
|
||||
* number or rolls, which can either be set to always be one number or a random number from a range. Each roll,
|
||||
* it generates one stack of a single random entry in that pool, weighted according to the weights of the
|
||||
* entries. Functions allow properties of that stack (stack size, damage, nbt) to be set, and even allow it to
|
||||
* be replaced dynamically with a completely different item (though there's very little point in doing that as
|
||||
* it could be achieved just as easily with more entries, which makes me think it would be bad practice). You
|
||||
* can also use conditions to control whether an entry or pool is used at all, which is mostly for mob drops
|
||||
* under specific conditions, but one of them is simply a random chance, meaning you could use it to make a pool
|
||||
* that only gets rolled sometimes. All in all, this can get rather confusing, because stackable items can have
|
||||
* 5 stages of randomness applied to them at once: a random chance for the pool, a random number of rolls for
|
||||
* the pool, the weighted random chance of choosing that particular entry, a random chance for that entry, and a
|
||||
* random stack size, and that's before you take functions into account.
|
||||
*
|
||||
* ...oh, and entries can be entire loot tables in themselves, allowing for potentially infinite levels of
|
||||
* randomness. Yeah. */
|
||||
|
||||
// Always registers the loot tables, but only injects the additions into vanilla if the appropriate option is
|
||||
// enabled in the config (see WizardryEventHandler).
|
||||
LootFunctionManager.registerFunction(new RandomSpell.Serializer());
|
||||
LootFunctionManager.registerFunction(new WizardSpell.Serializer());
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "chests/wizard_tower"));
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "chests/dungeon_additions"));
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "subsets/novice_wands"));
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "subsets/wizard_armour"));
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "subsets/arcane_tomes"));
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "subsets/wand_upgrades"));
|
||||
LootTableList.register(new ResourceLocation(Wizardry.MODID, "entities/evil_wizard"));
|
||||
// TODO: At the moment this is not used anywhere because I can't find a way to add it to all mobs.
|
||||
// LootTableList.register(new ResourceLocation(Wizardry.MODID, "entities/mob_additions"));
|
||||
|
||||
}
|
||||
|
||||
/** Called from the preInit method in the main mod class to register all the tile entities. */
|
||||
public static void registerTileEntities(){
|
||||
|
||||
GameRegistry.registerTileEntity(TileEntityArcaneWorkbench.class, Wizardry.MODID + "ArcaneWorkbenchTileEntity");
|
||||
GameRegistry.registerTileEntity(TileEntityStatue.class, Wizardry.MODID + "PetrifiedStoneTileEntity");
|
||||
GameRegistry.registerTileEntity(TileEntityMagicLight.class, Wizardry.MODID + "MagicLightTileEntity");
|
||||
GameRegistry.registerTileEntity(TileEntityTimer.class, Wizardry.MODID + "TimerTileEntity");
|
||||
GameRegistry.registerTileEntity(TileEntityPlayerSave.class, Wizardry.MODID + "TileEntityPlayerSave");
|
||||
}
|
||||
|
||||
/** Not actually the frequency at all; smaller numbers are more frequent. Vanilla uses 3 I think. */
|
||||
private static final int LIVING_UPDATE_INTERVAL = 3;
|
||||
/** Not actually the frequency at all; smaller numbers are more frequent. */
|
||||
private static final int PROJECTILE_UPDATE_INTERVAL = 10;
|
||||
|
||||
/** Called from the preInit method in the main mod class to register all the entities. */
|
||||
public static void registerEntities(){
|
||||
|
||||
int id = 0; // Incrementable index for the mod specific entity id.
|
||||
|
||||
registerEntity(EntityZombieMinion.class, "zombie_minion", id++, 128, LIVING_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityMagicMissile.class, "magic_missile", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
// TODO: This should be a particle
|
||||
registerEntity(EntityArc.class, "arc", id++, 128, PROJECTILE_UPDATE_INTERVAL, false);
|
||||
registerEntity(EntitySkeletonMinion.class, "skeleton_minion", id++, 128, LIVING_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntitySparkBomb.class, "spark_bomb", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntitySpiritWolf.class, "spirit_wolf", id++, 128, LIVING_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityIceShard.class, "ice_shard", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityBlazeMinion.class, "blaze_minion", id++, 128, LIVING_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityIceWraith.class, "ice_wraith", id++, 128, LIVING_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityLightningWraith.class, "lightning_wraith", id++, 128, LIVING_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityBlackHole.class, "black_hole", id++, 128, PROJECTILE_UPDATE_INTERVAL, false);
|
||||
registerEntity(EntityShield.class, "shield", id++, 128, 1, true);
|
||||
registerEntity(EntityMeteor.class, "meteor", id++, 128, 5, true);
|
||||
registerEntity(EntityBlizzard.class, "blizzard", id++, 128, PROJECTILE_UPDATE_INTERVAL, false);
|
||||
registerEntityAndEgg(EntityWizard.class, "wizard", id++, 128, LIVING_UPDATE_INTERVAL, true, 0x19295e, 0xee9312);
|
||||
registerEntity(EntityBubble.class, "bubble", id++, 128, 3, false);
|
||||
registerEntity(EntityTornado.class, "tornado", id++, 128, 1, false);
|
||||
registerEntity(EntityHammer.class, "lightning_hammer", id++, 128, 1, true);
|
||||
registerEntity(EntityFirebomb.class, "firebomb", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityForceOrb.class, "force_orb", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityArrowRain.class, "arrow_rain", id++, 128, PROJECTILE_UPDATE_INTERVAL, false);
|
||||
registerEntity(EntitySpark.class, "spark", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityShadowWraith.class, "shadow_wraith", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityDarknessOrb.class, "darkness_orb", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntitySpiderMinion.class, "spider_minion", id++, 128, LIVING_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityHealAura.class, "healing_aura", id++, 128, PROJECTILE_UPDATE_INTERVAL, false);
|
||||
registerEntity(EntityFireSigil.class, "fire_sigil", id++, 128, PROJECTILE_UPDATE_INTERVAL, false);
|
||||
registerEntity(EntityFrostSigil.class, "frost_sigil", id++, 128, PROJECTILE_UPDATE_INTERVAL, false);
|
||||
registerEntity(EntityLightningSigil.class, "lightning_sigil", id++, 128, PROJECTILE_UPDATE_INTERVAL, false);
|
||||
registerEntity(EntityLightningArrow.class, "lightning_arrow", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityFirebolt.class, "firebolt", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityPoisonBomb.class, "poison_bomb", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityIceCharge.class, "ice_charge", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityForceArrow.class, "force_arrow", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityDart.class, "dart", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityMagicSlime.class, "magic_slime", id++, 128, LIVING_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityForcefield.class, "forcefield", id++, 128, PROJECTILE_UPDATE_INTERVAL, false);
|
||||
registerEntity(EntityFireRing.class, "ring_of_fire", id++, 128, PROJECTILE_UPDATE_INTERVAL, false);
|
||||
registerEntity(EntityLightningDisc.class, "lightning_disc", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityThunderbolt.class, "thunderbolt", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityIceGiant.class, "ice_giant", id++, 128, LIVING_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntitySpiritHorse.class, "spirit_horse", id++, 128, LIVING_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityPhoenix.class, "phoenix", id++, 128, LIVING_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntitySilverfishMinion.class, "silverfish_minion", id++, 128, LIVING_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityDecay.class, "decay", id++, 128, PROJECTILE_UPDATE_INTERVAL, false);
|
||||
registerEntity(EntityStormElemental.class, "storm_elemental", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityEarthquake.class, "earthquake", id++, 128, PROJECTILE_UPDATE_INTERVAL, false);
|
||||
registerEntity(EntityIceLance.class, "ice_lance", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityHailstorm.class, "hailstorm", id++, 128, PROJECTILE_UPDATE_INTERVAL, false);
|
||||
registerEntity(EntitySmokeBomb.class, "smoke_bomb", id++, 128, PROJECTILE_UPDATE_INTERVAL, true);
|
||||
registerEntityAndEgg(EntityEvilWizard.class, "evil_wizard", id++, 128, LIVING_UPDATE_INTERVAL, true, 0x290404, 0xee9312);
|
||||
registerEntity(EntityDecoy.class, "decoy", id++, 128, LIVING_UPDATE_INTERVAL, true);
|
||||
registerEntity(EntityIceSpike.class, "ice_spike", id++, 128, 1, true);
|
||||
// TODO: This should be a particle.
|
||||
registerEntity(EntityLightningPulse.class, "lightning_pulse", id++, 128, PROJECTILE_UPDATE_INTERVAL, false);
|
||||
registerEntity(EntityWitherSkeletonMinion.class, "wither_skeleton_minion", id++, 128, LIVING_UPDATE_INTERVAL, true);
|
||||
|
||||
// TODO: May need fixing
|
||||
List<Biome> biomes = Lists.newArrayList();
|
||||
for (Biome biome : ForgeRegistries.BIOMES.getValuesCollection()) {
|
||||
biomes.add(biome);
|
||||
}
|
||||
biomes.remove(Biomes.MUSHROOM_ISLAND);
|
||||
biomes.remove(Biomes.MUSHROOM_ISLAND_SHORE);
|
||||
// For reference: 5, 1, 1 are the parameters for the witch in vanilla.
|
||||
EntityRegistry.addSpawn(EntityEvilWizard.class, 3, 1, 1, EnumCreatureType.MONSTER, biomes.toArray(new Biome[biomes.size()]));
|
||||
|
||||
}
|
||||
|
||||
/** Private helper method for registering entities; keeps things neater. For some reason, Forge 1.11.2 wants a
|
||||
* ResourceLocation and a string name... probably because it's transitioning to the registry system. */
|
||||
private static void registerEntity(Class<? extends Entity> entityClass, String name, int id, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates){
|
||||
ResourceLocation registryName = new ResourceLocation(Wizardry.MODID, name);
|
||||
EntityRegistry.registerModEntity(registryName, entityClass, registryName.toString(), id, Wizardry.instance, trackingRange, updateFrequency, sendsVelocityUpdates);
|
||||
}
|
||||
|
||||
/** Private helper method for registering entities with eggs; keeps things neater. For some reason, Forge 1.11.2
|
||||
* wants a ResourceLocation and a string name... probably because it's transitioning to the registry system. */
|
||||
private static void registerEntityAndEgg(Class<? extends Entity> entityClass, String name, int id, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates, int eggColour, int spotColour){
|
||||
ResourceLocation registryName = new ResourceLocation(Wizardry.MODID, name);
|
||||
EntityRegistry.registerModEntity(registryName, entityClass, registryName.toString(), id, Wizardry.instance, trackingRange, updateFrequency, sendsVelocityUpdates);
|
||||
EntityRegistry.registerEgg(registryName, eggColour, spotColour);
|
||||
}
|
||||
|
||||
/** 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();
|
||||
|
||||
FurnaceRecipes.instance().addSmeltingRecipeForBlock(WizardryBlocks.crystal_ore, new ItemStack(WizardryItems.magic_crystal), 0.5f);
|
||||
|
||||
// Mana flask recipe
|
||||
registry.register(new RecipeRechargeWithFlask().setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/eb_rechargeable_with_flask")));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +1,17 @@
|
||||
package electroblob.wizardry.registry;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.misc.Forfeit;
|
||||
import electroblob.wizardry.spell.Spell;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
/**
|
||||
* Class responsible for defining, storing and registering all of wizardry's sound events. For some reason, these worked
|
||||
* in the beta versions despite not being registered...
|
||||
* Class responsible for defining, storing and registering all of wizardry's sound events.
|
||||
*
|
||||
* @author Electroblob
|
||||
* @since Wizardry 2.1
|
||||
@@ -17,26 +19,118 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
@Mod.EventBusSubscriber
|
||||
public final class WizardrySounds {
|
||||
|
||||
// Anything with LOOP in its name is intended to be played in a continuous loop.
|
||||
public static final SoundEvent SPELL_SPARK = createSound("arc");
|
||||
public static final SoundEvent SPELL_CONJURATION = createSound("aura");
|
||||
public static final SoundEvent SPELL_SHOCKWAVE = createSound("boom");
|
||||
public static final SoundEvent SPELL_LOOP_CRACKLE = createSound("crackle");
|
||||
public static final SoundEvent SPELL_SUMMONING = createSound("darkaura");
|
||||
public static final SoundEvent SPELL_DEFLECTION = createSound("effect");
|
||||
public static final SoundEvent SPELL_LIGHTNING = createSound("electricitya");
|
||||
public static final SoundEvent SPELL_LOOP_LIGHTNING = createSound("electricityb");
|
||||
public static final SoundEvent SPELL_LOOP_FIRE = createSound("flameray");
|
||||
public static final SoundEvent SPELL_FREEZE = createSound("freeze");
|
||||
public static final SoundEvent SPELL_LOOP_ICE = createSound("frostray");
|
||||
public static final SoundEvent SPELL_HEAL = createSound("heal");
|
||||
public static final SoundEvent SPELL_ICE = createSound("ice");
|
||||
public static final SoundEvent SPELL_CONJURATION_LARGE = createSound("largeaura");
|
||||
public static final SoundEvent SPELL_MAGIC = createSound("magic");
|
||||
public static final SoundEvent SPELL_LOOP_SPARKLE = createSound("sparkle");
|
||||
public static final SoundEvent SPELL_LOOP_WIND = createSound("wind");
|
||||
public static final SoundEvent SPELL_EARTHQUAKE = createSound("rumble");
|
||||
public static final SoundEvent SPELL_FORCE = createSound("force");
|
||||
private WizardrySounds(){} // No instances!
|
||||
|
||||
/** Sound category for all spell-related sounds. This includes inanimate magical entities, but not minions.
|
||||
* @see electroblob.wizardry.util.CustomSoundCategory */
|
||||
public static SoundCategory SPELLS;
|
||||
|
||||
public static final SoundEvent BLOCK_ARCANE_WORKBENCH_SPELLBIND = createSound("block.arcane_workbench.bind_spell");
|
||||
public static final SoundEvent BLOCK_PEDESTAL_ACTIVATE = createSound("block.pedestal.activate");
|
||||
public static final SoundEvent BLOCK_PEDESTAL_CONQUER = createSound("block.pedestal.conquer");
|
||||
|
||||
public static final SoundEvent ITEM_WAND_SWITCH_SPELL = createSound("item.wand.switch_spell");
|
||||
public static final SoundEvent ITEM_WAND_LEVELUP = createSound("item.wand.levelup");
|
||||
public static final SoundEvent ITEM_WAND_MELEE = createSound("item.wand.melee");
|
||||
public static final SoundEvent ITEM_ARMOUR_EQUIP_SILK = createSound("item.armour.equip_silk");
|
||||
public static final SoundEvent ITEM_PURIFYING_ELIXIR_DRINK = createSound("item.purifying_elixir.drink");
|
||||
|
||||
public static final SoundEvent ENTITY_BLACK_HOLE_AMBIENT = createSound("entity.black_hole.ambient");
|
||||
public static final SoundEvent ENTITY_BLACK_HOLE_VANISH = createSound("entity.black_hole.vanish");
|
||||
public static final SoundEvent ENTITY_BUBBLE_POP = createSound("entity.bubble.pop");
|
||||
public static final SoundEvent ENTITY_BLIZZARD_AMBIENT = createSound("entity.blizzard.ambient");
|
||||
public static final SoundEvent ENTITY_DECAY_AMBIENT = createSound("entity.decay.ambient");
|
||||
public static final SoundEvent ENTITY_ENTRAPMENT_AMBIENT = createSound("entity.entrapment.ambient");
|
||||
public static final SoundEvent ENTITY_ENTRAPMENT_VANISH = createSound("entity.entrapment.vanish");
|
||||
public static final SoundEvent ENTITY_FIRE_RING_AMBIENT = createSound("entity.fire_ring.ambient");
|
||||
public static final SoundEvent ENTITY_FIRE_SIGIL_TRIGGER = createSound("entity.fire_sigil.trigger");
|
||||
public static final SoundEvent ENTITY_FORCEFIELD_DEFLECT = createSound("entity.forcefield.deflect");
|
||||
public static final SoundEvent ENTITY_FROST_SIGIL_TRIGGER = createSound("entity.frost_sigil.trigger");
|
||||
public static final SoundEvent ENTITY_HAMMER_ATTACK = createSound("entity.hammer.attack");
|
||||
public static final SoundEvent ENTITY_HAMMER_EXPLODE = createSound("entity.hammer.explode");
|
||||
public static final SoundEvent ENTITY_HAMMER_THROW = createSound("entity.hammer.throw");
|
||||
public static final SoundEvent ENTITY_HAMMER_LAND = createSound("entity.hammer.land");
|
||||
public static final SoundEvent ENTITY_HEAL_AURA_AMBIENT = createSound("entity.heal_aura.ambient");
|
||||
public static final SoundEvent ENTITY_ICE_SPIKE_EXTEND = createSound("entity.ice_spike.extend");
|
||||
public static final SoundEvent ENTITY_LIGHTNING_SIGIL_TRIGGER = createSound("entity.lightning_sigil.trigger");
|
||||
public static final SoundEvent ENTITY_METEOR_FALLING = createSound("entity.meteor.falling");
|
||||
public static final SoundEvent ENTITY_SHIELD_DEFLECT = createSound("entity.shield.deflect");
|
||||
public static final SoundEvent ENTITY_TORNADO_AMBIENT = createSound("entity.tornado.ambient");
|
||||
|
||||
public static final SoundEvent ENTITY_EVIL_WIZARD_AMBIENT = createSound("entity.evil_wizard.ambient");
|
||||
public static final SoundEvent ENTITY_EVIL_WIZARD_HURT = createSound("entity.evil_wizard.hurt");
|
||||
public static final SoundEvent ENTITY_EVIL_WIZARD_DEATH = createSound("entity.evil_wizard.death");
|
||||
public static final SoundEvent ENTITY_ICE_GIANT_ATTACK = createSound("entity.ice_giant.attack");
|
||||
public static final SoundEvent ENTITY_ICE_GIANT_DESPAWN = createSound("entity.ice_giant.despawn");
|
||||
public static final SoundEvent ENTITY_ICE_WRAITH_AMBIENT = createSound("entity.ice_wraith.ambient");
|
||||
public static final SoundEvent ENTITY_MAGIC_SLIME_ATTACK = createSound("entity.magic_slime.attack");
|
||||
public static final SoundEvent ENTITY_MAGIC_SLIME_EXPLODE = createSound("entity.magic_slime.explode");
|
||||
public static final SoundEvent ENTITY_MAGIC_SLIME_SPLAT = createSound("entity.magic_slime.splat");
|
||||
public static final SoundEvent ENTITY_PHOENIX_AMBIENT = createSound("entity.phoenix.ambient");
|
||||
public static final SoundEvent ENTITY_PHOENIX_BURN = createSound("entity.phoenix.burn");
|
||||
public static final SoundEvent ENTITY_PHOENIX_FLAP = createSound("entity.phoenix.flap");
|
||||
public static final SoundEvent ENTITY_PHOENIX_HURT = createSound("entity.phoenix.hurt");
|
||||
public static final SoundEvent ENTITY_PHOENIX_DEATH = createSound("entity.phoenix.death");
|
||||
public static final SoundEvent ENTITY_SHADOW_WRAITH_AMBIENT = createSound("entity.shadow_wraith.ambient");
|
||||
public static final SoundEvent ENTITY_SHADOW_WRAITH_NOISE = createSound("entity.shadow_wraith.noise");
|
||||
public static final SoundEvent ENTITY_SHADOW_WRAITH_HURT = createSound("entity.shadow_wraith.hurt");
|
||||
public static final SoundEvent ENTITY_SHADOW_WRAITH_DEATH = createSound("entity.shadow_wraith.death");
|
||||
public static final SoundEvent ENTITY_SPIRIT_HORSE_VANISH = createSound("entity.spirit_horse.vanish");
|
||||
public static final SoundEvent ENTITY_SPIRIT_WOLF_VANISH = createSound("entity.spirit_wolf.vanish");
|
||||
public static final SoundEvent ENTITY_STORM_ELEMENTAL_AMBIENT = createSound("entity.storm_elemental.ambient");
|
||||
public static final SoundEvent ENTITY_STORM_ELEMENTAL_BURN = createSound("entity.storm_elemental.burn");
|
||||
public static final SoundEvent ENTITY_STORM_ELEMENTAL_WIND = createSound("entity.storm_elemental.wind");
|
||||
public static final SoundEvent ENTITY_STORM_ELEMENTAL_HURT = createSound("entity.storm_elemental.hurt");
|
||||
public static final SoundEvent ENTITY_STORM_ELEMENTAL_DEATH = createSound("entity.storm_elemental.death");
|
||||
public static final SoundEvent ENTITY_WIZARD_YES = createSound("entity.wizard.yes");
|
||||
public static final SoundEvent ENTITY_WIZARD_NO = createSound("entity.wizard.no");
|
||||
public static final SoundEvent ENTITY_WIZARD_AMBIENT = createSound("entity.wizard.ambient");
|
||||
public static final SoundEvent ENTITY_WIZARD_TRADING = createSound("entity.wizard.trading");
|
||||
public static final SoundEvent ENTITY_WIZARD_HURT = createSound("entity.wizard.hurt");
|
||||
public static final SoundEvent ENTITY_WIZARD_DEATH = createSound("entity.wizard.death");
|
||||
|
||||
public static final SoundEvent ENTITY_DARKNESS_ORB_HIT = createSound("entity.darkness_orb.hit");
|
||||
public static final SoundEvent ENTITY_DART_HIT = createSound("entity.dart.hit");
|
||||
public static final SoundEvent ENTITY_DART_HIT_BLOCK = createSound("entity.dart.hit_block");
|
||||
public static final SoundEvent ENTITY_FIREBOLT_HIT = createSound("entity.firebolt.hit");
|
||||
public static final SoundEvent ENTITY_FIREBOMB_THROW = createSound("entity.firebomb.throw");
|
||||
public static final SoundEvent ENTITY_FIREBOMB_SMASH = createSound("entity.firebomb.smash");
|
||||
public static final SoundEvent ENTITY_FIREBOMB_FIRE = createSound("entity.firebomb.fire");
|
||||
public static final SoundEvent ENTITY_FORCE_ARROW_HIT = createSound("entity.force_arrow.hit");
|
||||
public static final SoundEvent ENTITY_FORCE_ORB_HIT = createSound("entity.force_orb.hit");
|
||||
public static final SoundEvent ENTITY_FORCE_ORB_HIT_BLOCK = createSound("entity.force_orb.hit_block");
|
||||
public static final SoundEvent ENTITY_ICEBALL_HIT = createSound("entity.iceball.hit");
|
||||
public static final SoundEvent ENTITY_ICE_CHARGE_SMASH = createSound("entity.ice_charge.smash");
|
||||
public static final SoundEvent ENTITY_ICE_CHARGE_ICE = createSound("entity.ice_charge.ice");
|
||||
public static final SoundEvent ENTITY_ICE_LANCE_SMASH = createSound("entity.ice_lance.smash");
|
||||
public static final SoundEvent ENTITY_ICE_LANCE_HIT = createSound("entity.ice_lance.hit");
|
||||
public static final SoundEvent ENTITY_ICE_SHARD_SMASH = createSound("entity.ice_shard.smash");
|
||||
public static final SoundEvent ENTITY_ICE_SHARD_HIT = createSound("entity.ice_shard.hit");
|
||||
public static final SoundEvent ENTITY_LIGHTNING_ARROW_HIT = createSound("entity.lightning_arrow.hit");
|
||||
public static final SoundEvent ENTITY_LIGHTNING_DISC_HIT = createSound("entity.lightning_disc.hit");
|
||||
// public static final SoundEvent ENTITY_MAGIC_FIREBALL_HIT = createSound("entity.magic_fireball.hit");
|
||||
public static final SoundEvent ENTITY_MAGIC_MISSILE_HIT = createSound("entity.magic_missile.hit");
|
||||
public static final SoundEvent ENTITY_POISON_BOMB_THROW = createSound("entity.poison_bomb.throw");
|
||||
public static final SoundEvent ENTITY_POISON_BOMB_SMASH = createSound("entity.poison_bomb.smash");
|
||||
public static final SoundEvent ENTITY_POISON_BOMB_POISON = createSound("entity.poison_bomb.poison");
|
||||
public static final SoundEvent ENTITY_SMOKE_BOMB_THROW = createSound("entity.smoke_bomb.throw");
|
||||
public static final SoundEvent ENTITY_SMOKE_BOMB_SMASH = createSound("entity.smoke_bomb.smash");
|
||||
public static final SoundEvent ENTITY_SMOKE_BOMB_SMOKE = createSound("entity.smoke_bomb.smoke");
|
||||
public static final SoundEvent ENTITY_HOMING_SPARK_HIT = createSound("entity.homing_spark.hit");
|
||||
public static final SoundEvent ENTITY_SPARK_BOMB_THROW = createSound("entity.spark_bomb.throw");
|
||||
public static final SoundEvent ENTITY_SPARK_BOMB_HIT = createSound("entity.spark_bomb.hit");
|
||||
public static final SoundEvent ENTITY_SPARK_BOMB_HIT_BLOCK = createSound("entity.spark_bomb.hit_block");
|
||||
public static final SoundEvent ENTITY_SPARK_BOMB_CHAIN = createSound("entity.spark_bomb.chain");
|
||||
public static final SoundEvent ENTITY_THUNDERBOLT_HIT = createSound("entity.thunderbolt.hit");
|
||||
|
||||
public static final SoundEvent SPELL_STATIC_AURA_RETALIATE = createSound("spell.static_aura.retaliate");
|
||||
public static final SoundEvent SPELL_CURSE_OF_SOULBINDING_RETALIATE = createSound("spell.curse_of_soulbinding.retaliate");
|
||||
public static final SoundEvent SPELL_TRANSPORTATION_TRAVEL = createSound("spell.transportation.travel");
|
||||
|
||||
public static final SoundEvent MISC_DISCOVER_SPELL = createSound("misc.discover_spell");
|
||||
public static final SoundEvent MISC_BOOK_OPEN = createSound("misc.book_open");
|
||||
public static final SoundEvent MISC_PAGE_TURN = createSound("misc.page_turn");
|
||||
public static final SoundEvent MISC_FREEZE = createSound("misc.freeze");
|
||||
|
||||
/** Trick borrowed from the Twilight Forest, makes things neater. */
|
||||
public static SoundEvent createSound(String name){
|
||||
@@ -44,26 +138,124 @@ public final class WizardrySounds {
|
||||
return new SoundEvent(new ResourceLocation(Wizardry.MODID, name)).setRegistryName(name);
|
||||
}
|
||||
|
||||
// For some reason, sound events seem to work even when they aren't registered, without even so much as a warning.
|
||||
|
||||
@SubscribeEvent
|
||||
public static void register(RegistryEvent.Register<SoundEvent> event){
|
||||
event.getRegistry().register(SPELL_SPARK);
|
||||
event.getRegistry().register(SPELL_CONJURATION);
|
||||
event.getRegistry().register(SPELL_SHOCKWAVE);
|
||||
event.getRegistry().register(SPELL_LOOP_CRACKLE);
|
||||
event.getRegistry().register(SPELL_SUMMONING);
|
||||
event.getRegistry().register(SPELL_DEFLECTION);
|
||||
event.getRegistry().register(SPELL_LIGHTNING);
|
||||
event.getRegistry().register(SPELL_LOOP_LIGHTNING);
|
||||
event.getRegistry().register(SPELL_LOOP_FIRE);
|
||||
event.getRegistry().register(SPELL_FREEZE);
|
||||
event.getRegistry().register(SPELL_LOOP_ICE);
|
||||
event.getRegistry().register(SPELL_HEAL);
|
||||
event.getRegistry().register(SPELL_ICE);
|
||||
event.getRegistry().register(SPELL_CONJURATION_LARGE);
|
||||
event.getRegistry().register(SPELL_MAGIC);
|
||||
event.getRegistry().register(SPELL_LOOP_SPARKLE);
|
||||
event.getRegistry().register(SPELL_LOOP_WIND);
|
||||
event.getRegistry().register(SPELL_EARTHQUAKE);
|
||||
event.getRegistry().register(SPELL_FORCE);
|
||||
|
||||
event.getRegistry().register(BLOCK_ARCANE_WORKBENCH_SPELLBIND);
|
||||
event.getRegistry().register(BLOCK_PEDESTAL_ACTIVATE);
|
||||
event.getRegistry().register(BLOCK_PEDESTAL_CONQUER);
|
||||
|
||||
event.getRegistry().register(ITEM_WAND_SWITCH_SPELL);
|
||||
event.getRegistry().register(ITEM_WAND_LEVELUP);
|
||||
event.getRegistry().register(ITEM_WAND_MELEE);
|
||||
event.getRegistry().register(ITEM_ARMOUR_EQUIP_SILK);
|
||||
event.getRegistry().register(ITEM_PURIFYING_ELIXIR_DRINK);
|
||||
|
||||
event.getRegistry().register(ENTITY_BLACK_HOLE_AMBIENT);
|
||||
event.getRegistry().register(ENTITY_BLACK_HOLE_VANISH);
|
||||
event.getRegistry().register(ENTITY_BUBBLE_POP);
|
||||
event.getRegistry().register(ENTITY_BLIZZARD_AMBIENT);
|
||||
event.getRegistry().register(ENTITY_DECAY_AMBIENT);
|
||||
event.getRegistry().register(ENTITY_ENTRAPMENT_AMBIENT);
|
||||
event.getRegistry().register(ENTITY_ENTRAPMENT_VANISH);
|
||||
event.getRegistry().register(ENTITY_FIRE_RING_AMBIENT);
|
||||
event.getRegistry().register(ENTITY_FIRE_SIGIL_TRIGGER);
|
||||
event.getRegistry().register(ENTITY_FORCEFIELD_DEFLECT);
|
||||
event.getRegistry().register(ENTITY_FROST_SIGIL_TRIGGER);
|
||||
event.getRegistry().register(ENTITY_HAMMER_ATTACK);
|
||||
event.getRegistry().register(ENTITY_HAMMER_EXPLODE);
|
||||
event.getRegistry().register(ENTITY_HAMMER_THROW);
|
||||
event.getRegistry().register(ENTITY_HAMMER_LAND);
|
||||
event.getRegistry().register(ENTITY_HEAL_AURA_AMBIENT);
|
||||
event.getRegistry().register(ENTITY_ICE_SPIKE_EXTEND);
|
||||
event.getRegistry().register(ENTITY_LIGHTNING_SIGIL_TRIGGER);
|
||||
event.getRegistry().register(ENTITY_METEOR_FALLING);
|
||||
event.getRegistry().register(ENTITY_SHIELD_DEFLECT);
|
||||
event.getRegistry().register(ENTITY_TORNADO_AMBIENT);
|
||||
|
||||
event.getRegistry().register(ENTITY_EVIL_WIZARD_AMBIENT);
|
||||
event.getRegistry().register(ENTITY_EVIL_WIZARD_HURT);
|
||||
event.getRegistry().register(ENTITY_EVIL_WIZARD_DEATH);
|
||||
event.getRegistry().register(ENTITY_ICE_GIANT_ATTACK);
|
||||
event.getRegistry().register(ENTITY_ICE_GIANT_DESPAWN);
|
||||
event.getRegistry().register(ENTITY_ICE_WRAITH_AMBIENT);
|
||||
event.getRegistry().register(ENTITY_MAGIC_SLIME_ATTACK);
|
||||
event.getRegistry().register(ENTITY_MAGIC_SLIME_EXPLODE);
|
||||
event.getRegistry().register(ENTITY_MAGIC_SLIME_SPLAT);
|
||||
event.getRegistry().register(ENTITY_PHOENIX_AMBIENT);
|
||||
event.getRegistry().register(ENTITY_PHOENIX_BURN);
|
||||
event.getRegistry().register(ENTITY_PHOENIX_FLAP);
|
||||
event.getRegistry().register(ENTITY_PHOENIX_HURT);
|
||||
event.getRegistry().register(ENTITY_PHOENIX_DEATH);
|
||||
event.getRegistry().register(ENTITY_SHADOW_WRAITH_AMBIENT);
|
||||
event.getRegistry().register(ENTITY_SHADOW_WRAITH_NOISE);
|
||||
event.getRegistry().register(ENTITY_SHADOW_WRAITH_HURT);
|
||||
event.getRegistry().register(ENTITY_SHADOW_WRAITH_DEATH);
|
||||
event.getRegistry().register(ENTITY_SPIRIT_HORSE_VANISH);
|
||||
event.getRegistry().register(ENTITY_SPIRIT_WOLF_VANISH);
|
||||
event.getRegistry().register(ENTITY_STORM_ELEMENTAL_AMBIENT);
|
||||
event.getRegistry().register(ENTITY_STORM_ELEMENTAL_BURN);
|
||||
event.getRegistry().register(ENTITY_STORM_ELEMENTAL_WIND);
|
||||
event.getRegistry().register(ENTITY_STORM_ELEMENTAL_HURT);
|
||||
event.getRegistry().register(ENTITY_STORM_ELEMENTAL_DEATH);
|
||||
event.getRegistry().register(ENTITY_WIZARD_YES);
|
||||
event.getRegistry().register(ENTITY_WIZARD_NO);
|
||||
event.getRegistry().register(ENTITY_WIZARD_AMBIENT);
|
||||
event.getRegistry().register(ENTITY_WIZARD_TRADING);
|
||||
event.getRegistry().register(ENTITY_WIZARD_HURT);
|
||||
event.getRegistry().register(ENTITY_WIZARD_DEATH);
|
||||
|
||||
event.getRegistry().register(ENTITY_DARKNESS_ORB_HIT);
|
||||
event.getRegistry().register(ENTITY_DART_HIT);
|
||||
event.getRegistry().register(ENTITY_DART_HIT_BLOCK);
|
||||
event.getRegistry().register(ENTITY_FIREBOLT_HIT);
|
||||
event.getRegistry().register(ENTITY_FIREBOMB_THROW);
|
||||
event.getRegistry().register(ENTITY_FIREBOMB_SMASH);
|
||||
event.getRegistry().register(ENTITY_FIREBOMB_FIRE);
|
||||
event.getRegistry().register(ENTITY_FORCE_ARROW_HIT);
|
||||
event.getRegistry().register(ENTITY_FORCE_ORB_HIT);
|
||||
event.getRegistry().register(ENTITY_FORCE_ORB_HIT_BLOCK);
|
||||
event.getRegistry().register(ENTITY_ICEBALL_HIT);
|
||||
event.getRegistry().register(ENTITY_ICE_CHARGE_SMASH);
|
||||
event.getRegistry().register(ENTITY_ICE_CHARGE_ICE);
|
||||
event.getRegistry().register(ENTITY_ICE_LANCE_SMASH);
|
||||
event.getRegistry().register(ENTITY_ICE_LANCE_HIT);
|
||||
event.getRegistry().register(ENTITY_ICE_SHARD_SMASH);
|
||||
event.getRegistry().register(ENTITY_ICE_SHARD_HIT);
|
||||
event.getRegistry().register(ENTITY_LIGHTNING_ARROW_HIT);
|
||||
event.getRegistry().register(ENTITY_LIGHTNING_DISC_HIT);
|
||||
// event.getRegistry().register(ENTITY_MAGIC_FIREBALL_HIT);
|
||||
event.getRegistry().register(ENTITY_MAGIC_MISSILE_HIT);
|
||||
event.getRegistry().register(ENTITY_POISON_BOMB_THROW);
|
||||
event.getRegistry().register(ENTITY_POISON_BOMB_SMASH);
|
||||
event.getRegistry().register(ENTITY_POISON_BOMB_POISON);
|
||||
event.getRegistry().register(ENTITY_SMOKE_BOMB_THROW);
|
||||
event.getRegistry().register(ENTITY_SMOKE_BOMB_SMASH);
|
||||
event.getRegistry().register(ENTITY_SMOKE_BOMB_SMOKE);
|
||||
event.getRegistry().register(ENTITY_HOMING_SPARK_HIT);
|
||||
event.getRegistry().register(ENTITY_SPARK_BOMB_THROW);
|
||||
event.getRegistry().register(ENTITY_SPARK_BOMB_HIT);
|
||||
event.getRegistry().register(ENTITY_SPARK_BOMB_HIT_BLOCK);
|
||||
event.getRegistry().register(ENTITY_SPARK_BOMB_CHAIN);
|
||||
event.getRegistry().register(ENTITY_THUNDERBOLT_HIT);
|
||||
|
||||
event.getRegistry().register(SPELL_STATIC_AURA_RETALIATE);
|
||||
event.getRegistry().register(SPELL_CURSE_OF_SOULBINDING_RETALIATE);
|
||||
event.getRegistry().register(SPELL_TRANSPORTATION_TRAVEL);
|
||||
|
||||
event.getRegistry().register(MISC_DISCOVER_SPELL);
|
||||
event.getRegistry().register(MISC_BOOK_OPEN);
|
||||
event.getRegistry().register(MISC_PAGE_TURN);
|
||||
event.getRegistry().register(MISC_FREEZE);
|
||||
|
||||
for(Spell spell : Spell.getSpells(Spell.allSpells)){
|
||||
event.getRegistry().registerAll(spell.getSounds());
|
||||
}
|
||||
|
||||
for(Forfeit forfeit : Forfeit.getForfeits()){
|
||||
event.getRegistry().register(forfeit.getSound());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,5 @@
|
||||
package electroblob.wizardry.registry;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import electroblob.wizardry.item.ItemScroll;
|
||||
import electroblob.wizardry.item.ItemSpellBook;
|
||||
import electroblob.wizardry.spell.Spell;
|
||||
@@ -15,6 +10,10 @@ import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Class responsible for defining and storing all of wizardry's creative tabs. Also handles sorting of the items.
|
||||
*
|
||||
@@ -23,111 +22,100 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
*/
|
||||
public final class WizardryTabs {
|
||||
|
||||
private static Comparator<ItemStack> itemSorter;
|
||||
private static Comparator<ItemStack> spellItemSorter;
|
||||
private WizardryTabs(){} // No instances!
|
||||
|
||||
// Creative Tabs
|
||||
public static final CreativeTabs WIZARDRY = new CreativeTabs("ebwizardry"){
|
||||
public static final CreativeTabs WIZARDRY = new CreativeTabListed("ebwizardry");
|
||||
public static final CreativeTabs GEAR = new CreativeTabListed("ebwizardrygear");
|
||||
public static final CreativeTabs SPELLS = new CreativeTabSorted("ebwizardryspells",
|
||||
|
||||
(stack1, stack2) -> {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ItemStack createIcon(){
|
||||
return new ItemStack(WizardryItems.wizard_handbook);
|
||||
}
|
||||
if((stack1.getItem() instanceof ItemSpellBook && stack2.getItem() instanceof ItemSpellBook)
|
||||
|| (stack1.getItem() instanceof ItemScroll && stack2.getItem() instanceof ItemScroll)){
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void displayAllRelevantItems(NonNullList<ItemStack> items){
|
||||
super.displayAllRelevantItems(items);
|
||||
Collections.sort(items, itemSorter);
|
||||
}
|
||||
};
|
||||
Spell spell1 = Spell.byMetadata(stack1.getItemDamage());
|
||||
Spell spell2 = Spell.byMetadata(stack2.getItemDamage());
|
||||
|
||||
return spell1.compareTo(spell2);
|
||||
|
||||
}else if(stack1.getItem() instanceof ItemScroll){
|
||||
return 1;
|
||||
}else if(stack2.getItem() instanceof ItemScroll){
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
|
||||
true);
|
||||
|
||||
public static final CreativeTabs SPELLS = new CreativeTabs("ebwizardryspells"){
|
||||
public static class CreativeTabSorted extends CreativeTabs {
|
||||
|
||||
private ItemStack iconItem;
|
||||
private final Comparator<? super ItemStack> sorter;
|
||||
private final boolean searchable;
|
||||
|
||||
public CreativeTabSorted(String label, Comparator<? super ItemStack> sorter){
|
||||
this(label, sorter, false);
|
||||
}
|
||||
|
||||
public CreativeTabSorted(String label, Comparator<? super ItemStack> sorter, boolean searchable){
|
||||
super(label);
|
||||
this.sorter = sorter;
|
||||
this.searchable = searchable;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ItemStack createIcon(){
|
||||
return new ItemStack(WizardryItems.spell_book);
|
||||
return iconItem;
|
||||
}
|
||||
|
||||
public void setIconItem(ItemStack iconItem){
|
||||
this.iconItem = iconItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void displayAllRelevantItems(NonNullList<ItemStack> items){
|
||||
super.displayAllRelevantItems(items);
|
||||
Collections.sort(items, spellItemSorter);
|
||||
items.sort(sorter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasSearchBar(){
|
||||
return true;
|
||||
return searchable;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getBackgroundImageName(){
|
||||
return "item_search.png";
|
||||
return searchable ? "item_search.png" : super.getBackgroundImageName();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static class CreativeTabListed extends CreativeTabSorted {
|
||||
|
||||
/** Initialises the item sorters for the creative tabs. */
|
||||
public static void sort(){
|
||||
public final List<Item> order;
|
||||
|
||||
List<Item> orderedItemList = Arrays.asList(
|
||||
|
||||
Item.getItemFromBlock(WizardryBlocks.arcane_workbench),
|
||||
Item.getItemFromBlock(WizardryBlocks.crystal_ore), Item.getItemFromBlock(WizardryBlocks.crystal_block),
|
||||
Item.getItemFromBlock(WizardryBlocks.crystal_flower),
|
||||
Item.getItemFromBlock(WizardryBlocks.transportation_stone), WizardryItems.magic_crystal,
|
||||
WizardryItems.magic_wand, WizardryItems.apprentice_wand, WizardryItems.advanced_wand,
|
||||
WizardryItems.master_wand, WizardryItems.arcane_tome, WizardryItems.wizard_handbook,
|
||||
WizardryItems.basic_fire_wand, WizardryItems.basic_ice_wand, WizardryItems.basic_lightning_wand,
|
||||
WizardryItems.basic_necromancy_wand, WizardryItems.basic_earth_wand, WizardryItems.basic_sorcery_wand,
|
||||
WizardryItems.basic_healing_wand, WizardryItems.smoke_bomb, WizardryItems.firebomb,
|
||||
WizardryItems.poison_bomb, WizardryItems.blank_scroll, WizardryItems.identification_scroll,
|
||||
WizardryItems.mana_flask, WizardryItems.storage_upgrade, WizardryItems.siphon_upgrade,
|
||||
WizardryItems.condenser_upgrade, WizardryItems.range_upgrade, WizardryItems.duration_upgrade,
|
||||
WizardryItems.cooldown_upgrade, WizardryItems.blast_upgrade, WizardryItems.attunement_upgrade,
|
||||
WizardryItems.magic_silk, WizardryItems.armour_upgrade, WizardryItems.wizard_hat,
|
||||
WizardryItems.wizard_robe, WizardryItems.wizard_leggings, WizardryItems.wizard_boots,
|
||||
WizardryItems.wizard_hat_fire, WizardryItems.wizard_robe_fire, WizardryItems.wizard_leggings_fire,
|
||||
WizardryItems.wizard_boots_fire, WizardryItems.wizard_hat_ice, WizardryItems.wizard_robe_ice,
|
||||
WizardryItems.wizard_leggings_ice, WizardryItems.wizard_boots_ice, WizardryItems.wizard_hat_lightning,
|
||||
WizardryItems.wizard_robe_lightning, WizardryItems.wizard_leggings_lightning,
|
||||
WizardryItems.wizard_boots_lightning, WizardryItems.wizard_hat_necromancy,
|
||||
WizardryItems.wizard_robe_necromancy, WizardryItems.wizard_leggings_necromancy,
|
||||
WizardryItems.wizard_boots_necromancy, WizardryItems.wizard_hat_earth, WizardryItems.wizard_robe_earth,
|
||||
WizardryItems.wizard_leggings_earth, WizardryItems.wizard_boots_earth, WizardryItems.wizard_hat_sorcery,
|
||||
WizardryItems.wizard_robe_sorcery, WizardryItems.wizard_leggings_sorcery,
|
||||
WizardryItems.wizard_boots_sorcery, WizardryItems.wizard_hat_healing, WizardryItems.wizard_robe_healing,
|
||||
WizardryItems.wizard_leggings_healing, WizardryItems.wizard_boots_healing);
|
||||
|
||||
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) -> {
|
||||
|
||||
if((stack1.getItem() instanceof ItemSpellBook && stack2.getItem() instanceof ItemSpellBook)
|
||||
|| (stack1.getItem() instanceof ItemScroll && stack2.getItem() instanceof ItemScroll)){
|
||||
|
||||
Spell spell1 = Spell.get(stack1.getItemDamage());
|
||||
Spell spell2 = Spell.get(stack2.getItemDamage());
|
||||
|
||||
return spell1.compareTo(spell2);
|
||||
|
||||
}else if(stack1.getItem() instanceof ItemScroll){
|
||||
return 1;
|
||||
}else if(stack2.getItem() instanceof ItemScroll){
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
public CreativeTabListed(String label){
|
||||
// Can't accomplish this in a single constructor... just a quirk of the java compiler!
|
||||
this(label, new ArrayList<>());
|
||||
}
|
||||
|
||||
// Hey, maybe someone might want to keep a reference to the list, or pass in a different one.
|
||||
public CreativeTabListed(String label, List<Item> order){
|
||||
|
||||
super(label, (stack1, stack2) -> {
|
||||
// Neither stack is in the creative tab
|
||||
if(!order.contains(stack1.getItem()) && !order.contains(stack2.getItem())) return 0;
|
||||
if(!order.contains(stack1.getItem())) return 1; // Only stack 2 is in the creative tab
|
||||
if(!order.contains(stack2.getItem())) return -1; // Only stack 1 is in the creative tab
|
||||
// Both stacks are in the creative tab
|
||||
return order.indexOf(stack1.getItem()) - order.indexOf(stack2.getItem());
|
||||
});
|
||||
|
||||
this.order = order;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user