-
-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #4263 by adding composter support for mystical flowers (small and tall), petals, petal blocks, shimmering mushrooms and cellular blocks, as per my comment on that issue.
- Loading branch information
1 parent
e84f303
commit ec1ac0e
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
Xplat/src/main/java/vazkii/botania/common/handler/CompostingData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package vazkii.botania.common.handler; | ||
|
||
import net.minecraft.world.item.DyeColor; | ||
import net.minecraft.world.level.ItemLike; | ||
|
||
import vazkii.botania.common.block.BotaniaBlocks; | ||
import vazkii.botania.common.item.BotaniaItems; | ||
|
||
import java.util.function.BiConsumer; | ||
|
||
public class CompostingData { | ||
public static void init(BiConsumer<ItemLike, Float> registrationMethod) { | ||
// common vanilla composting chances: | ||
final float chanceLowest = 0.3f; | ||
final float chanceLow = 0.5f; | ||
final float chanceMid = 0.65f; | ||
final float chanceHigh = 0.85f; | ||
// unused here: final float chanceHighest = 1.0f; | ||
|
||
// see https://github.com/VazkiiMods/Botania/issues/4263#issuecomment-1529130978 | ||
for (final var dyeColor : DyeColor.values()) { | ||
registrationMethod.accept(BotaniaItems.getPetal(dyeColor), chanceLowest); | ||
registrationMethod.accept(BotaniaBlocks.getPetalBlock(dyeColor), chanceLow); | ||
registrationMethod.accept(BotaniaBlocks.getFlower(dyeColor), chanceMid); | ||
registrationMethod.accept(BotaniaBlocks.getDoubleFlower(dyeColor), chanceMid); | ||
registrationMethod.accept(BotaniaBlocks.getMushroom(dyeColor), chanceMid); | ||
} | ||
|
||
registrationMethod.accept(BotaniaBlocks.cellBlock, chanceHigh); | ||
} | ||
} |