mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2025-01-06 00:08:11 +01:00
#61: Some fixes
This commit is contained in:
parent
a4f04ab92b
commit
70b4d16be5
@ -195,7 +195,7 @@ public class Game {
|
||||
finalRules.apply(type);
|
||||
}
|
||||
|
||||
if (dungeonConfig != null) {
|
||||
if (dungeonConfig != null && dungeonConfig.getOverrideValues() != null) {
|
||||
finalRules.apply(dungeonConfig.getOverrideValues());
|
||||
}
|
||||
|
||||
@ -203,7 +203,7 @@ public class Game {
|
||||
finalRules.apply(floorConfig);
|
||||
}
|
||||
|
||||
if (dungeonConfig != null) {
|
||||
if (dungeonConfig != null && dungeonConfig.getDefaultValues() != null) {
|
||||
finalRules.apply(dungeonConfig.getDefaultValues());
|
||||
}
|
||||
|
||||
|
@ -520,7 +520,9 @@ public class DGamePlayer extends DInstancePlayer {
|
||||
}
|
||||
|
||||
// Respawn Items
|
||||
if (Game.getByWorld(getWorld()).getRules().getKeepInventoryOnDeath()) {
|
||||
Game game = Game.getByWorld(getWorld());
|
||||
|
||||
if (game != null && game.getRules().getKeepInventoryOnDeath()) {
|
||||
applyRespawnInventory();
|
||||
}
|
||||
}
|
||||
|
@ -464,6 +464,7 @@ public class DGroup {
|
||||
if (game == null) {
|
||||
return;
|
||||
}
|
||||
game.fetchRules();
|
||||
|
||||
for (DGroup dGroup : game.getDGroups()) {
|
||||
if (dGroup == null) {
|
||||
@ -521,31 +522,30 @@ public class DGroup {
|
||||
}
|
||||
}
|
||||
|
||||
GameRules rules = gameWorld.getGame().getRules();
|
||||
if (rules != null) {
|
||||
for (Requirement requirement : rules.getRequirements()) {
|
||||
RequirementDemandEvent requirementDemandEvent = new RequirementDemandEvent(requirement, player);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
GameRules rules = game.getRules();
|
||||
|
||||
if (requirementDemandEvent.isCancelled()) {
|
||||
continue;
|
||||
}
|
||||
for (Requirement requirement : rules.getRequirements()) {
|
||||
RequirementDemandEvent requirementDemandEvent = new RequirementDemandEvent(requirement, player);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
requirement.demand(player);
|
||||
if (requirementDemandEvent.isCancelled()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
requirement.demand(player);
|
||||
}
|
||||
|
||||
} else {
|
||||
player.setGameMode(gameType.getGameMode());
|
||||
if (gameType.getShowTime()) {
|
||||
timeIsRunningTask = new TimeIsRunningTask(this, rules.getTimeToFinish()).runTaskTimer(plugin, 20, 20);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user