Fixed bed in nethe

This commit is contained in:
boy0001 2015-04-26 17:47:45 +10:00
parent 8ce33753f3
commit fb27792076
7 changed files with 55 additions and 24 deletions

View File

@ -81,7 +81,7 @@
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId> <artifactId>bukkit</artifactId>
<version>1.8-R0.1-SNAPSHOT</version> <version>1.8.3-R0.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.sk89q</groupId> <groupId>com.sk89q</groupId>

View File

@ -293,7 +293,7 @@ public class Set extends SubCommand {
private String getBiomeList(final String[] biomes) { private String getBiomeList(final String[] biomes) {
final StringBuilder builder = new StringBuilder(); final StringBuilder builder = new StringBuilder();
builder.append(MainUtil.colorise('&', C.NOT_VALID_BLOCK_LIST_HEADER.s())); builder.append(MainUtil.colorise('&', C.NEED_BIOME.s()));
for (final String b : biomes) { for (final String b : biomes) {
builder.append(getString(b)); builder.append(getString(b));
} }

View File

@ -286,7 +286,7 @@ public enum C {
/* /*
* Biome * Biome
*/ */
NEED_BIOME("$2You have got to specify a biome"), NEED_BIOME("$2You need to specify a valid biome."),
BIOME_SET_TO("$2Plot biome set to $2"), BIOME_SET_TO("$2Plot biome set to $2"),
/* /*
* Teleport / Entry * Teleport / Entry

View File

@ -97,19 +97,14 @@ public class SQLManager implements AbstractDB {
TaskManager.runTaskRepeat(new Runnable() { TaskManager.runTaskRepeat(new Runnable() {
@Override @Override
public void run() { public void run() {
TaskManager.runTaskAsync(new Runnable() { try {
@Override SQLManager.this.connection = PlotSquared.getMySQL().forceConnection();
public void run() { }
try { catch (Exception e) {
System.out.print("CONNECTIN"); e.printStackTrace();
SQLManager.this.connection = PlotSquared.getMySQL().forceConnection(); }
} catch (final Exception e) {
e.printStackTrace();
}
}
});
} }
}, 1); }, 11000);
} }
updateTables(); updateTables();
} }

View File

@ -49,6 +49,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.EntityChangeBlockEvent; import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.ExplosionPrimeEvent;
import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.hanging.HangingBreakByEntityEvent; import org.bukkit.event.hanging.HangingBreakByEntityEvent;
import org.bukkit.event.hanging.HangingPlaceEvent; import org.bukkit.event.hanging.HangingPlaceEvent;
@ -284,7 +285,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
MainUtil.teleportPlayer(pp, pp.getLocation(), plot); MainUtil.teleportPlayer(pp, pp.getLocation(), plot);
MainUtil.sendMessage(pp, C.TELEPORTED_TO_ROAD); MainUtil.sendMessage(pp, C.TELEPORTED_TO_ROAD);
} }
plotEntry(player, plot); plotEntry(pp, plot);
} }
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
@ -323,8 +324,8 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
} }
Plot plot = MainUtil.getPlot(t); Plot plot = MainUtil.getPlot(t);
if (plot != null) { if (plot != null) {
final PlotPlayer pp = BukkitUtil.getPlayer(player);
if (plot.denied.size() > 0) { if (plot.denied.size() > 0) {
final PlotPlayer pp = BukkitUtil.getPlayer(player);
if (plot.isDenied(pp.getUUID())) { if (plot.isDenied(pp.getUUID())) {
if (!Permissions.hasPermission(pp, "plots.admin.entry.denied")) { if (!Permissions.hasPermission(pp, "plots.admin.entry.denied")) {
MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.entry.denied"); MainUtil.sendMessage(pp, C.NO_PERMISSION, "plots.admin.entry.denied");
@ -334,7 +335,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
} }
} }
if (!plot.equals(MainUtil.getPlot(f))) { if (!plot.equals(MainUtil.getPlot(f))) {
plotEntry(player, plot); plotEntry(pp, plot);
} }
} }
else if (MainUtil.leftPlot(f, t)) { else if (MainUtil.leftPlot(f, t)) {
@ -1004,7 +1005,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
return; return;
} else { } else {
if (MainUtil.enteredPlot(f, t)) { if (MainUtil.enteredPlot(f, t)) {
plotEntry(player, plot); plotEntry(pp, plot);
} }
} }
} else { } else {

View File

@ -1,16 +1,20 @@
package com.intellectualcrafters.plot.listeners; package com.intellectualcrafters.plot.listeners;
import java.util.Iterator;
import java.util.UUID; import java.util.UUID;
import org.bukkit.block.Block;
import org.bukkit.entity.ArmorStand; import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockExplodeEvent;
import org.bukkit.event.player.PlayerInteractAtEntityEvent; import org.bukkit.event.player.PlayerInteractAtEntityEvent;
import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.PlotSquared;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.flag.FlagManager;
import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
@ -19,6 +23,7 @@ import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.bukkit.BukkitUtil; import com.intellectualcrafters.plot.util.bukkit.BukkitUtil;
public class PlayerEvents_1_8 extends PlotListener implements Listener { public class PlayerEvents_1_8 extends PlotListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onInteract(final PlayerInteractAtEntityEvent e) { public void onInteract(final PlayerInteractAtEntityEvent e) {
Entity entity = e.getRightClicked(); Entity entity = e.getRightClicked();
@ -59,4 +64,38 @@ public class PlayerEvents_1_8 extends PlotListener implements Listener {
} }
} }
} }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBigBoom(final BlockExplodeEvent event) {
Block block = event.getBlock();
Location loc = BukkitUtil.getLocation(block.getLocation());
final String world = loc.getWorld();
if (!PlotSquared.isPlotWorld(world)) {
return;
}
final Plot plot = MainUtil.getPlot(loc);
if ((plot != null) && plot.hasOwner()) {
if (FlagManager.isPlotFlagTrue(plot, "explosion")) {
final Iterator<Block> iter = event.blockList().iterator();
while (iter.hasNext()) {
final Block b = iter.next();
if (!plot.equals(MainUtil.getPlot(BukkitUtil.getLocation(b.getLocation())))) {
iter.remove();
}
}
return;
}
}
if (MainUtil.isPlotArea(loc)) {
event.setCancelled(true);
} else {
final Iterator<Block> iter = event.blockList().iterator();
while (iter.hasNext()) {
iter.next();
if (MainUtil.isPlotArea(loc)) {
iter.remove();
}
}
}
}
} }

View File

@ -86,11 +86,7 @@ public class PlotListener extends APlotListener {
} }
} }
public void plotEntry(final PlotPlayer player, final Plot plot) { public void plotEntry(final PlotPlayer pp, final Plot plot) {
plotEntry(((BukkitPlayer) player).player, plot);
}
public void plotEntry(final Player pp, final Plot plot) {
Player player = ((BukkitPlayer) pp).player; Player player = ((BukkitPlayer) pp).player;
if (plot.hasOwner()) { if (plot.hasOwner()) {
final Flag gamemodeFlag = FlagManager.getPlotFlag(plot, "gamemode"); final Flag gamemodeFlag = FlagManager.getPlotFlag(plot, "gamemode");