mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 09:27:43 +01:00
Merge branch 'ver/1.16.2' of github.com:pl3xgaming/Purpur into ver/1.16.2
This commit is contained in:
@@ -6,10 +6,10 @@ Subject: [PATCH] Allow toggling special MobSpawners per world
|
||||
In vanilla, these are all hardcoded on for world type 0 (overworld) and hardcoded off for every other world type. Default config behaviour matches this.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MobSpawnerTrader.java b/src/main/java/net/minecraft/server/MobSpawnerTrader.java
|
||||
index 502cb0ea4..a9eeddb81 100644
|
||||
index 502cb0ea40..f88c7b5480 100644
|
||||
--- a/src/main/java/net/minecraft/server/MobSpawnerTrader.java
|
||||
+++ b/src/main/java/net/minecraft/server/MobSpawnerTrader.java
|
||||
@@ -122,10 +122,20 @@ public class MobSpawnerTrader implements MobSpawner {
|
||||
@@ -122,7 +122,17 @@ public class MobSpawnerTrader implements MobSpawner {
|
||||
int k = blockposition.getX() + this.a.nextInt(i * 2) - i;
|
||||
int l = blockposition.getZ() + this.a.nextInt(i * 2) - i;
|
||||
int i1 = iworldreader.a(HeightMap.Type.WORLD_SURFACE, k, l);
|
||||
@@ -24,17 +24,12 @@ index 502cb0ea4..a9eeddb81 100644
|
||||
+ blockposition2.c(EnumDirection.DOWN);
|
||||
+ } while (iworldreader.getType(blockposition2).isAir() && blockposition2.getY() > 0);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
|
||||
- if (SpawnerCreature.a(EntityPositionTypes.Surface.ON_GROUND, iworldreader, blockposition2, EntityTypes.WANDERING_TRADER)) {
|
||||
- blockposition1 = blockposition2;
|
||||
+ if (SpawnerCreature.a(EntityPositionTypes.Surface.ON_GROUND, iworldreader, blockposition2.immutableCopy(), EntityTypes.WANDERING_TRADER)) {
|
||||
+ blockposition1 = blockposition2.immutableCopy();
|
||||
+ // Purpur end
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (SpawnerCreature.a(EntityPositionTypes.Surface.ON_GROUND, iworldreader, blockposition2, EntityTypes.WANDERING_TRADER)) {
|
||||
blockposition1 = blockposition2;
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 77c72ec9f..b1b376ba8 100644
|
||||
index 77c72ec9fa..b1b376ba86 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -128,7 +128,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
@@ -47,7 +42,7 @@ index 77c72ec9f..b1b376ba8 100644
|
||||
this.generator = gen;
|
||||
this.world = new CraftWorld((WorldServer) this, gen, env);
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index e4f2b8494..83f1be960 100644
|
||||
index 0a024bb5c6..4f00bbe5ae 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -322,7 +322,24 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
@@ -77,7 +72,7 @@ index e4f2b8494..83f1be960 100644
|
||||
this.worldDataServer = (WorldDataServer) iworlddataserver;
|
||||
worldDataServer.world = this;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 11a5795f5..755a46ee8 100644
|
||||
index 11a5795f51..755a46ee8b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -7,6 +7,8 @@ import net.minecraft.server.IRegistry;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: jmp <jasonpenilla2@me.com>
|
||||
Date: Sun, 23 Aug 2020 17:26:39 -0700
|
||||
Date: Thu, 27 Aug 2020 13:48:52 -0700
|
||||
Subject: [PATCH] Raid cooldown setting
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PersistentRaid.java b/src/main/java/net/minecraft/server/PersistentRaid.java
|
||||
index b46b20cae..89be52ca1 100644
|
||||
index b46b20cae8..e7aee30555 100644
|
||||
--- a/src/main/java/net/minecraft/server/PersistentRaid.java
|
||||
+++ b/src/main/java/net/minecraft/server/PersistentRaid.java
|
||||
@@ -9,6 +9,7 @@ import javax.annotation.Nullable;
|
||||
@@ -34,24 +34,25 @@ index b46b20cae..89be52ca1 100644
|
||||
Iterator iterator = this.raids.values().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -67,6 +79,15 @@ public class PersistentRaid extends PersistentBase {
|
||||
if (!dimensionmanager.hasRaids()) {
|
||||
return null;
|
||||
} else {
|
||||
+ // Purpur start
|
||||
+ if (b.purpurConfig.raidCooldownSeconds != 0) {
|
||||
+ if (!playerCooldowns.containsKey(entityplayer.getUniqueID())) {
|
||||
@@ -110,10 +122,15 @@ public class PersistentRaid extends PersistentBase {
|
||||
|
||||
if (flag) {
|
||||
// CraftBukkit start
|
||||
- if (!org.bukkit.craftbukkit.event.CraftEventFactory.callRaidTriggerEvent(raid, entityplayer)) {
|
||||
+ if ((b.purpurConfig.raidCooldownSeconds != 0 && playerCooldowns.containsKey(entityplayer.getUniqueID())) || !org.bukkit.craftbukkit.event.CraftEventFactory.callRaidTriggerEvent(raid, entityplayer)) { // Purpur
|
||||
entityplayer.removeEffect(MobEffects.BAD_OMEN);
|
||||
return null;
|
||||
}
|
||||
+ // Purpur start
|
||||
+ if (b.purpurConfig.raidCooldownSeconds != 0) {
|
||||
+ playerCooldowns.put(entityplayer.getUniqueID(), b.purpurConfig.raidCooldownSeconds);
|
||||
+ } else {
|
||||
+ return null;
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
BlockPosition blockposition = entityplayer.getChunkCoordinates();
|
||||
List<VillagePlaceRecord> list = (List) this.b.y().c(VillagePlaceType.b, blockposition, 64, VillagePlace.Occupancy.IS_OCCUPIED).collect(Collectors.toList());
|
||||
int i = 0;
|
||||
+ // Purpur end
|
||||
|
||||
if (!this.raids.containsKey(raid.getId())) {
|
||||
this.raids.put(raid.getId(), raid);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 755a46ee8..54e460ca8 100644
|
||||
index 755a46ee8b..54e460ca8e 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -155,6 +155,7 @@ public class PurpurWorldConfig {
|
||||
|
||||
Reference in New Issue
Block a user