Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit 85b64e1

Browse files
committed
fix runtime errors
1 parent 5f36af5 commit 85b64e1

3 files changed

Lines changed: 17 additions & 14 deletions

File tree

purpur-server/minecraft-patches/features/0001-Ridables.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ index 6a8aa33bbfbf1cd5afcd40abede3176975e8fae9..2bd5a295be2500f198230a62f48900b5
3030
/* Drop global time updates
3131
if (this.tickCount % 20 == 0) {
3232
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
33-
index 6f1cb7b9c01111eca0e0e253dddc1ad84b2aac15..8ad8e9879ada5f7b96a2600cd7a6692fa661c67c 100644
33+
index 345e5c7aff07544e24f2e91d71585b06392d9927..fd84a5aac26bbf2de2c2fa8bb5bc76bcbd09c3e4 100644
3434
--- a/net/minecraft/server/level/ServerLevel.java
3535
+++ b/net/minecraft/server/level/ServerLevel.java
3636
@@ -217,6 +217,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
@@ -75,10 +75,10 @@ index 4b1c9dc3f14973f9a1403d6cc407a31017f9a468..4dc6531bca6bd91d4f04e0559d21ce6b
7575
if ((target instanceof Bucketable && target instanceof LivingEntity && origItem != null && origItem.asItem() == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem)) {
7676
target.resendPossiblyDesyncedEntityData(ServerGamePacketListenerImpl.this.player); // Paper - The entire mob gets deleted, so resend it
7777
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
78-
index 51d240167f1079239cdc99a7262fc6bc0051f0b3..250676c904f6083edd06a2284307569cd76f0694 100644
78+
index a6fdb8bca6e8973392dc4faaed1124fc5f19e762..bc89d1401343d98381603684d5610a3b7344dcf3 100644
7979
--- a/net/minecraft/world/entity/Entity.java
8080
+++ b/net/minecraft/world/entity/Entity.java
81-
@@ -3156,6 +3156,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
81+
@@ -3157,6 +3157,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
8282
this.passengers = ImmutableList.copyOf(list);
8383
}
8484

@@ -92,7 +92,7 @@ index 51d240167f1079239cdc99a7262fc6bc0051f0b3..250676c904f6083edd06a2284307569c
9292
this.gameEvent(GameEvent.ENTITY_MOUNT, passenger);
9393
}
9494
}
95-
@@ -3197,6 +3204,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
95+
@@ -3198,6 +3205,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
9696
return false;
9797
}
9898
// CraftBukkit end
@@ -107,7 +107,7 @@ index 51d240167f1079239cdc99a7262fc6bc0051f0b3..250676c904f6083edd06a2284307569c
107107
if (this.passengers.size() == 1 && this.passengers.get(0) == passenger) {
108108
this.passengers = ImmutableList.of();
109109
} else {
110-
@@ -5120,4 +5135,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
110+
@@ -5121,4 +5136,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
111111
return ((ServerLevel) this.level).isPositionEntityTicking(this.blockPosition());
112112
}
113113
// Paper end - Expose entity id counter

purpur-server/minecraft-patches/sources/net/minecraft/server/level/ServerLevel.java.patch

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@
1515
this.server = server;
1616
- this.customSpawners = customSpawners;
1717
+ // Purpur start - Allow toggling special MobSpawners per world
18-
+ this.customSpawners = Lists.newArrayList();
18+
+ this.customSpawners = new ArrayList<>();
1919
+ if (purpurConfig.phantomSpawning) {
20-
+ customSpawners.add(new net.minecraft.world.level.levelgen.PhantomSpawner());
20+
+ this.customSpawners.add(new net.minecraft.world.level.levelgen.PhantomSpawner());
2121
+ }
2222
+ if (purpurConfig.patrolSpawning) {
23-
+ customSpawners.add(new net.minecraft.world.level.levelgen.PatrolSpawner());
23+
+ this.customSpawners.add(new net.minecraft.world.level.levelgen.PatrolSpawner());
2424
+ }
2525
+ if (purpurConfig.catSpawning) {
26-
+ customSpawners.add(new net.minecraft.world.entity.npc.CatSpawner());
26+
+ this.customSpawners.add(new net.minecraft.world.entity.npc.CatSpawner());
2727
+ }
2828
+ if (purpurConfig.villageSiegeSpawning) {
29-
+ customSpawners.add(new net.minecraft.world.entity.ai.village.VillageSiege());
29+
+ this.customSpawners.add(new net.minecraft.world.entity.ai.village.VillageSiege());
3030
+ }
3131
+ if (purpurConfig.villagerTraderSpawning) {
32-
+ customSpawners.add(new net.minecraft.world.entity.npc.WanderingTraderSpawner(serverLevelData));
32+
+ this.customSpawners.add(new net.minecraft.world.entity.npc.WanderingTraderSpawner(serverLevelData));
3333
+ }
3434
+ // Purpur end - Allow toggling special MobSpawners per world
3535
this.serverLevelData = serverLevelData;

purpur-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,17 @@
2121
public int tickCount;
2222
private int remainingFireTicks = -this.getFireImmuneTicks();
2323
public boolean wasTouchingWater;
24-
@@ -289,7 +_,7 @@
24+
@@ -289,8 +_,8 @@
2525
public PortalProcessor portalProcess;
2626
public int portalCooldown;
2727
private boolean invulnerable;
2828
- protected UUID uuid = Mth.createInsecureUUID(this.random);
29+
- protected String stringUUID = this.uuid.toString();
2930
+ protected UUID uuid; // Purpur - Add toggle for RNG manipulation
30-
protected String stringUUID = this.uuid.toString();
31+
+ protected String stringUUID; // Purpur - Add toggle for RNG manipulation
3132
private boolean hasGlowingTag;
3233
private final Set<String> tags = new io.papermc.paper.util.SizeLimitedSet<>(new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(), MAX_ENTITY_TAG_COUNT); // Paper - fully limit tag size - replace set impl
34+
private final double[] pistonDeltas = new double[]{0.0, 0.0, 0.0};
3335
@@ -342,6 +_,7 @@
3436
public long activatedTick = Integer.MIN_VALUE;
3537
public boolean isTemporarilyActive;
@@ -38,7 +40,7 @@
3840

3941
public void inactiveTick() {
4042
}
41-
@@ -526,10 +_,20 @@
43+
@@ -526,10 +_,21 @@
4244
}
4345
// Paper end - optimise entity tracker
4446

@@ -55,6 +57,7 @@
5557
+ // Purpur start - Add toggle for RNG manipulation
5658
+ this.random = level == null || level.purpurConfig.entitySharedRandom ? SHARED_RANDOM : RandomSource.create();
5759
+ this.uuid = Mth.createInsecureUUID(this.random);
60+
+ this.stringUUID = this.uuid.toString();
5861
+ // Purpur end - Add toggle for RNG manipulation
5962
this.position = Vec3.ZERO;
6063
this.blockPosition = BlockPos.ZERO;

0 commit comments

Comments
 (0)