Skip to content

Commit

Permalink
Update some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cjburkey01 committed Aug 29, 2024
1 parent 12c7d43 commit aeec60f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@
import java.util.*;
import java.util.stream.Collectors;

/*
* I've actually just decided that we're gonna do it this way:
* - SQLite backing database *file* similar to current MySQL integration (which will
* be removed and automatically converted).
* - Have some intermediary layer that can Respond immediately and asynchronously update database.
*/

/**
* The SHINY, NEW........data handler that tries to fix the data loss issues by which this project
* has been plagued since its conception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import java.util.regex.Pattern;
import java.util.stream.Collectors;

// TODO: REPLACE CHUNK_ID KEY WITH CHUNK COORDINATE KEY

public record SqLiteWrapper(File dbFile, boolean usesTransactionManager) implements Closeable {

private static final String SELECT_CHUNK_ID_SQL =
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/cjburkey/claimchunk/flag/FlagHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ private ApplicableFlags getApplicableFlags(
return new ApplicableFlags(chunkPlayerFlags, chunkFlags, playerFlags, globalFlags);
}

// TODO: RETURN FlagProtectResult.Unspecified TO ALLOW WORLD PROFILE
// FALLBACK.
private boolean doesProtect(
ApplicableFlags applicableFlags, String flagName, CCFlags.ProtectWhen protectWhen) {
FlagProtectResult result;
Expand Down
26 changes: 17 additions & 9 deletions src/main/resources/flags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
# enable/disable in their chunks to determine what other are allowed to do in
# their claimed chunk(s).
#
# When a user has a flag enabled, it overrides all more specific flag targets
# When a user has a flag enabled, it overrides all less specific flag targets
# even when they're disabled. So for example, if a user has some `interact`
# flag enabled for one of their chunks, it does not matter if they have it
# disabled for a specific player (either globally or in that chunk).
# This may end up being a big foot-gun! This should be changed to some
# "enabled/disabled/unset" system
# flag specifically enabled/disabled for one of their chunks, it does not
# matter if they have it enabled/disabled for a specific player, unless they
# have the flag as a different value for that player in the specific chunk.
# If all flags are unset, the fallback is determined by the world's protection
# profile file in the `/plugins/ClaimChunk/worlds/` directory.
#
# When specifying included/excluded blocks and entities, you can use either the
# resource name (like `minecraft:dirt`, for example), the Spigot/Bukkit
Expand All @@ -16,13 +17,13 @@
# Class references (preceded by `@`) reference the classes described in:
# /plugins/ClaimChunk/classes.yml
#
# By default, blocks/entities listed in flags will have protection from other
# By default, blocks/entities listed in flags will have PROTECTION from other
# players *enabled* when the flag is disabled!
# The `protectWhen` value can be used within each protection type list.
# If set to `ENABLED`, the protections will only be applied once the owner has
# enabled the flag for their claim(s).
# For an example, see the `disablePvp` flag below, which protects player
# entities once the flag has been enabled, rather than by default.
# entities once the flag has been enabled, rather than once disabled.

permissionFlags:
breakBlocks:
Expand All @@ -35,14 +36,18 @@ permissionFlags:
# entities/entity classes will be included.
# Similarly, `exclude` includes all default blocks/items and
# excludes the provided ones.
# If both are provided, exclusions are processed FIRST and then
# inclusions
type: BREAK
placeBlocks:
- for: BLOCKS
type: PLACE
interactBlocks:
- for: BLOCKS
type: INTERACT
exclude: ['@REDSTONE', '@DOORS', '@CONTAINER'] # Handle these separately
# Handle these separately.
# Note: @CONTAINER blocks are covered by the `containers` flag below
exclude: ['@REDSTONE', '@DOORS', '@CONTAINER']
redstone:
- for: BLOCKS
type: INTERACT
Expand All @@ -55,10 +60,12 @@ permissionFlags:
# Entities
damageEntities:
- for: ENTITIES
# Entities can have DAMAGE, INTERACT, and EXPLODE protection types
type: DAMAGE
interactEntities:
- for: ENTITIES
type: INTERACT
# Handle container entities with container blocks in the `containers` flag
exclude: ['@VEHICLES', '@CONTAINER_ENTITIES']
vehicles:
- for: ENTITIES
Expand All @@ -70,11 +77,12 @@ permissionFlags:
# PVP is unique, set the `for` to `PLAYERS`:
- for: PLAYERS
protectWhen: ENABLED
# Ender pearls are another unique target
disablePearl:
- for: PEARLS
protectWhen: ENABLED

# Can also handle both types with one flag
# Can also handle multiple types with one flag
containers:
- for: BLOCKS
type: INTERACT
Expand Down

0 comments on commit aeec60f

Please sign in to comment.