Skip to content

Commit

Permalink
Move Config (1)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Nov 28, 2024
1 parent ae6d5d6 commit 36b42ca
Show file tree
Hide file tree
Showing 39 changed files with 239 additions and 246 deletions.
8 changes: 4 additions & 4 deletions patches/server/0001-Build-changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ index ca8b6a926dfff3fdd6b04228809a4480366120b2..f77f04f7312a528d3f898c6c4b8603ab
@Override
public String getBrand() {
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
index 4b002e8b75d117b726b0de274a76d3596fce015b..03373e5a37a5f90d31434aab921ec8c6b6efef70 100644
index 4b002e8b75d117b726b0de274a76d3596fce015b..f6b362894bbd0f0f09f0f51a931529d708ca9b9e 100644
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -593,7 +593,8 @@ public class Metrics {
Expand All @@ -122,7 +122,7 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..03373e5a37a5f90d31434aab921ec8c6
+ return "unknown";
+ }));
+
+ if (org.leavesmc.leaves.LeavesConfig.bstatsPrivacyMode) {
+ if (org.leavesmc.leaves.LeavesConfig.mics.bstatsPrivacyMode) {
+ return;
+ }
+
Expand Down Expand Up @@ -197,7 +197,7 @@ index 790bad0494454ca12ee152e3de6da3da634d9b20..c060857cb0551fff8f5033553b887f3a
private static final String BUILD_DEV = "DEV";

diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 64b56abf8900d0424100da460fc68ac964394793..7f0d05c242c649b3f0482334306898dedd1d5c43 100644
index 64b56abf8900d0424100da460fc68ac964394793..9d5de69b85aff3d94f08c212eed76bd5ed0e39e9 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1262,7 +1262,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Expand All @@ -214,7 +214,7 @@ index 64b56abf8900d0424100da460fc68ac964394793..7f0d05c242c649b3f0482334306898de
@DontObfuscate
public String getServerModName() {
- return io.papermc.paper.ServerBuildInfo.buildInfo().brandName(); // Paper
+ return org.leavesmc.leaves.LeavesConfig.serverModName; // Leaves - Custom // Paper
+ return org.leavesmc.leaves.LeavesConfig.mics.serverModName; // Leaves - Custom // Paper
}

public SystemReport fillSystemReport(SystemReport details) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Make snowball and egg can knockback player


diff --git a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
index 70961e151666a0ecf5b791853f4581eaebbdcc8b..e1ce8159c757e3e8ad5daa5d146346349c8bcea5 100644
index 70961e151666a0ecf5b791853f4581eaebbdcc8b..5d9834ce6a8f892339438a4fe262c9f5d52484fb 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
@@ -61,6 +61,13 @@ public class Snowball extends ThrowableItemProjectile {
Expand All @@ -14,7 +14,7 @@ index 70961e151666a0ecf5b791853f4581eaebbdcc8b..e1ce8159c757e3e8ad5daa5d14634634
entity.hurt(this.damageSources().thrown(this, this.getOwner()), (float) i);
+
+ // Leaves start - make snowball can knockback player
+ if (org.leavesmc.leaves.LeavesConfig.snowballAndEggCanKnockback && entity instanceof net.minecraft.server.level.ServerPlayer player) {
+ if (org.leavesmc.leaves.LeavesConfig.modify.snowballAndEggCanKnockback && entity instanceof net.minecraft.server.level.ServerPlayer player) {
+ player.hurt(this.damageSources().thrown(this, this.getOwner()), 0.0000001F);
+ player.knockback(0.4000000059604645D, this.getX() - player.getX(), this.getZ() - player.getZ(), this, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.DAMAGE);
+ }
Expand All @@ -23,15 +23,15 @@ index 70961e151666a0ecf5b791853f4581eaebbdcc8b..e1ce8159c757e3e8ad5daa5d14634634

@Override
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownEgg.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownEgg.java
index 155c2bbd35adacb7c3668fbe81a7c454e5102c8b..1a07612522ef2369ebecda2c8a31b13bd563bb0b 100644
index 155c2bbd35adacb7c3668fbe81a7c454e5102c8b..26696c09a2ce5c483dc2f723689ed985445663b8 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownEgg.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownEgg.java
@@ -52,6 +52,12 @@ public class ThrownEgg extends ThrowableItemProjectile {
protected void onHitEntity(EntityHitResult entityHitResult) {
super.onHitEntity(entityHitResult);
entityHitResult.getEntity().hurt(this.damageSources().thrown(this, this.getOwner()), 0.0F);
+ // Leaves start - make egg can knockback player
+ if (org.leavesmc.leaves.LeavesConfig.snowballAndEggCanKnockback && entityHitResult.getEntity() instanceof ServerPlayer player) {
+ if (org.leavesmc.leaves.LeavesConfig.modify.snowballAndEggCanKnockback && entityHitResult.getEntity() instanceof ServerPlayer player) {
+ player.hurt(this.damageSources().thrown(this, this.getOwner()), 0.0000001F);
+ player.knockback(0.4000000059604645D, this.getX() - player.getX(), this.getZ() - player.getZ(), this, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.DAMAGE);
+ }
Expand Down
Loading

0 comments on commit 36b42ca

Please sign in to comment.