Dungeon keys invulnerable
This commit is contained in:
parent
b960bd7051
commit
9b4b4ef7a6
|
@ -9,6 +9,7 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.entity.EntityFlying;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
|
@ -430,7 +431,27 @@ public class EntitySlider extends EntityFlying
|
|||
{
|
||||
this.dropItem(Item.getItemFromBlock(BlocksAether.dungeon_block), 7 + rand.nextInt(3));
|
||||
|
||||
this.entityDropItem(new ItemStack(ItemsAether.dungeon_key), 0F);
|
||||
this.entityDropItem(new ItemStack(ItemsAether.dungeon_key), 0.5F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityItem entityDropItem(ItemStack stack, float offsetY)
|
||||
{
|
||||
if (stack.stackSize != 0 && stack.getItem() != null)
|
||||
{
|
||||
EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double)offsetY, this.posZ, stack);
|
||||
entityitem.setEntityInvulnerable(true);
|
||||
entityitem.setDefaultPickupDelay();
|
||||
if (captureDrops)
|
||||
this.capturedDrops.add(entityitem);
|
||||
else
|
||||
this.worldObj.spawnEntityInWorld(entityitem);
|
||||
return entityitem;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void stop()
|
||||
|
|
|
@ -10,6 +10,7 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.entity.EntityFlying;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
@ -554,9 +555,30 @@ public class EntitySunSpirit extends EntityFlying implements IMob
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dropFewItems(boolean var1, int var2)
|
||||
{
|
||||
this.entityDropItem(new ItemStack(ItemsAether.dungeon_key, 1, 2), 0.0F);
|
||||
this.entityDropItem(new ItemStack(ItemsAether.dungeon_key, 1, 2), 0.5F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityItem entityDropItem(ItemStack stack, float offsetY)
|
||||
{
|
||||
if (stack.stackSize != 0 && stack.getItem() != null)
|
||||
{
|
||||
EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double)offsetY, this.posZ, stack);
|
||||
entityitem.setEntityInvulnerable(true);
|
||||
entityitem.setDefaultPickupDelay();
|
||||
if (captureDrops)
|
||||
this.capturedDrops.add(entityitem);
|
||||
else
|
||||
this.worldObj.spawnEntityInWorld(entityitem);
|
||||
return entityitem;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void setDoor(IBlockState block)
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAISwimming;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
@ -495,8 +496,28 @@ public class EntityValkyrieQueen extends EntityMob
|
|||
@Override
|
||||
protected void dropFewItems(boolean var1, int var2)
|
||||
{
|
||||
entityDropItem(new ItemStack(ItemsAether.dungeon_key, 1, 1), 0F);
|
||||
dropItem(Items.GOLDEN_SWORD, 1);
|
||||
this.entityDropItem(new ItemStack(ItemsAether.dungeon_key, 1, 1), 0.5F);
|
||||
this.dropItem(Items.GOLDEN_SWORD, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityItem entityDropItem(ItemStack stack, float offsetY)
|
||||
{
|
||||
if (stack.stackSize != 0 && stack.getItem() != null)
|
||||
{
|
||||
EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double)offsetY, this.posZ, stack);
|
||||
entityitem.setEntityInvulnerable(true);
|
||||
entityitem.setDefaultPickupDelay();
|
||||
if (captureDrops)
|
||||
this.capturedDrops.add(entityitem);
|
||||
else
|
||||
this.worldObj.spawnEntityInWorld(entityitem);
|
||||
return entityitem;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue