mirror of
https://github.com/BentoBoxWorld/AcidIsland.git
synced 2024-12-23 09:37:43 +01:00
Merge branch 'develop'
This commit is contained in:
commit
9c19c972cf
@ -12,8 +12,9 @@ jdk:
|
||||
- openjdk8
|
||||
|
||||
script:
|
||||
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package -P sonar sonar:sonar -B
|
||||
- echo "${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}"
|
||||
# JaCoCo is used to have code coverage, the agent has to be activated
|
||||
#- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent org.jacoco:jacoco-maven-plugin:report package sonar:sonar
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- '$HOME/.m2/repository'
|
||||
|
20
pom.xml
20
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>world.bentobox</groupId>
|
||||
<artifactId>acidisland</artifactId>
|
||||
<version>1.4.0</version>
|
||||
<version>1.5.0</version>
|
||||
|
||||
<name>AcidIsland</name>
|
||||
<description>AcidIsland is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock or AcidIsland.</description>
|
||||
@ -62,7 +62,7 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.13.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.14.1-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -83,15 +83,10 @@
|
||||
<version>${powermock.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mongodb</groupId>
|
||||
<artifactId>mongodb-driver</artifactId>
|
||||
<version>3.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>world.bentobox</groupId>
|
||||
<artifactId>bentobox</artifactId>
|
||||
<version>1.4.0</version>
|
||||
<version>1.5.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@ -112,11 +107,12 @@
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources/schems</directory>
|
||||
<targetPath>./schems</targetPath>
|
||||
<directory>src/main/resources/blueprints</directory>
|
||||
<targetPath>./blueprints</targetPath>
|
||||
<filtering>false</filtering>
|
||||
<includes>
|
||||
<include>*.schem</include>
|
||||
<include>*.blu</include>
|
||||
<include>*.json</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
@ -132,7 +128,7 @@
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<nonFilteredFileExtensions>
|
||||
<nonFilteredFileExtension>schem</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>blu</nonFilteredFileExtension>
|
||||
</nonFilteredFileExtensions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
@ -18,7 +18,6 @@ import world.bentobox.bentobox.api.configuration.ConfigEntry;
|
||||
import world.bentobox.bentobox.api.configuration.StoreAt;
|
||||
import world.bentobox.bentobox.api.configuration.WorldSettings;
|
||||
import world.bentobox.bentobox.api.flags.Flag;
|
||||
import world.bentobox.bentobox.database.objects.DataObject;
|
||||
import world.bentobox.bentobox.database.objects.adapters.Adapter;
|
||||
import world.bentobox.bentobox.database.objects.adapters.FlagSerializer;
|
||||
import world.bentobox.bentobox.database.objects.adapters.FlagSerializer2;
|
||||
@ -31,7 +30,7 @@ import world.bentobox.bentobox.database.objects.adapters.PotionEffectListAdapter
|
||||
*/
|
||||
@ConfigComment("AcidIsland Configuration [version]")
|
||||
@StoreAt(filename="config.yml", path="addons/AcidIsland") // Explicitly call out what name this should have.
|
||||
public class AISettings implements DataObject, WorldSettings {
|
||||
public class AISettings implements WorldSettings {
|
||||
|
||||
// ---------------------------------------------
|
||||
|
||||
@ -74,6 +73,15 @@ public class AISettings implements DataObject, WorldSettings {
|
||||
@ConfigEntry(path = "acid.damage.rain")
|
||||
private int acidRainDamage = 1;
|
||||
|
||||
@ConfigComment("Damage from acid snow")
|
||||
@ConfigEntry(path = "acid.damage.snow")
|
||||
private boolean acidDamageSnow;
|
||||
|
||||
@ConfigComment("Delay before acid or acid rain starts burning")
|
||||
@ConfigComment("This can give time for conduit power to kick in")
|
||||
@ConfigEntry(path = "acid.damage.delay")
|
||||
private long acidDamageDelay = 2;
|
||||
|
||||
@ConfigComment("Portion effects from going into acid water")
|
||||
@ConfigComment("You can list multiple effects")
|
||||
@ConfigEntry(path = "acid.damage.effects")
|
||||
@ -95,9 +103,9 @@ public class AISettings implements DataObject, WorldSettings {
|
||||
private String friendlyName = "AcidIsland";
|
||||
|
||||
@ConfigComment("Name of the world - if it does not exist then it will be generated.")
|
||||
@ConfigComment("It acts like a prefix for nether and end (e.g. AcidIsland_world, AcidIsland_world_nether, AcidIsland_world_end)")
|
||||
@ConfigComment("It acts like a prefix for nether and end (e.g. acidisland_world, acidisland_world_nether, acidisland_world_end)")
|
||||
@ConfigEntry(path = "world.world-name", needsReset = true)
|
||||
private String worldName = "AcidIsland_world";
|
||||
private String worldName = "acidisland_world";
|
||||
|
||||
@ConfigComment("World difficulty setting - PEACEFUL, EASY, NORMAL, HARD")
|
||||
@ConfigComment("Other plugins may override this setting")
|
||||
@ -295,8 +303,7 @@ public class AISettings implements DataObject, WorldSettings {
|
||||
private boolean leaversLoseReset = false;
|
||||
|
||||
@ConfigComment("Allow kicked players to keep their inventory.")
|
||||
@ConfigComment("If false, kicked player's inventory will be thrown at the island leader if the")
|
||||
@ConfigComment("kicked player is online and in the island world.")
|
||||
@ConfigComment("Overrides the on-leave inventory reset for kicked players.")
|
||||
@ConfigEntry(path = "island.reset.kicked-keep-inventory")
|
||||
private boolean kickedKeepInventory = false;
|
||||
|
||||
@ -356,9 +363,6 @@ public class AISettings implements DataObject, WorldSettings {
|
||||
@ConfigEntry(path = "island.deaths.max")
|
||||
private int deathsMax = 10;
|
||||
|
||||
@ConfigEntry(path = "island.deaths.sum-team")
|
||||
private boolean deathsSumTeam = false;
|
||||
|
||||
@ConfigComment("When a player joins a team, reset their death count")
|
||||
@ConfigEntry(path = "island.deaths.team-join-reset")
|
||||
private boolean teamJoinDeathReset = true;
|
||||
@ -385,7 +389,6 @@ public class AISettings implements DataObject, WorldSettings {
|
||||
@ConfigComment("These settings should not be edited")
|
||||
@ConfigEntry(path = "do-not-edit-these-settings.reset-epoch")
|
||||
private long resetEpoch = 0;
|
||||
private String uniqueId = "config";
|
||||
|
||||
|
||||
/**
|
||||
@ -400,6 +403,12 @@ public class AISettings implements DataObject, WorldSettings {
|
||||
public int getAcidDamageAnimal() {
|
||||
return acidDamageAnimal;
|
||||
}
|
||||
/**
|
||||
* @return the acidDamageDelay
|
||||
*/
|
||||
public long getAcidDamageDelay() {
|
||||
return acidDamageDelay;
|
||||
}
|
||||
/**
|
||||
* @return the acidDamageMonster
|
||||
*/
|
||||
@ -636,13 +645,6 @@ public class AISettings implements DataObject, WorldSettings {
|
||||
public int getSeaHeight() {
|
||||
return seaHeight;
|
||||
}
|
||||
/**
|
||||
* @return the uniqueId
|
||||
*/
|
||||
@Override
|
||||
public String getUniqueId() {
|
||||
return uniqueId;
|
||||
}
|
||||
/**
|
||||
* @return the hidden flags
|
||||
*/
|
||||
@ -704,12 +706,6 @@ public class AISettings implements DataObject, WorldSettings {
|
||||
public boolean isDeathsCounted() {
|
||||
return deathsCounted;
|
||||
}
|
||||
/**
|
||||
* @return the deathsSumTeam
|
||||
*/
|
||||
public boolean isDeathsSumTeam() {
|
||||
return deathsSumTeam;
|
||||
}
|
||||
/**
|
||||
* @return the dragonSpawn
|
||||
*/
|
||||
@ -725,7 +721,6 @@ public class AISettings implements DataObject, WorldSettings {
|
||||
return endGenerate;
|
||||
}
|
||||
/**
|
||||
* @return the endIslands
|
||||
*/
|
||||
@Override
|
||||
public boolean isEndIslands() {
|
||||
@ -746,12 +741,14 @@ public class AISettings implements DataObject, WorldSettings {
|
||||
/**
|
||||
* @return the kickedKeepInventory
|
||||
*/
|
||||
@Override
|
||||
public boolean isKickedKeepInventory() {
|
||||
return kickedKeepInventory;
|
||||
}
|
||||
/**
|
||||
* @return the leaversLoseReset
|
||||
*/
|
||||
@Override
|
||||
public boolean isLeaversLoseReset() {
|
||||
return leaversLoseReset;
|
||||
}
|
||||
@ -872,6 +869,12 @@ public class AISettings implements DataObject, WorldSettings {
|
||||
public void setAcidDamageChickens(boolean acidDamageChickens) {
|
||||
this.acidDamageChickens = acidDamageChickens;
|
||||
}
|
||||
/**
|
||||
* @param acidDamageDelay the acidDamageDelay to set
|
||||
*/
|
||||
public void setAcidDamageDelay(long acidDamageDelay) {
|
||||
this.acidDamageDelay = acidDamageDelay;
|
||||
}
|
||||
/**
|
||||
* @param acidDamageMonster the acidDamageMonster to set
|
||||
*/
|
||||
@ -942,12 +945,6 @@ public class AISettings implements DataObject, WorldSettings {
|
||||
public void setDeathsMax(int deathsMax) {
|
||||
this.deathsMax = deathsMax;
|
||||
}
|
||||
/**
|
||||
* @param deathsSumTeam the deathsSumTeam to set
|
||||
*/
|
||||
public void setDeathsSumTeam(boolean deathsSumTeam) {
|
||||
this.deathsSumTeam = deathsSumTeam;
|
||||
}
|
||||
/**
|
||||
* @param defaultBiome the defaultBiome to set
|
||||
*/
|
||||
@ -1243,14 +1240,6 @@ public class AISettings implements DataObject, WorldSettings {
|
||||
this.teamJoinDeathReset = teamJoinDeathReset;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param uniqueId - unique ID the uniqueId to set
|
||||
*/
|
||||
@Override
|
||||
public void setUniqueId(String uniqueId) {
|
||||
this.uniqueId = uniqueId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param useOwnGenerator the useOwnGenerator to set
|
||||
*/
|
||||
@ -1285,4 +1274,17 @@ public class AISettings implements DataObject, WorldSettings {
|
||||
public void setWorldName(String worldName) {
|
||||
this.worldName = worldName;
|
||||
}
|
||||
/**
|
||||
* @return the acidDamageSnow
|
||||
*/
|
||||
public boolean isAcidDamageSnow() {
|
||||
return acidDamageSnow;
|
||||
}
|
||||
/**
|
||||
* @param acidDamageSnow the acidDamageSnow to set
|
||||
*/
|
||||
public void setAcidDamageSnow(boolean acidDamageSnow) {
|
||||
this.acidDamageSnow = acidDamageSnow;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import org.bukkit.World;
|
||||
import org.bukkit.WorldCreator;
|
||||
import org.bukkit.WorldType;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.eclipse.jdt.annotation.NonNull;
|
||||
|
||||
import world.bentobox.acidisland.commands.AcidCommand;
|
||||
@ -16,6 +15,7 @@ import world.bentobox.acidisland.world.ChunkGeneratorWorld;
|
||||
import world.bentobox.bentobox.api.addons.GameModeAddon;
|
||||
import world.bentobox.bentobox.api.configuration.Config;
|
||||
import world.bentobox.bentobox.api.configuration.WorldSettings;
|
||||
import world.bentobox.bentobox.lists.Flags;
|
||||
|
||||
/**
|
||||
* Add-on to BentoBox that enables AcidIsland
|
||||
@ -33,9 +33,15 @@ public class AcidIsland extends GameModeAddon {
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
// Save the default config from config.yml
|
||||
saveDefaultConfig();
|
||||
// Load settings
|
||||
// Load settings from config.yml. This will check if there are any issues with it too.
|
||||
loadSettings();
|
||||
// Chunk generator
|
||||
chunkGenerator = settings.isUseOwnGenerator() ? null : new ChunkGeneratorWorld(this);
|
||||
// Register commands
|
||||
adminCommand = new AcidCommand(this, settings.getAdminCommand());
|
||||
playerCommand = new AiCommand(this, settings.getIslandCommand());
|
||||
}
|
||||
|
||||
private boolean loadSettings() {
|
||||
@ -60,13 +66,9 @@ public class AcidIsland extends GameModeAddon {
|
||||
return;
|
||||
}
|
||||
// Register listeners
|
||||
PluginManager manager = getServer().getPluginManager();
|
||||
// Acid Effects
|
||||
manager.registerEvents(new AcidEffect(this), this.getPlugin());
|
||||
manager.registerEvents(new LavaCheck(this), this.getPlugin());
|
||||
// Register commands
|
||||
adminCommand = new AcidCommand(this, settings.getAdminCommand());
|
||||
playerCommand = new AiCommand(this, settings.getIslandCommand());
|
||||
registerListener(new AcidEffect(this));
|
||||
registerListener(new LavaCheck(this));
|
||||
// Burn everything
|
||||
acidTask = new AcidTask(this);
|
||||
}
|
||||
@ -92,7 +94,7 @@ public class AcidIsland extends GameModeAddon {
|
||||
|
||||
@Override
|
||||
public void createWorlds() {
|
||||
String worldName = settings.getWorldName();
|
||||
String worldName = settings.getWorldName().toLowerCase();
|
||||
if (getServer().getWorld(worldName) == null) {
|
||||
getLogger().info("Creating AcidIsland...");
|
||||
}
|
||||
@ -100,7 +102,8 @@ public class AcidIsland extends GameModeAddon {
|
||||
chunkGenerator = new ChunkGeneratorWorld(this);
|
||||
islandWorld = WorldCreator.name(worldName).type(WorldType.FLAT).environment(World.Environment.NORMAL).generator(chunkGenerator)
|
||||
.createWorld();
|
||||
|
||||
// Set default access to boats
|
||||
Flags.BOAT.setDefaultSetting(islandWorld, true);
|
||||
// Make the nether if it does not exist
|
||||
if (settings.isNetherGenerate()) {
|
||||
if (getServer().getWorld(worldName + NETHER) == null) {
|
||||
@ -108,6 +111,7 @@ public class AcidIsland extends GameModeAddon {
|
||||
}
|
||||
if (!settings.isNetherIslands()) {
|
||||
netherWorld = WorldCreator.name(worldName + NETHER).type(WorldType.NORMAL).environment(World.Environment.NETHER).createWorld();
|
||||
Flags.BOAT.setDefaultSetting(netherWorld, true);
|
||||
} else {
|
||||
netherWorld = WorldCreator.name(worldName + NETHER).type(WorldType.FLAT).generator(chunkGenerator)
|
||||
.environment(World.Environment.NETHER).createWorld();
|
||||
@ -120,6 +124,7 @@ public class AcidIsland extends GameModeAddon {
|
||||
}
|
||||
if (!settings.isEndIslands()) {
|
||||
endWorld = WorldCreator.name(worldName + THE_END).type(WorldType.NORMAL).environment(World.Environment.THE_END).createWorld();
|
||||
Flags.BOAT.setDefaultSetting(endWorld, true);
|
||||
} else {
|
||||
endWorld = WorldCreator.name(worldName + THE_END).type(WorldType.FLAT).generator(chunkGenerator)
|
||||
.environment(World.Environment.THE_END).createWorld();
|
||||
|
@ -13,16 +13,17 @@ import world.bentobox.bentobox.api.commands.admin.AdminReloadCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminResetFlagsCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminSetrankCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminSetspawnCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminSwitchCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminSwitchtoCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminTeleportCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminTrashCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminUnregisterCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminVersionCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminWhyCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.blueprints.AdminBlueprintCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.deaths.AdminDeathsCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.range.AdminRangeCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.resets.AdminResetsResetCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.schem.AdminSchemCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamAddCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamDisbandCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamKickCommand;
|
||||
@ -57,7 +58,7 @@ public class AcidCommand extends CompositeCommand {
|
||||
new AdminTeamDisbandCommand(this);
|
||||
new AdminTeamSetownerCommand(this);
|
||||
// Schems
|
||||
new AdminSchemCommand(this);
|
||||
new AdminBlueprintCommand(this);
|
||||
// Register/unregister islands
|
||||
new AdminRegisterCommand(this);
|
||||
new AdminUnregisterCommand(this);
|
||||
@ -82,7 +83,8 @@ public class AcidCommand extends CompositeCommand {
|
||||
new AdminTrashCommand(this);
|
||||
new AdminEmptyTrashCommand(this);
|
||||
new AdminSwitchtoCommand(this);
|
||||
|
||||
// Switch
|
||||
new AdminSwitchCommand(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,8 +1,9 @@
|
||||
package world.bentobox.acidisland.listeners;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
@ -39,8 +40,8 @@ import world.bentobox.bentobox.util.Util;
|
||||
public class AcidEffect implements Listener {
|
||||
|
||||
private final AcidIsland addon;
|
||||
private final List<Player> burningPlayers = new ArrayList<>();
|
||||
private final List<Player> wetPlayers = new ArrayList<>();
|
||||
private final Map<Player, Long> burningPlayers = new HashMap<>();
|
||||
private final Map<Player, Long> wetPlayers = new HashMap<>();
|
||||
private static final List<PotionEffectType> EFFECTS = Arrays.asList(
|
||||
PotionEffectType.BLINDNESS,
|
||||
PotionEffectType.CONFUSION,
|
||||
@ -94,10 +95,10 @@ public class AcidEffect implements Listener {
|
||||
if (addon.getSettings().getAcidRainDamage() > 0D && addon.getOverWorld().hasStorm()) {
|
||||
if (isSafeFromRain(player)) {
|
||||
wetPlayers.remove(player);
|
||||
} else if (!wetPlayers.contains(player)) {
|
||||
} else if (!wetPlayers.containsKey(player)) {
|
||||
// Start hurting them
|
||||
// Add to the list
|
||||
wetPlayers.add(player);
|
||||
wetPlayers.put(player, System.currentTimeMillis() + addon.getSettings().getAcidDamageDelay() * 1000);
|
||||
// This runnable continuously hurts the player even if
|
||||
// they are not
|
||||
// moving but are in acid rain.
|
||||
@ -110,7 +111,7 @@ public class AcidEffect implements Listener {
|
||||
wetPlayers.remove(player);
|
||||
this.cancel();
|
||||
// Check they are still in this world
|
||||
} else {
|
||||
} else if (wetPlayers.containsKey(player) && wetPlayers.get(player) < System.currentTimeMillis()) {
|
||||
double protection = addon.getSettings().getAcidRainDamage() * getDamageReduced(player);
|
||||
double totalDamage = Math.max(0, addon.getSettings().getAcidRainDamage() - protection);
|
||||
AcidRainEvent e = new AcidRainEvent(player, totalDamage, protection);
|
||||
@ -127,7 +128,7 @@ public class AcidEffect implements Listener {
|
||||
|
||||
}
|
||||
// If they are already burning in acid then return
|
||||
if (burningPlayers.contains(player)) {
|
||||
if (burningPlayers.containsKey(player)) {
|
||||
return;
|
||||
}
|
||||
if (isSafeFromAcid(player)) {
|
||||
@ -135,7 +136,7 @@ public class AcidEffect implements Listener {
|
||||
}
|
||||
// ACID!
|
||||
// Put the player into the acid list
|
||||
burningPlayers.add(player);
|
||||
burningPlayers.put(player, System.currentTimeMillis() + addon.getSettings().getAcidDamageDelay() * 1000);
|
||||
// This runnable continuously hurts the player even if they are not
|
||||
// moving but are in acid.
|
||||
new BukkitRunnable() {
|
||||
@ -144,7 +145,7 @@ public class AcidEffect implements Listener {
|
||||
if (player.isDead() || isSafeFromAcid(player)) {
|
||||
burningPlayers.remove(player);
|
||||
this.cancel();
|
||||
} else {
|
||||
} else if (burningPlayers.containsKey(player) && burningPlayers.get(player) < System.currentTimeMillis()) {
|
||||
double protection = addon.getSettings().getAcidDamage() * getDamageReduced(player);
|
||||
double totalDamage = Math.max(0, addon.getSettings().getAcidDamage() - protection);
|
||||
AcidEvent acidEvent = new AcidEvent(player, totalDamage, protection, addon.getSettings().getAcidEffects());
|
||||
@ -171,7 +172,7 @@ public class AcidEffect implements Listener {
|
||||
private boolean isSafeFromRain(Player player) {
|
||||
if (addon.getSettings().isHelmetProtection() && (player.getInventory().getHelmet() != null
|
||||
&& player.getInventory().getHelmet().getType().name().contains("HELMET"))
|
||||
|| player.getLocation().getBlock().getTemperature() < 0.1 // snow falls
|
||||
|| (!addon.getSettings().isAcidDamageSnow() && player.getLocation().getBlock().getTemperature() < 0.1) // snow falls
|
||||
|| player.getLocation().getBlock().getHumidity() == 0 // dry
|
||||
|| (player.getActivePotionEffects().stream().map(PotionEffect::getType).anyMatch(IMMUNE_EFFECTS::contains))) {
|
||||
return true;
|
||||
@ -191,14 +192,15 @@ public class AcidEffect implements Listener {
|
||||
* @return true if player is safe
|
||||
*/
|
||||
private boolean isSafeFromAcid(Player player) {
|
||||
// In liquid
|
||||
// Not in liquid or on snow
|
||||
if (!player.getLocation().getBlock().getType().equals(Material.WATER)
|
||||
&& (!player.getLocation().getBlock().getType().equals(Material.SNOW) || !addon.getSettings().isAcidDamageSnow())
|
||||
&& !player.getLocation().getBlock().getRelative(BlockFace.UP).getType().equals(Material.WATER)) {
|
||||
return true;
|
||||
}
|
||||
// Check if player is in a boat
|
||||
// Check if player is on a boat
|
||||
if (player.getVehicle() != null && player.getVehicle().getType().equals(EntityType.BOAT)) {
|
||||
// I'M ON A BOAT! I'M ON A BOAT! A %^&&* BOAT! SNL Sketch.
|
||||
// I'M ON A BOAT! I'M ON A BOAT! A %^&&* BOAT! SNL Sketch. https://youtu.be/avaSdC0QOUM.
|
||||
return true;
|
||||
}
|
||||
// Check if full armor protects
|
||||
|
@ -1,6 +1,9 @@
|
||||
name: AcidIsland
|
||||
main: world.bentobox.acidisland.AcidIsland
|
||||
version: ${project.version}
|
||||
metrics: true
|
||||
repository: "BentoBoxWorld/AcidIsland"
|
||||
icon: "OAK_BOAT"
|
||||
|
||||
authors: tastybento
|
||||
|
||||
@ -14,21 +17,24 @@ permissions:
|
||||
acidisland.island.home:
|
||||
description: Allow teleporting to player island
|
||||
default: true
|
||||
acidisland.island.info:
|
||||
description: Let the player check their island level
|
||||
default: true
|
||||
acidisland.island.sethome:
|
||||
description: Let the player set their island teleport point
|
||||
description: Let the player use the sethome command
|
||||
default: true
|
||||
acidisland.island.info:
|
||||
description: Let the player check other players info
|
||||
default: true
|
||||
acidisland.island.lock:
|
||||
description: Allows island locking
|
||||
default: false
|
||||
default: true
|
||||
acidisland.island.near:
|
||||
description: Players can see nearby island names
|
||||
default: true
|
||||
acidisland.island.expel:
|
||||
description: Allows expelling of visitors
|
||||
default: true
|
||||
acidisland.island.ban:
|
||||
description: Allows banning of visitors
|
||||
default: false
|
||||
default: true
|
||||
acidisland.island.settings:
|
||||
description: Player can see server settings
|
||||
default: true
|
||||
@ -53,21 +59,18 @@ permissions:
|
||||
acidisland.island.team.coop:
|
||||
description: Let a player use team coop commands
|
||||
default: true
|
||||
acidisland.island.team.promote:
|
||||
description: Let a player use promote commands
|
||||
default: true
|
||||
acidisland.settings.*:
|
||||
description: Allow access to settings panel items
|
||||
description: Allow use of settings on island
|
||||
default: true
|
||||
acidisland.mod.info:
|
||||
description: Let a moderator see info on a player
|
||||
default: op
|
||||
acidisland.mod.resethome:
|
||||
description: Allows setting or reseting of a player's home position
|
||||
default: op
|
||||
acidisland.mod.clearreset:
|
||||
description: Allow clearing of island reset limit
|
||||
default: false
|
||||
acidisland.mod.tp:
|
||||
description: Allows teleport to an island
|
||||
default: op
|
||||
acidisland.mod.bypasscooldowns:
|
||||
description: Allow moderator to bypass cooldowns
|
||||
default: op
|
||||
@ -83,15 +86,15 @@ permissions:
|
||||
acidisland.mod.bypasslock:
|
||||
description: Bypasses an island lock
|
||||
default: op
|
||||
acidisland.mod.bypassban:
|
||||
description: Bypasses island ban
|
||||
default: op
|
||||
acidisland.mod.team:
|
||||
description: Enables modification of teams via kick and add commands
|
||||
default: false
|
||||
acidisland.mod.name:
|
||||
description: Enables naming of player's islands
|
||||
default: false
|
||||
acidisland.mod.resetname:
|
||||
description: Enables reset of player's island names
|
||||
default: false
|
||||
acidisland.admin.tp:
|
||||
description: Allows teleport to an island
|
||||
default: op
|
||||
acidisland.admin.clearresetall:
|
||||
description: Allow clearing of island reset limit of all players
|
||||
default: op
|
||||
@ -101,33 +104,27 @@ permissions:
|
||||
acidisland.admin.delete:
|
||||
description: Let a player completely remove a player (including island)
|
||||
default: op
|
||||
acidisland.admin.deleteisland:
|
||||
description: Let a player completely remove the island the player is on
|
||||
default: op
|
||||
acidisland.admin.register:
|
||||
description: Let a player register the nearest island to another player.
|
||||
default: op
|
||||
acidisland.admin.unregister:
|
||||
description: Removes a player from an island without deleting the island blocks.
|
||||
default: op
|
||||
acidisland.admin.purge:
|
||||
description: Let a player purge old islands.
|
||||
default: op
|
||||
acidisland.admin.setspawn:
|
||||
description: Allows use of spawn tools
|
||||
default: op
|
||||
acidisland.admin.setrange:
|
||||
description: Allows setting of island protection range
|
||||
default: op
|
||||
acidisland.admin.reserve:
|
||||
description: Reserves an empty spot for a player's next island
|
||||
default: op
|
||||
acidisland.admin.settingsreset:
|
||||
description: Resets all the islands to default protection settings
|
||||
default: op
|
||||
acidisland.admin.noban:
|
||||
description: Player cannot be banned from an island
|
||||
default: op
|
||||
acidisland.admin.noexpel:
|
||||
description: Player cannot be expelled from an island
|
||||
default: op
|
||||
acidisland.admin.setlanguage:
|
||||
description: Resets all player languages and sets the default language
|
||||
default: op
|
||||
|
18
src/main/resources/blueprints/default.json
Normal file
18
src/main/resources/blueprints/default.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"uniqueId": "default",
|
||||
"icon": "PRISMARINE",
|
||||
"displayName": "§eThe Original AcidIsland",
|
||||
"description": [
|
||||
"§bAn island with a sheep - baa!",
|
||||
"§aIncludes an Overworld island",
|
||||
"§cIncludes a Nether island",
|
||||
"§6Includes an End island"
|
||||
],
|
||||
"requirePermission": false,
|
||||
"blueprints": {
|
||||
"NORMAL": "island",
|
||||
"NETHER": "nether-island",
|
||||
"THE_END": "end-island"
|
||||
},
|
||||
"slot": 2
|
||||
}
|
17
src/main/resources/blueprints/desert_temple.json
Normal file
17
src/main/resources/blueprints/desert_temple.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"uniqueId": "desert_temple",
|
||||
"icon": "CACTUS",
|
||||
"displayName": "Desert Temple",
|
||||
"description": [
|
||||
"You find yourself",
|
||||
"on a desert island",
|
||||
"with a hidden secret!"
|
||||
],
|
||||
"requirePermission": false,
|
||||
"blueprints": {
|
||||
"NORMAL": "temple",
|
||||
"NETHER": "nether-island",
|
||||
"THE_END": "end-island"
|
||||
},
|
||||
"slot": 5
|
||||
}
|
BIN
src/main/resources/blueprints/end-island.blu
Normal file
BIN
src/main/resources/blueprints/end-island.blu
Normal file
Binary file not shown.
BIN
src/main/resources/blueprints/island.blu
Normal file
BIN
src/main/resources/blueprints/island.blu
Normal file
Binary file not shown.
BIN
src/main/resources/blueprints/nether-island.blu
Normal file
BIN
src/main/resources/blueprints/nether-island.blu
Normal file
Binary file not shown.
BIN
src/main/resources/blueprints/temple.blu
Normal file
BIN
src/main/resources/blueprints/temple.blu
Normal file
Binary file not shown.
@ -35,8 +35,8 @@ world:
|
||||
# Friendly name for this world. Used in admin commands. Must be a single word
|
||||
friendly-name: AcidIsland
|
||||
# Name of the world - if it does not exist then it will be generated.
|
||||
# It acts like a prefix for nether and end (e.g. AcidIsland_world, AcidIsland_world_nether, AcidIsland_world_end)
|
||||
world-name: AcidIsland_world
|
||||
# It acts like a prefix for nether and end (e.g. acidisland_world, acidisland_world_nether, acidisland_world_end)
|
||||
world-name: acidisland_world
|
||||
# World difficulty setting - PEACEFUL, EASY, NORMAL, HARD
|
||||
# Other plugins may override this setting
|
||||
difficulty: NORMAL
|
||||
@ -243,8 +243,7 @@ island:
|
||||
# Leave this true to avoid players exploiting free islands
|
||||
leavers-lose-reset: false
|
||||
# Allow kicked players to keep their inventory.
|
||||
# If false, kicked player's inventory will be thrown at the island leader if the
|
||||
# kicked player is online and in the island world.
|
||||
# Overrides the on-leave inventory reset for kicked players.
|
||||
kicked-keep-inventory: false
|
||||
on-join:
|
||||
# What the plugin should reset when the player joins or creates an island
|
||||
@ -282,7 +281,6 @@ island:
|
||||
counted: true
|
||||
# Maximum number of deaths to count. The death count can be used by add-ons.
|
||||
max: 10
|
||||
sum-team: false
|
||||
# When a player joins a team, reset their death count
|
||||
team-join-reset: true
|
||||
customranks: {}
|
||||
|
11
src/main/resources/locales/es-ES.yml
Normal file
11
src/main/resources/locales/es-ES.yml
Normal file
@ -0,0 +1,11 @@
|
||||
###########################################################################################################
|
||||
# Este es un archivo YML. Tenga cuidado al editar. Revisa tus ediciones en un verificador de YAML como #
|
||||
# el de http://yaml-online-parser.appspot.com #
|
||||
###########################################################################################################
|
||||
|
||||
acidisland:
|
||||
sign:
|
||||
line0: "&1AcidIsland"
|
||||
line1: "[name]"
|
||||
line2: "El Agua es acida!"
|
||||
line3: "Ten cuidado! &c<3"
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -37,6 +37,7 @@ import world.bentobox.bentobox.managers.CommandsManager;
|
||||
@PrepareForTest({Bukkit.class, BentoBox.class, User.class })
|
||||
public class AcidCommandTest {
|
||||
|
||||
private static final int NUM_COMMANDS = 27;
|
||||
private User user;
|
||||
|
||||
/**
|
||||
@ -92,7 +93,7 @@ public class AcidCommandTest {
|
||||
assertEquals("commands.admin.help.parameters", cmd.getParameters());
|
||||
assertEquals("commands.admin.help.description", cmd.getDescription());
|
||||
// Number of commands = sub commands + help
|
||||
assertEquals("Number of sub commands registered", 26, cmd.getSubCommands().values().size());
|
||||
assertEquals("Number of sub commands registered", NUM_COMMANDS, cmd.getSubCommands().values().size());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user