That's one heck of a commit you've got there...

I may have got a bit behind with version control. A lot behind, in fact. Maybe I'll go back and split this sometime - then again, I probably won't. But hey, at least it's here!
This commit is contained in:
Electroblob77
2019-08-18 00:04:18 +01:00
parent 2680d02304
commit f37812be3e
1564 changed files with 47652 additions and 12984 deletions
@@ -1,18 +1,20 @@
package electroblob.wizardry.entity;
import java.lang.ref.WeakReference;
import electroblob.wizardry.WizardData;
import electroblob.wizardry.item.ItemWand;
import electroblob.wizardry.data.WizardData;
import electroblob.wizardry.item.ISpellCastingItem;
import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.spell.Shield;
import net.minecraft.entity.Entity;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.world.World;
import java.lang.ref.WeakReference;
public class EntityShield extends Entity {
public WeakReference<EntityPlayer> player;
@@ -46,8 +48,8 @@ public class EntityShield extends Entity {
entityplayer.posY + 1 + entityplayer.getLookVec().y * 0.3,
entityplayer.posZ + entityplayer.getLookVec().z * 0.3, entityplayer.rotationYawHead,
entityplayer.rotationPitch);
if(!entityplayer.isHandActive() || !(entityplayer.getHeldItem(entityplayer.getActiveHand()).getItem() instanceof ItemWand)){
WizardData.get(entityplayer).shield = null;
if(!entityplayer.isHandActive() || !(entityplayer.getHeldItem(entityplayer.getActiveHand()).getItem() instanceof ISpellCastingItem)){
WizardData.get(entityplayer).setVariable(Shield.SHIELD_KEY, null);
this.setDead();
}
}else if(!world.isRemote){
@@ -62,13 +64,19 @@ public class EntityShield extends Entity {
this.setRotation(par7, par8);
}
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2){
if(par1DamageSource != null && par1DamageSource.getImmediateSource() instanceof IProjectile){
par1DamageSource.getImmediateSource().playSound(WizardrySounds.SPELL_DEFLECTION, 0.3f, 1.3f);
public boolean attackEntityFrom(DamageSource source, float damage){
if(source != null && source.getImmediateSource() instanceof IProjectile){
world.playSound(null, source.getImmediateSource().posX, source.getImmediateSource().posY,
source.getImmediateSource().posZ, WizardrySounds.ENTITY_SHIELD_DEFLECT, WizardrySounds.SPELLS, 0.3f, 1.3f);
}
super.attackEntityFrom(par1DamageSource, par2);
super.attackEntityFrom(source, damage);
return false;
}
@Override
public SoundCategory getSoundCategory(){
return WizardrySounds.SPELLS;
}
public boolean canBeCollidedWith(){
return !this.isDead;