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:
@@ -35,59 +35,19 @@ public class EntitySpiderMinion extends EntityCaveSpider implements ISummonedCre
|
||||
private UUID casterUUID;
|
||||
|
||||
// Setter + getter implementations
|
||||
@Override
|
||||
public int getLifetime(){
|
||||
return lifetime;
|
||||
}
|
||||
@Override public int getLifetime(){ return lifetime; }
|
||||
@Override public void setLifetime(int lifetime){ this.lifetime = lifetime; }
|
||||
@Override public WeakReference<EntityLivingBase> getCasterReference(){ return casterReference; }
|
||||
@Override public void setCasterReference(WeakReference<EntityLivingBase> reference){ casterReference = reference; }
|
||||
@Override public UUID getCasterUUID(){ return casterUUID; }
|
||||
@Override public void setCasterUUID(UUID uuid){ this.casterUUID = uuid; }
|
||||
|
||||
@Override
|
||||
public void setLifetime(int lifetime){
|
||||
this.lifetime = lifetime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WeakReference<EntityLivingBase> getCasterReference(){
|
||||
return casterReference;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCasterReference(WeakReference<EntityLivingBase> reference){
|
||||
casterReference = reference;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UUID getCasterUUID(){
|
||||
return casterUUID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCasterUUID(UUID uuid){
|
||||
this.casterUUID = uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default shell constructor, only used by client. Lifetime defaults arbitrarily to 600, but this doesn't matter
|
||||
* because the client side entity immediately gets the lifetime value copied over to it by this class anyway. When
|
||||
* extending this class, you must override this constructor or Minecraft won't like it, but there's no need to do
|
||||
* anything inside it other than call super().
|
||||
*/
|
||||
/** Creates a new spider minion in the given world. */
|
||||
public EntitySpiderMinion(World world){
|
||||
super(world);
|
||||
this.experienceValue = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set lifetime to -1 to allow this creature to last forever. This constructor should be overridden when extending
|
||||
* this class (be sure to call super()) so that AI and other things can be added.
|
||||
*/
|
||||
public EntitySpiderMinion(World world, double x, double y, double z, EntityLivingBase caster, int lifetime){
|
||||
super(world);
|
||||
this.setPosition(x, y, z);
|
||||
this.casterReference = new WeakReference<EntityLivingBase>(caster);
|
||||
this.experienceValue = 0;
|
||||
this.lifetime = lifetime;
|
||||
}
|
||||
|
||||
// EntitySpider overrides
|
||||
|
||||
// This particular override is pretty standard: let the superclass handle basic AI like swimming, but replace its
|
||||
@@ -198,36 +158,13 @@ public class EntitySpiderMinion extends EntityCaveSpider implements ISummonedCre
|
||||
|
||||
// Recommended overrides
|
||||
|
||||
@Override
|
||||
protected int getExperiencePoints(EntityPlayer player){
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canDropLoot(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Item getDropItem(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getLootTable(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPickUpLoot(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override protected int getExperiencePoints(EntityPlayer player){ return 0; }
|
||||
@Override protected boolean canDropLoot(){ return false; }
|
||||
@Override protected Item getDropItem(){ return null; }
|
||||
@Override protected ResourceLocation getLootTable(){ return null; }
|
||||
@Override public boolean canPickUpLoot(){ return false; }
|
||||
// This vanilla method has nothing to do with the custom despawn() method.
|
||||
@Override
|
||||
protected boolean canDespawn(){
|
||||
return false;
|
||||
}
|
||||
@Override protected boolean canDespawn(){ return false; }
|
||||
|
||||
@Override
|
||||
public boolean canAttackClass(Class<? extends EntityLivingBase> entityType){
|
||||
|
||||
Reference in New Issue
Block a user