Hopperhocks now make poof effects

This commit is contained in:
Vasco Lavos committed 2015-12-16 19:00:48 +00:00
1 parent ab1d938abe
commit 46d3ffc902
2 files changed
+14 -9

No files matched your search

@@ -53,7 +53,7 @@ public class SubTileHopperhock extends SubTileFunctional {
public void onUpdate() {
super.onUpdate();
if(redstoneSignal > 0 || supertile.getWorldObj().isRemote)
if(redstoneSignal > 0)
return;
boolean pulledAny = false;
@@ -102,10 +102,15 @@ public class SubTileHopperhock extends SubTileFunctional {
}
if(invToPutItemIn != null) {
InventoryHelper.insertItemIntoInventory(invToPutItemIn, stack.copy(), sideToPutItemIn, -1);
invToPutItemIn.markDirty();
item.setDead();
pulledAny = true;
boolean remote = supertile.getWorldObj().isRemote;
if(!item.isDead && remote)
SubTileSpectranthemum.spawnExplosionParticles(item, 1);
else {
InventoryHelper.insertItemIntoInventory(invToPutItemIn, stack.copy(), sideToPutItemIn, -1);
invToPutItemIn.markDirty();
item.setDead();
pulledAny = true;
}
}
}
@@ -66,11 +66,11 @@ public class SubTileSpectranthemum extends SubTileFunctional {
int cost = stack.stackSize * COST;
if(mana >= cost) {
spawnExplosionParticles(item);
spawnExplosionParticles(item, 10);
item.setPosition(bindX + 0.5, bindY + 1.5, bindZ + 0.5);
item.getEntityData().setBoolean(TAG_TELEPORTED, true);
item.motionX = item.motionY = item.motionZ = 0;
spawnExplosionParticles(item);
spawnExplosionParticles(item, 10);
if(!supertile.getWorldObj().isRemote) {
mana -= cost;
did = true;
@@ -84,8 +84,8 @@ public class SubTileSpectranthemum extends SubTileFunctional {
}
}
void spawnExplosionParticles(EntityItem item) {
for(int i = 0; i < 10; i++) {
public static void spawnExplosionParticles(EntityItem item, int p) {
for(int i = 0; i < p; i++) {
double m = 0.01;
double d0 = item.worldObj.rand.nextGaussian() * m;
double d1 = item.worldObj.rand.nextGaussian() * m;