mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Ya'll didn't see nothing..
This commit is contained in:
@@ -534,7 +534,7 @@ index 28a1fe3af1546daa779df46468e0ff8ad823f9ca..7a3be414ef9d54d7a852ba92d704011f
|
||||
|
||||
@NotNull
|
||||
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
index 6dbd520182b1e7713a68baad09b7f613424ef619..14244cc7f11035c4da4613bbdf49dac51f0da3cf 100644
|
||||
index 6dbd520182b1e7713a68baad09b7f613424ef619..7899609b7a3041477d5240deaeee9b80159c2db3 100644
|
||||
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
||||
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
@@ -87,6 +87,8 @@ public interface UnsafeValues {
|
||||
@@ -582,6 +582,35 @@ index 6dbd520182b1e7713a68baad09b7f613424ef619..14244cc7f11035c4da4613bbdf49dac5
|
||||
*/
|
||||
public int nextEntityId();
|
||||
|
||||
@@ -162,4 +172,28 @@ public interface UnsafeValues {
|
||||
*/
|
||||
int getProtocolVersion();
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+
|
||||
+ /**
|
||||
+ * Serialize entity to byte array
|
||||
+ *
|
||||
+ * @param entity entity to serialize
|
||||
+ * @return serialized entity
|
||||
+ */
|
||||
+ byte[] serializeEntity(org.bukkit.entity.Entity entity);
|
||||
+
|
||||
+ /**
|
||||
+ * Deserialize an entity from byte array
|
||||
+ * <p>
|
||||
+ * The entity is not automatically spawned in the world. You will have to spawn
|
||||
+ * the entity yourself with {@link org.bukkit.entity.Entity#spawnAt(Location)} or
|
||||
+ * {@link org.bukkit.entity.Entity#spawnAt(Location, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason)}
|
||||
+ *
|
||||
+ * @param data serialized entity
|
||||
+ * @param world world entity belongs in
|
||||
+ * @return deserialized entity
|
||||
+ */
|
||||
+ org.bukkit.entity.Entity deserializeEntity(byte[] data, org.bukkit.World world);
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/WorldBorder.java b/src/main/java/org/bukkit/WorldBorder.java
|
||||
index afb7b136b461202026290624836446cff9f9e45d..087579fdff09237409c9f80446e7a15a78f9040c 100644
|
||||
--- a/src/main/java/org/bukkit/WorldBorder.java
|
||||
|
||||
@@ -16,39 +16,6 @@ GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
index 14244cc7f11035c4da4613bbdf49dac51f0da3cf..7899609b7a3041477d5240deaeee9b80159c2db3 100644
|
||||
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
||||
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
@@ -172,4 +172,28 @@ public interface UnsafeValues {
|
||||
*/
|
||||
int getProtocolVersion();
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+
|
||||
+ /**
|
||||
+ * Serialize entity to byte array
|
||||
+ *
|
||||
+ * @param entity entity to serialize
|
||||
+ * @return serialized entity
|
||||
+ */
|
||||
+ byte[] serializeEntity(org.bukkit.entity.Entity entity);
|
||||
+
|
||||
+ /**
|
||||
+ * Deserialize an entity from byte array
|
||||
+ * <p>
|
||||
+ * The entity is not automatically spawned in the world. You will have to spawn
|
||||
+ * the entity yourself with {@link org.bukkit.entity.Entity#spawnAt(Location)} or
|
||||
+ * {@link org.bukkit.entity.Entity#spawnAt(Location, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason)}
|
||||
+ *
|
||||
+ * @param data serialized entity
|
||||
+ * @param world world entity belongs in
|
||||
+ * @return deserialized entity
|
||||
+ */
|
||||
+ org.bukkit.entity.Entity deserializeEntity(byte[] data, org.bukkit.World world);
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index b47e31d2b9b41b39b46892fe10bf36d82c5d8e1b..7fa5242bd44c9b19648d79fa8fecbb7ee125288e 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
|
||||
@@ -104,6 +104,25 @@ index dd0daf3138a38d0c8a399e6cb54bbc58af47f710..53d847b863a957639ff2e58280861316
|
||||
}
|
||||
|
||||
public CrashReport b(CrashReport crashreport) {
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 858bd62d2a17c15ee573c5cd607a876d3a99c2b1..3e63ea5ae2d31a502fa639806a926cd1ab8b6796 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -260,11 +260,12 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
|
||||
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
|
||||
// Spigot start
|
||||
- if (org.spigotmc.SpigotConfig.bungee) {
|
||||
- DedicatedServer.LOGGER.warn("Whilst this makes it possible to use BungeeCord, unless access to your server is properly restricted, it also opens up the ability for hackers to connect with any username they choose.");
|
||||
+ if (com.destroystokyo.paper.PaperConfig.isProxyOnlineMode()) { // Purpur
|
||||
+ DedicatedServer.LOGGER.warn("Whilst this makes it possible to use BungeeCord or Velocity, unless access to your server is properly restricted, it also opens up the ability for hackers to connect with any username they choose."); // Purpur
|
||||
DedicatedServer.LOGGER.warn("Please see http://www.spigotmc.org/wiki/firewall-guide/ for further information.");
|
||||
} else {
|
||||
DedicatedServer.LOGGER.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
|
||||
+ DedicatedServer.LOGGER.warn("You will not be offered any support as long as the server allows offline-mode players to join."); // Purpur
|
||||
}
|
||||
// Spigot end
|
||||
DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurVersionFetcher.java b/src/main/java/net/pl3x/purpur/PurpurVersionFetcher.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..cabfcebf9f944f7a2a2a1cffc7401435803a8741
|
||||
|
||||
@@ -45,7 +45,7 @@ index 14ac28d4d6b1ab0f0a70dfefc589f7723a1d2e1a..4eb122cfd31902df9789d2e8ff261520
|
||||
config.save(CONFIG_FILE);
|
||||
} catch (IOException ex) {
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 858bd62d2a17c15ee573c5cd607a876d3a99c2b1..a76219e59c24862b9c1e09e4a2a29cf2a6260514 100644
|
||||
index 3e63ea5ae2d31a502fa639806a926cd1ab8b6796..cbccb889167f8e235f417e224bbf5f025a6304f5 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -212,6 +212,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
|
||||
@@ -29,10 +29,10 @@ index e3c3b2eb03ad132a91140cb459fd8f378154ee2e..176fc4c8b7c5ef45b29cb8aaa1b1ff16
|
||||
this.isRestarting = isRestarting;
|
||||
this.hasLoggedStop = true; // Paper
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index a76219e59c24862b9c1e09e4a2a29cf2a6260514..4f7fed0418df17b80cb41e16bb1978c5cb284810 100644
|
||||
index cbccb889167f8e235f417e224bbf5f025a6304f5..df6eaa94f2928242dbd69a918d0b0b919bd3436b 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -324,6 +324,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
@@ -325,6 +325,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
MinecraftServerBeans.a((MinecraftServer) this);
|
||||
}
|
||||
|
||||
|
||||
46
patches/server/0208-Implement-Mob-Blindness.patch
Normal file
46
patches/server/0208-Implement-Mob-Blindness.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Encode42 <me@encode42.dev>
|
||||
Date: Tue, 11 May 2021 21:00:53 -0400
|
||||
Subject: [PATCH] Implement Mob Blindness
|
||||
|
||||
Ported from https://github.com/raltsmc/mobblindness
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
index aa2106e038ff882924be5b956af7cb3e8ff00397..2dc40e11eae98400b426175ceb2c92cd5942291c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
@@ -925,6 +925,18 @@ public abstract class EntityLiving extends Entity {
|
||||
// Airplane end
|
||||
d0 *= 0.5D;
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ if (entity instanceof EntityLiving) {
|
||||
+ EntityLiving livingEntity = (EntityLiving) entity;
|
||||
+ if (livingEntity.hasEffect(MobEffects.BLINDNESS)) {
|
||||
+ int amplifier = livingEntity.getEffect(MobEffects.BLINDNESS).getAmplifier();
|
||||
+ for (int i = 0; i < amplifier; i++) {
|
||||
+ d0 *= world.purpurConfig.mobsBlindnessMultiplier;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
return d0;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 07c66f9d41e7a74021dde6702d654710e400e93b..b8622f687b4fd70aaee5fa44cc50b8ee38582582 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -542,6 +542,11 @@ public class PurpurWorldConfig {
|
||||
mobsSpawnOnBlueIce = getBoolean("blocks.blue_ice.allow-mob-spawns", mobsSpawnOnBlueIce);
|
||||
}
|
||||
|
||||
+ public double mobsBlindnessMultiplier = 1;
|
||||
+ private void blindnessSettings() {
|
||||
+ mobsBlindnessMultiplier = getDouble("gameplay-mechanics.entity-blindness-multiplier", mobsBlindnessMultiplier);
|
||||
+ }
|
||||
+
|
||||
public boolean chestOpenWithBlockOnTop = false;
|
||||
private void chestSettings() {
|
||||
chestOpenWithBlockOnTop = getBoolean("blocks.chest.open-with-solid-block-on-top", chestOpenWithBlockOnTop);
|
||||
Reference in New Issue
Block a user