Adjusted to run in 1.13-pre7

Removed references to STATIONARY_WATER as this does not exist in 1.13.
This commit is contained in:
tastybento 2018-07-23 23:14:51 -07:00
parent b40023bcf9
commit 342387cf09
2 changed files with 9 additions and 5 deletions

View File

@ -52,6 +52,7 @@ public class AddonsManager {
plugin.logError("Cannot make addons folder!");
return;
}
Arrays.stream(Objects.requireNonNull(f.listFiles())).filter(x -> !x.isDirectory() && x.getName().endsWith(".jar")).forEach(this::loadAddon);
addons.forEach(Addon::onLoad);
plugin.log("Loaded " + addons.size() + " addons.");
@ -122,12 +123,14 @@ public class AddonsManager {
addons.add(addon);
// Inform the console
plugin.log("Loaded BSkyBlock addon " + addon.getDescription().getName() + "...");
plugin.log("Loaded BSkyBlock addon " + addon.getDescription().getName() + "...");
} catch (Exception e) {
plugin.log(e.getMessage());
}
} catch (Exception e) {
if (DEBUG) {
plugin.log(f.getName() + "is not a jarfile, ignoring...");
plugin.log(f.getName() + " is not a jarfile, ignoring...");
}
}
}
@ -171,7 +174,7 @@ public class AddonsManager {
* @param name - name of the class
* @return Class - the class
*/
public Class<?> getClassByName(final String name) {
public Class<?> getClassByName(final String name) {
return classes.getOrDefault(name, loader.stream().map(l -> l.findClass(name, false)).filter(Objects::nonNull).findFirst().orElse(null));
}

View File

@ -5,6 +5,7 @@ import java.util.EnumMap;
import java.util.Map;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.World.Environment;
@ -220,7 +221,7 @@ public class NewIsland {
if (!plugin.getIWM().isUseOwnGenerator(location.getWorld())) {
// Block check
if (!location.getBlock().isEmpty() && !location.getBlock().isLiquid()) {
if (!location.getBlock().isEmpty() && !location.getBlock().getType().equals(Material.WATER)) {
plugin.getIslands().createIsland(location);
return Result.BLOCK_AT_CENTER;
}
@ -229,7 +230,7 @@ public class NewIsland {
for (int y = 10; y < location.getWorld().getMaxHeight(); y++) {
for (int z = -5; z <= 5; z++) {
if (!location.getWorld().getBlockAt(x + location.getBlockX(), y, z + location.getBlockZ()).isEmpty()
&& !location.getWorld().getBlockAt(x + location.getBlockX(), y, z + location.getBlockZ()).isLiquid()) {
&& !location.getWorld().getBlockAt(x + location.getBlockX(), y, z + location.getBlockZ()).getType().equals(Material.WATER)) {
plugin.getIslands().createIsland(location);
return Result.BLOCKS_IN_AREA;
}