mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 18:57:32 +00:00
Fixed Staff Bug
Corrected the Staff Crash issue
This commit is contained in:
1 parent
65eeca72cf
commit
f155ef2481
1 file changed
+12
-7
@@ -9,23 +9,28 @@ import net.minecraft.world.World;
|
||||
public class EntityMagicProjectile extends EntityProjectile{
|
||||
private EntityPlayer player;
|
||||
private ItemStack equiped;
|
||||
|
||||
public EntityMagicProjectile(World par1World){
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public EntityMagicProjectile(World par1World,
|
||||
EntityPlayer player, ItemStack item, boolean isNPC) {
|
||||
EntityPlayer player, ItemStack item, boolean isNPC) {
|
||||
super(par1World, player, item, isNPC);
|
||||
|
||||
|
||||
this.player = player;
|
||||
this.equiped = player.inventory.getCurrentItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(){
|
||||
if(player.inventory.getCurrentItem() != equiped)
|
||||
if(!worldObj.isRemote && (player == null || player.inventory.getCurrentItem() != equiped))
|
||||
this.setDead();
|
||||
super.onUpdate();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getCommandSenderName(){
|
||||
return StatCollector.translateToLocal("entity.throwableitem.name");
|
||||
}
|
||||
public String getCommandSenderName(){
|
||||
return StatCollector.translateToLocal("entity.throwableitem.name");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user