mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 06:28:54 +00:00
Join command permission adjustments (#522)
* Adjust channel permissions base channel perm: allows joining .see: allows seeing messages .speak: allows sending messages * Move #permission to config channel and add #dynamicPermission * add since tag
This commit is contained in:
1 parent
6760e05c93
commit
e97d6eb7f8
14 files changed
+102
-30
No files matched your search
@@ -64,6 +64,14 @@ public class AllianceChannel extends AbstractFactionsChannel {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChannelPermissionResult joinPermitted(final CarbonPlayer player) {
|
||||
return channelPermissionResult(
|
||||
this.hasRelations(player, Relation.ALLY),
|
||||
() -> this.messages.cannotUseFactionAllianceChannel(player)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChannelPermissionResult speechPermitted(final CarbonPlayer player) {
|
||||
return channelPermissionResult(
|
||||
|
||||
@@ -61,6 +61,14 @@ public class FactionChannel extends AbstractFactionsChannel {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChannelPermissionResult joinPermitted(final CarbonPlayer player) {
|
||||
return channelPermissionResult(
|
||||
this.faction(player) != null,
|
||||
() -> this.messages.cannotUseFactionChannel(player)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChannelPermissionResult speechPermitted(final CarbonPlayer player) {
|
||||
return channelPermissionResult(
|
||||
|
||||
@@ -64,6 +64,14 @@ public class TruceChannel extends AbstractFactionsChannel {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChannelPermissionResult joinPermitted(final CarbonPlayer player) {
|
||||
return channelPermissionResult(
|
||||
this.hasRelations(player, Relation.TRUCE),
|
||||
() -> this.messages.cannotUseTruceChannel(player)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChannelPermissionResult speechPermitted(final CarbonPlayer player) {
|
||||
return channelPermissionResult(
|
||||
|
||||
@@ -64,6 +64,14 @@ public class McmmoPartyChannel extends ConfigChatChannel {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChannelPermissionResult joinPermitted(final CarbonPlayer player) {
|
||||
return channelPermissionResult(
|
||||
this.party(player) != null,
|
||||
() -> this.messages.cannotUseMcmmoPartyChannel(player)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChannelPermissionResult speechPermitted(final CarbonPlayer player) {
|
||||
return channelPermissionResult(
|
||||
|
||||
+8
@@ -52,6 +52,14 @@ abstract class ResidentListChannel<T extends ResidentList> extends ConfigChatCha
|
||||
|
||||
protected abstract @Nullable T residentList(CarbonPlayer player);
|
||||
|
||||
@Override
|
||||
public ChannelPermissionResult joinPermitted(final CarbonPlayer player) {
|
||||
return channelPermissionResult(
|
||||
this.residentList(player) != null,
|
||||
() -> this.cannotUseChannel(player)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChannelPermissionResult speechPermitted(final CarbonPlayer player) {
|
||||
return channelPermissionResult(
|
||||
|
||||
Reference in new issue
Block a user