Skip to content

Commit

Permalink
Refactor ProtectionFlag usage to Flag in registration.
Browse files Browse the repository at this point in the history
Replaced all instances of `ProtectionFlag` with `Flag` within the plugin's flag registry. This simplifies the code and ensures consistency across flag types, making flag registration more streamlined and easier to maintain.
  • Loading branch information
NonSwag committed Nov 2, 2024
1 parent 74e1285 commit 61c7f26
Showing 1 changed file with 47 additions and 48 deletions.
95 changes: 47 additions & 48 deletions plugin/src/main/java/net/thenextlvl/protect/ProtectPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import net.thenextlvl.protect.flag.CraftFlagRegistry;
import net.thenextlvl.protect.flag.Flag;
import net.thenextlvl.protect.flag.FlagRegistry;
import net.thenextlvl.protect.flag.ProtectionFlag;
import net.thenextlvl.protect.listener.AreaListener;
import net.thenextlvl.protect.listener.EntityListener;
import net.thenextlvl.protect.listener.MovementListener;
Expand Down Expand Up @@ -192,52 +191,52 @@ public class Flags {
public final Flag<Boolean> areaLeave = flagRegistry().register(ProtectPlugin.this, "leave", true);
public final Flag<Boolean> notifyFailedInteractions = flagRegistry().register(ProtectPlugin.this, "notify_failed_interactions", false);

public final ProtectionFlag<Boolean> armorStandManipulate = flagRegistry().register(ProtectPlugin.this, "armor_stand_manipulate", true, false);
public final ProtectionFlag<Boolean> armorWashing = flagRegistry().register(ProtectPlugin.this, Boolean.class, "armor_washing", true, false);
public final ProtectionFlag<Boolean> bannerWashing = flagRegistry().register(ProtectPlugin.this, Boolean.class, "banner_washing", true, false);
public final ProtectionFlag<Boolean> blockAbsorb = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_absorb", true, false);
public final ProtectionFlag<Boolean> blockBreak = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_break", true, false);
public final ProtectionFlag<Boolean> blockBurning = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_burning", true, false);
public final ProtectionFlag<Boolean> blockDrying = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_drying", true, false);
public final ProtectionFlag<Boolean> blockFading = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_fading", true, false);
public final ProtectionFlag<Boolean> blockFertilize = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_fertilize", true, false);
public final ProtectionFlag<Boolean> blockForming = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_forming", true, false);
public final ProtectionFlag<Boolean> blockGrowth = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_growth", true, false);
public final ProtectionFlag<Boolean> blockIgniting = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_igniting", true, false);
public final ProtectionFlag<Boolean> blockMoisturising = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_moisturising", true, false);
public final ProtectionFlag<Boolean> blockPlace = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_place", true, false);
public final ProtectionFlag<Boolean> blockSpread = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_spread", true, false);
public final ProtectionFlag<Boolean> cauldronEvaporation = flagRegistry().register(ProtectPlugin.this, Boolean.class, "cauldron_evaporation", true, false);
public final ProtectionFlag<Boolean> cauldronExtinguishEntity = flagRegistry().register(ProtectPlugin.this, Boolean.class, "cauldron_extinguish_entity", true, false);
public final ProtectionFlag<Boolean> cauldronLevelChangeUnknown = flagRegistry().register(ProtectPlugin.this, Boolean.class, "cauldron_level_change_unknown", true, false);
public final ProtectionFlag<Boolean> cropTrample = flagRegistry().register(ProtectPlugin.this, Boolean.class, "crop_trample", true, false);
public final ProtectionFlag<Boolean> damage = flagRegistry().register(ProtectPlugin.this, Boolean.class, "damage", true, false);
public final ProtectionFlag<Boolean> emptyBottle = flagRegistry().register(ProtectPlugin.this, Boolean.class, "empty_bottle", true, false);
public final ProtectionFlag<Boolean> emptyBucket = flagRegistry().register(ProtectPlugin.this, Boolean.class, "empty_bucket", true, false);
public final ProtectionFlag<Boolean> entityAttackEntity = flagRegistry().register(ProtectPlugin.this, Boolean.class, "entity_attack_entity", true, false);
public final ProtectionFlag<Boolean> entityAttackPlayer = flagRegistry().register(ProtectPlugin.this, Boolean.class, "entity_attack_player", true, false);
public final ProtectionFlag<Boolean> entityInteract = flagRegistry().register(ProtectPlugin.this, Boolean.class, "entity_interact", true, false);
public final ProtectionFlag<Boolean> entityItemDrop = flagRegistry().register(ProtectPlugin.this, Boolean.class, "entity_item_drop", true, false);
public final ProtectionFlag<Boolean> entityItemPickup = flagRegistry().register(ProtectPlugin.this, Boolean.class, "entity_item_pickup", true, false);
public final ProtectionFlag<Boolean> entityShear = flagRegistry().register(ProtectPlugin.this, Boolean.class, "entity_shear", true, false);
public final ProtectionFlag<Boolean> explosions = flagRegistry().register(ProtectPlugin.this, Boolean.class, "explosions", true, false);
public final ProtectionFlag<Boolean> fillBottle = flagRegistry().register(ProtectPlugin.this, Boolean.class, "fill_bottle", true, false);
public final ProtectionFlag<Boolean> fillBucket = flagRegistry().register(ProtectPlugin.this, Boolean.class, "fill_bucket", true, false);
public final ProtectionFlag<Boolean> gameEvents = flagRegistry().register(ProtectPlugin.this, Boolean.class, "game_events", true, false);
public final ProtectionFlag<Boolean> hangingBreak = flagRegistry().register(ProtectPlugin.this, Boolean.class, "hanging_break", true, false);
public final ProtectionFlag<Boolean> hangingPlace = flagRegistry().register(ProtectPlugin.this, Boolean.class, "hanging_place", true, false);
public final ProtectionFlag<Boolean> hunger = flagRegistry().register(ProtectPlugin.this, Boolean.class, "hunger", true, false);
public final ProtectionFlag<Boolean> interact = flagRegistry().register(ProtectPlugin.this, Boolean.class, "interact", true, false);
public final ProtectionFlag<Boolean> leavesDecay = flagRegistry().register(ProtectPlugin.this, Boolean.class, "leaves_decay", true, false);
public final ProtectionFlag<Boolean> naturalCauldronFill = flagRegistry().register(ProtectPlugin.this, Boolean.class, "natural_cauldron_fill", true, false);
public final ProtectionFlag<Boolean> naturalEntitySpawn = flagRegistry().register(ProtectPlugin.this, Boolean.class, "natural_entity_spawn", true, false);
public final ProtectionFlag<Boolean> physicalInteract = flagRegistry().register(ProtectPlugin.this, Boolean.class, "physical_interact", true, false);
public final ProtectionFlag<Boolean> physics = flagRegistry().register(ProtectPlugin.this, Boolean.class, "physics", true, false);
public final ProtectionFlag<Boolean> playerAttackEntity = flagRegistry().register(ProtectPlugin.this, Boolean.class, "player_attack_entity", true, false);
public final ProtectionFlag<Boolean> playerAttackPlayer = flagRegistry().register(ProtectPlugin.this, Boolean.class, "player_attack_player", true, false);
public final ProtectionFlag<Boolean> playerItemDrop = flagRegistry().register(ProtectPlugin.this, Boolean.class, "player_item_drop", true, false);
public final ProtectionFlag<Boolean> redstone = flagRegistry().register(ProtectPlugin.this, Boolean.class, "redstone", true, false);
public final ProtectionFlag<Boolean> shoot = flagRegistry().register(ProtectPlugin.this, Boolean.class, "shoot", true, false);
public final ProtectionFlag<Boolean> shulkerWashing = flagRegistry().register(ProtectPlugin.this, Boolean.class, "shulker_washing", true, false);
public final Flag<Boolean> armorStandManipulate = flagRegistry().register(ProtectPlugin.this, "armor_stand_manipulate", true, false);
public final Flag<Boolean> armorWashing = flagRegistry().register(ProtectPlugin.this, Boolean.class, "armor_washing", true, false);
public final Flag<Boolean> bannerWashing = flagRegistry().register(ProtectPlugin.this, Boolean.class, "banner_washing", true, false);
public final Flag<Boolean> blockAbsorb = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_absorb", true, false);
public final Flag<Boolean> blockBreak = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_break", true, false);
public final Flag<Boolean> blockBurning = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_burning", true, false);
public final Flag<Boolean> blockDrying = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_drying", true, false);
public final Flag<Boolean> blockFading = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_fading", true, false);
public final Flag<Boolean> blockFertilize = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_fertilize", true, false);
public final Flag<Boolean> blockForming = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_forming", true, false);
public final Flag<Boolean> blockGrowth = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_growth", true, false);
public final Flag<Boolean> blockIgniting = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_igniting", true, false);
public final Flag<Boolean> blockMoisturising = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_moisturising", true, false);
public final Flag<Boolean> blockPlace = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_place", true, false);
public final Flag<Boolean> blockSpread = flagRegistry().register(ProtectPlugin.this, Boolean.class, "block_spread", true, false);
public final Flag<Boolean> cauldronEvaporation = flagRegistry().register(ProtectPlugin.this, Boolean.class, "cauldron_evaporation", true, false);
public final Flag<Boolean> cauldronExtinguishEntity = flagRegistry().register(ProtectPlugin.this, Boolean.class, "cauldron_extinguish_entity", true, false);
public final Flag<Boolean> cauldronLevelChangeUnknown = flagRegistry().register(ProtectPlugin.this, Boolean.class, "cauldron_level_change_unknown", true, false);
public final Flag<Boolean> cropTrample = flagRegistry().register(ProtectPlugin.this, Boolean.class, "crop_trample", true, false);
public final Flag<Boolean> damage = flagRegistry().register(ProtectPlugin.this, Boolean.class, "damage", true, false);
public final Flag<Boolean> emptyBottle = flagRegistry().register(ProtectPlugin.this, Boolean.class, "empty_bottle", true, false);
public final Flag<Boolean> emptyBucket = flagRegistry().register(ProtectPlugin.this, Boolean.class, "empty_bucket", true, false);
public final Flag<Boolean> entityAttackEntity = flagRegistry().register(ProtectPlugin.this, Boolean.class, "entity_attack_entity", true, false);
public final Flag<Boolean> entityAttackPlayer = flagRegistry().register(ProtectPlugin.this, Boolean.class, "entity_attack_player", true, false);
public final Flag<Boolean> entityInteract = flagRegistry().register(ProtectPlugin.this, Boolean.class, "entity_interact", true, false);
public final Flag<Boolean> entityItemDrop = flagRegistry().register(ProtectPlugin.this, Boolean.class, "entity_item_drop", true, false);
public final Flag<Boolean> entityItemPickup = flagRegistry().register(ProtectPlugin.this, Boolean.class, "entity_item_pickup", true, false);
public final Flag<Boolean> entityShear = flagRegistry().register(ProtectPlugin.this, Boolean.class, "entity_shear", true, false);
public final Flag<Boolean> explosions = flagRegistry().register(ProtectPlugin.this, Boolean.class, "explosions", true, false);
public final Flag<Boolean> fillBottle = flagRegistry().register(ProtectPlugin.this, Boolean.class, "fill_bottle", true, false);
public final Flag<Boolean> fillBucket = flagRegistry().register(ProtectPlugin.this, Boolean.class, "fill_bucket", true, false);
public final Flag<Boolean> gameEvents = flagRegistry().register(ProtectPlugin.this, Boolean.class, "game_events", true, false);
public final Flag<Boolean> hangingBreak = flagRegistry().register(ProtectPlugin.this, Boolean.class, "hanging_break", true, false);
public final Flag<Boolean> hangingPlace = flagRegistry().register(ProtectPlugin.this, Boolean.class, "hanging_place", true, false);
public final Flag<Boolean> hunger = flagRegistry().register(ProtectPlugin.this, Boolean.class, "hunger", true, false);
public final Flag<Boolean> interact = flagRegistry().register(ProtectPlugin.this, Boolean.class, "interact", true, false);
public final Flag<Boolean> leavesDecay = flagRegistry().register(ProtectPlugin.this, Boolean.class, "leaves_decay", true, false);
public final Flag<Boolean> naturalCauldronFill = flagRegistry().register(ProtectPlugin.this, Boolean.class, "natural_cauldron_fill", true, false);
public final Flag<Boolean> naturalEntitySpawn = flagRegistry().register(ProtectPlugin.this, Boolean.class, "natural_entity_spawn", true, false);
public final Flag<Boolean> physicalInteract = flagRegistry().register(ProtectPlugin.this, Boolean.class, "physical_interact", true, false);
public final Flag<Boolean> physics = flagRegistry().register(ProtectPlugin.this, Boolean.class, "physics", true, false);
public final Flag<Boolean> playerAttackEntity = flagRegistry().register(ProtectPlugin.this, Boolean.class, "player_attack_entity", true, false);
public final Flag<Boolean> playerAttackPlayer = flagRegistry().register(ProtectPlugin.this, Boolean.class, "player_attack_player", true, false);
public final Flag<Boolean> playerItemDrop = flagRegistry().register(ProtectPlugin.this, Boolean.class, "player_item_drop", true, false);
public final Flag<Boolean> redstone = flagRegistry().register(ProtectPlugin.this, Boolean.class, "redstone", true, false);
public final Flag<Boolean> shoot = flagRegistry().register(ProtectPlugin.this, Boolean.class, "shoot", true, false);
public final Flag<Boolean> shulkerWashing = flagRegistry().register(ProtectPlugin.this, Boolean.class, "shulker_washing", true, false);
}
}

0 comments on commit 61c7f26

Please sign in to comment.