mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 12:42:05 -07:00
Couple config fixes (#7975)
This commit is contained in:
@@ -73,7 +73,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ for (Class<?> check = packet.getClass(); check != Object.class; check = check.getSuperclass()) {
|
+ for (Class<?> check = packet.getClass(); check != Object.class; check = check.getSuperclass()) {
|
||||||
+ io.papermc.paper.configuration.GlobalConfiguration.PacketLimiter.PacketLimit packetSpecificLimit =
|
+ io.papermc.paper.configuration.GlobalConfiguration.PacketLimiter.PacketLimit packetSpecificLimit =
|
||||||
+ io.papermc.paper.configuration.GlobalConfiguration.get().packetLimiter.overrides.get(check);
|
+ io.papermc.paper.configuration.GlobalConfiguration.get().packetLimiter.overrides.get(check);
|
||||||
+ if (packetSpecificLimit == null) {
|
+ if (packetSpecificLimit == null || !packetSpecificLimit.isEnabled()) {
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+ io.papermc.paper.util.IntervalledCounter counter = this.packetSpecificLimits.computeIfAbsent((Class)check, (clazz) -> {
|
+ io.papermc.paper.util.IntervalledCounter counter = this.packetSpecificLimits.computeIfAbsent((Class)check, (clazz) -> {
|
||||||
|
@@ -631,7 +631,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ public Map<Class<? extends Packet<?>>, PacketLimit> overrides = Map.of(ServerboundPlaceRecipePacket.class, new PacketLimit(4.0, 5.0, PacketLimit.ViolateAction.DROP));
|
+ public Map<Class<? extends Packet<?>>, PacketLimit> overrides = Map.of(ServerboundPlaceRecipePacket.class, new PacketLimit(4.0, 5.0, PacketLimit.ViolateAction.DROP));
|
||||||
+
|
+
|
||||||
+ @ConfigSerializable
|
+ @ConfigSerializable
|
||||||
+ public record PacketLimit(@Constraint(Constraints.Positive.class) @Required double interval, @Constraint(Constraints.Positive.class) @Required double maxPacketRate, ViolateAction action) {
|
+ public record PacketLimit(@Required double interval, @Required double maxPacketRate, ViolateAction action) {
|
||||||
+ public PacketLimit(final double interval, final double maxPacketRate, final @Nullable ViolateAction action) {
|
+ public PacketLimit(final double interval, final double maxPacketRate, final @Nullable ViolateAction action) {
|
||||||
+ this.interval = interval;
|
+ this.interval = interval;
|
||||||
+ this.maxPacketRate = maxPacketRate;
|
+ this.maxPacketRate = maxPacketRate;
|
||||||
@@ -1354,6 +1354,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ path("use-hopper-check"),
|
+ path("use-hopper-check"),
|
||||||
+ path("use-async-lighting"),
|
+ path("use-async-lighting"),
|
||||||
+ path("tnt-explosion-volume"),
|
+ path("tnt-explosion-volume"),
|
||||||
|
+ path("entities", "spawning", "despawn-ranges", "soft"),
|
||||||
|
+ path("entities", "spawning", "despawn-ranges", "hard")
|
||||||
+ };
|
+ };
|
||||||
+
|
+
|
||||||
+ NodePath[] REMOVED_GLOBAL_PATHS = {
|
+ NodePath[] REMOVED_GLOBAL_PATHS = {
|
||||||
|
Reference in New Issue
Block a user