Made plant creation consistent with BehaviourBuilders

This commit is contained in:
Frank 2023-06-13 17:01:36 +02:00
parent c340d575c5
commit f259496ba0
56 changed files with 363 additions and 396 deletions

View file

@ -1,7 +1,8 @@
package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.interfaces.survives.SurvivesOnShadowGrass;
import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes;
@ -13,12 +14,19 @@ import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.level.pathfinder.PathComputationType;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
public class MurkweedBlock extends EndPlantBlock {
public class MurkweedBlock extends EndPlantBlock implements SurvivesOnShadowGrass {
public MurkweedBlock() {
super(
BehaviourBuilders.createPlant(MapColor.COLOR_BLACK).ignitedByLava()
);
}
@Override
@Environment(EnvType.CLIENT)
public void animateTick(BlockState state, Level world, BlockPos pos, RandomSource random) {
@ -37,11 +45,6 @@ public class MurkweedBlock extends EndPlantBlock {
}
}
@Override
protected boolean isTerrain(BlockState state) {
return state.is(EndBlocks.SHADOW_GRASS);
}
@Override
@SuppressWarnings("deprecation")
public boolean isPathfindable(BlockState state, BlockGetter world, BlockPos pos, PathComputationType type) {