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