/*
 * This file is part of Sponge, licensed under the MIT License (MIT).
 *
 * Copyright (c) SpongePowered <https://www.spongepowered.org>
 * Copyright (c) contributors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package org.spongepowered.common.config.category;

import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;

@ConfigSerializable
public class ExploitCategory extends ConfigCategory {

    @Setting(value = "prevent-creative-itemstack-name-exploit", comment = "Prevents an exploit in which the client sends a packet with the \n"
                                                                        + "itemstack name exceeding the string limit.")
    private boolean preventItemNameOverflow = true;

    @Setting(value = "mark-chunks-as-dirty-on-entity-list-modification",
        comment = "Enables forcing chunks to save when an entity is added\n"
                  + "or removed from said chunk. This is a partial fix for\n"
                  + "some exploits using vehicles."
                  + "See https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0306-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch")
    private boolean chunksAlwaysSave = true;

    @Setting(value = "update-tracked-chunk-on-entity-move",
        comment = "Enables forcing a chunk-tracking refresh on entity movement.\n"
                  + "This enables a guarantee that the entity is tracked in the \n"
                  + "proper chunk when moving."
                  + "See https://github.com/PaperMC/Paper/blob/master/Spigot-Server-Patches/0315-Always-process-chunk-registration-after-moving.patch"
    )
    private boolean chunkRegistrationOnMove = true;

    @Setting(value = "load-chunk-on-position-set",
        comment = "Enables focing a chunk load when an entity position\n"
                  + "is set. Usually due to teleportation, vehicle movement\n"
                  + "etc. can a position lead an entity to no longer exist\n"
                  + "within it's currently marked and tracked chunk. This will\n"
                  + "enable that chunk for the position is loaded. Part of several\n"
                  + "exploits."
                  + "See https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0335-Ensure-chunks-are-always-loaded-on-hard-position-set.patch "
    )
    private boolean chunkLoadOnPosition = true;

    @Setting(value = "sync-player-positions-for-vehicle-movement",
        comment = "Enables forcing updates to the player's location on vehicle movement.\n"
                  + "This is partially required to update the server's understanding of\n"
                  + "where the player exists, and allows chunk loading issues to be avoided\n"
                  + "with laggy connections and/or hack clients."
                  + "See https://github.com/PaperMC/Paper/blob/fd1bd5223a461b6d98280bb8f2d67280a30dd24a/Spigot-Server-Patches/0378-Sync-Player-Position-to-Vehicles.patch"
    )
    private boolean playerVehicleSync = true;

    @Setting(value = "filter-invalid-entities-on-chunk-save",
        comment = "Enables filtering invalid entities when a chunk is being saved\n"
                  + "such that the entity that does not \"belong\" in the saving\n"
                  + "chunk will not be saved, and forced an update to the world's\n"
                  + "tracked entity lists for chunks.\n"
                  + "See https://github.com/PaperMC/Paper/blob/master/Spigot-Server-Patches/0311-Prevent-Saving-Bad-entities-to-chunks.patch"
    )
    private boolean chunkSaveFiltersEntities = true;

    public boolean isPreventItemNameOverflow() {
        return this.preventItemNameOverflow;
    }

    public boolean changedChunksAlwaysSave() {
        return this.chunksAlwaysSave;
    }

    public boolean chunkLoadOnPosition() {
        return this.chunkLoadOnPosition;
    }

    public boolean chunkRefreshOnMove() {
        return this.chunkRegistrationOnMove;
    }

    public boolean playerSyncVehicle() {
        return this.playerVehicleSync;
    }

    public boolean chunkSaveFiltersEntities() {
        return this.chunkSaveFiltersEntities;
    }
}
@@ -2623,36 +2623,32 @@
              + %22
-See 
 https://github.c
@@ -2661,38 +2661,72 @@
 erMC/Paper/blob/
-master
+fd1bd5223a461b6d98280bb8f2d67280a30dd24a
 /Spigot-Server-P
@@ -4654,14 +4654,48 @@
 lob/
-master
+fd1bd5223a461b6d98280bb8f2d67280a30dd24a
 /Spi
@@ -5389,8 +5389,9 @@
 %0A    %7D%0A%7D
+%0A

Update ExploitCategory.java