mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
parent
d0be0780fd
commit
9f792fa54b
3 changed files with 12 additions and 15 deletions
|
@ -420,7 +420,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
|||
case SHULKER:
|
||||
if (Settings.Enabled_Components.KILL_ROAD_MOBS) {
|
||||
LivingEntity livingEntity = (LivingEntity) entity;
|
||||
List<MetadataValue> meta = entity.getMetadata("plot");
|
||||
List<MetadataValue> meta = entity.getMetadata("shulkerPlot");
|
||||
if (!meta.isEmpty()) {
|
||||
if (livingEntity.isLeashed()) {
|
||||
continue;
|
||||
|
@ -457,7 +457,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
|||
if (area != null) {
|
||||
PlotId currentPlotId = PlotId.of(area.getPlotAbs(pLoc));
|
||||
if (currentPlotId != null) {
|
||||
entity.setMetadata("plot", new FixedMetadataValue(
|
||||
entity.setMetadata("shulkerPlot", new FixedMetadataValue(
|
||||
(Plugin) PlotSquared.get().IMP, currentPlotId));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ public class EntitySpawnListener implements Listener {
|
|||
public static void test(Entity entity) {
|
||||
@NotNull World world = entity.getWorld();
|
||||
List<MetadataValue> meta = entity.getMetadata(KEY);
|
||||
if (meta == null || meta.isEmpty()) {
|
||||
if (meta.isEmpty()) {
|
||||
if (PlotSquared.get().hasPlotArea(world.getName())) {
|
||||
entity.setMetadata(KEY,
|
||||
new FixedMetadataValue((Plugin) PlotSquared.get().IMP, entity.getLocation()));
|
||||
|
@ -126,8 +126,8 @@ public class EntitySpawnListener implements Listener {
|
|||
event.setCancelled(true);
|
||||
}
|
||||
case SHULKER:
|
||||
if (!entity.hasMetadata("plot")) {
|
||||
entity.setMetadata("plot",
|
||||
if (!entity.hasMetadata("shulkerPlot")) {
|
||||
entity.setMetadata("shulkerPlot",
|
||||
new FixedMetadataValue((Plugin) PlotSquared.get().IMP, plot.getId()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,10 +10,13 @@ import com.github.intellectualsites.plotsquared.plot.config.Settings;
|
|||
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
|
||||
import com.github.intellectualsites.plotsquared.plot.listener.PlayerBlockEventType;
|
||||
import com.github.intellectualsites.plotsquared.plot.listener.PlotListener;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Location;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.*;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.*;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.FluidCollisionMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.BlockState;
|
||||
|
@ -1048,17 +1051,11 @@ import java.util.regex.Pattern;
|
|||
public void onBigBoom(EntityExplodeEvent event) {
|
||||
Location location = BukkitUtil.getLocation(event.getLocation());
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
boolean plotArea = location.isPlotArea();
|
||||
if (!plotArea) {
|
||||
if (!PlotSquared.get().hasPlotArea(location.getWorld())) {
|
||||
return;
|
||||
}
|
||||
Iterator<Block> iterator = event.blockList().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
iterator.next();
|
||||
if (location.isPlotArea()) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
Plot plot = area.getOwnedPlot(location);
|
||||
|
|
Loading…
Reference in a new issue