use of com.mraof.minestuck.entity.item.EntityVitalityGel in project Minestuck by mraof.
the class EntityUnderling method onDeathUpdate.
@Override
protected void onDeathUpdate() {
super.onDeathUpdate();
if (this.deathTime == 20 && !this.world.isRemote) {
GristSet grist = this.getGristSpoils();
if (fromSpawner)
grist.scaleGrist(0.5F);
if (!dropCandy) {
for (GristAmount gristType : grist.getArray()) this.world.spawnEntity(new EntityGrist(world, randX(), this.posY, randZ(), gristType));
} else {
for (GristAmount gristType : grist.getArray()) {
int candy = (gristType.getAmount() + 2) / 4;
int gristAmount = gristType.getAmount() - candy * 2;
if (candy > 0)
this.world.spawnEntity(new EntityItem(world, randX(), this.posY, randZ(), new ItemStack(MinestuckItems.candy, candy, gristType.getType().getId() + 1)));
if (gristAmount > 0)
this.world.spawnEntity(new EntityGrist(world, randX(), this.posY, randZ(), new GristAmount(gristType.getType(), gristAmount)));
}
}
if (this.rand.nextInt(4) == 0)
this.world.spawnEntity(new EntityVitalityGel(world, randX(), this.posY, randZ(), this.getVitalityGel()));
}
}
Aggregations