Compare commits

..

No commits in common. "ff264f55397ead4dfee72222a37878a3de17ed5c" and "0182eb0bb3ec8dd920062d0364e5d556c0ae7877" have entirely different histories.

3 changed files with 6 additions and 22 deletions

View file

@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
version = '37.7'
version = '37.6'
group = 'de.ellpeck.naturesaura' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'NaturesAura'

View file

@ -4,7 +4,6 @@ import de.ellpeck.naturesaura.api.NaturesAuraAPI;
import de.ellpeck.naturesaura.api.aura.type.BasicAuraType;
import de.ellpeck.naturesaura.api.misc.WeightedOre;
import de.ellpeck.naturesaura.chunk.effect.OreSpawnEffect;
import de.ellpeck.naturesaura.chunk.effect.PlantBoostEffect;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.common.ForgeConfigSpec;
import net.minecraftforge.common.ForgeConfigSpec.ConfigValue;
@ -21,7 +20,6 @@ public final class ModConfig {
public ConfigValue<List<? extends String>> auraTypeOverrides;
public ConfigValue<List<? extends String>> additionalOres;
public ConfigValue<List<? extends String>> oreExceptions;
public ConfigValue<List<? extends String>> plantBoostExceptions;
public ConfigValue<List<? extends String>> additionalProjectiles;
public ConfigValue<Integer> fieldCreatorRange;
public ConfigValue<Double> auraToRFRatio;
@ -68,10 +66,6 @@ public final class ModConfig {
.comment("Blocks that are exempt from being recognized as generatable ores for the passive ore generation effect. Each entry needs to be formatted as modid:block[prop1=value1,...] where block state properties are optional")
.translation("config." + NaturesAura.MOD_ID + ".oreExceptions")
.defineList("oreExceptions", Collections.emptyList(), s -> true);
this.plantBoostExceptions = builder
.comment("Blocks that are exept from being fertilized by the plant boost effect. Each entry needs to be formatted as modid:block")
.translation("config." + NaturesAura.MOD_ID + ".plantBoostExceptions")
.defineList("plantBoostExceptions", Collections.emptyList(), s -> true);
this.additionalProjectiles = builder
.comment("Additional projectile types that are allowed to be consumed by the projectile generator. Each entry needs to be formatted as entity_registry_name->aura_amount")
.translation("config." + NaturesAura.MOD_ID + ".additionalProjectiles")
@ -233,14 +227,6 @@ public final class ModConfig {
NaturesAura.LOGGER.warn("Error parsing oreExceptions", e);
}
try {
for (String s : this.plantBoostExceptions.get())
PlantBoostEffect.EXCEPTIONS.add(Objects.requireNonNull(ForgeRegistries.BLOCKS.getValue(new ResourceLocation(s))));
} catch (Exception e) {
NaturesAura.LOGGER.warn("Error parsing plantBoostExceptions", e);
}
try {
for (String s : this.additionalProjectiles.get()) {
var split = s.split("->");

View file

@ -17,16 +17,14 @@ import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.BonemealableBlock;
import net.minecraft.world.level.block.DoublePlantBlock;
import net.minecraft.world.level.block.TallGrassBlock;
import net.minecraft.world.level.chunk.LevelChunk;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class PlantBoostEffect implements IDrainSpotEffect {
public static final Set<Block> EXCEPTIONS = new HashSet<>(List.of(Blocks.GRASS_BLOCK, Blocks.MOSS_BLOCK, Blocks.GLOW_LICHEN, Blocks.SMALL_DRIPLEAF, Blocks.BIG_DRIPLEAF, Blocks.BIG_DRIPLEAF_STEM));
public static final ResourceLocation NAME = new ResourceLocation(NaturesAura.MOD_ID, "plant_boost");
private int amount;
@ -77,7 +75,7 @@ public class PlantBoostEffect implements IDrainSpotEffect {
var state = level.getBlockState(plantPos);
var block = state.getBlock();
if (block instanceof BonemealableBlock growable && !PlantBoostEffect.EXCEPTIONS.contains(block) && !(block instanceof DoublePlantBlock) && !(block instanceof TallGrassBlock)) {
if (block instanceof BonemealableBlock growable && !(block instanceof DoublePlantBlock) && !(block instanceof TallGrassBlock) && block != Blocks.GRASS_BLOCK && block != Blocks.MOSS_BLOCK) {
if (growable.isValidBonemealTarget(level, plantPos, state, false)) {
try {
growable.performBonemeal((ServerLevel) level, level.random, plantPos, state);