Initial 1.14 Update

This commit is contained in:
MattBDev 2019-04-23 13:45:24 -04:00
parent 6fa41efbf5
commit 1118901ca2
10 changed files with 37 additions and 47 deletions

View File

@ -9,7 +9,7 @@ repositories {
dependencies {
implementation project(':Core')
compile project(':Core')
compile 'org.spigotmc:spigot-api:1.13.2-R0.1-SNAPSHOT'
compile 'org.spigotmc:spigot-api:1.14-pre5-SNAPSHOT'
compile(group: 'com.sk89q.worldedit', name: 'worldedit-bukkit', version: '7.0.0-SNAPSHOT')
compile(group: 'org.bstats', name: 'bstats-bukkit', version: '1.4')
compile("net.milkbowl.vault:VaultAPI:1.7") {
@ -43,7 +43,6 @@ shadowJar {
include(dependency('com.squareup.okio:okio:2.2.2'))
include(dependency('org.jetbrains.kotlin:kotlin-stdlib:1.3.21'))
}
// relocate('org.mcstats', 'com.plotsquared.stats')
archiveName = "${parent.name}-${project.name}-${parent.version}.jar"
destinationDir = file '../target'
}

View File

@ -247,7 +247,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
}
} else {
result = world
.unloadChunk(chunkI.getX(), chunkI.getZ(), true, false);
.unloadChunk(chunkI.getX(), chunkI.getZ(), true);
}
if (!result) {
continue outer;
@ -332,15 +332,12 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
Entity entity = iterator.next();
switch (entity.getType()) {
case EGG:
case COMPLEX_PART:
case FISHING_HOOK:
case ENDER_SIGNAL:
case LINGERING_POTION:
case AREA_EFFECT_CLOUD:
case EXPERIENCE_ORB:
case LEASH_HITCH:
case FIREWORK:
case WEATHER:
case LIGHTNING:
case WITHER_SKULL:
case UNKNOWN:
@ -352,7 +349,6 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
case SNOWBALL:
case SHULKER_BULLET:
case SPECTRAL_ARROW:
case TIPPED_ARROW:
case ENDER_PEARL:
case ARROW:
case LLAMA_SPIT:
@ -421,12 +417,12 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
if (Settings.Enabled_Components.KILL_ROAD_MOBS) {
LivingEntity livingEntity = (LivingEntity) entity;
List<MetadataValue> meta = entity.getMetadata("plot");
if (meta != null && !meta.isEmpty()) {
if (!meta.isEmpty()) {
if (livingEntity.isLeashed()) {
continue;
}
List<MetadataValue> keep = entity.getMetadata("keep");
if (keep != null && !keep.isEmpty()) {
if (!keep.isEmpty()) {
continue;
}
@ -774,6 +770,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
return;
}
}
assert world != null;
ChunkGenerator gen = world.getGenerator();
if (gen instanceof BukkitPlotGenerator) {
PlotSquared.get().loadWorld(worldName, (BukkitPlotGenerator) gen);

View File

@ -94,7 +94,7 @@ import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils
if (System.currentTimeMillis() - start > 5) {
return;
}
chunk.unload(true, false);
chunk.unload(true);
}
} catch (Throwable e) {
e.printStackTrace();
@ -112,7 +112,7 @@ import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils
field.set(false);
if (chunk.isLoaded()) {
ignoreUnload = true;
chunk.unload(false, false);
chunk.unload(false);
ignoreUnload = false;
}
}
@ -225,7 +225,7 @@ import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils
TaskManager.tasks.remove(currentIndex);
PlotSquared
.debug(Captions.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
chunk.unload(true, true);
chunk.unload(true);
return;
}
BlockState[] tiles = chunk.getTileEntities();
@ -234,7 +234,7 @@ import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils
TaskManager.tasks.remove(currentIndex);
PlotSquared
.debug(Captions.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
chunk.unload(true, true);
chunk.unload(true);
return;
}
long start = System.currentTimeMillis();
@ -245,7 +245,7 @@ import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils
TaskManager.tasks.remove(currentIndex);
PlotSquared.debug(
Captions.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
chunk.unload(true, true);
chunk.unload(true);
return;
}
tiles[i].getBlock().setType(Material.AIR, false);

View File

@ -108,7 +108,6 @@ import java.util.regex.Pattern;
case EGG:
case ENDER_PEARL:
case FIREBALL:
case LINGERING_POTION:
case LLAMA_SPIT:
case SHULKER_BULLET:
case SMALL_FIREBALL:
@ -116,13 +115,11 @@ import java.util.regex.Pattern;
case SPECTRAL_ARROW:
case SPLASH_POTION:
case THROWN_EXP_BOTTLE:
case TIPPED_ARROW:
// projectile
case FALLING_BLOCK:
case PRIMED_TNT:
// Block entities
case AREA_EFFECT_CLOUD:
case COMPLEX_PART:
case ENDER_CRYSTAL:
case ENDER_SIGNAL:
case EVOKER_FANGS:
@ -132,7 +129,6 @@ import java.util.regex.Pattern;
case LEASH_HITCH:
case LIGHTNING:
case UNKNOWN:
case WEATHER:
case WITHER_SKULL:
// non moving / unmovable
return EntityUtil.checkEntity(plot, Flags.ENTITY_CAP);
@ -1956,8 +1952,8 @@ import java.util.regex.Pattern;
case CHAIN_COMMAND_BLOCK:
case REPEATING_COMMAND_BLOCK:
case SIGN:
case WALL_SIGN:
case LEGACY_SIGN:
case LEGACY_WALL_SIGN:
case REDSTONE_TORCH:
case REDSTONE_WALL_TORCH:

View File

@ -63,7 +63,6 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
this.dataByte = getOrdinal(TreeSpecies.values(), boat.getWoodType());
return;
case ARROW:
case COMPLEX_PART:
case EGG:
case ENDER_CRYSTAL:
case ENDER_PEARL:
@ -87,14 +86,11 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
case MINECART_FURNACE:
case SPLASH_POTION:
case THROWN_EXP_BOTTLE:
case WEATHER:
case WITHER_SKULL:
case UNKNOWN:
case TIPPED_ARROW:
case SPECTRAL_ARROW:
case SHULKER_BULLET:
case DRAGON_FIREBALL:
case LINGERING_POTION:
case AREA_EFFECT_CLOUD:
case TRIDENT:
case LLAMA_SPIT:
@ -164,9 +160,14 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
storeLiving((LivingEntity) entity);
return;
// END TAMEABLE //
//todo fix sheep
case SHEEP:
Sheep sheep = (Sheep) entity;
this.dataByte = (byte) (sheep.isSheared() ? 1 : 0);
if (sheep.isSheared()) {
this.dataByte = (byte) 1;
} else {
this.dataByte = (byte) 0;
}
this.dataByte2 = sheep.getColor().getDyeData();
storeAgeable(sheep);
storeLiving(sheep);
@ -324,12 +325,14 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
void restoreEquipment(LivingEntity entity) {
EntityEquipment equipment = entity.getEquipment();
equipment.setItemInMainHand(this.lived.mainHand);
equipment.setItemInOffHand(this.lived.offHand);
equipment.setHelmet(this.lived.helmet);
equipment.setChestplate(this.lived.chestplate);
equipment.setLeggings(this.lived.leggings);
equipment.setBoots(this.lived.boots);
if (equipment != null) {
equipment.setItemInMainHand(this.lived.mainHand);
equipment.setItemInOffHand(this.lived.offHand);
equipment.setHelmet(this.lived.helmet);
equipment.setChestplate(this.lived.chestplate);
equipment.setLeggings(this.lived.leggings);
equipment.setBoots(this.lived.boots);
}
}
private void restoreInventory(InventoryHolder entity) {
@ -462,7 +465,6 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
((Slime) entity).setSize(this.dataByte);
return entity;
case ARROW:
case COMPLEX_PART:
case EGG:
case ENDER_CRYSTAL:
case ENDER_PEARL:
@ -485,11 +487,8 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
case SNOWBALL:
case SPLASH_POTION:
case THROWN_EXP_BOTTLE:
case WEATHER:
case TIPPED_ARROW:
case SPECTRAL_ARROW:
case SHULKER_BULLET:
case LINGERING_POTION:
case AREA_EFFECT_CLOUD:
case DRAGON_FIREBALL:
case WITHER_SKULL:

View File

@ -395,9 +395,9 @@ public class BukkitChunkManager extends ChunkManager {
final boolean safe) {
if (!PlotSquared.get().isMainThread(Thread.currentThread())) {
TaskManager
.runTask(() -> BukkitUtil.getWorld(world).unloadChunk(loc.x, loc.z, save, safe));
.runTask(() -> BukkitUtil.getWorld(world).unloadChunk(loc.x, loc.z, save));
} else {
BukkitUtil.getWorld(world).unloadChunk(loc.x, loc.z, save, safe);
BukkitUtil.getWorld(world).unloadChunk(loc.x, loc.z, save);
}
}
@ -466,7 +466,6 @@ public class BukkitChunkManager extends ChunkManager {
case ENDER_PEARL:
case ARROW:
case TRIDENT:
case TIPPED_ARROW:
case SHULKER_BULLET:
case SPECTRAL_ARROW:
case DRAGON_FIREBALL:
@ -476,18 +475,15 @@ public class BukkitChunkManager extends ChunkManager {
case FALLING_BLOCK:
// Block entities
case ENDER_CRYSTAL:
case COMPLEX_PART:
case FISHING_HOOK:
case ENDER_SIGNAL:
case EXPERIENCE_ORB:
case LEASH_HITCH:
case FIREWORK:
case WEATHER:
case LIGHTNING:
case WITHER_SKULL:
case UNKNOWN:
case AREA_EFFECT_CLOUD:
case LINGERING_POTION:
case EVOKER_FANGS:
// non moving / unremovable
break;
@ -534,6 +530,9 @@ public class BukkitChunkManager extends ChunkManager {
case SALMON:
case PUFFERFISH:
case TROPICAL_FISH:
case CAT:
case FOX:
case PANDA:
// animal
count[3]++;
count[1]++;

View File

@ -304,7 +304,7 @@ public class BukkitHybridUtils extends HybridUtils {
}
}
}
worldObj.unloadChunkRequest(X, Z, true);
worldObj.unloadChunkRequest(X, Z);
}
}, () -> TaskManager.runTaskAsync(run), 5);
});

