[SPIGOT-7581] Redundant code Created: 08/Feb/24  Updated: 25/Dec/24  Resolved: 09/Feb/24

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Ryan Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None

Version: 1.20.4
Guidelines Read: Yes

 Description   

Hi, I was looking at CraftBukkit patches and found some redundant code

BlockSapling.treeType = (this == Blocks.BROWN_MUSHROOM) ? TreeType.BROWN_MUSHROOM : TreeType.BROWN_MUSHROOM; // CraftBukkit

It could simply be

BlockSapling.treeType = TreeType.BROWN_MUSHROOM; // CraftBukkit

https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/nms-patches/net/minecraft/world/level/block/BlockMushroom.patch#27



 Comments   
Comment by Ryan [ 08/Feb/24 ]

Hello, I don't understand much about spigot/minecraft-server code, I just reported it because I found the code redundant. However, after I reported this I went to take a look at a fork of Spigot (Paper), now that I saw your question I looked at the same class in Paper, apparently they did what you suggested, their patch: https://github.com/PaperMC/Paper/blob/master/patches/server/0735-Fix-StructureGrowEvent-species-for-RED_MUSHROOM.patch

Comment by md_5 [ 08/Feb/24 ]

What about red mushrooms?

Generated at Sat Dec 13 19:00:11 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.