Spell hierarchisation and refactoring, plus miscellaneous renaming and minor refactoring
- Adds new generic spell superclasses which aim to group spells such that duplicate code is eliminated, and functions standardised, as much as possible. - Removes numerous spell classes which are no longer required as a result of this change, and replaces them with instances of the relevant generic spell classes. - Changes the remaining spell classes to fit with the new system, mostly by having them extend the generic spell classes. - Completes the transfer of particle spawning to the ParticleBuilder system.
This commit is contained in:
@@ -30,9 +30,8 @@ public class ItemFirebomb extends Item {
|
||||
player.playSound(SoundEvents.ENTITY_SNOWBALL_THROW, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
if(!world.isRemote){
|
||||
EntityFirebomb firebomb = new EntityFirebomb(world, player);
|
||||
// This is the standard set of parameters for this method, used by snowballs and ender pearls.
|
||||
firebomb.shoot(player, player.rotationPitch, player.rotationYaw, 0.0f, 1.5f, 1.0f);
|
||||
EntityFirebomb firebomb = new EntityFirebomb(world);
|
||||
firebomb.aim(player, 1.5f);
|
||||
world.spawnEntity(firebomb);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,9 +30,8 @@ public class ItemPoisonBomb extends Item {
|
||||
player.playSound(SoundEvents.ENTITY_SNOWBALL_THROW, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
if(!world.isRemote){
|
||||
EntityPoisonBomb poisonbomb = new EntityPoisonBomb(world, player);
|
||||
// This is the standard set of parameters for this method, used by snowballs and ender pearls.
|
||||
poisonbomb.shoot(player, player.rotationPitch, player.rotationYaw, 0.0f, 1.5f, 1.0f);
|
||||
EntityPoisonBomb poisonbomb = new EntityPoisonBomb(world);
|
||||
poisonbomb.aim(player, 1.5f);
|
||||
world.spawnEntity(poisonbomb);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,9 +30,8 @@ public class ItemSmokeBomb extends Item {
|
||||
player.playSound(SoundEvents.ENTITY_SNOWBALL_THROW, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
if(!world.isRemote){
|
||||
EntitySmokeBomb smokebomb = new EntitySmokeBomb(world, player);
|
||||
// This is the standard set of parameters for this method, used by snowballs and ender pearls.
|
||||
smokebomb.shoot(player, player.rotationPitch, player.rotationYaw, 0.0f, 1.5f, 1.0f);
|
||||
EntitySmokeBomb smokebomb = new EntitySmokeBomb(world);
|
||||
smokebomb.aim(player, 1.5f);
|
||||
world.spawnEntity(smokebomb);
|
||||
}
|
||||
|
||||
|
||||
@@ -375,7 +375,7 @@ public class ItemWand extends Item {
|
||||
// normal mob on full 20 health, but wither 2 for the same duration only deals about 6 hearts of damage in
|
||||
// total.
|
||||
if(this.element == spell.element){
|
||||
modifiers.set(SpellModifiers.DAMAGE, 1.0f + (this.tier.level + 1) * Constants.DAMAGE_INCREASE_PER_TIER,
|
||||
modifiers.set(SpellModifiers.POTENCY, 1.0f + (this.tier.level + 1) * Constants.DAMAGE_INCREASE_PER_TIER,
|
||||
true);
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ public class ItemWand extends Item {
|
||||
|
||||
private boolean selectMinionTarget(EntityPlayer player, World world){
|
||||
|
||||
RayTraceResult rayTrace = WizardryUtilities.standardEntityRayTrace(world, player, 16);
|
||||
RayTraceResult rayTrace = WizardryUtilities.standardEntityRayTrace(world, player, 16, false);
|
||||
|
||||
if(rayTrace != null && WizardryUtilities.isLiving(rayTrace.entityHit)){
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@ import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.block.BlockStatue;
|
||||
import electroblob.wizardry.constants.Constants;
|
||||
import electroblob.wizardry.constants.Element;
|
||||
import electroblob.wizardry.registry.WizardryAdvancementTriggers;
|
||||
import electroblob.wizardry.registry.WizardryTabs;
|
||||
import electroblob.wizardry.spell.Petrify;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -142,7 +142,7 @@ public class ItemWizardArmour extends ItemArmor {
|
||||
// fix, considering how long I spent trying to do this before - a bit of lateral thinking was all it took.
|
||||
// Do note however that a texture pack could override this.
|
||||
if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).isInvisible()
|
||||
&& !entity.getEntityData().getBoolean(Petrify.NBT_KEY))
|
||||
&& !entity.getEntityData().getBoolean(BlockStatue.NBT_KEY))
|
||||
return "ebwizardry:textures/armour/invisible_armour.png";
|
||||
|
||||
if(slot == EntityEquipmentSlot.LEGS)
|
||||
|
||||
Reference in New Issue
Block a user