View File

@ -61,11 +61,11 @@ public class BukkitSetupUtils extends SetupUtils {
}
if (save) {
for (Chunk chunk : world.getLoadedChunks()) {
chunk.unload(true, false);
chunk.unload(true);
}
} else {
for (Chunk chunk : world.getLoadedChunks()) {
chunk.unload(false, false);
chunk.unload(false);
}
}
Bukkit.unloadWorld(world, false);

View File

@ -331,7 +331,7 @@ import java.util.*;
final Block block = world.getBlockAt(x, y, z);
// block.setType(Material.AIR);
final Material type = block.getType();
if (type != Material.SIGN && type != Material.WALL_SIGN) {
if (type != Material.LEGACY_SIGN && type != Material.LEGACY_WALL_SIGN) {
BlockFace facing = BlockFace.EAST;
if (world.getBlockAt(x, y, z + 1).getType().isSolid()) {
facing = BlockFace.NORTH;
@ -340,7 +340,7 @@ import java.util.*;
} else if (world.getBlockAt(x, y, z - 1).getType().isSolid()) {
facing = BlockFace.SOUTH;
}
block.setType(Material.WALL_SIGN, false);
block.setType(Material.LEGACY_WALL_SIGN, false);
final WallSign sign = (WallSign) block.getBlockData();
sign.setFacing(facing);
block.setBlockData(sign, false);

View File

@ -116,7 +116,7 @@ public class SendChunk {
for (final Chunk chunk : chunks) {
TaskManager.runTask(() -> {
try {
chunk.unload(true, false);
chunk.unload(true);
} catch (Throwable ignored) {
String worldName = chunk.getWorld().getName();
PlotSquared.debug(