Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase vanilla mushroom spread limit #9591

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A9o=20Moriceau?= <[email protected]>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is the correct name of the author ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UTF-8 issue, i'll change

Date: Wed, 9 Aug 2023 13:55:23 +0200
Subject: [PATCH] Increase vanilla mushroom spread limit


diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
index a33de97340f14219291c4175e9194914cdf441db..aa25c7a7df84c3b99af5b5b2b80198f53c698a2b 100644
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
@@ -354,6 +354,12 @@ public class WorldConfiguration extends ConfigurationPart {
public boolean portalSearchVanillaDimensionScaling = true;
public boolean disableTeleportationSuffocationCheck = false;
public IntOr.Disabled netherCeilingVoidDamageHeight = IntOr.Disabled.DISABLED;
+
+ public Mushroom mushroom;
+
+ public class Mushroom extends ConfigurationPart {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New configuration options should be added to the paper configuration patch, not the patch consuming the config option.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean I should do a patch with the config, & then another patch that will use it ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh ok, thanks

+ public int spreadLimit = 5;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think IntOr.Default would fit a lot better here.

+ }
}

public Spawn spawn;
diff --git a/src/main/java/net/minecraft/world/level/block/MushroomBlock.java b/src/main/java/net/minecraft/world/level/block/MushroomBlock.java
index 5238b23cd3bca21e2b14c9be15699b95ad267e24..7294d268a04486952389282a0d27f2737f302bd1 100644
--- a/src/main/java/net/minecraft/world/level/block/MushroomBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/MushroomBlock.java
@@ -40,10 +40,17 @@ public class MushroomBlock extends BushBlock implements BonemealableBlock {
@Override
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
if (random.nextFloat() < (world.spigotConfig.mushroomModifier / (100.0f * 25))) { // Spigot - SPIGOT-7159: Better modifier resolution
- int i = 5;
+ io.papermc.paper.configuration.WorldConfiguration.Environment.Mushroom mushroomSettings = world.paperConfig().environment.mushroom; // Paper - Increase vanilla mushroom spread
GrayR0ot marked this conversation as resolved.
Show resolved Hide resolved
+
boolean flag = true;
Iterator iterator = BlockPos.betweenClosed(pos.offset(-4, -1, -4), pos.offset(4, 1, 4)).iterator();

+ int mushroomSpreadLimit = world.paperConfig().environment.mushroom.spreadLimit;
+ if(mushroomSpreadLimit == -1) {
+ mushroomSpreadLimit = 9 * 9 * 3; // Paper - 9x9x3 Vanilla SHAPE sum
+ }
+ int i = mushroomSpreadLimit;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the definition of i moved below the iterator and flag creation ? This just seems like added diff for no reason.

+
while (iterator.hasNext()) {
BlockPos blockposition1 = (BlockPos) iterator.next();

Loading