mirror of
https://github.com/kaboomserver/extras.git
synced 2024-11-01 01:11:51 +00:00
Remove use of deprecated API
This commit is contained in:
parent
8eadbd89b1
commit
b291a2a652
12
pom.xml
12
pom.xml
|
@ -26,6 +26,18 @@
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<finalName>${project.artifactId}</finalName>
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.0</version>
|
||||||
|
<configuration>
|
||||||
|
<compilerArgs>
|
||||||
|
<arg>-Xlint:all</arg>
|
||||||
|
</compilerArgs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ class CommandDestroyEntities implements CommandExecutor {
|
||||||
class CommandEnchantAll implements CommandExecutor {
|
class CommandEnchantAll implements CommandExecutor {
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
ItemStack item = player.getItemInHand();
|
ItemStack item = player.getInventory().getItemInMainHand();
|
||||||
|
|
||||||
if (item.getType() == Material.AIR) {
|
if (item.getType() == Material.AIR) {
|
||||||
player.sendMessage("Please hold an item in your hand to enchant it");
|
player.sendMessage("Please hold an item in your hand to enchant it");
|
||||||
|
|
|
@ -119,7 +119,7 @@ class TickAsync extends BukkitRunnable {
|
||||||
world.setAutoSave(true);
|
world.setAutoSave(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
/*try {
|
||||||
for (final Chunk chunk : world.getLoadedChunks()) {
|
for (final Chunk chunk : world.getLoadedChunks()) {
|
||||||
try {
|
try {
|
||||||
chunk.getTileEntities();
|
chunk.getTileEntities();
|
||||||
|
@ -132,7 +132,7 @@ class TickAsync extends BukkitRunnable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (LivingEntity mob : world.getLivingEntities()) {
|
for (LivingEntity mob : world.getLivingEntities()) {
|
||||||
|
@ -573,7 +573,7 @@ class Events implements Listener {
|
||||||
@EventHandler
|
@EventHandler
|
||||||
void onPlayerLogin(PlayerLoginEvent event) {
|
void onPlayerLogin(PlayerLoginEvent event) {
|
||||||
if (!(event.getHostname().startsWith("play.kaboom.pw") &&
|
if (!(event.getHostname().startsWith("play.kaboom.pw") &&
|
||||||
event.getHostname().endsWith(":64518"))) {
|
event.getHostname().endsWith(":49450"))) {
|
||||||
event.disallow(Result.KICK_OTHER, "You connected to the server using an outdated server address/IP.\nPlease use the following address/IP:\n\nkaboom.pw");
|
event.disallow(Result.KICK_OTHER, "You connected to the server using an outdated server address/IP.\nPlease use the following address/IP:\n\nkaboom.pw");
|
||||||
} else {
|
} else {
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
|
|
Loading…
Reference in a new issue