mirror of
https://github.com/BentoBoxWorld/AcidIsland.git
synced 2024-11-22 18:45:22 +01:00
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:
parent
0ae1f70365
commit
064feb3030
@ -355,26 +355,12 @@ public class AISettings implements DataObject, WorldSettings {
|
|||||||
// ---------------------------------------------
|
// ---------------------------------------------
|
||||||
|
|
||||||
/* PROTECTION */
|
/* 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;
|
private int togglePvPCooldown;
|
||||||
|
|
||||||
//TODO transform these options below into flags
|
@ConfigComment("Geo restrict mobs.")
|
||||||
private boolean allowEndermanGriefing;
|
@ConfigComment("Mobs that exit the island space where they were spawned will be removed.")
|
||||||
private boolean endermanDeathDrop;
|
@ConfigEntry(path = "protection.geo-limit-settings")
|
||||||
private boolean allowTNTDamage;
|
private List<String> geoLimitSettings = new ArrayList<>();
|
||||||
private boolean allowChestDamage;
|
|
||||||
private boolean allowCreeperDamage;
|
|
||||||
private boolean allowCreeperGriefing;
|
|
||||||
private boolean allowMobDamageToItemFrames;
|
|
||||||
|
|
||||||
// Invincible visitor settings
|
// Invincible visitor settings
|
||||||
@ConfigComment("Invincible visitors. List of damages that will not affect visitors.")
|
@ConfigComment("Invincible visitors. List of damages that will not affect visitors.")
|
||||||
@ -707,60 +693,12 @@ public class AISettings implements DataObject, WorldSettings {
|
|||||||
public String getWorldName() {
|
public String getWorldName() {
|
||||||
return worldName;
|
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
|
* @return the deathsSumTeam
|
||||||
*/
|
*/
|
||||||
public boolean isDeathsSumTeam() {
|
public boolean isDeathsSumTeam() {
|
||||||
return deathsSumTeam;
|
return deathsSumTeam;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* @return the endermanDeathDrop
|
|
||||||
*/
|
|
||||||
public boolean isEndermanDeathDrop() {
|
|
||||||
return endermanDeathDrop;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @return the endGenerate
|
* @return the endGenerate
|
||||||
*/
|
*/
|
||||||
@ -850,12 +788,6 @@ public class AISettings implements DataObject, WorldSettings {
|
|||||||
public boolean isRespawnOnIsland() {
|
public boolean isRespawnOnIsland() {
|
||||||
return respawnOnIsland;
|
return respawnOnIsland;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* @return the restrictFlyingMobs
|
|
||||||
*/
|
|
||||||
public boolean isRestrictFlyingMobs() {
|
|
||||||
return restrictFlyingMobs;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @return the useOwnGenerator
|
* @return the useOwnGenerator
|
||||||
*/
|
*/
|
||||||
@ -863,48 +795,6 @@ public class AISettings implements DataObject, WorldSettings {
|
|||||||
public boolean isUseOwnGenerator() {
|
public boolean isUseOwnGenerator() {
|
||||||
return useOwnGenerator;
|
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
|
* @param customRanks the customRanks to set
|
||||||
*/
|
*/
|
||||||
@ -923,12 +813,6 @@ public class AISettings implements DataObject, WorldSettings {
|
|||||||
public void setDeathsSumTeam(boolean deathsSumTeam) {
|
public void setDeathsSumTeam(boolean deathsSumTeam) {
|
||||||
this.deathsSumTeam = deathsSumTeam;
|
this.deathsSumTeam = deathsSumTeam;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* @param endermanDeathDrop the endermanDeathDrop to set
|
|
||||||
*/
|
|
||||||
public void setEndermanDeathDrop(boolean endermanDeathDrop) {
|
|
||||||
this.endermanDeathDrop = endermanDeathDrop;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @param endGenerate the endGenerate to set
|
* @param endGenerate the endGenerate to set
|
||||||
*/
|
*/
|
||||||
@ -1127,12 +1011,6 @@ public class AISettings implements DataObject, WorldSettings {
|
|||||||
public void setRespawnOnIsland(boolean respawnOnIsland) {
|
public void setRespawnOnIsland(boolean respawnOnIsland) {
|
||||||
this.respawnOnIsland = respawnOnIsland;
|
this.respawnOnIsland = respawnOnIsland;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* @param restrictFlyingMobs the restrictFlyingMobs to set
|
|
||||||
*/
|
|
||||||
public void setRestrictFlyingMobs(boolean restrictFlyingMobs) {
|
|
||||||
this.restrictFlyingMobs = restrictFlyingMobs;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @param seaHeight the seaHeight to set
|
* @param seaHeight the seaHeight to set
|
||||||
*/
|
*/
|
||||||
@ -1433,5 +1311,18 @@ public class AISettings implements DataObject, WorldSettings {
|
|||||||
// Water is unsafe in acid island
|
// Water is unsafe in acid island
|
||||||
return true;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ import us.tastybento.bskyblock.commands.admin.AdminSetRankCommand;
|
|||||||
import us.tastybento.bskyblock.commands.admin.AdminTeleportCommand;
|
import us.tastybento.bskyblock.commands.admin.AdminTeleportCommand;
|
||||||
import us.tastybento.bskyblock.commands.admin.AdminUnregisterCommand;
|
import us.tastybento.bskyblock.commands.admin.AdminUnregisterCommand;
|
||||||
import us.tastybento.bskyblock.commands.admin.AdminVersionCommand;
|
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.AdminTeamAddCommand;
|
||||||
import us.tastybento.bskyblock.commands.admin.team.AdminTeamDisbandCommand;
|
import us.tastybento.bskyblock.commands.admin.team.AdminTeamDisbandCommand;
|
||||||
import us.tastybento.bskyblock.commands.admin.team.AdminTeamKickCommand;
|
import us.tastybento.bskyblock.commands.admin.team.AdminTeamKickCommand;
|
||||||
@ -52,6 +53,8 @@ public class AcidCommand extends CompositeCommand {
|
|||||||
new AdminTeleportCommand(this, "tpend");
|
new AdminTeleportCommand(this, "tpend");
|
||||||
new AdminUnregisterCommand(this);
|
new AdminUnregisterCommand(this);
|
||||||
new AdminVersionCommand(this);
|
new AdminVersionCommand(this);
|
||||||
|
// Range
|
||||||
|
new AdminRangeCommand(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -203,9 +203,10 @@ public class AcidEffect implements Listener {
|
|||||||
// In liquid
|
// In liquid
|
||||||
Material bodyMat = player.getLocation().getBlock().getType();
|
Material bodyMat = player.getLocation().getBlock().getType();
|
||||||
Material headMat = player.getLocation().getBlock().getRelative(BlockFace.UP).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;
|
bodyMat = Material.WATER;
|
||||||
if (headMat.equals(Material.STATIONARY_WATER))
|
if (headMat.name().contains("WATER"))
|
||||||
headMat = Material.WATER;
|
headMat = Material.WATER;
|
||||||
if (bodyMat != Material.WATER && headMat != Material.WATER) {
|
if (bodyMat != Material.WATER && headMat != Material.WATER) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -28,7 +28,8 @@ public class LavaCheck implements Listener {
|
|||||||
public void onCleanstoneGen(BlockFromToEvent e) {
|
public void onCleanstoneGen(BlockFromToEvent e) {
|
||||||
// Only do this in AcidIsland over world
|
// Only do this in AcidIsland over world
|
||||||
if (!e.getBlock().getWorld().equals(addon.getIslandWorld()) || addon.getSettings().getAcidDamage() <= 0
|
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;
|
return;
|
||||||
}
|
}
|
||||||
Material prev = e.getToBlock().getType();
|
Material prev = e.getToBlock().getType();
|
||||||
|
@ -7,7 +7,6 @@ import java.util.WeakHashMap;
|
|||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Animals;
|
import org.bukkit.entity.Animals;
|
||||||
import org.bukkit.entity.Entity;
|
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
|
// This part will kill monsters if they fall into the water because it is acid
|
||||||
entityBurnTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(addon.getBSkyBlock(), () -> getEntityStream()
|
entityBurnTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(addon.getBSkyBlock(), () -> getEntityStream()
|
||||||
.filter(e -> !(e instanceof Guardian || e instanceof Squid))
|
.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 -> {
|
.forEach(e -> {
|
||||||
if ((e instanceof Monster || e instanceof MagmaCube) && addon.getSettings().getAcidDamageMonster() > 0D) {
|
if ((e instanceof Monster || e instanceof MagmaCube) && addon.getSettings().getAcidDamageMonster() > 0D) {
|
||||||
((LivingEntity) e).damage(addon.getSettings().getAcidDamageMonster());
|
((LivingEntity) e).damage(addon.getSettings().getAcidDamageMonster());
|
||||||
@ -76,8 +76,7 @@ public class AcidTask {
|
|||||||
itemBurnTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(addon.getBSkyBlock(), () -> {
|
itemBurnTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(addon.getBSkyBlock(), () -> {
|
||||||
Set<Entity> newItemsInWater = new HashSet<>();
|
Set<Entity> newItemsInWater = new HashSet<>();
|
||||||
getEntityStream().filter(e -> e.getType().equals(EntityType.DROPPED_ITEM)
|
getEntityStream().filter(e -> e.getType().equals(EntityType.DROPPED_ITEM)
|
||||||
&& (e.getLocation().getBlock().getType().equals(Material.WATER)
|
&& (e.getLocation().getBlock().getType().name().contains("WATER"))
|
||||||
|| e.getLocation().getBlock().getType().equals(Material.STATIONARY_WATER))
|
|
||||||
)
|
)
|
||||||
.forEach(e -> {
|
.forEach(e -> {
|
||||||
if (itemsInWater.contains(e)) {
|
if (itemsInWater.contains(e)) {
|
||||||
|
@ -41,7 +41,7 @@ class ChunkGeneratorWorld extends ChunkGenerator {
|
|||||||
for (int x = 0; x < 16; x++) {
|
for (int x = 0; x < 16; x++) {
|
||||||
for (int z = 0; z < 16; z++) {
|
for (int z = 0; z < 16; z++) {
|
||||||
for (int y = 0; y < addon.getSettings().getSeaHeight(); y++) {
|
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 x = 0; x < 16; x++) {
|
||||||
for (int z = 0; z < 16; z++) {
|
for (int z = 0; z < 16; z++) {
|
||||||
for (int y = 0; y < addon.getSettings().getSeaHeight(); y++) {
|
for (int y = 0; y < addon.getSettings().getSeaHeight(); y++) {
|
||||||
result.setBlock(x, y, z, Material.STATIONARY_WATER);
|
result.setBlock(x, y, z, Material.WATER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user