mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 10:14:42 +02:00
Code cleaning and Gradle Update
Updated gradle wrapper to 3.0 Updated Gradle files for Nukkit Added/cleaned minor Nukkit code Removed duplicate TitleManagement code Signed-off-by: MattBDev <mattbdev@outlook.com>
This commit is contained in:
@ -12,6 +12,7 @@ import cn.nukkit.entity.item.EntityPotion;
|
||||
import cn.nukkit.entity.item.EntityVehicle;
|
||||
import cn.nukkit.entity.mob.EntityMob;
|
||||
import cn.nukkit.entity.passive.EntityAnimal;
|
||||
import cn.nukkit.entity.passive.EntityTameable;
|
||||
import cn.nukkit.entity.passive.EntityWaterAnimal;
|
||||
import cn.nukkit.entity.projectile.EntityProjectile;
|
||||
import cn.nukkit.event.Cancellable;
|
||||
@ -552,7 +553,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
PlotPlayer plotPlayer = NukkitUtil.getPlayer(event.getPlayer());
|
||||
Location location = plotPlayer.getLocation();
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null || (!area.PLOT_CHAT != plotPlayer.getAttribute("chat"))) {
|
||||
if (area == null || (area.PLOT_CHAT == plotPlayer.getAttribute("chat"))) {
|
||||
return;
|
||||
}
|
||||
Plot plot = area.getPlot(location);
|
||||
@ -1052,9 +1053,7 @@ public void blockDestroy(BlockBreakEvent event) {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onInventoryClose(InventoryCloseEvent event) {
|
||||
Player closer = event.getPlayer();
|
||||
Player player = (Player) closer;
|
||||
NukkitUtil.getPlayer(player).deleteMeta("inventory");
|
||||
NukkitUtil.getPlayer(event.getPlayer()).deleteMeta("inventory");
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
@ -1224,7 +1223,7 @@ public void blockDestroy(BlockBreakEvent event) {
|
||||
MainUtil.sendMessage(plotPlayer, C.NO_PERMISSION_EVENT, "plots.admin.pve." + stub);
|
||||
return false;
|
||||
}
|
||||
} else if (false) { // TODO victim is tameable
|
||||
} else if (victim instanceof EntityTameable) {
|
||||
if (plot != null && (plot.getFlag(Flags.TAMED_ATTACK, false) || plot.getFlag(Flags.PVE, false) || plot.isAdded(plotPlayer.getUUID()))) {
|
||||
return true;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public class NukkitEventUtil extends EventUtil {
|
||||
|
||||
public boolean callEvent(Event event) {
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
return !(event instanceof Cancellable) || !((Cancellable) event).isCancelled();
|
||||
return !(event instanceof Cancellable) || !event.isCancelled();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -79,7 +79,7 @@ public class NukkitSchematicHandler extends SchematicHandler {
|
||||
public void run() {
|
||||
schematic.put("Blocks", new ByteArrayTag("Blocks", blocks));
|
||||
schematic.put("Data", new ByteArrayTag("Data", blockData));
|
||||
schematic.put("Entities", new ListTag("Entities", CompoundTag.class, new ArrayList<Tag>()));
|
||||
schematic.put("Entities", new ListTag("Entities", CompoundTag.class, new ArrayList<>()));
|
||||
schematic.put("TileEntities", new ListTag("TileEntities", CompoundTag.class, tileEntities));
|
||||
whenDone.value = new CompoundTag("Schematic", schematic);
|
||||
TaskManager.runTask(whenDone);
|
||||
|
@ -34,7 +34,7 @@ public class NukkitSetupUtils extends SetupUtils {
|
||||
return;
|
||||
}
|
||||
String testWorld = "CheckingPlotSquaredGenerator";
|
||||
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("world", testWorld);
|
||||
map.put("plot-generator", new HybridGen());
|
||||
NukkitPlotGenerator gen = new NukkitPlotGenerator(map);
|
||||
@ -117,7 +117,7 @@ public class NukkitSetupUtils extends SetupUtils {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (object.setupGenerator != null) {
|
||||
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("world", object.world);
|
||||
map.put("plot-generator", new HybridGen());
|
||||
plugin.getServer().generateLevel(object.world, object.world.hashCode(), NukkitPlotGenerator.class, map);
|
||||
|
@ -8,7 +8,6 @@ import cn.nukkit.level.generator.biome.Biome;
|
||||
import cn.nukkit.math.Vector3;
|
||||
import com.intellectualcrafters.plot.PS;
|
||||
import com.intellectualcrafters.plot.object.PlotBlock;
|
||||
import com.intellectualcrafters.plot.util.StringMan;
|
||||
import com.intellectualcrafters.plot.util.block.BasicLocalBlockQueue;
|
||||
import com.plotsquared.nukkit.NukkitMain;
|
||||
|
||||
@ -112,9 +111,7 @@ public class NukkitLocalQueue<T> extends BasicLocalBlockQueue<T> {
|
||||
for (int y = 0; y < biomes2.length; y++) {
|
||||
String biomeStr = biomes2[y];
|
||||
if (biomeStr != null) {
|
||||
if (last == null || !StringMan.isEqual(last, biomeStr)) {
|
||||
biome = Biome.getBiome(biomeStr.toUpperCase()).getId();
|
||||
}
|
||||
biome = Biome.getBiome(biomeStr.toUpperCase()).getId();
|
||||
level.setBiomeId(bx + x, bz + y, biome);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user