Skip to content

Commit

Permalink
Fix missing slime particles
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryLoenwind committed May 31, 2017
1 parent ce21865 commit 578f6d5
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions src/main/java/crazypants/enderzoo/entity/EntityDireSlime.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
package crazypants.enderzoo.entity;

import javax.annotation.Nullable;

import crazypants.enderzoo.config.Config;
import net.minecraft.block.Block;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.monster.EntityMagmaCube;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.Item;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
Expand Down Expand Up @@ -94,10 +100,27 @@ public void setDead() {
isDead = true;
}

// @Override
// protected String getSlimeParticle() {
// return "blockcrack_" + Block.getIdFromBlock(Blocks.dirt) + "_0";
// }
@Override
protected EnumParticleTypes getParticleType() {
return EnumParticleTypes.BLOCK_CRACK;
}

@Override
protected boolean spawnCustomParticles() {
int i = this.getSlimeSize();
for (int j = 0; j < i * 8; ++j) {
float f = this.rand.nextFloat() * ((float) Math.PI * 2F);
float f1 = this.rand.nextFloat() * 0.5F + 0.5F;
float f2 = MathHelper.sin(f) * (float) i * 0.5F * f1;
float f3 = MathHelper.cos(f) * (float) i * 0.5F * f1;
World world = this.world;
EnumParticleTypes enumparticletypes = this.getParticleType();
double d0 = this.posX + (double) f2;
double d1 = this.posZ + (double) f3;
world.spawnParticle(enumparticletypes, d0, this.getEntityBoundingBox().minY, d1, 0.0D, 0.0D, 0.0D, Block.getStateId(Blocks.DIRT.getDefaultState()));
}
return true;
}

@Override
protected EntitySlime createInstance() {
Expand Down

0 comments on commit 578f6d5

Please sign in to comment.