Skip to content

Commit

Permalink
Added CloudParticle
Browse files Browse the repository at this point in the history
Fixed wrong particle when put a wet sponge on nether
  • Loading branch information
Gabriel8579 committed Jan 23, 2020
1 parent 8c9b4d8 commit f8b05b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/cn/nukkit/block/BlockSponge.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import cn.nukkit.level.GlobalBlockPalette;
import cn.nukkit.level.Level;
import cn.nukkit.level.Sound;
import cn.nukkit.level.particle.CloudParticle;
import cn.nukkit.level.particle.SmokeParticle;
import cn.nukkit.math.BlockFace;
import cn.nukkit.network.protocol.LevelEventPacket;
Expand Down Expand Up @@ -71,8 +72,8 @@ public boolean place(Item item, Block block, Block target, BlockFace face, doubl

for (int i = 0; i < 8; ++i) {
this.getLevel().addParticle(
//TODO: Use correct smoke particle
new SmokeParticle(block.getLocation().add(Math.random(), 1, Math.random())));
new CloudParticle(block.getLocation().add(Math.random(), 1, Math.random()))
);
}
} else if (this.getDamage() == DRY && performWaterAbsorb(block)) {
level.setBlock(block, Block.get(BlockID.SPONGE, WET));
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/cn/nukkit/level/particle/CloudParticle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package cn.nukkit.level.particle;

import cn.nukkit.math.Vector3;

public class CloudParticle extends GenericParticle {
public CloudParticle(Vector3 pos) {
this(pos, 0);
}
public CloudParticle(Vector3 pos, int scale) { super(pos, Particle.TYPE_EVAPORATION, scale); }
}

0 comments on commit f8b05b4

Please sign in to comment.