Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void init(FightManager fightManager, Server server) {
this.initialize("WorldGuard",
() -> this.regionProvider = new WorldGuardRegionProvider(this.pluginConfig.settings.blockedRegions, this.pluginConfig),
() -> {
this.regionProvider = new DefaultRegionProvider(this.pluginConfig.settings.blockedRegionRadius);
this.regionProvider = new DefaultRegionProvider(this.pluginConfig.settings.restrictedRegionRadius);

this.logger.warning("WorldGuard is not installed, set to default region provider.");
});
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void status(@Context CommandSender sender, @Arg Player target) {
@Priority(PriorityValue.HIGH)
void tag(@Context CommandSender sender, @Arg Player target) {
UUID targetUniqueId = target.getUniqueId();
Duration time = this.config.settings.combatDuration;
Duration time = this.config.settings.combatTimerDuration;

FightTagEvent event = this.fightManager.tag(targetUniqueId, time, CauseOfTag.COMMAND);

Expand All @@ -76,7 +76,7 @@ void tag(@Context CommandSender sender, @Arg Player target) {
@Execute(name = "tag")
@Permission("eternalcombat.tag")
void tagMultiple(@Context CommandSender sender, @Arg Player firstTarget, @Arg Player secondTarget) {
Duration combatTime = this.config.settings.combatDuration;
Duration combatTime = this.config.settings.combatTimerDuration;
PluginConfig.Messages messages = this.config.messages;

if (sender.equals(firstTarget) || sender.equals(secondTarget)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public FightActionBlockerController(FightManager fightManager, NotificationAnnou

@EventHandler
void onPlace(BlockPlaceEvent event) {
if (!this.config.settings.shouldPreventBlockPlacing) {
if (!this.config.settings.disableBlockPlacing) {
return;
}

Expand All @@ -47,7 +47,7 @@ void onPlace(BlockPlaceEvent event) {
Block block = event.getBlock();
int level = block.getY();

List<Material> specificBlocksToPreventPlacing = this.config.settings.specificBlocksToPreventPlacing;
List<Material> specificBlocksToPreventPlacing = this.config.settings.restrictedBlockTypes;

boolean isPlacementBlocked = this.isPlacementBlocked(level);

Expand All @@ -56,8 +56,8 @@ void onPlace(BlockPlaceEvent event) {
this.announcer.create()
.player(uniqueId)
.notice(this.config.messages.blockPlacingBlockedDuringCombat)
.placeholder("{Y}", String.valueOf(this.config.settings.blockPlacingYCoordinate))
.placeholder("{MODE}", this.config.settings.blockPlacingModeName)
.placeholder("{Y}", String.valueOf(this.config.settings.blockPlacementYCoordinate))
.placeholder("{MODE}", this.config.settings.blockPlacementModeDisplayName)
.send();

}
Expand All @@ -70,22 +70,22 @@ void onPlace(BlockPlaceEvent event) {
this.announcer.create()
.player(uniqueId)
.notice(this.config.messages.blockPlacingBlockedDuringCombat)
.placeholder("{Y}", String.valueOf(this.config.settings.blockPlacingYCoordinate))
.placeholder("{MODE}", this.config.settings.blockPlacingModeName)
.placeholder("{Y}", String.valueOf(this.config.settings.blockPlacementYCoordinate))
.placeholder("{MODE}", this.config.settings.blockPlacementModeDisplayName)
.send();

}
}

private boolean isPlacementBlocked(int level) {
return this.config.settings.blockPlacingMode == PluginConfig.Settings.BlockPlacingMode.ABOVE
? level > this.config.settings.blockPlacingYCoordinate
: level < this.config.settings.blockPlacingYCoordinate;
return this.config.settings.blockPlacementMode == PluginConfig.Settings.BlockPlacingMode.ABOVE
? level > this.config.settings.blockPlacementYCoordinate
: level < this.config.settings.blockPlacementYCoordinate;
}

@EventHandler
void onToggleGlide(EntityToggleGlideEvent event) {
if (!this.config.settings.shouldPreventElytraUsage) {
if (!this.config.settings.disableElytraUsage) {
return;
}

Expand All @@ -105,7 +105,7 @@ void onToggleGlide(EntityToggleGlideEvent event) {

@EventHandler
void onFly(PlayerToggleFlightEvent event) {
if (!this.config.settings.shouldPreventFlying) {
if (!this.config.settings.disableFlying) {
return;
}

Expand All @@ -125,7 +125,7 @@ void onFly(PlayerToggleFlightEvent event) {

@EventHandler
void onDamage(EntityDamageEvent event) {
if (!this.config.settings.shouldElytraDisableOnDamage) {
if (!this.config.settings.disableElytraOnDamage) {
return;
}

Expand All @@ -141,7 +141,7 @@ void onDamage(EntityDamageEvent event) {

@EventHandler
void onOpenInventory(InventoryOpenEvent event) {
if (!this.config.settings.shouldPreventInventoryOpening) {
if (!this.config.settings.disableInventoryAccess) {
return;
}

Expand Down Expand Up @@ -172,10 +172,10 @@ void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {

String command = event.getMessage().split(" ")[0].substring(1).toLowerCase();

boolean isMatchCommand = this.config.settings.blockedCommands.stream()
boolean isMatchCommand = this.config.settings.restrictedCommands.stream()
.anyMatch(command::startsWith);

WhitelistBlacklistMode mode = this.config.settings.commandBlockingMode;
WhitelistBlacklistMode mode = this.config.settings.commandRestrictionMode;

boolean shouldCancel = mode.shouldBlock(isMatchCommand);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
return;
}

List<EntityType> disabledProjectileEntities = this.config.settings.disabledProjectileEntities;
List<EntityType> disabledProjectileEntities = this.config.settings.ignoredProjectileTypes;

if (event.getDamager() instanceof Projectile projectile && disabledProjectileEntities.contains(projectile.getType())) {
return;
Expand All @@ -51,7 +51,7 @@ void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
return;
}

Duration combatTime = this.config.settings.combatDuration;
Duration combatTime = this.config.settings.combatTimerDuration;
UUID attackedUniqueId = attackedPlayerByPerson.getUniqueId();
UUID attackerUniqueId = attacker.getUniqueId();

Expand All @@ -63,7 +63,7 @@ void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
return;
}

if (this.config.settings.shouldPreventFlying) {
if (this.config.settings.disableFlying) {
if (attackedPlayerByPerson.isFlying()) {
attackedPlayerByPerson.setFlying(false);
attackedPlayerByPerson.setAllowFlight(false);
Expand All @@ -81,7 +81,7 @@ void onEntityDamageByEntity(EntityDamageByEntityEvent event) {

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
void onEntityDamage(EntityDamageEvent event) {
if (!this.config.settings.shouldEnableDamageCauses) {
if (!this.config.settings.enableDamageCauseLogging) {
return;
}

Expand All @@ -97,12 +97,12 @@ void onEntityDamage(EntityDamageEvent event) {
return;
}

Duration combatTime = this.config.settings.combatDuration;
Duration combatTime = this.config.settings.combatTimerDuration;

UUID uuid = player.getUniqueId();

List<EntityDamageEvent.DamageCause> damageCauses = this.config.settings.damageCausesToLog;
WhitelistBlacklistMode mode = this.config.settings.damageCausesMode;
List<EntityDamageEvent.DamageCause> damageCauses = this.config.settings.loggedDamageCauses;
WhitelistBlacklistMode mode = this.config.settings.damageCauseRestrictionMode;

EntityDamageEvent.DamageCause cause = event.getCause();

Expand Down Expand Up @@ -131,15 +131,15 @@ Player getDamager(EntityDamageByEntityEvent event) {
private boolean isPlayerInDisabledWorld(Player player) {
String worldName = player.getWorld().getName();

return this.config.settings.worldsToIgnore.contains(worldName);
return this.config.settings.ignoredWorlds.contains(worldName);
}

private boolean cannotBeTagged(Player player) {
if (player.getGameMode().equals(GameMode.CREATIVE) && this.config.settings.excludeCreativeFromCombat) {
if (player.getGameMode().equals(GameMode.CREATIVE) && this.config.settings.excludeCreativePlayersFromCombat) {
return true;
}

if (player.isOp() && this.config.settings.excludeOpFromCombat) {
if (player.isOp() && this.config.settings.excludeAdminsFromCombat) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void onPlayerDeath(PlayerDeathEvent event) {

this.fightManager.untag(player.getUniqueId(), cause);

if (killer != null && this.config.settings.shouldReleaseAttacker) {
if (killer != null && this.config.settings.releaseAttackerOnVictimDeath) {
this.fightManager.untag(killer.getUniqueId(), CauseOfUnTag.ATTACKER_RELEASE);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ void onPlayerMove(PlayerMoveEvent event) {

Vector knockbackVector = new Vector(subtract.getX(), 0, subtract.getZ()).normalize();
Vector configuredVector = new Vector(
this.pluginConfig.settings.blockedRegionKnockMultiplier,
this.pluginConfig.settings.regionKnockbackMultiplier,
0.5,
this.pluginConfig.settings.blockedRegionKnockMultiplier);
this.pluginConfig.settings.regionKnockbackMultiplier);

player.setVelocity(knockbackVector.multiply(configuredVector));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private boolean isCombatRegion(ProtectedRegion region) {
return true;
}

if (this.pluginConfig.settings.shouldPreventPvpRegions) {
if (this.pluginConfig.settings.preventPvpInRegions) {
StateFlag.State flag = region.getFlag(Flags.PVP);

if (flag != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void onJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
Audience audience = this.audienceProvider.player(player.getUniqueId());

if (!player.hasPermission(RECEIVE_UPDATES_PERMISSION) || !this.pluginConfig.settings.shouldReceivePluginUpdates) {
if (!player.hasPermission(RECEIVE_UPDATES_PERMISSION) || !this.pluginConfig.settings.notifyAboutUpdates) {
return;
}

Expand Down
Loading