mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
Fix boot errors
Thanks kennytv
This commit is contained in:
parent
c7006765bd
commit
5c8d49542f
@ -12,16 +12,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
// Spigot start - limit place/interactions
|
// Spigot start - limit place/interactions
|
||||||
private int limitedPackets;
|
private int limitedPackets;
|
||||||
private long lastLimitedPacket = -1;
|
private long lastLimitedPacket = -1;
|
||||||
+ private static final int THRESHOLD = io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.incomingPacketThreshold; // Paper - Configurable threshold
|
+ private static int getSpamThreshold() { return io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.incomingPacketThreshold; } // Paper - Configurable threshold
|
||||||
|
|
||||||
private boolean checkLimit(long timestamp) {
|
private boolean checkLimit(long timestamp) {
|
||||||
- if (this.lastLimitedPacket != -1 && timestamp - this.lastLimitedPacket < 30 && this.limitedPackets++ >= 4) {
|
- if (this.lastLimitedPacket != -1 && timestamp - this.lastLimitedPacket < 30 && this.limitedPackets++ >= 4) {
|
||||||
+ if (this.lastLimitedPacket != -1 && timestamp - this.lastLimitedPacket < THRESHOLD && this.limitedPackets++ >= 8) { // Paper - Use threshold, raise packet limit to 8
|
+ if (this.lastLimitedPacket != -1 && timestamp - this.lastLimitedPacket < getSpamThreshold() && this.limitedPackets++ >= 8) { // Paper - Use threshold, raise packet limit to 8
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
- if (this.lastLimitedPacket == -1 || timestamp - this.lastLimitedPacket >= 30) {
|
- if (this.lastLimitedPacket == -1 || timestamp - this.lastLimitedPacket >= 30) {
|
||||||
+ if (this.lastLimitedPacket == -1 || timestamp - this.lastLimitedPacket >= THRESHOLD) { // Paper
|
+ if (this.lastLimitedPacket == -1 || timestamp - this.lastLimitedPacket >= getSpamThreshold()) { // Paper
|
||||||
this.lastLimitedPacket = timestamp;
|
this.lastLimitedPacket = timestamp;
|
||||||
this.limitedPackets = 0;
|
this.limitedPackets = 0;
|
||||||
return true;
|
return true;
|
||||||
|
@ -118,7 +118,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/net/minecraft/server/Bootstrap.java
|
--- a/src/main/java/net/minecraft/server/Bootstrap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/Bootstrap.java
|
+++ b/src/main/java/net/minecraft/server/Bootstrap.java
|
||||||
@@ -0,0 +0,0 @@ public class Bootstrap {
|
@@ -0,0 +0,0 @@ public class Bootstrap {
|
||||||
BuiltInRegistries.bootStrap();
|
CauldronInteraction.bootStrap();
|
||||||
// Paper start
|
// Paper start
|
||||||
BuiltInRegistries.bootStrap(() -> {
|
BuiltInRegistries.bootStrap(() -> {
|
||||||
+ net.minecraft.core.Registry.register(net.minecraft.core.registries.BuiltInRegistries.MATERIAL_CONDITION, new net.minecraft.resources.ResourceLocation("paper", "bedrock_condition_source"), net.minecraft.data.worldgen.SurfaceRuleData.PaperBedrockConditionSource.CODEC.codec());
|
+ net.minecraft.core.Registry.register(net.minecraft.core.registries.BuiltInRegistries.MATERIAL_CONDITION, new net.minecraft.resources.ResourceLocation("paper", "bedrock_condition_source"), net.minecraft.data.worldgen.SurfaceRuleData.PaperBedrockConditionSource.CODEC.codec());
|
||||||
|
@ -6948,9 +6948,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/net/minecraft/server/Bootstrap.java
|
--- a/src/main/java/net/minecraft/server/Bootstrap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/Bootstrap.java
|
+++ b/src/main/java/net/minecraft/server/Bootstrap.java
|
||||||
@@ -0,0 +0,0 @@ public class Bootstrap {
|
@@ -0,0 +0,0 @@ public class Bootstrap {
|
||||||
|
EntitySelectorOptions.bootStrap();
|
||||||
DispenseItemBehavior.bootStrap();
|
DispenseItemBehavior.bootStrap();
|
||||||
CauldronInteraction.bootStrap();
|
CauldronInteraction.bootStrap();
|
||||||
BuiltInRegistries.bootStrap();
|
- BuiltInRegistries.bootStrap();
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ BuiltInRegistries.bootStrap(() -> {
|
+ BuiltInRegistries.bootStrap(() -> {
|
||||||
+ io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enterBootstrappers(); // Paper - Entrypoint for bootstrapping
|
+ io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enterBootstrappers(); // Paper - Entrypoint for bootstrapping
|
||||||
|
Loading…
Reference in New Issue
Block a user