mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2025-02-03 14:02:00 +01:00
Implement simple break / place game rules
This commit is contained in:
parent
5b77ab4e8c
commit
80ceb79b5d
@ -392,7 +392,7 @@ public class GameRules {
|
||||
friendlyFire = defaultValues.isFriendlyFire();
|
||||
}
|
||||
|
||||
if (timeToFinish == null) {
|
||||
if (timeToFinish == null && defaultValues.getShowTime() != null) {
|
||||
timeToFinish = defaultValues.getShowTime() ? null : -1;
|
||||
}
|
||||
|
||||
|
@ -48,90 +48,90 @@ public interface GameType {
|
||||
/**
|
||||
* @return the playerVersusPlayer
|
||||
*/
|
||||
public boolean isPlayerVersusPlayer();
|
||||
public Boolean isPlayerVersusPlayer();
|
||||
|
||||
/**
|
||||
* @param playerVersusPlayer
|
||||
* the playerVersusPlayer to set
|
||||
*/
|
||||
public void setPlayerVersusPlayer(boolean playerVersusPlayer);
|
||||
public void setPlayerVersusPlayer(Boolean playerVersusPlayer);
|
||||
|
||||
/**
|
||||
* @return the friendlyFire
|
||||
*/
|
||||
public boolean isFriendlyFire();
|
||||
public Boolean isFriendlyFire();
|
||||
|
||||
/**
|
||||
* @param friendlyFire
|
||||
* the friendlyFire to set
|
||||
*/
|
||||
public void setFriendlyFire(boolean friendlyFire);
|
||||
public void setFriendlyFire(Boolean friendlyFire);
|
||||
|
||||
/**
|
||||
* @return the mobWaves
|
||||
*/
|
||||
public boolean hasMobWaves();
|
||||
public Boolean hasMobWaves();
|
||||
|
||||
/**
|
||||
* @param mobWaves
|
||||
* enable / disable mob waves
|
||||
*/
|
||||
public void setMobWaves(boolean mobWaves);
|
||||
public void setMobWaves(Boolean mobWaves);
|
||||
|
||||
/**
|
||||
* @return if players get rewards after the dungeon
|
||||
*/
|
||||
public boolean hasRewards();
|
||||
public Boolean hasRewards();
|
||||
|
||||
/**
|
||||
* @param rewards
|
||||
* enable / disable rewards
|
||||
*/
|
||||
public void setRewards(boolean rewards);
|
||||
public void setRewards(Boolean rewards);
|
||||
|
||||
/**
|
||||
* @return if players shall see how long they play
|
||||
*/
|
||||
public boolean getShowTime();
|
||||
public Boolean getShowTime();
|
||||
|
||||
/**
|
||||
* @param showTime
|
||||
* set if players shall see how long they play
|
||||
*/
|
||||
public void setShowTime(boolean showTime);
|
||||
public void setShowTime(Boolean showTime);
|
||||
|
||||
/**
|
||||
* @return if all blocks may be destroyed
|
||||
*/
|
||||
public boolean canBreakBlocks();
|
||||
public Boolean canBreakBlocks();
|
||||
|
||||
/**
|
||||
* @param breakBlocks
|
||||
* if blocks may be destroyed
|
||||
*/
|
||||
public void setBreakBlocks(boolean breakBlocks);
|
||||
public void setBreakBlocks(Boolean breakBlocks);
|
||||
|
||||
/**
|
||||
* @return if blocks placed in game may be destroyed
|
||||
*/
|
||||
public boolean canBreakPlacedBlocks();
|
||||
public Boolean canBreakPlacedBlocks();
|
||||
|
||||
/**
|
||||
* @param breakPlacedBlocks
|
||||
* if placed blocks may be destroyed
|
||||
*/
|
||||
public void setBreakPlacedBlocks(boolean breakPlacedBlocks);
|
||||
public void setBreakPlacedBlocks(Boolean breakPlacedBlocks);
|
||||
|
||||
/**
|
||||
* @return if blocks may be placed
|
||||
*/
|
||||
public boolean canPlaceBlocks();
|
||||
public Boolean canPlaceBlocks();
|
||||
|
||||
/**
|
||||
* @param placeBlocks
|
||||
* if blocks may be placed
|
||||
*/
|
||||
public void setPlaceBlocks(boolean placeBlocks);
|
||||
public void setPlaceBlocks(Boolean placeBlocks);
|
||||
|
||||
/**
|
||||
* @return the gameMode
|
||||
@ -147,12 +147,12 @@ public interface GameType {
|
||||
/**
|
||||
* @return if players lose lives
|
||||
*/
|
||||
public boolean hasLives();
|
||||
public Boolean hasLives();
|
||||
|
||||
/**
|
||||
* @param lives
|
||||
* set if the gametype uses player lives
|
||||
*/
|
||||
public void setLives(boolean lives);
|
||||
public void setLives(Boolean lives);
|
||||
|
||||
}
|
||||
|
@ -38,23 +38,24 @@ public enum GameTypeDefault implements GameType {
|
||||
QUEST_TIME_IS_RUNNING("Quest - Time is Running", "Quest TiR", false, false, false, true, true, false, false, false, GameMode.SURVIVAL, true),
|
||||
TEST("Test", "Test", false, false, false, false, true, true, true, true, GameMode.SURVIVAL, false),
|
||||
TUTORIAL("Tutorial", "Tutorial", false, false, false, true, false, false, false, false, GameMode.SURVIVAL, false),
|
||||
DEFAULT("Default", "Default", false, false, false, true, false, false, false, false, GameMode.SURVIVAL, true);
|
||||
DEFAULT("Default", "Default", false, false, false, true, false, false, false, false, GameMode.SURVIVAL, true),
|
||||
CUSTOM("Custom", "Custom");
|
||||
|
||||
private String displayName;
|
||||
private String signName;
|
||||
private boolean playerVersusPlayer;
|
||||
private boolean friendlyFire;
|
||||
private boolean mobWaves;
|
||||
private boolean rewards;
|
||||
private boolean showTime;
|
||||
private boolean breakBlocks;
|
||||
private boolean breakPlacedBlocks;
|
||||
private boolean placeBlocks;
|
||||
private Boolean playerVersusPlayer;
|
||||
private Boolean friendlyFire;
|
||||
private Boolean mobWaves;
|
||||
private Boolean rewards;
|
||||
private Boolean showTime;
|
||||
private Boolean breakBlocks;
|
||||
private Boolean breakPlacedBlocks;
|
||||
private Boolean placeBlocks;
|
||||
private GameMode gameMode;
|
||||
private boolean lives;
|
||||
private Boolean lives;
|
||||
|
||||
GameTypeDefault(String displayName, String signName, boolean playerVersusPlayer, boolean friendlyFire, boolean mobWaves, boolean rewards,
|
||||
boolean showTime, boolean breakBlocks, boolean breakPlacedBlocks, boolean placeBlocks, GameMode gameMode, boolean lives) {
|
||||
GameTypeDefault(String displayName, String signName, Boolean playerVersusPlayer, Boolean friendlyFire, Boolean mobWaves, Boolean rewards,
|
||||
Boolean showTime, Boolean breakBlocks, Boolean breakPlacedBlocks, Boolean placeBlocks, GameMode gameMode, Boolean lives) {
|
||||
this.displayName = displayName;
|
||||
this.signName = signName;
|
||||
this.playerVersusPlayer = playerVersusPlayer;
|
||||
@ -69,6 +70,11 @@ public enum GameTypeDefault implements GameType {
|
||||
this.lives = lives;
|
||||
}
|
||||
|
||||
GameTypeDefault(String displayName, String signName) {
|
||||
this.displayName = displayName;
|
||||
this.signName = signName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
@ -90,82 +96,82 @@ public enum GameTypeDefault implements GameType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPlayerVersusPlayer() {
|
||||
public Boolean isPlayerVersusPlayer() {
|
||||
return playerVersusPlayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlayerVersusPlayer(boolean playerVersusPlayer) {
|
||||
public void setPlayerVersusPlayer(Boolean playerVersusPlayer) {
|
||||
this.playerVersusPlayer = playerVersusPlayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFriendlyFire() {
|
||||
public Boolean isFriendlyFire() {
|
||||
return friendlyFire;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFriendlyFire(boolean friendlyFire) {
|
||||
public void setFriendlyFire(Boolean friendlyFire) {
|
||||
this.friendlyFire = friendlyFire;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasMobWaves() {
|
||||
public Boolean hasMobWaves() {
|
||||
return mobWaves;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMobWaves(boolean mobWaves) {
|
||||
public void setMobWaves(Boolean mobWaves) {
|
||||
this.mobWaves = mobWaves;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasRewards() {
|
||||
public Boolean hasRewards() {
|
||||
return rewards;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRewards(boolean rewards) {
|
||||
public void setRewards(Boolean rewards) {
|
||||
this.rewards = rewards;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getShowTime() {
|
||||
public Boolean getShowTime() {
|
||||
return showTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShowTime(boolean showTime) {
|
||||
public void setShowTime(Boolean showTime) {
|
||||
this.showTime = showTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBreakBlocks() {
|
||||
public Boolean canBreakBlocks() {
|
||||
return breakBlocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBreakBlocks(boolean breakBlocks) {
|
||||
public void setBreakBlocks(Boolean breakBlocks) {
|
||||
this.breakBlocks = breakBlocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBreakPlacedBlocks() {
|
||||
public Boolean canBreakPlacedBlocks() {
|
||||
return breakPlacedBlocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBreakPlacedBlocks(boolean breakPlacedBlocks) {
|
||||
public void setBreakPlacedBlocks(Boolean breakPlacedBlocks) {
|
||||
this.breakPlacedBlocks = breakPlacedBlocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlocks() {
|
||||
public Boolean canPlaceBlocks() {
|
||||
return placeBlocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlaceBlocks(boolean placeBlocks) {
|
||||
public void setPlaceBlocks(Boolean placeBlocks) {
|
||||
this.placeBlocks = placeBlocks;
|
||||
}
|
||||
|
||||
@ -180,12 +186,12 @@ public enum GameTypeDefault implements GameType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasLives() {
|
||||
public Boolean hasLives() {
|
||||
return lives;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLives(boolean lives) {
|
||||
public void setLives(Boolean lives) {
|
||||
this.lives = lives;
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,10 @@
|
||||
*/
|
||||
package io.github.dre2n.dungeonsxl.global;
|
||||
|
||||
import io.github.dre2n.commons.util.messageutil.MessageUtil;
|
||||
import io.github.dre2n.dungeonsxl.DungeonsXL;
|
||||
import io.github.dre2n.dungeonsxl.config.DMessages;
|
||||
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import org.bukkit.World;
|
||||
@ -54,6 +57,7 @@ public abstract class GlobalProtection {
|
||||
return id;
|
||||
}
|
||||
|
||||
/* Actions */
|
||||
/**
|
||||
* Delete this protection.
|
||||
*/
|
||||
@ -61,7 +65,6 @@ public abstract class GlobalProtection {
|
||||
protections.removeProtection(this);
|
||||
}
|
||||
|
||||
/* Abstracts */
|
||||
/**
|
||||
* Save the data to the default file
|
||||
*/
|
||||
@ -77,6 +80,20 @@ public abstract class GlobalProtection {
|
||||
save(YamlConfiguration.loadConfiguration(file));
|
||||
}
|
||||
|
||||
public boolean onBreak(DGlobalPlayer dPlayer) {
|
||||
if (dPlayer.isInBreakMode()) {
|
||||
delete();
|
||||
MessageUtil.sendMessage(dPlayer.getPlayer(), plugin.getMessageConfig().getMessage(DMessages.PLAYER_PROTECTED_BLOCK_DELETED));
|
||||
MessageUtil.sendMessage(dPlayer.getPlayer(), plugin.getMessageConfig().getMessage(DMessages.CMD_BREAK_PROTECTED_MODE));
|
||||
dPlayer.setInBreakMode(false);
|
||||
return false;
|
||||
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* Abstracts */
|
||||
/**
|
||||
* @param config
|
||||
* the config to save the protection to
|
||||
|
@ -20,9 +20,6 @@ import io.github.dre2n.commons.util.NumberUtil;
|
||||
import io.github.dre2n.commons.util.messageutil.MessageUtil;
|
||||
import io.github.dre2n.dungeonsxl.DungeonsXL;
|
||||
import io.github.dre2n.dungeonsxl.config.DMessages;
|
||||
import io.github.dre2n.dungeonsxl.game.Game;
|
||||
import io.github.dre2n.dungeonsxl.game.GameType;
|
||||
import io.github.dre2n.dungeonsxl.game.GameTypeDefault;
|
||||
import io.github.dre2n.dungeonsxl.global.DPortal;
|
||||
import io.github.dre2n.dungeonsxl.global.GameSign;
|
||||
import io.github.dre2n.dungeonsxl.global.GlobalProtection;
|
||||
@ -35,8 +32,6 @@ import io.github.dre2n.dungeonsxl.sign.DSign;
|
||||
import io.github.dre2n.dungeonsxl.task.RedstoneEventTask;
|
||||
import io.github.dre2n.dungeonsxl.world.DEditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.DGameWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.GamePlaceableBlock;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Sign;
|
||||
@ -80,16 +75,9 @@ public class BlockListener implements Listener {
|
||||
|
||||
GlobalProtection protection = plugin.getGlobalProtections().getByBlock(event.getBlock());
|
||||
if (protection != null) {
|
||||
if (dGlobalPlayer.isInBreakMode()) {
|
||||
protection.delete();
|
||||
MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.PLAYER_PROTECTED_BLOCK_DELETED));
|
||||
MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.CMD_BREAK_PROTECTED_MODE));
|
||||
dGlobalPlayer.setInBreakMode(false);
|
||||
|
||||
} else {
|
||||
if (protection.onBreak(dGlobalPlayer)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -103,24 +91,7 @@ public class BlockListener implements Listener {
|
||||
// Deny DGameWorld block breaking
|
||||
DGameWorld gameWorld = DGameWorld.getByWorld(block.getWorld());
|
||||
if (gameWorld != null) {
|
||||
for (DSign dSign : gameWorld.getDSigns()) {
|
||||
if (dSign.getSign().equals(block)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Game game = gameWorld.getGame();
|
||||
if (game != null) {
|
||||
GameType gameType = game.getType();
|
||||
if (gameType == GameTypeDefault.DEFAULT) {
|
||||
event.setCancelled(!game.getRules().canBuild());
|
||||
|
||||
} else if (!gameType.canBuild()) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (gameWorld.onBreak(player, block)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
@ -136,27 +107,9 @@ public class BlockListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
Game game = gameWorld.getGame();
|
||||
if (game != null) {
|
||||
if (game.getRules().canBuild() || GamePlaceableBlock.canBuildHere(block, block.getFace(event.getBlockAgainst()), event.getItemInHand().getType(), gameWorld)) {
|
||||
return;
|
||||
}
|
||||
if (gameWorld.onPlace(event.getPlayer(), block, event.getBlockAgainst(), event.getItemInHand())) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
// Workaround for a bug that would allow 3-Block-high jumping
|
||||
Location loc = event.getPlayer().getLocation();
|
||||
if (loc.getY() > block.getY() + 1.0 && loc.getY() <= block.getY() + 1.5) {
|
||||
if (loc.getX() >= block.getX() - 0.3 && loc.getX() <= block.getX() + 1.3) {
|
||||
if (loc.getZ() >= block.getZ() - 0.3 && loc.getZ() <= block.getZ() + 1.3) {
|
||||
loc.setX(block.getX() + 0.5);
|
||||
loc.setY(block.getY());
|
||||
loc.setZ(block.getZ() + 0.5);
|
||||
event.getPlayer().teleport(loc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
|
@ -658,18 +658,9 @@ public class DGroup {
|
||||
requirement.demand(player);
|
||||
}
|
||||
|
||||
GameType gameType = game.getType();
|
||||
if (gameType == GameTypeDefault.DEFAULT) {
|
||||
player.setGameMode(rules.getGameMode());
|
||||
if (rules.isTimeIsRunning()) {
|
||||
timeIsRunningTask = new TimeIsRunningTask(this, rules.getTimeToFinish()).runTaskTimer(plugin, 20, 20);
|
||||
}
|
||||
|
||||
} else {
|
||||
player.setGameMode(gameType.getGameMode());
|
||||
if (gameType.getShowTime()) {
|
||||
timeIsRunningTask = new TimeIsRunningTask(this, rules.getTimeToFinish()).runTaskTimer(plugin, 20, 20);
|
||||
}
|
||||
player.setGameMode(rules.getGameMode());
|
||||
if (rules.isTimeIsRunning()) {
|
||||
timeIsRunningTask = new TimeIsRunningTask(this, rules.getTimeToFinish()).runTaskTimer(plugin, 20, 20);
|
||||
}
|
||||
|
||||
// Permission bridge
|
||||
|
@ -88,7 +88,7 @@ public class ReadySign extends DSign {
|
||||
gameType = plugin.getGameTypes().getBySign(this);
|
||||
|
||||
} else {
|
||||
gameType = GameTypeDefault.DEFAULT;
|
||||
gameType = GameTypeDefault.CUSTOM;
|
||||
}
|
||||
|
||||
if (!lines[2].isEmpty()) {
|
||||
|
@ -21,6 +21,7 @@ import io.github.dre2n.dungeonsxl.dungeon.Dungeon;
|
||||
import io.github.dre2n.dungeonsxl.event.gameworld.GameWorldStartGameEvent;
|
||||
import io.github.dre2n.dungeonsxl.event.gameworld.GameWorldUnloadEvent;
|
||||
import io.github.dre2n.dungeonsxl.game.Game;
|
||||
import io.github.dre2n.dungeonsxl.game.GameRules;
|
||||
import io.github.dre2n.dungeonsxl.mob.DMob;
|
||||
import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.reward.RewardChest;
|
||||
@ -37,15 +38,18 @@ import io.github.dre2n.dungeonsxl.trigger.TriggerType;
|
||||
import io.github.dre2n.dungeonsxl.trigger.TriggerTypeDefault;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Sign;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Spider;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
@ -60,6 +64,7 @@ public class DGameWorld extends DInstanceWorld {
|
||||
private boolean isPlaying = false;
|
||||
|
||||
// TO DO: Which lists actually need to be CopyOnWriteArrayLists?
|
||||
private List<Block> placedBlocks = new LinkedList<>();
|
||||
private CopyOnWriteArrayList<GamePlaceableBlock> placeableBlocks = new CopyOnWriteArrayList<>();
|
||||
private List<ItemStack> secureObjects = new CopyOnWriteArrayList<>();
|
||||
private CopyOnWriteArrayList<Chunk> loadedChunks = new CopyOnWriteArrayList<>();
|
||||
@ -451,6 +456,59 @@ public class DGameWorld extends DInstanceWorld {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onBreak(Player player, Block block) {
|
||||
for (DSign dSign : dSigns) {
|
||||
if (dSign.getSign().getBlock().equals(block)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for (RewardChest rChest : rewardChests) {
|
||||
if (rChest.getChest().getBlock().equals(block)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Game game = getGame();
|
||||
if (game != null) {
|
||||
GameRules rules = game.getRules();
|
||||
if (rules.canBreakBlocks()) {
|
||||
return (false);
|
||||
} else if (rules.canBreakPlacedBlocks()) {
|
||||
return (!placedBlocks.contains(block));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean onPlace(Player player, Block block, Block against, ItemStack hand) {
|
||||
// Workaround for a bug that would allow 3-Block-high jumping
|
||||
Location loc = player.getLocation();
|
||||
if (loc.getY() > block.getY() + 1.0 && loc.getY() <= block.getY() + 1.5) {
|
||||
if (loc.getX() >= block.getX() - 0.3 && loc.getX() <= block.getX() + 1.3) {
|
||||
if (loc.getZ() >= block.getZ() - 0.3 && loc.getZ() <= block.getZ() + 1.3) {
|
||||
loc.setX(block.getX() + 0.5);
|
||||
loc.setY(block.getY());
|
||||
loc.setZ(block.getZ() + 0.5);
|
||||
player.teleport(loc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Game game = getGame();
|
||||
if (game == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (game.getRules().canPlaceBlocks() || GamePlaceableBlock.canBuildHere(block, block.getFace(against), hand.getType(), this)) {
|
||||
placedBlocks.add(block);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Statics */
|
||||
/**
|
||||
* @param world
|
||||
|
@ -27,19 +27,19 @@ public enum CustomGameType implements GameType {
|
||||
|
||||
private String displayName;
|
||||
private String signName;
|
||||
private boolean playerVersusPlayer;
|
||||
private boolean friendlyFire;
|
||||
private boolean mobWaves;
|
||||
private boolean rewards;
|
||||
private boolean showTime;
|
||||
private boolean breakBlocks;
|
||||
private boolean breakPlacedBlocks;
|
||||
private boolean placeBlocks;
|
||||
private Boolean playerVersusPlayer;
|
||||
private Boolean friendlyFire;
|
||||
private Boolean mobWaves;
|
||||
private Boolean rewards;
|
||||
private Boolean showTime;
|
||||
private Boolean breakBlocks;
|
||||
private Boolean breakPlacedBlocks;
|
||||
private Boolean placeBlocks;
|
||||
private GameMode gameMode;
|
||||
private boolean lives;
|
||||
private Boolean lives;
|
||||
|
||||
CustomGameType(String displayName, String signName, boolean playerVersusPlayer, boolean friendlyFire, boolean mobWaves, boolean rewards,
|
||||
boolean showTime, boolean breakBlocks, boolean breakPlacedBlocks, boolean placeBlocks, GameMode gameMode, boolean lives) {
|
||||
CustomGameType(String displayName, String signName, Boolean playerVersusPlayer, Boolean friendlyFire, Boolean mobWaves, Boolean rewards,
|
||||
Boolean showTime, Boolean breakBlocks, Boolean breakPlacedBlocks, Boolean placeBlocks, GameMode gameMode, Boolean lives) {
|
||||
this.displayName = displayName;
|
||||
this.signName = signName;
|
||||
this.playerVersusPlayer = playerVersusPlayer;
|
||||
@ -75,82 +75,82 @@ public enum CustomGameType implements GameType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPlayerVersusPlayer() {
|
||||
public Boolean isPlayerVersusPlayer() {
|
||||
return playerVersusPlayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlayerVersusPlayer(boolean playerVersusPlayer) {
|
||||
public void setPlayerVersusPlayer(Boolean playerVersusPlayer) {
|
||||
this.playerVersusPlayer = playerVersusPlayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFriendlyFire() {
|
||||
public Boolean isFriendlyFire() {
|
||||
return friendlyFire;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFriendlyFire(boolean friendlyFire) {
|
||||
public void setFriendlyFire(Boolean friendlyFire) {
|
||||
this.friendlyFire = friendlyFire;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasMobWaves() {
|
||||
public Boolean hasMobWaves() {
|
||||
return mobWaves;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMobWaves(boolean mobWaves) {
|
||||
public void setMobWaves(Boolean mobWaves) {
|
||||
this.mobWaves = mobWaves;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasRewards() {
|
||||
public Boolean hasRewards() {
|
||||
return rewards;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRewards(boolean rewards) {
|
||||
public void setRewards(Boolean rewards) {
|
||||
this.rewards = rewards;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getShowTime() {
|
||||
public Boolean getShowTime() {
|
||||
return showTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShowTime(boolean showTime) {
|
||||
public void setShowTime(Boolean showTime) {
|
||||
this.showTime = showTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBreakBlocks() {
|
||||
public Boolean canBreakBlocks() {
|
||||
return breakBlocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBreakBlocks(boolean breakBlocks) {
|
||||
public void setBreakBlocks(Boolean breakBlocks) {
|
||||
this.breakBlocks = breakBlocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBreakPlacedBlocks() {
|
||||
public Boolean canBreakPlacedBlocks() {
|
||||
return breakPlacedBlocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBreakPlacedBlocks(boolean breakPlacedBlocks) {
|
||||
public void setBreakPlacedBlocks(Boolean breakPlacedBlocks) {
|
||||
this.breakPlacedBlocks = breakPlacedBlocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlocks() {
|
||||
public Boolean canPlaceBlocks() {
|
||||
return placeBlocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlaceBlocks(boolean placeBlocks) {
|
||||
public void setPlaceBlocks(Boolean placeBlocks) {
|
||||
this.placeBlocks = placeBlocks;
|
||||
}
|
||||
|
||||
@ -165,12 +165,12 @@ public enum CustomGameType implements GameType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasLives() {
|
||||
public Boolean hasLives() {
|
||||
return lives;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLives(boolean lives) {
|
||||
public void setLives(Boolean lives) {
|
||||
this.lives = lives;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user