[Fix] Hydralux Sapling is missing survival description (#228)

This commit is contained in:
Frank 2023-06-17 20:14:08 +02:00
parent c6cee74377
commit 7fc1c96a2b
2 changed files with 25 additions and 3 deletions

View file

@ -4,6 +4,7 @@ import org.betterx.bclib.behaviours.interfaces.BehaviourWaterPlantSapling;
import org.betterx.bclib.blocks.UnderwaterPlantWithAgeBlock; import org.betterx.bclib.blocks.UnderwaterPlantWithAgeBlock;
import org.betterx.bclib.util.BlocksHelper; import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.MHelper; import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.interfaces.survives.SurvivesOnSulphuricRock;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@ -13,7 +14,7 @@ import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
public class HydraluxSaplingBlock extends UnderwaterPlantWithAgeBlock implements BehaviourWaterPlantSapling { public class HydraluxSaplingBlock extends UnderwaterPlantWithAgeBlock implements BehaviourWaterPlantSapling, SurvivesOnSulphuricRock {
@Override @Override
public void grow(WorldGenLevel world, RandomSource random, BlockPos pos) { public void grow(WorldGenLevel world, RandomSource random, BlockPos pos) {
@ -70,7 +71,11 @@ public class HydraluxSaplingBlock extends UnderwaterPlantWithAgeBlock implements
} }
@Override @Override
protected boolean isTerrain(BlockState state) { public boolean isTerrain(BlockState state) {
return state.is(EndBlocks.SULPHURIC_ROCK.stone); return SurvivesOnSulphuricRock.super.isTerrain(state);
}
public String prefixComponent() {
return "tooltip.bclib.place_underwater_on";
} }
} }

View file

@ -0,0 +1,17 @@
package org.betterx.betterend.interfaces.survives;
import org.betterx.bclib.interfaces.SurvivesOnBlocks;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.world.level.block.Block;
import java.util.List;
public interface SurvivesOnSulphuricRock extends SurvivesOnBlocks {
List<Block> BLOCKS = List.of(EndBlocks.SULPHURIC_ROCK.stone);
@Override
default List<Block> getSurvivableBlocks() {
return BLOCKS;
}
}