Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-09 21:10:05 +01:00
Replaced an if-else tree in /rement by an equivalent switch.
Dieser Commit ist enthalten in:
Ursprung
b710f919d5
Commit
34093884bc
@ -1004,59 +1004,80 @@ public class BukkitWorld extends LocalWorld {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == EntityType.ALL) {
|
switch (type) {
|
||||||
|
case ALL:
|
||||||
if (ent instanceof Projectile || ent instanceof Boat || ent instanceof Item
|
if (ent instanceof Projectile || ent instanceof Boat || ent instanceof Item
|
||||||
|| ent instanceof FallingBlock || ent instanceof Minecart || ent instanceof Hanging
|
|| ent instanceof FallingBlock || ent instanceof Minecart || ent instanceof Hanging
|
||||||
|| ent instanceof TNTPrimed || ent instanceof ExperienceOrb) {
|
|| ent instanceof TNTPrimed || ent instanceof ExperienceOrb) {
|
||||||
ent.remove();
|
ent.remove();
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
} else if (type == EntityType.PROJECTILES || type == EntityType.ARROWS) {
|
break;
|
||||||
|
|
||||||
|
case PROJECTILES:
|
||||||
|
case ARROWS:
|
||||||
if (ent instanceof Projectile) {
|
if (ent instanceof Projectile) {
|
||||||
// covers: arrow, egg, enderpearl, fireball, fish, snowball, throwpotion, thrownexpbottle
|
// covers: arrow, egg, enderpearl, fireball, fish, snowball, throwpotion, thrownexpbottle
|
||||||
ent.remove();
|
ent.remove();
|
||||||
++num;
|
++num;
|
||||||
}
|
}
|
||||||
} else if (type == EntityType.BOATS) {
|
break;
|
||||||
|
|
||||||
|
case BOATS:
|
||||||
if (ent instanceof Boat) {
|
if (ent instanceof Boat) {
|
||||||
ent.remove();
|
ent.remove();
|
||||||
++num;
|
++num;
|
||||||
}
|
}
|
||||||
} else if (type == EntityType.ITEMS) {
|
break;
|
||||||
|
|
||||||
|
case ITEMS:
|
||||||
if (ent instanceof Item) {
|
if (ent instanceof Item) {
|
||||||
ent.remove();
|
ent.remove();
|
||||||
++num;
|
++num;
|
||||||
}
|
}
|
||||||
} else if (type == EntityType.FALLING_BLOCKS) {
|
break;
|
||||||
|
|
||||||
|
case FALLING_BLOCKS:
|
||||||
if (ent instanceof FallingBlock) {
|
if (ent instanceof FallingBlock) {
|
||||||
ent.remove();
|
ent.remove();
|
||||||
++num;
|
++num;
|
||||||
}
|
}
|
||||||
} else if (type == EntityType.MINECARTS) {
|
break;
|
||||||
|
|
||||||
|
case MINECARTS:
|
||||||
if (ent instanceof Minecart) {
|
if (ent instanceof Minecart) {
|
||||||
ent.remove();
|
ent.remove();
|
||||||
++num;
|
++num;
|
||||||
}
|
}
|
||||||
} else if (type == EntityType.PAINTINGS) {
|
break;
|
||||||
|
|
||||||
|
case PAINTINGS:
|
||||||
if (ent instanceof Painting) {
|
if (ent instanceof Painting) {
|
||||||
ent.remove();
|
ent.remove();
|
||||||
++num;
|
++num;
|
||||||
}
|
}
|
||||||
} else if (type == EntityType.ITEM_FRAMES) {
|
break;
|
||||||
|
|
||||||
|
case ITEM_FRAMES:
|
||||||
if (ent instanceof ItemFrame) {
|
if (ent instanceof ItemFrame) {
|
||||||
ent.remove();
|
ent.remove();
|
||||||
++num;
|
++num;
|
||||||
}
|
}
|
||||||
} else if (type == EntityType.TNT) {
|
break;
|
||||||
|
|
||||||
|
case TNT:
|
||||||
if (ent instanceof TNTPrimed || ent.getType() == tntMinecartType) {
|
if (ent instanceof TNTPrimed || ent.getType() == tntMinecartType) {
|
||||||
ent.remove();
|
ent.remove();
|
||||||
++num;
|
++num;
|
||||||
}
|
}
|
||||||
} else if (type == EntityType.XP_ORBS) {
|
break;
|
||||||
|
|
||||||
|
case XP_ORBS:
|
||||||
if (ent instanceof ExperienceOrb) {
|
if (ent instanceof ExperienceOrb) {
|
||||||
ent.remove();
|
ent.remove();
|
||||||
++num;
|
++num;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren