-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add config options for Default Claim Permissions (#160)
* Added permission config for default claim permissions. * Fixed unused imports and unnecesary semicolons. * Added changes for pr #160 * Added Function into constructor for pr #160
- Loading branch information
1 parent
56b40ef
commit 9d77ca8
Showing
12 changed files
with
500 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
...va/codes/wasabi/xclaim/config/impl/defaulting/sub/DefaultingDefaultPermissionsConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
package codes.wasabi.xclaim.config.impl.defaulting.sub; | ||
|
||
import codes.wasabi.xclaim.config.impl.filter.sub.FilterDefaultPermissionsConfig; | ||
import codes.wasabi.xclaim.config.struct.sub.DefaultPermissionsConfig; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public final class DefaultingDefaultPermissionsConfig extends FilterDefaultPermissionsConfig { | ||
|
||
public DefaultingDefaultPermissionsConfig(@NotNull DefaultPermissionsConfig backing) { | ||
super(backing); | ||
} | ||
|
||
@Override | ||
public @NotNull String defaultBuild(){ | ||
return this.nullFallback(this.backing().defaultBuild(), "TRUSTED"); | ||
} | ||
|
||
@Override | ||
public @NotNull String defaultBreak(){ | ||
return this.nullFallback(this.backing().defaultBreak(), "TRUSTED"); | ||
} | ||
|
||
@Override | ||
public @NotNull String defaultEnter(){ | ||
return this.nullFallback(this.backing().defaultEnter(), "ALL"); | ||
} | ||
|
||
@Override | ||
public @NotNull String defaultInteract(){ | ||
return this.nullFallback(this.backing().defaultInteract(), "VETERANS"); | ||
} | ||
|
||
@Override | ||
public @NotNull String defaultChestOpen(){ | ||
return this.nullFallback(this.backing().defaultChestOpen(), "TRUSTED"); | ||
} | ||
|
||
@Override | ||
public @NotNull String defaultEntPlace(){ | ||
return this.nullFallback(this.backing().defaultEntPlace(), "VETERANS"); | ||
} | ||
|
||
@Override | ||
public @NotNull String defaultVehiclePlace(){ | ||
return this.nullFallback(this.backing().defaultVehiclePlace(), "VETERANS"); | ||
} | ||
|
||
@Override | ||
public @NotNull String defaultFireUse(){ | ||
return this.nullFallback(this.backing().defaultFireUse(), "TRUSTED"); | ||
} | ||
|
||
@Override | ||
public @NotNull String defaultEntFriendly(){ | ||
return this.nullFallback(this.backing().defaultEntFriendly(), "VETERANS"); | ||
} | ||
|
||
@Override | ||
public @NotNull String defaultEntDamageHost(){ | ||
return this.nullFallback(this.backing().defaultEntDamageHost(), "VETERANS"); | ||
} | ||
|
||
@Override | ||
public @NotNull String defaultEntDamageVehicle(){ | ||
return this.nullFallback(this.backing().defaultEntDamageVehicle(), "VETERANS"); | ||
} | ||
|
||
@Override | ||
public @NotNull String defaultEntDamageNL(){ | ||
return this.nullFallback(this.backing().defaultEntDamageNL(), "VETERANS"); | ||
} | ||
|
||
@Override | ||
public @NotNull String defaultEntDamageMisc(){ | ||
return this.nullFallback(this.backing().defaultEntDamageMisc(), "ALL"); | ||
} | ||
|
||
@Override | ||
public @NotNull String defaultExplode(){ | ||
return this.nullFallback(this.backing().defaultExplode(), "TRUSTED"); | ||
} | ||
|
||
@Override | ||
public @NotNull String defaultItemDrop(){ | ||
return this.nullFallback(this.backing().defaultItemDrop(), "ALL"); | ||
} | ||
|
||
@Override | ||
public @NotNull String defaultManage(){ | ||
return this.nullFallback(this.backing().defaultManage(), "NONE"); | ||
} | ||
|
||
@Override | ||
public @NotNull String defaultDelete(){ | ||
return this.nullFallback(this.backing().defaultDelete(), "NONE"); | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/codes/wasabi/xclaim/config/impl/filter/sub/FilterDefaultPermissionsConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package codes.wasabi.xclaim.config.impl.filter.sub; | ||
|
||
import codes.wasabi.xclaim.config.impl.filter.FilterConfig; | ||
import codes.wasabi.xclaim.config.struct.sub.DefaultPermissionsConfig; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public abstract class FilterDefaultPermissionsConfig extends FilterConfig implements DefaultPermissionsConfig { | ||
|
||
public FilterDefaultPermissionsConfig(@NotNull DefaultPermissionsConfig backing) { | ||
super(backing); | ||
} | ||
|
||
@Override | ||
protected @NotNull DefaultPermissionsConfig backing() { | ||
return (DefaultPermissionsConfig) super.backing(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
src/main/java/codes/wasabi/xclaim/config/impl/toml/sub/TomlDefaultPermissionsConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
package codes.wasabi.xclaim.config.impl.toml.sub; | ||
|
||
import codes.wasabi.xclaim.config.impl.toml.TomlConfig; | ||
import codes.wasabi.xclaim.config.struct.sub.DefaultPermissionsConfig; | ||
import com.moandjiezana.toml.Toml; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.jetbrains.annotations.UnknownNullability; | ||
|
||
public class TomlDefaultPermissionsConfig extends TomlConfig implements DefaultPermissionsConfig { | ||
|
||
public TomlDefaultPermissionsConfig(@Nullable Toml table) { | ||
super(table); | ||
} | ||
|
||
@Override | ||
public @UnknownNullability String defaultBuild() { | ||
return this.getString("build"); | ||
} | ||
|
||
@Override | ||
public @UnknownNullability String defaultBreak() { | ||
return this.getString("break"); | ||
} | ||
|
||
@Override | ||
public @UnknownNullability String defaultEnter() { | ||
return this.getString("enter"); | ||
} | ||
|
||
@Override | ||
public @UnknownNullability String defaultInteract() { | ||
return this.getString("interact"); | ||
} | ||
|
||
@Override | ||
public @UnknownNullability String defaultChestOpen() { | ||
return this.getString("chest-open"); | ||
} | ||
|
||
@Override | ||
public @UnknownNullability String defaultEntPlace() { | ||
return this.getString("ent-place"); | ||
} | ||
|
||
@Override | ||
public @UnknownNullability String defaultVehiclePlace() { | ||
return this.getString("vehicle_place"); | ||
} | ||
|
||
@Override | ||
public @UnknownNullability String defaultFireUse() { | ||
return this.getString("fire-use"); | ||
} | ||
|
||
@Override | ||
public @UnknownNullability String defaultEntFriendly() { | ||
return this.getString("entity-friendly"); | ||
} | ||
|
||
@Override | ||
public @UnknownNullability String defaultEntDamageHost() { | ||
return this.getString("entity-damage-hostile"); | ||
} | ||
|
||
@Override | ||
public @UnknownNullability String defaultEntDamageVehicle() { | ||
return this.getString("entity-damage-vehicle"); | ||
} | ||
|
||
@Override | ||
public @UnknownNullability String defaultEntDamageNL() { | ||
return this.getString("entity-damage-nl"); | ||
} | ||
|
||
@Override | ||
public @UnknownNullability String defaultEntDamageMisc() { | ||
return this.getString("entity-damage-misc"); | ||
} | ||
|
||
@Override | ||
public @UnknownNullability String defaultExplode() { | ||
return this.getString("explode"); | ||
} | ||
|
||
@Override | ||
public @UnknownNullability String defaultItemDrop() { | ||
return this.getString("item-drop"); | ||
} | ||
|
||
@Override | ||
public @UnknownNullability String defaultManage() { | ||
return this.getString("manage"); | ||
} | ||
|
||
@Override | ||
public @UnknownNullability String defaultDelete() { | ||
return this.getString("delete"); | ||
} | ||
} |
Oops, something went wrong.