Skip to content

Commit

Permalink
fix some patches
Browse files Browse the repository at this point in the history
  • Loading branch information
MC-XiaoHei committed May 8, 2024
1 parent 4587f00 commit 4689cf3
Show file tree
Hide file tree
Showing 51 changed files with 2,167 additions and 3,105 deletions.
73 changes: 20 additions & 53 deletions patches/server/0047-MC-Technical-Survival-Mode.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] MC Technical Survival Mode
Will automatically overwrite some configuration after startup

diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
index 6177f91146d2bc9dc1a066a24f84581cec0f53cd..04eab3a1f3cb5332293a95f1b3023ed55ab42237 100644
index 30a59663c3b30430f8ca202965ebb21d4d7abf4c..af20e05ef5e37d742650626c71e6e091d8419ac0 100644
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
@@ -331,14 +331,14 @@ public final class ChatProcessor {
Expand Down Expand Up @@ -40,10 +40,10 @@ index 5b446e6ac151f99f64f0c442d0b40b5e251bc4c4..c2eb3e8b019dbc0543a2308d7e88e324
final long timeout;
if (type == RegionizedPlayerChunkLoader.REGION_PLAYER_TICKET && delayTimeout > 0) {
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..c24148d8486420434922864df6f1ffa0b9929612 100644
index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..409ace040a39e5d8a23952c2ac9c39922c69581e 100644
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
@@ -317,6 +317,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -316,6 +316,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
for (ServerLevel level : server.getAllLevels()) {
this.createWorldConfig(createWorldContextMap(level), reloader(this.worldConfigClass, level.paperConfig()));
}
Expand All @@ -52,10 +52,10 @@ index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..c24148d8486420434922864df6f1ffa0
throw new RuntimeException("Could not reload paper configuration files", ex);
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 47864d5c04496ab18a3ad82781df5a06e8b9ea9b..9488fbbf0442d38c18632f0ed50c23fd27078f71 100644
index 72f771e03f0b24e3b301d925600b550552ade8e6..7cea0325cb626f5de5d8d58ecaa580e6d979f636 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2739,7 +2739,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2695,7 +2695,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public void onTickingEnd(Entity entity) {
ServerLevel.this.entityTickList.remove(entity);
// Paper start - Reset pearls when they stop being ticked
Expand All @@ -65,10 +65,10 @@ index 47864d5c04496ab18a3ad82781df5a06e8b9ea9b..9488fbbf0442d38c18632f0ed50c23fd
pearl.ownerUUID = null;
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 362eb965a12f14c4381c98bf7b7ec172c581642a..362ec0d4de4f77511651b28d47b8bdac626f935b 100644
index 79cfb5a2cd6fbab93a89914e915b0080f6792caf..66b4bc82c53ce227066625fdc49614bb254dc7f4 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1533,7 +1533,7 @@ public class ServerPlayer extends Player {
@@ -1598,7 +1598,7 @@ public class ServerPlayer extends Player {

@Override
public boolean isInvulnerableTo(DamageSource damageSource) {
Expand All @@ -78,7 +78,7 @@ index 362eb965a12f14c4381c98bf7b7ec172c581642a..362ec0d4de4f77511651b28d47b8bdac

@Override
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
index 036640d49a5e891e9a0f767abe33f1f51d6d4cde..c635ea132c6a5e0f05165a6626d0d9f36fbb0c48 100644
index d8e440e14b72dc48ae97244f1bed2c06abd997ab..1b768034991f73467169c8b33537994c47a1c954 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
@@ -68,7 +68,7 @@ public class EndCrystal extends Entity {
Expand All @@ -91,23 +91,23 @@ index 036640d49a5e891e9a0f767abe33f1f51d6d4cde..c635ea132c6a5e0f05165a6626d0d9f3
|| ((ServerLevel) this.level()).getDragonFight() == null
|| ((ServerLevel) this.level()).getDragonFight().respawnStage == null
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
index e712bd07ea2946167782473a536e0c72fab4bccd..89681445d9d66a7fdbab50c39fd598fb45cd7441 100644
index f1f352ec0e51f5db59254841a06c176c5a876fc9..7482121be813cf1f15be459040ea0a4839bfc26e 100644
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
@@ -72,7 +72,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
@@ -75,7 +75,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {

@Override
public void tick() {
- if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > this.level().spigotConfig.maxTntTicksPerTick) { return; } // Spigot
+ if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > (top.leavesmc.leaves.LeavesConfig.mcTechnicalMode ? 2000 : this.level().spigotConfig.maxTntTicksPerTick)) { return; } // Spigot // Leaves - mc technical survival mode
if (!this.isNoGravity()) {
this.setDeltaMovement(this.getDeltaMovement().add(0.0D, -0.04D, 0.0D));
}
this.applyGravity();
this.move(MoverType.SELF, this.getDeltaMovement());
// Paper start - Configurable TNT height nerf
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
index 156809090f1f83ad68e7e2477a3cfddac5757a8e..7f191b04f7c84f3188b96c108616424bf54170cb 100644
index 74c596264d4da551437bd2a23e1c70022cfc73fc..c677be27b5939b283059b83752331ab2819e460b 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
@@ -119,7 +119,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
@@ -120,7 +120,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
if (nbt.hasUUID("Owner")) {
this.ownerUUID = nbt.getUUID("Owner");
this.cachedOwner = null;
Expand All @@ -117,10 +117,10 @@ index 156809090f1f83ad68e7e2477a3cfddac5757a8e..7f191b04f7c84f3188b96c108616424b

this.leftOwner = nbt.getBoolean("LeftOwner");
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index 93fbf20c6e5ded31570415c30b837f5dc0dd5d42..667a480b7c546bb130bbd32a8ae7ce85d37a6b0a 100644
index 616dc6f7f9cf37c109575d3d33c490054f575592..50879a522a1c9fa817ca226792793c1c3c3e1940 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -95,7 +95,7 @@ public final class NaturalSpawner {
@@ -90,7 +90,7 @@ public final class NaturalSpawner {

if (enumcreaturetype != MobCategory.MISC) {
// Paper start - Only count natural spawns
Expand All @@ -130,10 +130,10 @@ index 93fbf20c6e5ded31570415c30b837f5dc0dd5d42..667a480b7c546bb130bbd32a8ae7ce85
entity.spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) {
continue;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
index 21a64f3a704fb362ed3aade559d55c0804ae5023..006e990d57c7ad1081f63402ef85a3ba856fe329 100644
index e308d9b28af5969d73c65bd7a08241d4d4e9ee95..6461d2c98bdc914c090405ca42b2c88e267001a9 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
@@ -292,7 +292,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@@ -280,7 +280,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
origItemStack.setCount(originalItemCount);
}
}
Expand All @@ -142,7 +142,7 @@ index 21a64f3a704fb362ed3aade559d55c0804ae5023..006e990d57c7ad1081f63402ef85a3ba
hopper.setCooldown(level.spigotConfig.hopperTransfer);
}
return false;
@@ -333,7 +333,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@@ -321,7 +321,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
}
origItemStack.setCount(originalItemCount);

Expand All @@ -151,36 +151,3 @@ index 21a64f3a704fb362ed3aade559d55c0804ae5023..006e990d57c7ad1081f63402ef85a3ba
cooldownHopper(hopper);
}

diff --git a/src/main/java/top/leavesmc/leaves/util/McTechnicalModeHelper.java b/src/main/java/top/leavesmc/leaves/util/McTechnicalModeHelper.java
new file mode 100644
index 0000000000000000000000000000000000000000..4822a3806c55126e219364c3f76d0159a6f6453e
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/util/McTechnicalModeHelper.java
@@ -0,0 +1,27 @@
+package top.leavesmc.leaves.util;
+
+import io.papermc.paper.configuration.GlobalConfiguration;
+import top.leavesmc.leaves.LeavesConfig;
+
+import java.util.Map;
+
+public class McTechnicalModeHelper {
+
+ public static void doMcTechnicalModeIf() {
+ if (LeavesConfig.mcTechnicalMode) {
+ doMcTechnicalMode();
+ }
+ }
+
+ public static void doMcTechnicalMode() {
+ GlobalConfiguration.get().unsupportedSettings.allowPistonDuplication = true;
+ GlobalConfiguration.get().unsupportedSettings.allowHeadlessPistons = true;
+ GlobalConfiguration.get().unsupportedSettings.allowPermanentBlockBreakExploits = true;
+ GlobalConfiguration.get().packetLimiter.allPackets = new GlobalConfiguration.PacketLimiter.PacketLimit(GlobalConfiguration.get().packetLimiter.allPackets.interval(),
+ 5000.0, GlobalConfiguration.get().packetLimiter.allPackets.action());
+ GlobalConfiguration.get().packetLimiter.overrides = Map.of();
+ GlobalConfiguration.get().unsupportedSettings.allowGrindstoneOverstacking = true;
+ GlobalConfiguration.get().itemValidation.resolveSelectorsInBooks = true;
+ GlobalConfiguration.get().scoreboards.saveEmptyScoreboardTeams = true;
+ }
+}
Loading

0 comments on commit 4689cf3

Please sign in to comment.