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

Remove mod priority configuration option for Orechid outputs #4584

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,6 @@ private static class Common implements BotaniaConfig.ConfigAccess {
public final ForgeConfigSpec.BooleanValue gogSpawnWithLexicon;
public final ForgeConfigSpec.IntValue gogIslandScaleMultiplier;

public final ForgeConfigSpec.ConfigValue<List<? extends String>> orechidPriorityMods;

public final ForgeConfigSpec.ConfigValue<List<? extends String>> rannuncarpusItemBlacklist;
public final ForgeConfigSpec.ConfigValue<List<? extends String>> rannuncarpusModBlacklist;

Expand Down Expand Up @@ -288,13 +286,6 @@ public Common(ForgeConfigSpec.Builder builder) {
By default, the scale is 8, putting each island on points separated by 2048 blocks.
Values below 4 (1024 block spacing) are not recommended due to Nether portal collisions.""")
.defineInRange("gardenOfGlass.islandScaleMultiplier", 8, 1, 512);
orechidPriorityMods = builder
.comment("""
List of modids to prioritize when choosing a random ore from the tag.
By default, the chosen ore is randomly picked from all ores in the ore's tag.
Ores from mods present on this list will be picked over mods listed lower or not listed at all.
Applying changes at runtime requires /reload afterwards.""")
.defineList("orechidPriorityMods", Collections.emptyList(), o -> o instanceof String s && ResourceLocation.tryParse(s + ":test") != null);
rannuncarpusItemBlacklist = builder
.comment("List of item registry names that will be ignored by rannuncarpuses when placing blocks.")
.defineList("rannuncarpus.itemBlacklist", Collections.emptyList(), o -> o instanceof String s && ResourceLocation.tryParse(s) != null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import com.google.gson.JsonObject;

import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.RandomSource;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.Block;
Expand Down Expand Up @@ -41,15 +40,6 @@ public boolean test(BlockState state) {
return isNotExcluded(state);
}

@Override
public BlockState pick(RandomSource random) {
List<Block> blocks = getBlocks();
if (blocks.isEmpty()) {
return null;
}
return blocks.get(random.nextInt(blocks.size())).defaultBlockState();
}

private boolean isNotExcluded(BlockState state) {
for (StateIngredient exclude : excludes) {
if (exclude.test(state)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ public boolean test(BlockState state) {

@Override
public BlockState pick(RandomSource random) {
var values = resolve().toList();
if (values.isEmpty()) {
var blocks = getBlocks();
if (blocks.isEmpty()) {
return null;
}
return values.get(random.nextInt(values.size())).defaultBlockState();
return blocks.get(random.nextInt(blocks.size())).defaultBlockState();
}

@Override
Expand Down