Spigot 1.8 compatibility

* 1.8 Spigot API
* 6.0 WorldGuard
This commit is contained in:
Jascha Starke 2014-12-01 22:18:54 +01:00
parent 47fb0e137a
commit c387bcbf55
4 changed files with 10 additions and 6 deletions

View file

@ -9,7 +9,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<plib.version>1.4-SNAPSHOT</plib.version>
<bukkit.version>1.7.2-R0.1-SNAPSHOT</bukkit.version>
<bukkit.version>1.8-R0.1-SNAPSHOT</bukkit.version>
</properties>
<scm>
@ -84,7 +84,7 @@
<!-- http://dev.bukkit.org/server-mods/worldguard/ -->
<groupId>com.sk89q</groupId>
<artifactId>worldguard</artifactId>
<version>5.8-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- http://dev.bukkit.org/server-mods/authme-reloaded/ -->

View file

@ -223,7 +223,7 @@ public class BlockStateCommand extends BukkitCommand implements IHelpDescribed {
return false;
}
if (Bukkit.getServer().getOnlinePlayers().length > (context.isPlayer() ? 1 : 0)) {
if (Bukkit.getServer().getOnlinePlayers().size() > (context.isPlayer() ? 1 : 0)) {
context.responseFormatted(ChatFormattings.ERROR, L("command.blockstate.migrate_useronline_error"));
return true;
}

View file

@ -45,6 +45,7 @@ import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.material.DirectionalContainer;
import org.bukkit.potion.PotionEffect;
import org.bukkit.projectiles.ProjectileSource;
import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission;
import de.jaschastarke.minecraft.lib.permissions.IDynamicPermission;
@ -224,8 +225,11 @@ public class PlayerListener implements Listener {
EntityDamageByEntityEvent event = (EntityDamageByEntityEvent) rawevent;
Entity source = event.getDamager();
if (source instanceof Projectile)
source = ((Projectile) source).getShooter();
if (source instanceof Projectile) {
ProjectileSource shooter = ((Projectile) source).getShooter();
if (shooter instanceof Entity)
source = (Entity) shooter;
}
if (source instanceof Player) {
Player player = (Player) source;

View file

@ -243,7 +243,7 @@ public class RegionsCommand extends BukkitCommand implements IHelpDescribed {
if (set.size() > 0) {
region = set.iterator().next();
} else {
region = getWorldGuard().getGlobalRegionManager().get(w).getRegionExact(GLOBAL_REGION);
region = getWorldGuard().getGlobalRegionManager().get(w).getRegion(GLOBAL_REGION);
}
} else {
int rpc = params.getArgumentCount() > 1 ? 1 : 0;