mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 01:47:42 +01:00
it compiles :O \o/
This commit is contained in:
@@ -5,29 +5,31 @@ Subject: [PATCH] Configurable dungeon seed
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.java b/src/main/java/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.java
|
||||
index d36b6208077254af5f0ebed8e8ce20fd45cbb79d..b09611f7c5177d3f5b22ffcaa9a65480afa819c3 100644
|
||||
index d36b6208077254af5f0ebed8e8ce20fd45cbb79d..612bc6e4a759df96bade4c322aad0b3e8753e0ee 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/MonsterRoomFeature.java
|
||||
@@ -25,6 +25,7 @@ public class MonsterRoomFeature extends Feature<NoneFeatureConfiguration> {
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final EntityType<?>[] MOBS = new EntityType[]{EntityType.SKELETON, EntityType.ZOMBIE, EntityType.ZOMBIE, EntityType.SPIDER};
|
||||
private static final BlockState AIR = Blocks.CAVE_AIR.defaultBlockState();
|
||||
+ private Random random; // Purpur
|
||||
+ private Random rnd; // Purpur
|
||||
|
||||
public MonsterRoomFeature(Codec<NoneFeatureConfiguration> configCodec) {
|
||||
super(configCodec);
|
||||
@@ -32,9 +33,13 @@ public class MonsterRoomFeature extends Feature<NoneFeatureConfiguration> {
|
||||
@@ -32,9 +33,15 @@ public class MonsterRoomFeature extends Feature<NoneFeatureConfiguration> {
|
||||
|
||||
@Override
|
||||
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> context) {
|
||||
+ // Purpur start
|
||||
+ if (random == null) {
|
||||
+ if (this.rnd == null) {
|
||||
+ int seed = net.pl3x.purpur.PurpurConfig.dungeonSeed;
|
||||
+ this.random = seed == -1 ? random : new Random(seed);
|
||||
+ this.rnd = seed == -1 ? context.random() : new Random(seed);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
Predicate<BlockState> predicate = Feature.isReplaceable(BlockTags.FEATURES_CANNOT_REPLACE.getName());
|
||||
BlockPos blockPos = context.origin();
|
||||
- Random random = context.random();
|
||||
+ Random random = this.rnd; // Purpur
|
||||
WorldGenLevel worldGenLevel = context.level();
|
||||
int i = 3;
|
||||
int j = random.nextInt(2) + 2;
|
||||
|
||||
Reference in New Issue
Block a user