Remove outdated command

This commit is contained in:
mathiascode 2020-04-18 17:13:03 +03:00
parent ca92e0fada
commit 92d9e4ad64
5 changed files with 8 additions and 47 deletions

View file

@ -25,7 +25,6 @@ import pw.kaboom.extras.commands.CommandSkin;
import pw.kaboom.extras.commands.CommandSpawn;
import pw.kaboom.extras.commands.CommandSpidey;
import pw.kaboom.extras.commands.CommandTellraw;
import pw.kaboom.extras.commands.CommandUnloadChunks;
import pw.kaboom.extras.commands.CommandUsername;
import pw.kaboom.extras.modules.block.BlockCheck;
import pw.kaboom.extras.modules.block.BlockPhysics;
@ -77,7 +76,6 @@ public final class Main extends JavaPlugin {
this.getCommand("spawn").setExecutor(new CommandSpawn());
this.getCommand("spidey").setExecutor(new CommandSpidey());
this.getCommand("tellraw").setExecutor(new CommandTellraw());
this.getCommand("unloadchunks").setExecutor(new CommandUnloadChunks());
this.getCommand("username").setExecutor(new CommandUsername());
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Client.WINDOW_CLICK) {

View file

@ -1,26 +0,0 @@
package pw.kaboom.extras.commands;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
public final class CommandUnloadChunks implements CommandExecutor {
public boolean onCommand(final CommandSender sender, final Command command, final String label, final String[] args) {
int chunkCount = 0;
for (World world : Bukkit.getServer().getWorlds()) {
for (Chunk chunk : world.getLoadedChunks()) {
if (chunk.unload()) {
chunkCount++;
}
}
}
sender.sendMessage("Unloaded " + chunkCount + " unused chunks");
return true;
}
}

View file

@ -105,12 +105,19 @@ public final class BlockPhysics implements Listener {
case REDSTONE_TORCH:
case REDSTONE_WIRE:
case REPEATER:
case TRIPWIRE:
if (!event.getBlock().getRelative(BlockFace.DOWN).getType().isSolid()
&& !Material.AIR.equals(event.getBlock().getRelative(BlockFace.DOWN).getType())
&& !Material.CAVE_AIR.equals(event.getBlock().getRelative(BlockFace.DOWN).getType())) {
event.setCancelled(true);
}
return;
case COMMAND_BLOCK:
case CHAIN_COMMAND_BLOCK:
case REPEATING_COMMAND_BLOCK:
if (Material.STRUCTURE_BLOCK.equals(event.getSourceBlock().getType())) {
event.setCancelled(true);
}
default:
break;
}

View file

@ -1,10 +1,7 @@
package pw.kaboom.extras.modules.player;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.ExperienceOrb;
import org.bukkit.entity.HumanEntity;
@ -78,18 +75,7 @@ public final class PlayerDamage implements Listener {
player.teleportAsync(player.getBedSpawnLocation());
} else {
final World world = Bukkit.getWorld("world");
final Location spawnLocation = world.getSpawnLocation();
for (double y = spawnLocation.getY(); y <= 256; y++) {
final Location yLocation = new Location(world, spawnLocation.getX(), y, spawnLocation.getZ());
final Block coordBlock = world.getBlockAt(yLocation);
if (!coordBlock.getType().isSolid()
&& !coordBlock.getRelative(BlockFace.UP).getType().isSolid()) {
player.teleportAsync(yLocation);
break;
}
}
player.teleportAsync(world.getSpawnLocation());
}
} catch (Exception exception) {
player.setMaxHealth(Double.POSITIVE_INFINITY);

View file

@ -55,10 +55,6 @@ commands:
spidey:
description: Annoying little spider...
permission: extras.spidey
unloadchunks:
aliases: uc
description: Unloads all unused chunks
permission: extras.unloadchunks
username:
description: Changes your username on the server
permission: extras.username