Adjusted to run 1.13-pre7

Removed references to STATIONARY_WATER but used a backwards
compatibility hack to use the enum name to cover WATER. This should be
removed when we go full 1.13.
This commit is contained in:
tastybento 2018-07-23 23:13:57 -07:00
parent 0ae1f70365
commit 064feb3030
6 changed files with 32 additions and 137 deletions

View File

@ -355,26 +355,12 @@ public class AISettings implements DataObject, WorldSettings {
// ---------------------------------------------
/* PROTECTION */
@ConfigComment("Allow pistons to push outside of the protected area (maybe to make bridges)")
@ConfigEntry(path = "protection.allow-piston-push")
private boolean allowPistonPush = false;
@ConfigComment("Restrict Wither and other flying mobs.")
@ConfigComment("Any flying mobs that exit the island space where they were spawned will be removed.")
@ConfigComment("Includes blaze and ghast. ")
@ConfigEntry(path = "protection.restrict-flying-mobs")
private boolean restrictFlyingMobs = true;
private int togglePvPCooldown;
//TODO transform these options below into flags
private boolean allowEndermanGriefing;
private boolean endermanDeathDrop;
private boolean allowTNTDamage;
private boolean allowChestDamage;
private boolean allowCreeperDamage;
private boolean allowCreeperGriefing;
private boolean allowMobDamageToItemFrames;
@ConfigComment("Geo restrict mobs.")
@ConfigComment("Mobs that exit the island space where they were spawned will be removed.")
@ConfigEntry(path = "protection.geo-limit-settings")
private List<String> geoLimitSettings = new ArrayList<>();
// Invincible visitor settings
@ConfigComment("Invincible visitors. List of damages that will not affect visitors.")
@ -707,60 +693,12 @@ public class AISettings implements DataObject, WorldSettings {
public String getWorldName() {
return worldName;
}
/**
* @return the allowChestDamage
*/
public boolean isAllowChestDamage() {
return allowChestDamage;
}
/**
* @return the allowCreeperDamage
*/
public boolean isAllowCreeperDamage() {
return allowCreeperDamage;
}
/**
* @return the allowCreeperGriefing
*/
public boolean isAllowCreeperGriefing() {
return allowCreeperGriefing;
}
/**
* @return the allowEndermanGriefing
*/
public boolean isAllowEndermanGriefing() {
return allowEndermanGriefing;
}
/**
* @return the allowMobDamageToItemFrames
*/
public boolean isAllowMobDamageToItemFrames() {
return allowMobDamageToItemFrames;
}
/**
* @return the allowPistonPush
*/
public boolean isAllowPistonPush() {
return allowPistonPush;
}
/**
* @return the allowTNTDamage
*/
public boolean isAllowTNTDamage() {
return allowTNTDamage;
}
/**
* @return the deathsSumTeam
*/
public boolean isDeathsSumTeam() {
return deathsSumTeam;
}
/**
* @return the endermanDeathDrop
*/
public boolean isEndermanDeathDrop() {
return endermanDeathDrop;
}
/**
* @return the endGenerate
*/
@ -850,12 +788,6 @@ public class AISettings implements DataObject, WorldSettings {
public boolean isRespawnOnIsland() {
return respawnOnIsland;
}
/**
* @return the restrictFlyingMobs
*/
public boolean isRestrictFlyingMobs() {
return restrictFlyingMobs;
}
/**
* @return the useOwnGenerator
*/
@ -863,48 +795,6 @@ public class AISettings implements DataObject, WorldSettings {
public boolean isUseOwnGenerator() {
return useOwnGenerator;
}
/**
* @param allowChestDamage the allowChestDamage to set
*/
public void setAllowChestDamage(boolean allowChestDamage) {
this.allowChestDamage = allowChestDamage;
}
/**
* @param allowCreeperDamage the allowCreeperDamage to set
*/
public void setAllowCreeperDamage(boolean allowCreeperDamage) {
this.allowCreeperDamage = allowCreeperDamage;
}
/**
* @param allowCreeperGriefing the allowCreeperGriefing to set
*/
public void setAllowCreeperGriefing(boolean allowCreeperGriefing) {
this.allowCreeperGriefing = allowCreeperGriefing;
}
/**
* @param allowEndermanGriefing the allowEndermanGriefing to set
*/
public void setAllowEndermanGriefing(boolean allowEndermanGriefing) {
this.allowEndermanGriefing = allowEndermanGriefing;
}
/**
* @param allowMobDamageToItemFrames the allowMobDamageToItemFrames to set
*/
public void setAllowMobDamageToItemFrames(boolean allowMobDamageToItemFrames) {
this.allowMobDamageToItemFrames = allowMobDamageToItemFrames;
}
/**
* @param allowPistonPush the allowPistonPush to set
*/
public void setAllowPistonPush(boolean allowPistonPush) {
this.allowPistonPush = allowPistonPush;
}
/**
* @param allowTNTDamage the allowTNTDamage to set
*/
public void setAllowTNTDamage(boolean allowTNTDamage) {
this.allowTNTDamage = allowTNTDamage;
}
/**
* @param customRanks the customRanks to set
*/
@ -923,12 +813,6 @@ public class AISettings implements DataObject, WorldSettings {
public void setDeathsSumTeam(boolean deathsSumTeam) {
this.deathsSumTeam = deathsSumTeam;
}
/**
* @param endermanDeathDrop the endermanDeathDrop to set
*/
public void setEndermanDeathDrop(boolean endermanDeathDrop) {
this.endermanDeathDrop = endermanDeathDrop;
}
/**
* @param endGenerate the endGenerate to set
*/
@ -1127,12 +1011,6 @@ public class AISettings implements DataObject, WorldSettings {
public void setRespawnOnIsland(boolean respawnOnIsland) {
this.respawnOnIsland = respawnOnIsland;
}
/**
* @param restrictFlyingMobs the restrictFlyingMobs to set
*/
public void setRestrictFlyingMobs(boolean restrictFlyingMobs) {
this.restrictFlyingMobs = restrictFlyingMobs;
}
/**
* @param seaHeight the seaHeight to set
*/
@ -1433,5 +1311,18 @@ public class AISettings implements DataObject, WorldSettings {
// Water is unsafe in acid island
return true;
}
/**
* @return the geoLimitSettings
*/
@Override
public List<String> getGeoLimitSettings() {
return geoLimitSettings;
}
/**
* @param geoLimitSettings the geoLimitSettings to set
*/
public void setGeoLimitSettings(List<String> geoLimitSettings) {
this.geoLimitSettings = geoLimitSettings;
}
}

View File

@ -15,6 +15,7 @@ import us.tastybento.bskyblock.commands.admin.AdminSetRankCommand;
import us.tastybento.bskyblock.commands.admin.AdminTeleportCommand;
import us.tastybento.bskyblock.commands.admin.AdminUnregisterCommand;
import us.tastybento.bskyblock.commands.admin.AdminVersionCommand;
import us.tastybento.bskyblock.commands.admin.range.AdminRangeCommand;
import us.tastybento.bskyblock.commands.admin.team.AdminTeamAddCommand;
import us.tastybento.bskyblock.commands.admin.team.AdminTeamDisbandCommand;
import us.tastybento.bskyblock.commands.admin.team.AdminTeamKickCommand;
@ -52,6 +53,8 @@ public class AcidCommand extends CompositeCommand {
new AdminTeleportCommand(this, "tpend");
new AdminUnregisterCommand(this);
new AdminVersionCommand(this);
// Range
new AdminRangeCommand(this);
}
@Override

View File

@ -203,9 +203,10 @@ public class AcidEffect implements Listener {
// In liquid
Material bodyMat = player.getLocation().getBlock().getType();
Material headMat = player.getLocation().getBlock().getRelative(BlockFace.UP).getType();
if (bodyMat.equals(Material.STATIONARY_WATER))
// TODO: remove backwards compatibility hack
if (bodyMat.name().contains("WATER"))
bodyMat = Material.WATER;
if (headMat.equals(Material.STATIONARY_WATER))
if (headMat.name().contains("WATER"))
headMat = Material.WATER;
if (bodyMat != Material.WATER && headMat != Material.WATER) {
return true;

View File

@ -21,17 +21,18 @@ public class LavaCheck implements Listener {
/**
* Removes stone generated by lava pouring on water
*
*
* @param e - event
*/
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onCleanstoneGen(BlockFromToEvent e) {
// Only do this in AcidIsland over world
if (!e.getBlock().getWorld().equals(addon.getIslandWorld()) || addon.getSettings().getAcidDamage() <= 0
|| !(e.getToBlock().getType().equals(Material.WATER) || e.getToBlock().getType().equals(Material.STATIONARY_WATER))) {
// TODO: backward compatibility hack
|| !(e.getToBlock().getType().name().equals("WATER"))) {
return;
}
Material prev = e.getToBlock().getType();
Material prev = e.getToBlock().getType();
addon.getServer().getScheduler().runTask(addon.getBSkyBlock(), () -> {
if (e.getToBlock().getType().equals(Material.STONE)) {
e.getToBlock().setType(prev);

View File

@ -7,7 +7,6 @@ import java.util.WeakHashMap;
import java.util.stream.Stream;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Animals;
import org.bukkit.entity.Entity;
@ -43,7 +42,8 @@ public class AcidTask {
// This part will kill monsters if they fall into the water because it is acid
entityBurnTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(addon.getBSkyBlock(), () -> getEntityStream()
.filter(e -> !(e instanceof Guardian || e instanceof Squid))
.filter(w -> w.getLocation().getBlock().getType().equals(Material.WATER) || w.getLocation().getBlock().getType().equals(Material.STATIONARY_WATER))
// TODO: remove backwards compatibility hack
.filter(w -> w.getLocation().getBlock().getType().name().contains("WATER"))
.forEach(e -> {
if ((e instanceof Monster || e instanceof MagmaCube) && addon.getSettings().getAcidDamageMonster() > 0D) {
((LivingEntity) e).damage(addon.getSettings().getAcidDamageMonster());
@ -76,8 +76,7 @@ public class AcidTask {
itemBurnTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(addon.getBSkyBlock(), () -> {
Set<Entity> newItemsInWater = new HashSet<>();
getEntityStream().filter(e -> e.getType().equals(EntityType.DROPPED_ITEM)
&& (e.getLocation().getBlock().getType().equals(Material.WATER)
|| e.getLocation().getBlock().getType().equals(Material.STATIONARY_WATER))
&& (e.getLocation().getBlock().getType().name().contains("WATER"))
)
.forEach(e -> {
if (itemsInWater.contains(e)) {

View File

@ -41,7 +41,7 @@ class ChunkGeneratorWorld extends ChunkGenerator {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
for (int y = 0; y < addon.getSettings().getSeaHeight(); y++) {
result.setBlock(x, y, z, Material.STATIONARY_WATER);
result.setBlock(x, y, z, Material.WATER);
}
}
}
@ -77,7 +77,7 @@ class ChunkGeneratorWorld extends ChunkGenerator {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
for (int y = 0; y < addon.getSettings().getSeaHeight(); y++) {
result.setBlock(x, y, z, Material.STATIONARY_WATER);
result.setBlock(x, y, z, Material.WATER);
}
}
}