This commit is contained in:
MidnightTale 2023-04-12 16:06:31 +07:00
commit 45b9568dd0

View file

@ -41,7 +41,6 @@ public class Bbsdfia extends JavaPlugin implements Listener {
@EventHandler @EventHandler
public void onFallingBlockToBlock(EntityChangeBlockEvent e){ public void onFallingBlockToBlock(EntityChangeBlockEvent e){
if(e.getEntityType() == EntityType.FALLING_BLOCK){ if(e.getEntityType() == EntityType.FALLING_BLOCK){
Entity entity = e.getEntity(); Entity entity = e.getEntity();
Location loc = entity.getLocation(); Location loc = entity.getLocation();
Vector vel = entity.getVelocity(); Vector vel = entity.getVelocity();
@ -61,7 +60,6 @@ public class Bbsdfia extends JavaPlugin implements Listener {
dummyVel.add(new Vector(0, -0.2, 0)); dummyVel.add(new Vector(0, -0.2, 0));
dummy.setVelocity(dummyVel); dummy.setVelocity(dummyVel);
dummy.remove();
} }
} }
} }
@ -70,9 +68,11 @@ public class Bbsdfia extends JavaPlugin implements Listener {
public void onEntityChangeBlock(EntityChangeBlockEvent event) { public void onEntityChangeBlock(EntityChangeBlockEvent event) {
Entity entity = event.getEntity(); Entity entity = event.getEntity();
if (!(entity instanceof FallingBlock)) { if (!(entity instanceof FallingBlock)) {
entity.remove();
return; return;
} }
if (entity.getWorld().getEnvironment() != World.Environment.THE_END) { if (entity.getWorld().getEnvironment() != World.Environment.THE_END) {
entity.remove();
return; return;
} }