2020-08-03 18:48:42 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2020-10-27 20:15:13 +01:00
From: YatopiaMC <yatopiamc@gmail.com>
Date: Sun, 25 Oct 2020 12:23:35 -0500
2020-08-07 02:59:57 +02:00
Subject: [PATCH] Yatopia-Server-Fixes
2020-08-03 18:48:42 +02:00
2020-08-03 21:25:54 +02:00
diff --git a/src/main/java/de/minebench/origami/OrigamiConfig.java b/src/main/java/de/minebench/origami/OrigamiConfig.java
2020-10-04 17:43:50 +02:00
index fe7330fabe386966c2d203a190a00a785ea21be0..537456a7427cddd6783f5b5d8ee2d655668c4c53 100644
2020-08-03 21:25:54 +02:00
--- a/src/main/java/de/minebench/origami/OrigamiConfig.java
+++ b/src/main/java/de/minebench/origami/OrigamiConfig.java
2020-08-13 17:53:32 +02:00
@@ -16,7 +16,7 @@ public final class OrigamiConfig {
private static final Object[] EMPTY = new Object[0];
private static File configFile;
- private static YamlConfiguration config;
2020-08-16 11:07:31 +02:00
+ public static YamlConfiguration config; // Yatopia
2020-08-13 17:53:32 +02:00
private static int configVersion;
public static void init(final File file) {
2020-10-04 17:43:50 +02:00
@@ -112,6 +112,28 @@ public final class OrigamiConfig {
2020-08-03 21:25:54 +02:00
config.addDefault("worlds.default." + path, Double.valueOf(dfl));
return config.getDouble("worlds." + worldName + "." + path, config.getDouble("worlds.default." + path, dfl));
}
2020-08-05 02:27:24 +02:00
+
2020-10-04 17:43:50 +02:00
+ public boolean tickEmptyHoppers = false;
+ public int fullHopperCooldown = 128;
+ private void hopperOptimizations() {
+ tickEmptyHoppers = getBoolean("tick-empty-hoppers", tickEmptyHoppers);
+ fullHopperCooldown = getInt("ticks-per.full-hopper-cooldown", fullHopperCooldown);
+ }
+
2020-09-12 08:31:53 +02:00
+ public boolean fastFeatureSearchDontLoad = false;
+ private void fastFeatureSearchDontLoad() {
+ fastFeatureSearchDontLoad = getBoolean("fast-feature-search-dont-load", false);
+ }
+
2020-08-15 18:18:36 +02:00
+ public boolean pigmenDontTargetUnlessHit = false;
+ private void pigmenDontTargetUnlessHit() {
+ pigmenDontTargetUnlessHit = getBoolean("pigmen.dont-target-unless-hit", pigmenDontTargetUnlessHit);
+ }
+
+ public boolean disableObserverClocks = false;
+ private void observerClock() {
+ disableObserverClocks = getBoolean("disable-observer-clocks", disableObserverClocks);
+ }
2020-08-03 21:25:54 +02:00
}
}
\ No newline at end of file
diff --git a/src/main/java/de/minebench/origami/OrigamiConfig.java.rej b/src/main/java/de/minebench/origami/OrigamiConfig.java.rej
deleted file mode 100644
2020-08-15 18:18:36 +02:00
index 02f5ccf54210776770d3215afb7c8e82f750d57e..0000000000000000000000000000000000000000
2020-08-03 21:25:54 +02:00
--- a/src/main/java/de/minebench/origami/OrigamiConfig.java.rej
+++ /dev/null
2020-08-15 18:18:36 +02:00
@@ -1,12 +0,0 @@
2020-08-03 21:25:54 +02:00
-diff a/src/main/java/de/minebench/origami/OrigamiConfig.java b/src/main/java/de/minebench/origami/OrigamiConfig.java (rejected hunks)
2020-08-15 18:18:36 +02:00
-@@ -153,6 +153,10 @@ public final class OrigamiConfig {
- public int getTickRate(String type, String typeName, String entityType, int def) {
- return tickRates.getOrDefault(type + "." + entityType + "." + typeName, tickRates.getOrDefault(type + "." + typeName, def));
2020-08-03 21:25:54 +02:00
- }
2020-08-15 18:18:36 +02:00
-+ public boolean pigmenDontTargetUnlessHit = false;
-+ private void pigmenDontTargetUnlessHit() {
-+ pigmenDontTargetUnlessHit = getBoolean("pigmen.dont-target-unless-hit", pigmenDontTargetUnlessHit);
2020-08-03 21:25:54 +02:00
-+ }
2020-08-15 18:18:36 +02:00
- public int pigmenPortalSpawn = 2000;
- public double pigmenPortalBoost = 0.0;
- public boolean pigmenFarmsWaterAi = false;
2020-09-13 07:22:23 +02:00
diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java
index e811295b4d6afcd920f60e0ce5440e43300d9085..d1064bd1c76eb23ce12e4a0703ce9f2622952897 100644
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
@@ -111,6 +111,7 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
return this.distanceSquared((double) baseblockposition.getX(), (double) baseblockposition.getY(), (double) baseblockposition.getZ(), false) < d0 * d0;
}
+ public final boolean distanceSquared(IPosition pos, double dist) { return a(pos, dist); } // Yatopia - OBFHELPER
public boolean a(IPosition iposition, double d0) {
return this.distanceSquared(iposition.getX(), iposition.getY(), iposition.getZ(), true) < d0 * d0;
}
2020-08-15 18:18:36 +02:00
diff --git a/src/main/java/net/minecraft/server/Behavior.java b/src/main/java/net/minecraft/server/Behavior.java
2020-11-07 08:02:33 +01:00
index fb4a5ca220c9ef0916ecd4249a0ec7d1d8024ef1..899ca7bf676ccd874e317ba7e19b733fbf444baa 100644
2020-08-15 18:18:36 +02:00
--- a/src/main/java/net/minecraft/server/Behavior.java
+++ b/src/main/java/net/minecraft/server/Behavior.java
@@ -11,6 +11,7 @@ public abstract class Behavior<E extends EntityLiving> {
private long c;
private final int d;
private final int e;
+ co.aikar.timings.Timing timing; // Origami - behavior timing
public Behavior(Map<MemoryModuleType<?>, MemoryStatus> map) {
this(map, 60);
@@ -25,6 +26,9 @@ public abstract class Behavior<E extends EntityLiving> {
this.d = i;
this.e = j;
this.a = map;
+ // Origami start - behavior timing
+ timing = co.aikar.timings.WorldTimingsHandler.getBehaviorTimings(getClass().getSimpleName());
+ // Origami end
}
public Behavior.Status a() {
diff --git a/src/main/java/net/minecraft/server/Behavior.java.rej b/src/main/java/net/minecraft/server/Behavior.java.rej
deleted file mode 100644
index c3d129452b4f6ff2069bc066e594b1c632ceb0d4..0000000000000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/Behavior.java.rej
+++ /dev/null
@@ -1,19 +0,0 @@
-diff a/src/main/java/net/minecraft/server/Behavior.java b/src/main/java/net/minecraft/server/Behavior.java (rejected hunks)
-@@ -15,6 +15,7 @@ public abstract class Behavior<E extends EntityLiving> {
- private final String configKey;
- private static final String RATE_TYPE = "behavior";
- // Origami end
-+ co.aikar.timings.Timing timing; // Origami - behavior timing
-
- public Behavior(Map<MemoryModuleType<?>, MemoryStatus> map) {
- this(map, 60);
-@@ -37,6 +38,9 @@ public abstract class Behavior<E extends EntityLiving> {
- }
- this.configKey = key;
- // Origami end
-+ // Origami start - behavior timing
-+ timing = co.aikar.timings.WorldTimingsHandler.getBehaviorTimings(key);
-+ // Origami end
2020-08-03 21:25:54 +02:00
- }
-
2020-08-15 18:18:36 +02:00
- public Behavior.Status a() {
2020-08-15 11:43:24 +02:00
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 2291135eaef64c403183724cb6e413cd7e472672..6fcc7ed7c129e6a33386d65b37cbba4a44e96f0f 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -56,6 +56,12 @@ public class BlockPosition extends BaseBlockPosition {
this(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ());
}
+ // Yatopia start - helper method
+ public BlockPosition(Entity entity) {
+ this(entity.locX(), entity.locY(), entity.locZ());
+ }
+ // Yatopia end
+
public static long getAdjacent(int baseX, int baseY, int baseZ, EnumDirection enumdirection) { return asLong(baseX + enumdirection.getAdjacentX(), baseY + enumdirection.getAdjacentY(), baseZ + enumdirection.getAdjacentZ()); } // Paper
public static long a(long i, EnumDirection enumdirection) {
return a(i, enumdirection.getAdjacentX(), enumdirection.getAdjacentY(), enumdirection.getAdjacentZ());
2020-12-23 08:46:56 +01:00
diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java
2020-12-23 09:35:14 +01:00
index cabce1a8ba5db56495628edd9bc796aee7a53356..9754a9eac48c50efdefdceefbb4386bf0df583dd 100644
2020-12-23 08:46:56 +01:00
--- a/src/main/java/net/minecraft/server/CommandDispatcher.java
+++ b/src/main/java/net/minecraft/server/CommandDispatcher.java
2020-12-23 09:35:14 +01:00
@@ -107,6 +107,7 @@ public class CommandDispatcher {
CommandIdleTimeout.a(this.b);
CommandStop.a(this.b);
CommandWhitelist.a(this.b);
+ net.pl3x.purpur.command.TPSBarCommand.register(getDispatcher()); // Purpur
}
if (commanddispatcher_servertype.d) {
@@ -337,6 +338,7 @@ public class CommandDispatcher {
2020-12-23 08:46:56 +01:00
}
+ public static LiteralArgumentBuilder<CommandListenerWrapper> literal(String s) { return a(s); } // Purpur - OBFHELPER
public static LiteralArgumentBuilder<CommandListenerWrapper> a(String s) {
return LiteralArgumentBuilder.literal(s);
}
2020-12-23 09:35:14 +01:00
@@ -356,6 +358,7 @@ public class CommandDispatcher {
};
}
+ public com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> getDispatcher() { return a(); } // Purpur - OBFHELPER
public com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> a() {
return this.b;
}
diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java.rej b/src/main/java/net/minecraft/server/CommandDispatcher.java.rej
deleted file mode 100644
index 7c1db96ec8692728e204a7d8490d74cf53b096a5..0000000000000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/CommandDispatcher.java.rej
+++ /dev/null
@@ -1,9 +0,0 @@
-diff a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java (rejected hunks)
-@@ -109,6 +109,7 @@ public class CommandDispatcher {
- CommandWhitelist.a(this.b);
- net.pl3x.purpur.command.DemoCommand.register(getDispatcher()); // Purpur
- net.pl3x.purpur.command.PingCommand.register(getDispatcher()); // Purpur
-+ net.pl3x.purpur.command.TPSBarCommand.register(getDispatcher()); // Purpur
- }
-
- if (commanddispatcher_servertype.d) {
2020-12-23 08:46:56 +01:00
diff --git a/src/main/java/net/minecraft/server/CommandListenerWrapper.java b/src/main/java/net/minecraft/server/CommandListenerWrapper.java
index 86f1cfe454ea0a989775b49a6b88375c766ef647..da53af61d1171db3c167c6e007adf95355771653 100644
--- a/src/main/java/net/minecraft/server/CommandListenerWrapper.java
+++ b/src/main/java/net/minecraft/server/CommandListenerWrapper.java
@@ -189,6 +189,7 @@ public class CommandListenerWrapper implements ICompletionProvider, com.destroys
}
}
+ public EntityPlayer getPlayerOrException() throws CommandSyntaxException { return h(); } // Purpur - OBFHELPER
public EntityPlayer h() throws CommandSyntaxException {
if (!(this.k instanceof EntityPlayer)) {
throw CommandListenerWrapper.a.create();
2020-08-13 17:53:32 +02:00
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
2020-12-28 10:34:56 +01:00
index 77100ab382b33aef8b2194b611c0b1d454da91fd..1ece3e1e9e7a26f1ee07202916687f627c9e4c95 100644
2020-08-13 17:53:32 +02:00
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
2020-12-01 08:42:51 +01:00
@@ -434,7 +434,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
2020-08-13 17:53:32 +02:00
public void setPosition(double d0, double d1, double d2) {
this.setPositionRaw(d0, d1, d2);
//this.a(this.size.a(d0, d1, d2)); // Paper - move into setPositionRaw
- if (valid) ((WorldServer) world).chunkCheck(this); // CraftBukkit
+ if (valid && !dead) ((WorldServer) world).chunkCheck(this); // CraftBukkit // Purpur
}
2020-11-07 08:02:33 +01:00
protected void af() {
2020-08-03 18:48:42 +02:00
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
2020-12-13 16:18:57 +01:00
index 171e8553a339eb3c995369f274de86b824183ca6..4103f3c39e2ed7466824e8fecbb8d21b515b5f01 100644
2020-08-03 18:48:42 +02:00
--- a/src/main/java/net/minecraft/server/EntityVillager.java
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
2020-10-08 13:04:22 +02:00
@@ -92,6 +92,13 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
2020-10-04 17:43:50 +02:00
return behaviorcontroller;
}
+ // Purpur start
+ @Override
+ public boolean a(EntityHuman entityhuman) {
+ return world.purpurConfig.villagerCanBeLeashed && !this.isLeashed();
+ }
+ // Purpur end
+
public void c(WorldServer worldserver) {
BehaviorController<EntityVillager> behaviorcontroller = this.getBehaviorController();
2020-08-03 18:48:42 +02:00
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java.rej b/src/main/java/net/minecraft/server/EntityVillager.java.rej
deleted file mode 100644
2020-10-04 17:43:50 +02:00
index 538b2c92e050176a1ac0bb4c2315f5b22c7f8eac..0000000000000000000000000000000000000000
2020-08-03 18:48:42 +02:00
--- a/src/main/java/net/minecraft/server/EntityVillager.java.rej
+++ /dev/null
2020-10-04 17:43:50 +02:00
@@ -1,13 +0,0 @@
2020-08-03 18:48:42 +02:00
-diff a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java (rejected hunks)
2020-10-04 17:43:50 +02:00
-@@ -79,6 +79,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
- protected void initPathfinder() {
- if (world.purpurConfig.villagerFollowEmeraldBlock) this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.0D, false, TEMPT_ITEMS));
2020-08-14 20:16:57 +02:00
- }
2020-10-04 17:43:50 +02:00
-+
-+ @Override
-+ public boolean a(EntityHuman entityhuman) {
-+ return world.purpurConfig.villagerCanBeLeashed && !this.isLeashed();
-+ }
- // Purpur end
2020-08-14 20:16:57 +02:00
-
2020-10-04 17:43:50 +02:00
- @Override
2020-08-18 10:57:12 +02:00
diff --git a/src/main/java/net/minecraft/server/IProjectile.java b/src/main/java/net/minecraft/server/IProjectile.java
2020-12-01 08:42:51 +01:00
index 9f5ce64a60fe7c312399ee416b11b84213dd3bee..64c08d830c358247186cf4e5fcf2010ed43f0f02 100644
2020-08-18 10:57:12 +02:00
--- a/src/main/java/net/minecraft/server/IProjectile.java
+++ b/src/main/java/net/minecraft/server/IProjectile.java
@@ -13,6 +13,7 @@ public abstract class IProjectile extends Entity {
private UUID shooter;
private int c;
private boolean d;
+ public int despawnCounter; // Purpur - moved from EntityArrow
IProjectile(EntityTypes<? extends IProjectile> entitytypes, World world) {
super(entitytypes, world);
2020-12-01 08:42:51 +01:00
@@ -27,6 +28,19 @@ public abstract class IProjectile extends Entity {
}
+ // Purpur start
+ protected final void tickDespawnCounter() {
+ if (this.getPurpurDespawnRate() != -1) {
+ ++this.despawnCounter;
+ if (this.despawnCounter >= this.getPurpurDespawnRate()) {
+ this.die();
+ }
+ }
+ }
+
+ protected abstract int getPurpurDespawnRate();
+ // Purpur end
+
@Nullable
public Entity getShooter() {
// Paper start - MC-50319 - shooter might be in another world (arrows through portals)
@@ -72,6 +86,12 @@ public abstract class IProjectile extends Entity {
2020-08-18 10:57:12 +02:00
}
super.tick();
+
+ // Purpur start
+ if (!(this instanceof EntityArrow)) {
2020-10-12 18:16:14 +02:00
+ this.tickDespawnCounter();
2020-08-18 10:57:12 +02:00
+ }
+ // Purpur end
}
private boolean h() {
diff --git a/src/main/java/net/minecraft/server/IProjectile.java.rej b/src/main/java/net/minecraft/server/IProjectile.java.rej
deleted file mode 100644
2020-12-01 08:42:51 +01:00
index f9080f6f15f51ac6ce521f062010d4485fb97524..0000000000000000000000000000000000000000
2020-08-18 10:57:12 +02:00
--- a/src/main/java/net/minecraft/server/IProjectile.java.rej
+++ /dev/null
2020-12-01 08:42:51 +01:00
@@ -1,40 +0,0 @@
2020-08-18 10:57:12 +02:00
-diff a/src/main/java/net/minecraft/server/IProjectile.java b/src/main/java/net/minecraft/server/IProjectile.java (rejected hunks)
2020-12-01 08:42:51 +01:00
-@@ -13,11 +13,25 @@ public abstract class IProjectile extends Entity {
2020-08-18 10:57:12 +02:00
- private UUID shooter;
- private int c;
- private boolean d; public boolean leftOwner() { return d; } public void setLeftOwner(boolean leftOwner) { this.d = leftOwner; } // Purpur - OBFHELPER
-+ public int despawnCounter; // Purpur - moved from EntityArrow
-
- IProjectile(EntityTypes<? extends IProjectile> entitytypes, World world) {
- super(entitytypes, world);
2020-12-01 08:42:51 +01:00
- }
-
-+ // Purpur start
-+ protected final void tickDespawnCounter() {
-+ if (this.getPurpurDespawnRate() != -1) {
-+ ++this.despawnCounter;
-+ if (this.despawnCounter >= this.getPurpurDespawnRate()) {
-+ this.die();
-+ }
-+ }
-+ }
-+
-+ protected abstract int getPurpurDespawnRate();
-+ // Purpur end
-+
- public void setShooter(@Nullable Entity entity) {
- if (entity != null) {
- this.shooter = entity.getUniqueID();
-@@ -72,6 +86,12 @@ public abstract class IProjectile extends Entity {
2020-08-18 10:57:12 +02:00
- }
-
- super.tick();
-+
-+ // Purpur start
2020-09-20 20:45:23 +02:00
-+ if (!(this instanceof EntityArrow)) { // EntityArrow handles its own despawn counter
-+ this.tickDespawnCounter();
2020-08-18 10:57:12 +02:00
-+ }
-+ // Purpur end
- }
-
- public boolean checkIfLeftOwner() { return this.h(); } // Purpur - OBFHELPER
2020-08-03 21:25:54 +02:00
diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java
2020-11-15 14:39:13 +01:00
index a62c87bceab2c9700a7b3925f208b0ffa2b9b393..1a6c593f5f20fb3a8e87ccb70cd3de7f0dcb0327 100644
2020-08-03 21:25:54 +02:00
--- a/src/main/java/net/minecraft/server/StructureGenerator.java
+++ b/src/main/java/net/minecraft/server/StructureGenerator.java
2020-11-15 14:39:13 +01:00
@@ -151,6 +151,11 @@ public abstract class StructureGenerator<C extends WorldGenFeatureConfiguration>
}
}
// Paper end
2020-08-03 21:25:54 +02:00
+ // Origami start - seed based feature search doesn't load
+ if (iworldreader instanceof World && ((World) iworldreader).origamiConfig.fastFeatureSearchDontLoad) {
+ return chunkcoordintpair.l();
+ }
+ // Origami end
IChunkAccess ichunkaccess = iworldreader.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z, ChunkStatus.STRUCTURE_STARTS);
StructureStart<?> structurestart = structuremanager.a(SectionPosition.a(ichunkaccess.getPos(), 0), this, ichunkaccess);
diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java.rej b/src/main/java/net/minecraft/server/StructureGenerator.java.rej
deleted file mode 100644
2020-11-15 14:39:13 +01:00
index dd52a8fe4fd46e57a5d1af49ba1965a483cf4fcc..0000000000000000000000000000000000000000
2020-08-03 21:25:54 +02:00
--- a/src/main/java/net/minecraft/server/StructureGenerator.java.rej
+++ /dev/null
@@ -1,13 +0,0 @@
-diff a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java (rejected hunks)
2020-11-15 14:39:13 +01:00
-@@ -151,6 +151,11 @@ public abstract class StructureGenerator<C extends WorldGenFeatureConfiguration>
- }
- }
- // Paper end
2020-08-03 21:25:54 +02:00
-+ // Origami start - seed based feature search doesn't load
-+ if (iworldreader instanceof World && ((World) iworldreader).origamiConfig.fastFeatureSearchDontLoad) {
-+ return chunkcoordintpair.l();
-+ }
-+ // Origami end
- // Origami start - option to only find generated features to not generate new chunks
- IChunkAccess ichunkaccess = iworldreader.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z, ChunkStatus.STRUCTURE_STARTS, !(iworldreader instanceof World) || !((World) iworldreader).origamiConfig.onlyFindGeneratedFeatures);
- if (ichunkaccess == null) {
2020-08-03 18:48:42 +02:00
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
2021-01-03 12:41:36 +01:00
index c2b5874a77ae8a992bc668dc19f5300bebf3d239..3bbfb0117187a26354fa58ec46eeb6e62845851e 100644
2020-08-03 18:48:42 +02:00
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
2020-09-13 09:00:43 +02:00
@@ -96,6 +96,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
2020-08-03 18:48:42 +02:00
public final com.tuinity.tuinity.config.TuinityConfig.WorldConfig tuinityConfig; // Tuinity - Server Config
2020-08-11 17:38:17 +02:00
public final net.pl3x.purpur.PurpurWorldConfig purpurConfig; // Purpur
2020-08-13 17:53:32 +02:00
+ public final de.minebench.origami.OrigamiConfig.WorldConfig origamiConfig; // Origami - World config
2020-08-03 18:48:42 +02:00
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
public static BlockPosition lastPhysicsProblem; // Spigot
2020-11-07 08:02:33 +01:00
@@ -157,6 +158,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
2020-11-20 08:14:39 +01:00
this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((WorldDataServer) worlddatamutable).getName(), this.spigotConfig); // Paper
2020-08-03 18:48:42 +02:00
this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Tuinity - Server Config
2020-08-15 20:20:57 +02:00
this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig((((WorldDataServer)worlddatamutable).getName())); // Purpur
2020-08-16 11:07:31 +02:00
+ this.origamiConfig = new de.minebench.origami.OrigamiConfig.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Origami
2020-08-15 20:20:57 +02:00
this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
2020-08-03 18:48:42 +02:00
this.generator = gen;
this.world = new CraftWorld((WorldServer) this, gen, env);
diff --git a/src/main/java/net/minecraft/server/World.java.rej b/src/main/java/net/minecraft/server/World.java.rej
deleted file mode 100644
2020-12-28 10:34:56 +01:00
index f4e9c5a0136d3a0ed813efec7fe8a0e7f256cf40..0000000000000000000000000000000000000000
2020-08-03 18:48:42 +02:00
--- a/src/main/java/net/minecraft/server/World.java.rej
+++ /dev/null
2020-08-31 11:24:45 +02:00
@@ -1,18 +0,0 @@
2020-08-03 18:48:42 +02:00
-diff a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java (rejected hunks)
2020-09-13 09:00:43 +02:00
-@@ -94,6 +94,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
2020-08-31 11:24:45 +02:00
- public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper
- public final ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
2020-08-03 18:48:42 +02:00
-
2020-09-13 09:00:43 +02:00
-+ public final de.minebench.origami.OrigamiConfig.WorldConfig origamiConfig; // Origami - World Config
2020-08-31 11:24:45 +02:00
-+
- public final co.aikar.timings.WorldTimingsHandler timings; // Paper
- public static BlockPosition lastPhysicsProblem; // Spigot
- private org.spigotmc.TickLimiter entityLimiter;
2020-09-13 09:00:43 +02:00
-@@ -124,6 +126,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
- protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, final DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env, java.util.concurrent.Executor executor) { // Paper
2020-08-31 11:24:45 +02:00
- this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot
2020-12-28 10:34:56 +01:00
- this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((WorldDataServer) worlddatamutable).getName(), this.spigotConfig); // Paper
2020-09-13 09:00:43 +02:00
-+ this.origamiConfig = new de.minebench.origami.OrigamiConfig.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Origami - World Config
2020-08-31 11:24:45 +02:00
- this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
- this.generator = gen;
- this.world = new CraftWorld((WorldServer) this, gen, env);
2020-08-13 17:53:32 +02:00
diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java
2020-11-26 10:52:33 +01:00
index b5cf60495b85c6ae6c32ee8a1c65d80e59fdce3d..1f77b251d7e7b0f023793cbf0876fc067caa75c1 100644
2020-08-13 17:53:32 +02:00
--- a/src/main/java/net/minecraft/server/WorldNBTStorage.java
+++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java
2020-11-26 10:52:33 +01:00
@@ -49,7 +49,8 @@ public class WorldNBTStorage {
File file = new File(this.playerDir, entityhuman.getUniqueIDString() + ".dat");
// Spigot Start
boolean usingWrongFile = false;
- if ( org.bukkit.Bukkit.getOnlineMode() && !file.exists() ) // Paper - Check online mode first
+ boolean normalFile = file.exists() && file.isFile(); // Akarin - ensures normal file
+ if ( org.bukkit.Bukkit.getOnlineMode() && !normalFile ) // Paper - Check online mode first // Akarin - ensures normal file
{
file = new File( this.playerDir, java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + entityhuman.getName() ).getBytes( "UTF-8" ) ).toString() + ".dat");
if ( file.exists() )
@@ -60,7 +61,7 @@ public class WorldNBTStorage {
2020-08-13 17:53:32 +02:00
}
// Spigot End
- if (file.exists() && file.isFile()) {
+ if (normalFile) { // Akarin - avoid double I/O operation
nbttagcompound = NBTCompressedStreamTools.a(file);
}
// Spigot Start
diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java.rej b/src/main/java/net/minecraft/server/WorldNBTStorage.java.rej
deleted file mode 100644
2020-11-26 10:52:33 +01:00
index 39dce006ebf2bd81a9d6c62c25eb9bd55d24199e..0000000000000000000000000000000000000000
2020-08-13 17:53:32 +02:00
--- a/src/main/java/net/minecraft/server/WorldNBTStorage.java.rej
+++ /dev/null
2020-11-26 10:52:33 +01:00
@@ -1,20 +0,0 @@
2020-08-13 17:53:32 +02:00
-diff a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java (rejected hunks)
2020-11-26 10:52:33 +01:00
-@@ -165,7 +165,8 @@ public class WorldNBTStorage implements IPlayerFileData {
- File file = new File(this.playerDir, entityhuman.getUniqueIDString() + ".dat");
- // Spigot Start
- boolean usingWrongFile = false;
-- if ( org.bukkit.Bukkit.getOnlineMode() && !file.exists() ) // Paper - Check online mode first
-+ boolean normalFile = file.exists() && file.isFile(); // Akarin - ensures normal file
-+ if ( org.bukkit.Bukkit.getOnlineMode() && !normalFile ) // Paper - Check online mode first // Akarin - ensures normal file
- {
- file = new File( this.playerDir, UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + entityhuman.getName() ).getBytes( "UTF-8" ) ).toString() + ".dat");
- if ( file.exists() )
-@@ -176,7 +177,7 @@ public class WorldNBTStorage implements IPlayerFileData {
2020-08-13 17:53:32 +02:00
- }
- // Spigot End
-
-- if (file.exists() && file.isFile()) {
-+ if (normalFile) { // Akarin - avoid double I/O operation
- nbttagcompound = NBTCompressedStreamTools.a((InputStream) (new FileInputStream(file)));
- }
- // Spigot Start
2020-08-03 18:48:42 +02:00
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
2020-12-22 15:01:31 +01:00
index f5c827f7427e7b743e8ec2adbcbc478735d028d4..718528409154348733166240478e9d577aa87b6e 100644
2020-08-03 18:48:42 +02:00
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
2020-12-01 08:42:51 +01:00
@@ -1,5 +1,6 @@
package net.pl3x.purpur;
+import com.destroystokyo.paper.PaperConfig;
import com.google.common.base.Throwables;
import net.minecraft.server.MinecraftServer;
import net.pl3x.purpur.command.PurpurCommand;
@@ -129,11 +130,6 @@ public class PurpurConfig {
2020-08-03 18:48:42 +02:00
return config.getString(path, config.getString(path));
}
2020-08-14 20:16:57 +02:00
- public static String timingsUrl = "https://timings.pl3x.net";
- private static void timingsSettings() {
- timingsUrl = getString("settings.timings.url", timingsUrl);
2020-08-15 11:43:24 +02:00
- }
-
2020-08-22 09:44:43 +02:00
public static double laggingThreshold = 19.0D;
private static void tickLoopSettings() {
laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
2020-12-17 08:48:17 +01:00
@@ -162,4 +158,35 @@ public class PurpurConfig {
InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
2020-10-27 20:15:13 +01:00
}
+
2020-12-17 08:48:17 +01:00
+ public static boolean dontSendUselessEntityPackets = false;
+ private static void dontSendUselessEntityPackets() {
+ dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
+ }
+
2020-10-27 20:15:13 +01:00
+ public static boolean allowInfinityMending = false;
+ private static void enchantmentSettings() {
+ if (version < 5) {
+ boolean oldValue = getBoolean("settings.enchantment.allow-infinite-and-mending-together", false);
+ set("settings.enchantment.allow-infinity-and-mending-together", oldValue);
+ set("settings.enchantment.allow-infinite-and-mending-together", null);
+ }
2020-12-17 08:48:17 +01:00
+ allowInfinityMending = getBoolean("settings.enchantment.allow-infinity-and-mending-together", allowInfinityMending);
2020-11-18 07:23:48 +01:00
+ }
+
+ public static boolean useHexColorsInConsole = true;
+ private static void loggerSettings() {
+ useHexColorsInConsole = getBoolean("settings.logger.hex-color-support-in-console", useHexColorsInConsole);
2020-12-01 08:42:51 +01:00
+ }
+
+ private static void migrateDisableProjectileSaving() {
+ if (PurpurConfig.version < 6) {
+ final boolean saveProjectilesToDisk = getBoolean("world-settings.default.gameplay-mechanics.save-projectiles-to-disk", true);
+ set("world-settings.default.gameplay-mechanics.save-projectiles-to-disk", null);
+ if (!saveProjectilesToDisk) {
+ PaperConfig.config.set("world-settings.default.projectile-load-save-per-chunk-limit", 0);
+ PaperConfig.saveConfig();
+ }
+ }
2020-10-27 20:15:13 +01:00
+ }
}
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java.rej b/src/main/java/net/pl3x/purpur/PurpurConfig.java.rej
deleted file mode 100644
2020-12-01 08:42:51 +01:00
index ccee2c7ae135a3a532f76b44d7d3ad6db7e8c387..0000000000000000000000000000000000000000
2020-10-27 20:15:13 +01:00
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java.rej
+++ /dev/null
2020-12-01 08:42:51 +01:00
@@ -1,27 +0,0 @@
2020-10-27 20:15:13 +01:00
-diff a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java (rejected hunks)
2020-12-01 08:42:51 +01:00
-@@ -1,6 +1,7 @@
- package net.pl3x.purpur;
-
- import co.aikar.timings.TimingsManager;
-+import com.destroystokyo.paper.PaperConfig;
- import com.google.common.base.Throwables;
- import net.minecraft.server.MinecraftServer;
- import net.pl3x.purpur.command.PurpurCommand;
-@@ -130,6 +131,17 @@ public class PurpurConfig {
- return config.getString(path, config.getString(path));
2020-10-27 20:15:13 +01:00
- }
-
2020-12-01 08:42:51 +01:00
-+ private static void migrateDisableProjectileSaving() {
-+ if (PurpurConfig.version < 6) {
-+ final boolean saveProjectilesToDisk = getBoolean("world-settings.default.gameplay-mechanics.save-projectiles-to-disk", true);
-+ set("world-settings.default.gameplay-mechanics.save-projectiles-to-disk", null);
-+ if (!saveProjectilesToDisk) {
-+ PaperConfig.config.set("world-settings.default.projectile-load-save-per-chunk-limit", 0);
-+ PaperConfig.saveConfig();
-+ }
2020-10-27 20:15:13 +01:00
-+ }
-+ }
-+
2020-12-01 08:42:51 +01:00
- public static String afkBroadcastAway = "§e§o%s is now AFK";
- public static String afkBroadcastBack = "§e§o%s is no longer AFK";
- public static String afkTabListPrefix = "[AFK] ";
2020-08-03 18:48:42 +02:00
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
2020-12-24 08:14:21 +01:00
index 361f7857e461578e90cb71e15027dadaf794cb69..5f0491a7cd6bb7e94cc5652be24d9bc111bb8035 100644
2020-08-03 18:48:42 +02:00
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
2020-12-01 08:42:51 +01:00
@@ -1,7 +1,15 @@
2020-08-14 20:16:57 +02:00
package net.pl3x.purpur;
2020-12-01 08:42:51 +01:00
+import com.destroystokyo.paper.PaperConfig;
2020-08-15 11:43:24 +02:00
+import java.util.ArrayList;
+import java.util.HashSet;
2020-08-16 11:07:31 +02:00
import org.bukkit.configuration.ConfigurationSection;
2020-08-15 11:43:24 +02:00
import java.util.List;
+import java.util.Set;
+import net.minecraft.server.Block;
2020-08-14 20:16:57 +02:00
+import net.minecraft.server.IRegistry;
+import net.minecraft.server.MinecraftKey;
+
import static net.pl3x.purpur.PurpurConfig.log;
public class PurpurWorldConfig {
2020-12-24 08:14:21 +01:00
@@ -56,4 +64,167 @@ public class PurpurWorldConfig {
2020-08-03 18:48:42 +02:00
PurpurConfig.config.addDefault("world-settings.default." + path, def);
return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
}
+
+ public int villagerBrainTicks = 1;
+ public boolean villagerUseBrainTicksOnlyWhenLagging = true;
2020-08-14 20:16:57 +02:00
+ public boolean villagerCanBeLeashed = false;
2020-08-03 18:48:42 +02:00
+ private void villagerSettings() {
+ villagerBrainTicks = getInt("mobs.villager.brain-ticks", villagerBrainTicks);
+ villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging);
2020-08-14 20:16:57 +02:00
+ villagerCanBeLeashed = getBoolean("mobs.villager.can-be-leashed", villagerCanBeLeashed);
+ }
+
+ public boolean villagerTraderCanBeLeashed = false;
+ private void villagerTraderSettings() {
+ villagerTraderCanBeLeashed = getBoolean("mobs.wandering_trader.can-be-leashed", villagerTraderCanBeLeashed);
2020-08-03 18:48:42 +02:00
+ }
+
2020-08-14 20:16:57 +02:00
+ public boolean milkCuresBadOmen = true;
2020-10-04 17:43:50 +02:00
+ public boolean persistentTileEntityDisplayNames = false;
2020-08-03 18:48:42 +02:00
+ private void miscGameplayMechanicsSettings() {
2020-08-14 20:16:57 +02:00
+ milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
2020-10-04 17:43:50 +02:00
+ persistentTileEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-tileentity-display-names-and-lore", persistentTileEntityDisplayNames);
2020-08-14 20:16:57 +02:00
+ }
+
+ public boolean anvilAllowColors = false;
+ private void anvilSettings() {
+ anvilAllowColors = getBoolean("blocks.anvil.allow-colors", anvilAllowColors);
+ }
+
+ public int cowFeedMushrooms = 0;
+ private void cowSettings() {
+ cowFeedMushrooms = getInt("mobs.cow.feed-mushrooms-for-mooshroom", cowFeedMushrooms);
+ }
+
+ public boolean snowGolemDropsPumpkin = false;
+ public boolean snowGolemPutPumpkinBack = false;
+ private void snowGolemSettings() {
+ snowGolemDropsPumpkin = getBoolean("mobs.snow_golem.drop-pumpkin-when-sheared", snowGolemDropsPumpkin);
+ snowGolemPutPumpkinBack = getBoolean("mobs.snow_golem.pumpkin-can-be-added-back", snowGolemPutPumpkinBack);
+ }
+
+ public boolean farmlandGetsMoistFromBelow = false;
+ private void farmlandSettings() {
+ farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
+ }
+
+ public int entityLifeSpan = 0;
+ private void entitySettings() {
+ entityLifeSpan = getInt("gameplay-mechanics.entity-lifespan", entityLifeSpan);
+ }
+
+ public boolean squidImmuneToEAR = true;
2020-09-03 08:04:54 +02:00
+ public double squidOffsetWaterCheck = 0.0D;
2020-08-14 20:16:57 +02:00
+ private void squidSettings() {
+ squidImmuneToEAR = getBoolean("mobs.squid.immune-to-EAR", squidImmuneToEAR);
2020-09-03 08:04:54 +02:00
+ squidOffsetWaterCheck = getDouble("mobs.squid.water-offset-check", squidOffsetWaterCheck);
2020-08-15 11:43:24 +02:00
+ }
+
+ public Set<Block> noTickBlocks = new HashSet<>();
+ private void noTickBlocks() {
+ getList("blocks.no-tick", new ArrayList<>()).forEach(key -> {
+ Block block = IRegistry.BLOCK.get(new MinecraftKey(key.toString()));
+ if (!block.getBlockData().isAir()) {
+ noTickBlocks.add(block);
+ }
+ });
+ }
+
+ public boolean dolphinDisableTreasureSearching = false;
+ private void dolphinSettings() {
+ dolphinDisableTreasureSearching = getBoolean("mobs.dolphin.disable-treasure-searching", dolphinDisableTreasureSearching);
2020-08-22 09:44:43 +02:00
+ }
+
+ public boolean turtleEggsBreakFromExpOrbs = true;
+ public boolean turtleEggsBreakFromItems = true;
+ public boolean turtleEggsBreakFromMinecarts = true;
+ private void turtleEggSettings() {
+ turtleEggsBreakFromExpOrbs = getBoolean("blocks.turtle_egg.break-from-exp-orbs", turtleEggsBreakFromExpOrbs);
+ turtleEggsBreakFromItems = getBoolean("blocks.turtle_egg.break-from-items", turtleEggsBreakFromItems);
+ turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
2020-09-15 07:23:39 +02:00
+ }
+
+ public int dragonFireballDespawnRate = -1;
+ public int eggDespawnRate = -1;
+ public int enderPearlDespawnRate = -1;
2020-09-20 20:45:23 +02:00
+ public int expBottleDespawnRate = -1;
+ public int fireworkDespawnRate = -1;
2020-09-15 07:23:39 +02:00
+ public int fishingHookDespawnRate = -1;
2020-09-20 20:45:23 +02:00
+ public int largeFireballDespawnRate = -1;
2020-09-23 17:38:34 +02:00
+ public int llamaSpitDespawnRate = -1;
2020-09-15 07:23:39 +02:00
+ public int potionDespawnRate = -1;
+ public int shulkerBulletDespawnRate = -1;
2020-09-20 20:45:23 +02:00
+ public int smallFireballDespawnRate = -1;
+ public int snowballDespawnRate = -1;
+ public int witherSkullDespawnRate = -1;
2020-09-15 07:23:39 +02:00
+ private void projectileDespawnRateSettings() {
+ dragonFireballDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.dragon_fireball", dragonFireballDespawnRate);
+ eggDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.egg", eggDespawnRate);
+ enderPearlDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.ender_pearl", enderPearlDespawnRate);
2020-09-20 20:45:23 +02:00
+ expBottleDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.experience_bottle", expBottleDespawnRate);
+ fireworkDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.firework_rocket", fireworkDespawnRate);
2020-09-15 07:23:39 +02:00
+ fishingHookDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.fishing_bobber", fishingHookDespawnRate);
2020-09-20 20:45:23 +02:00
+ largeFireballDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.fireball", largeFireballDespawnRate);
2020-09-23 17:38:34 +02:00
+ llamaSpitDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.llama_spit", llamaSpitDespawnRate);
2020-09-15 07:23:39 +02:00
+ potionDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.potion", potionDespawnRate);
+ shulkerBulletDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.shulker_bullet", shulkerBulletDespawnRate);
2020-09-20 20:45:23 +02:00
+ smallFireballDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.small_fireball", smallFireballDespawnRate);
+ snowballDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.snowball", snowballDespawnRate);
+ witherSkullDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.wither_skull", witherSkullDespawnRate);
2020-10-27 20:15:13 +01:00
+ }
+
+ public boolean infinityWorksWithNormalArrows = true;
+ public boolean infinityWorksWithSpectralArrows = false;
+ public boolean infinityWorksWithTippedArrows = false;
+ private void infinityArrowsSettings() {
+ infinityWorksWithNormalArrows = getBoolean("gameplay-mechanics.infinity-bow.normal-arrows", infinityWorksWithNormalArrows);
+ infinityWorksWithSpectralArrows = getBoolean("gameplay-mechanics.infinity-bow.spectral-arrows", infinityWorksWithSpectralArrows);
+ infinityWorksWithTippedArrows = getBoolean("gameplay-mechanics.infinity-bow.tipped-arrows", infinityWorksWithTippedArrows);
2020-11-26 11:38:40 +01:00
+ }
+
+ public boolean signAllowColors = false;
+ public boolean signRightClickEdit = false;
+ private void signSettings() {
+ signAllowColors = getBoolean("blocks.sign.allow-colors", signAllowColors);
+ signRightClickEdit = getBoolean("blocks.sign.right-click-edit", signRightClickEdit);
2020-12-01 08:42:51 +01:00
+ }
+
+ private void migrateDisableProjectileSaving() {
+ if (PurpurConfig.version < 6) {
+ final boolean saveProjectilesToDisk = PurpurConfig.config.getBoolean("world-settings." + worldName + ".gameplay-mechanics.save-projectiles-to-disk", true);
+ set("gameplay-mechanics.save-projectiles-to-disk", null);
+ if (!saveProjectilesToDisk) {
+ PaperConfig.config.set("world-settings." + worldName + ".projectile-load-save-per-chunk-limit", 0);
+ PaperConfig.saveConfig();
+ }
+ }
2020-12-23 08:46:56 +01:00
+ }
+
+ public int bambooMaxHeight = 16;
+ public int bambooSmallHeight = 10;
+ private void bambooSettings() {
+ bambooMaxHeight = getInt("blocks.bamboo.max-height", bambooMaxHeight);
+ bambooSmallHeight = getInt("blocks.bamboo.small-height", bambooSmallHeight);
+ }
+
+ public double twistingVinesGrowthModifier = 0.10D;
+ private void twistingVinesSettings() {
+ twistingVinesGrowthModifier = getDouble("blocks.twisting_vines.growth-modifier", twistingVinesGrowthModifier);
+ }
+
+ public double weepingVinesGrowthModifier = 0.10D;
+ private void weepingVinesSettings() {
+ weepingVinesGrowthModifier = getDouble("blocks.weeping_vines.growth-modifier", weepingVinesGrowthModifier);
+ }
+
+ public int lavaSpeedNether = 10;
+ public int lavaSpeedNotNether = 30;
2020-12-24 08:14:21 +01:00
+ public boolean lavaInfinite = false;
+ public int lavaInfiniteRequiredSources = 2;
2020-12-23 08:46:56 +01:00
+ private void lavaSettings() {
+ lavaSpeedNether = getInt("blocks.lava.speed.nether", lavaSpeedNether);
+ lavaSpeedNotNether = getInt("blocks.lava.speed.not-nether", lavaSpeedNotNether);
2020-12-24 08:14:21 +01:00
+ lavaInfinite = getBoolean("blocks.lava.infinite-source", lavaInfinite);
+ lavaInfiniteRequiredSources = getInt("blocks.lava.infinite-required-sources", lavaInfiniteRequiredSources);
2020-08-03 18:48:42 +02:00
+ }
}
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java.rej b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java.rej
deleted file mode 100644
2020-12-04 07:34:51 +01:00
index ad57dcdf457379d3282e710874808a6cebd3c17f..0000000000000000000000000000000000000000
2020-08-03 18:48:42 +02:00
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java.rej
+++ /dev/null
2020-12-01 08:42:51 +01:00
@@ -1,26 +0,0 @@
2020-08-03 18:48:42 +02:00
-diff a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java (rejected hunks)
2020-12-01 08:42:51 +01:00
-@@ -1,5 +1,6 @@
- package net.pl3x.purpur;
-
-+import com.destroystokyo.paper.PaperConfig;
- import net.minecraft.server.Block;
- import net.minecraft.server.Blocks;
- import net.minecraft.server.EnumDifficulty;
-@@ -84,6 +85,17 @@ public class PurpurWorldConfig {
- return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
2020-10-27 20:15:13 +01:00
- }
-
2020-12-01 08:42:51 +01:00
-+ private void migrateDisableProjectileSaving() {
-+ if (PurpurConfig.version < 6) {
-+ final boolean saveProjectilesToDisk = PurpurConfig.config.getBoolean("world-settings." + worldName + ".gameplay-mechanics.save-projectiles-to-disk", true);
2020-12-04 07:34:51 +01:00
-+ PurpurConfig.config.set("world-settings." + worldName + ".gameplay-mechanics.save-projectiles-to-disk", null);
2020-12-01 08:42:51 +01:00
-+ if (!saveProjectilesToDisk) {
-+ PaperConfig.config.set("world-settings." + worldName + ".projectile-load-save-per-chunk-limit", 0);
-+ PaperConfig.saveConfig();
-+ }
-+ }
2020-10-27 20:15:13 +01:00
-+ }
-+
2020-12-01 08:42:51 +01:00
- public boolean armorstandSetNameVisible = false;
- public boolean armorstandFixNametags = false;
- public float armorstandStepHeight = 0.0F;
2020-08-03 18:48:42 +02:00
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2020-12-13 16:18:57 +01:00
index 00e6b6f29e042fb48c2fc8009659c57e9a930abc..fcf2bf8962cf6bc33d4213c1101debae4afa7114 100644
2020-08-03 18:48:42 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2020-12-13 16:18:57 +01:00
@@ -863,6 +863,7 @@ public final class CraftServer implements Server {
2020-08-03 18:48:42 +02:00
com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); // Paper
com.tuinity.tuinity.config.TuinityConfig.init((File) console.options.valueOf("tuinity-settings")); // Tuinity - Server Config
2020-08-11 17:38:17 +02:00
net.pl3x.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
2020-08-15 11:43:24 +02:00
+ de.minebench.origami.OrigamiConfig.init((File) console.options.valueOf("origami-settings")); // Origami
2020-08-03 18:48:42 +02:00
for (WorldServer world : console.getWorlds()) {
world.worldDataServer.setDifficulty(config.difficulty);
world.setSpawnFlags(config.spawnMonsters, config.spawnAnimals);
2020-12-13 16:18:57 +01:00
@@ -899,6 +900,7 @@ public final class CraftServer implements Server {
2020-08-03 18:48:42 +02:00
world.paperConfig.init(); // Paper
world.tuinityConfig.init(); // Tuinity - Server Config
2020-08-11 17:38:17 +02:00
world.purpurConfig.init(); // Purpur
2020-08-15 20:20:57 +02:00
+ world.origamiConfig.init(); // Origami
2020-08-03 18:48:42 +02:00
}
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
2020-12-13 16:18:57 +01:00
@@ -2309,6 +2311,13 @@ public final class CraftServer implements Server {
2020-08-03 18:48:42 +02:00
}
2020-08-11 17:38:17 +02:00
// Purpur end
2020-08-03 18:48:42 +02:00
2020-08-13 17:53:32 +02:00
+ // Origami start
+ @Override
+ public YamlConfiguration getOrigamiConfig() {
+ return de.minebench.origami.OrigamiConfig.config;
+ }
+ // Origami end
2020-08-06 16:05:19 +02:00
+
2020-08-03 18:48:42 +02:00
@Override
public void restart() {
org.spigotmc.RestartCommand.restart();
2020-12-13 16:18:57 +01:00
@@ -2446,4 +2455,11 @@ public final class CraftServer implements Server {
2020-08-03 18:48:42 +02:00
return mobGoals;
}
// Paper end
+
+ // Purpur start
+ @Override
+ public boolean isLagging() {
+ return getServer().lagging;
+ }
+ // Purpur end
}
2020-11-08 17:59:56 +01:00
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java.rej b/src/main/java/org/bukkit/craftbukkit/CraftServer.java.rej
deleted file mode 100644
2020-12-13 16:18:57 +01:00
index b9dbdd5416862e325200e62b7d5821a73c230ec1..0000000000000000000000000000000000000000
2020-11-08 17:59:56 +01:00
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java.rej
+++ /dev/null
@@ -1,12 +0,0 @@
-diff a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java (rejected hunks)
2020-12-13 16:18:57 +01:00
-@@ -2451,5 +2451,10 @@ public final class CraftServer implements Server {
2020-11-08 17:59:56 +01:00
- public String getServerName() {
- return getProperties().serverName;
- }
-+
-+ @Override
-+ public boolean isLagging() {
-+ return getServer().lagging;
-+ }
- // Purpur end
- }
2020-08-03 18:48:42 +02:00
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
2020-12-04 07:34:51 +01:00
index 25501197b33441fa0d319082bd8d8b72110373af..dbc934b374ff1b9eb4b66d2365e89c39c951763b 100644
2020-08-03 18:48:42 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
2020-09-13 09:00:43 +02:00
@@ -154,6 +154,14 @@ public class Main {
2020-08-03 18:48:42 +02:00
.describedAs("Yml file");
2020-08-11 17:38:17 +02:00
// Purpur end
2020-08-03 18:48:42 +02:00
2020-08-15 11:43:24 +02:00
+ // Origami start
+ acceptsAll(asList("origami", "origami-settings"), "File for origami settings")
+ .withRequiredArg()
+ .ofType(File.class)
+ .defaultsTo(new File("origami.yml"))
+ .describedAs("Yml file");
+ // Origami end
2020-08-03 18:48:42 +02:00
+
// Paper start
acceptsAll(asList("server-name"), "Name of the server")
.withRequiredArg()
2020-08-13 17:53:32 +02:00
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java.rej b/src/main/java/org/bukkit/craftbukkit/Main.java.rej
deleted file mode 100644
2020-09-13 09:00:43 +02:00
index 27a6c3279b77f24edcea24f3a01559145d2f4da1..0000000000000000000000000000000000000000
2020-08-13 17:53:32 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/Main.java.rej
+++ /dev/null
@@ -1,16 +0,0 @@
-diff a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java (rejected hunks)
-@@ -139,6 +139,14 @@ public class Main {
- .describedAs("Yml file");
- // Paper end
-
2020-09-13 09:00:43 +02:00
-+ // Origami Start - Server Config
-+ acceptsAll(asList("origami", "origami-settings"), "File for origami settings")
2020-08-13 17:53:32 +02:00
-+ .withRequiredArg()
-+ .ofType(File.class)
2020-09-13 09:00:43 +02:00
-+ .defaultsTo(new File("origami.yml"))
2020-08-13 17:53:32 +02:00
-+ .describedAs("Yml file");
2020-09-13 09:00:43 +02:00
-+ // Origami end - Server Config
2020-08-13 17:53:32 +02:00
-+
- // Paper start
- acceptsAll(asList("server-name"), "Name of the server")
- .withRequiredArg()