Skip to content

Commit

Permalink
more work
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaKR93 committed Sep 27, 2023
1 parent 617172a commit 4042f69
Show file tree
Hide file tree
Showing 11 changed files with 167 additions and 196 deletions.
33 changes: 29 additions & 4 deletions patches/server/0006-Plazma-Configurations.patch
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,10 @@ index 0000000000000000000000000000000000000000..85002144e0b350c4ae044e1a4a4c1734
+}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
new file mode 100644
index 0000000000000000000000000000000000000000..31c98e2c869722ea7e396c245be2d0e8c6bb8feb
index 0000000000000000000000000000000000000000..92524f24bdb56a861b06fffc900ff3c118bdb4ee
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -0,0 +1,23 @@
@@ -0,0 +1,33 @@
+package org.plazmamc.plazma.configurations;
+
+import io.papermc.paper.configuration.Configuration;
Expand All @@ -604,13 +604,23 @@ index 0000000000000000000000000000000000000000..31c98e2c869722ea7e396c245be2d0e8
+
+ @Setting(Configuration.VERSION_FIELD)
+ public int version = CURRENT_VERSION;
+
+ public Misc misc;
+ public class Misc extends ConfigurationPart {
+
+ }
+
+ public Player player;
+ public class Player extends ConfigurationPart {
+
+ }
+}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
new file mode 100644
index 0000000000000000000000000000000000000000..629322f0054dff8578ab6980d96db144c04a95f0
index 0000000000000000000000000000000000000000..5e31a23ed4f31cc06562aa7814812242a04ee086
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
@@ -0,0 +1,25 @@
@@ -0,0 +1,40 @@
+package org.plazmamc.plazma.configurations;
+
+import io.papermc.paper.configuration.Configuration;
Expand All @@ -635,6 +645,21 @@ index 0000000000000000000000000000000000000000..629322f0054dff8578ab6980d96db144
+
+ @Setting(Configuration.VERSION_FIELD)
+ public int version = CURRENT_VERSION;
+
+ public GlobalConfiguration.Misc misc;
+ public class Misc extends ConfigurationPart {
+
+ }
+
+ public Structure structure;
+ public class Structure extends ConfigurationPart {
+
+ public NetherPortal netherPortal;
+ public class NetherPortal extends ConfigurationPart {
+
+ }
+
+ }
+}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
new file mode 100644
Expand Down
8 changes: 4 additions & 4 deletions patches/server/0009-Console-logging-tweaks.patch
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ index a970e00482952318c258fc406cb7c39a229b65bc..879c090d9c4574a2cd45a0eb1bf9cb17
if (!OldUsersConverter.serverReadyAfterUserconversion(this)) {
return false;
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index 31c98e2c869722ea7e396c245be2d0e8c6bb8feb..ac7089a174365a0e31cfa9eb7bd79148622e1b0c 100644
index 92524f24bdb56a861b06fffc900ff3c118bdb4ee..25cd126e676e7114dea5357acbbbc3ed52c82e39 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -20,4 +20,12 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -30,4 +30,12 @@ public class GlobalConfiguration extends ConfigurationPart {
public class Player extends ConfigurationPart {

@Setting(Configuration.VERSION_FIELD)
public int version = CURRENT_VERSION;
}
+
+ public ConsoleLogs consoleLogs;
+ public class ConsoleLogs extends ConfigurationPart {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ index b875f4af9dcb45bcad0ee59a958442ba673268fe..d38685f82d2e6c4e71179bf3a85a8b18
// Paper start - validate usernames
if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation) {
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index aa6e455f9f94e33085a7c29ec3b5222eb24957df..1c6ab6665788ac4484ff7cda0488604a01e53214 100644
index 25cd126e676e7114dea5357acbbbc3ed52c82e39..351379de0811b3dc610e8bb0b526b3431e856b1c 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -32,5 +32,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -29,6 +29,8 @@ public class GlobalConfiguration extends ConfigurationPart {
public Player player;
public class Player extends ConfigurationPart {

+ public boolean allowAnyUsername = false;
+
}
}

public ConsoleLogs consoleLogs;
20 changes: 0 additions & 20 deletions patches/server/0010-Player-configuration-section.patch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ index 9cc09f0415a09299102dbcf022326944368ea033..2e9e63f3ee6268cafa3b90666cf31019
scanDirectory(resourceManager, this.directory, this.gson, map);
return map;
diff --git a/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
index 7ab57748b2f2aea1003d9b7e70e76c372aa1e432..da21380a84d4dcbeaf965b2202e5209b82a82529 100644
index 7ab57748b2f2aea1003d9b7e70e76c372aa1e432..7de117e0464a24da632d134870554fd11e1b87ca 100644
--- a/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
+++ b/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
@@ -2,19 +2,19 @@ package net.minecraft.server.packs.resources;
Expand All @@ -248,21 +248,21 @@ index 7ab57748b2f2aea1003d9b7e70e76c372aa1e432..da21380a84d4dcbeaf965b2202e5209b
public abstract class SimplePreparableReloadListener<T> implements PreparableReloadListener {
@Override
- public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
+ public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) {
+ public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
return CompletableFuture.supplyAsync(() -> {
- return this.prepare(manager, prepareProfiler);
+ return this.prepare(manager/*, prepareProfiler*/);
+ return this.prepare(manager/*, prepareProfiler*/); // Plazma - Completely remove profiler
}, prepareExecutor).thenCompose(synchronizer::wait).thenAcceptAsync((prepared) -> {
- this.apply(prepared, manager, applyProfiler);
+ this.apply(prepared, manager/*, applyProfiler*/);
+ this.apply(prepared, manager/*, applyProfiler*/); // Plazma - Completely remove profiler
}, applyExecutor);
}

- protected abstract T prepare(ResourceManager manager, ProfilerFiller profiler);
+ protected abstract T prepare(ResourceManager manager/*, ProfilerFiller profiler*/);
+ protected abstract T prepare(ResourceManager manager/*, ProfilerFiller profiler*/); // Plazma - Completely remove profiler

- protected abstract void apply(T prepared, ResourceManager manager, ProfilerFiller profiler);
+ protected abstract void apply(T prepared, ResourceManager manager/*, ProfilerFiller profiler*/);
+ protected abstract void apply(T prepared, ResourceManager manager/*, ProfilerFiller profiler*/); // Plazma - Completely remove profiler
}
diff --git a/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java b/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java
index de2ecc7c69fb870f843f60596115866214267ee4..05a731dec4aec1d3cf61a761bda018cc8c46afde 100644
Expand Down Expand Up @@ -891,7 +891,7 @@ index dd375fffa727db76fa989248b9b836960974c372..45161f960a29395538c67461ebf864e5
CompletableFuture<?>[] acompletablefuture = (CompletableFuture[]) LootDataType.values().map((lootdatatype) -> {
return LootDataManager.scheduleElementParse(lootdatatype, manager, prepareExecutor, map);
diff --git a/src/main/java/net/minecraft/world/ticks/LevelTicks.java b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
index 0043c0087896a6df6910b0500da37d84b287c901..a7b4d38bf7d2f8c1ba42d64b7ffd577d6fca5378 100644
index 0043c0087896a6df6910b0500da37d84b287c901..17a5928afade7e477cda34365dc8c72c52a6b758 100644
--- a/src/main/java/net/minecraft/world/ticks/LevelTicks.java
+++ b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
@@ -23,7 +23,7 @@ import net.minecraft.Util;
Expand All @@ -917,7 +917,7 @@ index 0043c0087896a6df6910b0500da37d84b287c901..a7b4d38bf7d2f8c1ba42d64b7ffd577d
};

- public LevelTicks(LongPredicate tickingFutureReadyPredicate, Supplier<ProfilerFiller> profilerGetter) {
+ public LevelTicks(LongPredicate tickingFutureReadyPredicate/*, Supplier<ProfilerFiller> profilerGetter*/) {
+ public LevelTicks(LongPredicate tickingFutureReadyPredicate/*, Supplier<ProfilerFiller> profilerGetter*/) { // Plazma - Completely remove profiler
this.tickCheck = tickingFutureReadyPredicate;
- this.profiler = profilerGetter;
+ //this.profiler = profilerGetter; // Plazma - Completely remove profiler
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <[email protected]>
Date: Wed, 27 Sep 2023 18:29:51 +0900
Subject: [PATCH] Add some missing Pufferfish configurations


diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
index c97ef420581803b569d130b58a97f67d1fee54f2..e562dffdf84612b50c5d464f9913cfe8ec5c6279 100644
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
@@ -168,10 +168,12 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
return dimensions.height - 0.1F * this.getScale();
}

+ private int behaviorTick = 0; // Plazma - Add missing pufferfish configurations
@Override
protected void customServerAiStep() {
//this.level().getProfiler().push("camelBrain"); // Purpur
Brain<Camel> brain = (Brain<Camel>) this.getBrain(); // Paper - decompile fix
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations
brain.tick((ServerLevel)this.level(), this);
//this.level().getProfiler().pop(); // Purpur
//this.level().getProfiler().push("camelActivityUpdate"); // Purpur
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
index 795c93352dfa69fad0e034a8377eceb6dc1e81da..e743b4891c1e56f82d40f798e456a701b0efbc73 100644
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
@@ -527,9 +527,11 @@ public class Sniffer extends Animal {
return Brain.provider(SnifferAi.MEMORY_TYPES, SnifferAi.SENSOR_TYPES);
}

+ private int behaviorTick; // Plazma - Add missing pufferfish configurations
@Override
protected void customServerAiStep() {
//this.level().getProfiler().push("snifferBrain"); // Purpur
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations
this.getBrain().tick((ServerLevel) this.level(), this);
//this.level().getProfiler().popPush("snifferActivityUpdate"); // Purpur
SnifferAi.updateActivity(this);
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
index 66d47c1613532189e761c0f48d893652c17fe240..8a5d8f9ad1bd94ca53c1ffd1872275c07a52f0b7 100644
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
@@ -319,7 +319,7 @@ public class Warden extends Monster implements VibrationSystem {
ServerLevel worldserver = (ServerLevel) this.level();

//worldserver.getProfiler().push("wardenBrain"); // Purpur
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Plazma
this.getBrain().tick(worldserver, this);
//this.level().getProfiler().pop(); // Purpur
super.customServerAiStep();
70 changes: 70 additions & 0 deletions patches/server/0014-Configurable-nether-portal-size.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <[email protected]>
Date: Sat, 25 Mar 2023 00:10:52 +0900
Subject: [PATCH] Configurable nether portal size

Configurable nether portal size

diff --git a/src/main/java/net/minecraft/world/level/portal/PortalShape.java b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
index e7554ec800f321e4e34c926c53f2375a8c3aa979..c7f974e0b614afa1ced716ff7b6c67ee037a4071 100644
--- a/src/main/java/net/minecraft/world/level/portal/PortalShape.java
+++ b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
@@ -100,7 +100,7 @@ public class PortalShape {
private int calculateWidth() {
int i = this.getDistanceUntilEdgeAboveFrame(this.bottomLeft, this.rightDir);

- return i >= 2 && i <= 21 ? i : 0;
+ return i >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.width.min() && i <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.width.max() ? i : 0; // Plazma
}

private int getDistanceUntilEdgeAboveFrame(BlockPos pos, Direction direction) {
@@ -133,7 +133,7 @@ public class PortalShape {
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
int i = this.getDistanceUntilTop(blockposition_mutableblockposition);

- return i >= 3 && i <= 21 && this.hasTopFrame(blockposition_mutableblockposition, i) ? i : 0;
+ return i >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.height.min() && i <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.height.max() && this.hasTopFrame(blockposition_mutableblockposition, i) ? i : 0; // Plazma
}

private boolean hasTopFrame(BlockPos.MutableBlockPos pos, int height) {
@@ -187,7 +187,7 @@ public class PortalShape {
}

public boolean isValid() {
- return this.bottomLeft != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
+ return this.bottomLeft != null && this.width >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.width.min() && this.width <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.width.max() && this.height >= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.height.min() && this.height <= this.level.getMinecraftWorld().plazmaLevelConfiguration().structure.netherPortal.size.height.max(); // Plazma
}

// CraftBukkit start - return boolean
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
index 5e31a23ed4f31cc06562aa7814812242a04ee086..0d4139ec1a34510bc8f96f2cbcb913626fd26b65 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
@@ -34,6 +34,27 @@ public class LevelConfigurations extends ConfigurationPart {
public NetherPortal netherPortal;
public class NetherPortal extends ConfigurationPart {

+ public Size size;
+ public class Size extends ConfigurationPart {
+
+ public Width width;
+ public class Width extends ConfigurationPart {
+
+ int min; public int min() { return Math.max(this.min, 1); }
+ int max; public int max() { return Math.max(this.min, this.max); }
+
+ }
+
+ public Height height;
+ public class Height extends ConfigurationPart {
+
+ int min; public int min() { return Math.max(this.min, 2); }
+ int max; public int max() { return Math.max(this.min, this.max); }
+
+ }
+
+ }
+
}

}
32 changes: 0 additions & 32 deletions patches/unapplied/server/0017-Structure-Configuration.patch

This file was deleted.

Loading

0 comments on commit 4042f69

Please sign in to comment.