Fixed Survives On handling
This commit is contained in:
parent
7c61b8c92e
commit
afc3d1e795
27 changed files with 126 additions and 32 deletions
|
@ -14,6 +14,7 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
|
||||
public class BlueVineSeedBlock extends EndPlantWithAgeBlock implements SurvivesOnMossOrMycelium, BehaviourSeed {
|
||||
|
@ -75,4 +76,9 @@ public class BlueVineSeedBlock extends EndPlantWithAgeBlock implements SurvivesO
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnMossOrMycelium.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,4 +54,9 @@ public class BoluxMushroomBlock extends EndPlantBlock implements SurvivesOnRutis
|
|||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
return Lists.newArrayList(new ItemStack(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnRutiscus.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import org.betterx.bclib.behaviours.BehaviourBuilders;
|
|||
import org.betterx.bclib.behaviours.interfaces.BehaviourWaterPlant;
|
||||
import org.betterx.bclib.interfaces.tools.AddMineableShears;
|
||||
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
|
||||
import org.betterx.betterend.interfaces.survives.SurvivesOnEndStone;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
|
@ -21,7 +22,7 @@ import net.minecraft.world.phys.shapes.VoxelShape;
|
|||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
public class BubbleCoralBlock extends EndUnderwaterPlantBlock implements BehaviourWaterPlant, AddMineableShears {
|
||||
public class BubbleCoralBlock extends EndUnderwaterPlantBlock implements BehaviourWaterPlant, AddMineableShears, SurvivesOnEndStone {
|
||||
|
||||
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 14, 16);
|
||||
|
||||
|
@ -55,4 +56,9 @@ public class BubbleCoralBlock extends EndUnderwaterPlantBlock implements Behavio
|
|||
public boolean isBonemealSuccess(Level world, RandomSource random, BlockPos pos, BlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnEndStone.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,4 +50,9 @@ public class BulbVineSeedBlock extends EndPlantWithAgeBlock implements Behaviour
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnEndStoneOrTrees.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,4 +79,9 @@ public class CavePumpkinVineBlock extends EndPlantWithAgeBlock implements Surviv
|
|||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnEndStone.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,16 @@ import org.betterx.bclib.behaviours.interfaces.BehaviourPlant;
|
|||
import org.betterx.betterend.blocks.basis.EndPlantBlock;
|
||||
import org.betterx.betterend.interfaces.survives.SurvivesOnChorusNylium;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
|
||||
public class ChorusGrassBlock extends EndPlantBlock implements SurvivesOnChorusNylium, BehaviourPlant {
|
||||
public ChorusGrassBlock() {
|
||||
super(BehaviourBuilders.createGrass(MapColor.COLOR_PURPLE).replaceable());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnChorusNylium.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.betterx.bclib.blocks.BlockProperties.TripleShape;
|
|||
import org.betterx.bclib.interfaces.tools.AddMineableShears;
|
||||
import org.betterx.bclib.util.MHelper;
|
||||
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
|
||||
import org.betterx.betterend.interfaces.survives.SurvivesOnEndStone;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.betterend.registry.EndItems;
|
||||
|
||||
|
@ -38,7 +39,7 @@ import com.google.common.collect.Lists;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class EndLilyBlock extends EndUnderwaterPlantBlock implements BehaviourWaterPlant, AddMineableShears {
|
||||
public class EndLilyBlock extends EndUnderwaterPlantBlock implements BehaviourWaterPlant, AddMineableShears, SurvivesOnEndStone {
|
||||
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
||||
private static final VoxelShape SHAPE_BOTTOM = Block.box(4, 0, 4, 12, 16, 12);
|
||||
private static final VoxelShape SHAPE_TOP = Block.box(2, 0, 2, 14, 6, 14);
|
||||
|
@ -125,4 +126,9 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock implements BehaviourWa
|
|||
public boolean isBonemealSuccess(Level world, RandomSource random, BlockPos pos, BlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnEndStone.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,4 +54,9 @@ public class FlamaeaBlock extends EndPlantBlock implements CustomItemProvider, B
|
|||
public BlockItem getCustomItem(ResourceLocation resourceLocation, Item.Properties itemSettings) {
|
||||
return new PlaceOnWaterBlockItem(this, itemSettings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnWater.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,4 +36,9 @@ public class FlammalixBlock extends EndPlantBlock implements BehaviourPlant, Sur
|
|||
public BlockModel getItemModel(ResourceLocation resourceLocation) {
|
||||
return ModelsHelper.createItemModel(resourceLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvicesOnPallidium.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.betterx.betterend.interfaces.survives.SurvivesOnMossOrMycelium;
|
|||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
|
@ -31,4 +32,9 @@ public class GlowingMossBlock extends EndPlantBlock implements SurvivesOnMossOrM
|
|||
public float getAmbientOcclusionLightLevel(BlockGetter world, BlockPos pos) {
|
||||
return 1F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnMossOrMycelium.super.isTerrain(state);
|
||||
}
|
||||
}
|
|
@ -76,4 +76,9 @@ public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock implements AddM
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnAmberMoss.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,4 +76,9 @@ public class LanceleafBlock extends EndPlantBlock implements SurvivesOnAmberMoss
|
|||
return MHelper.RANDOM.nextBoolean() ? Collections.emptyList() : Collections.singletonList(new ItemStack(
|
||||
EndBlocks.LANCELEAF_SEED));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnAmberMoss.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,4 +57,9 @@ public class LanceleafSeedBlock extends EndPlantWithAgeBlock implements Survives
|
|||
plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.TOP)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnAmberMoss.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,4 +65,9 @@ public class LargeAmaranitaBlock extends EndPlantBlock implements BehaviourPlant
|
|||
public boolean isBonemealSuccess(Level world, RandomSource random, BlockPos pos, BlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnEndBone.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.betterx.betterend.registry.EndFeatures;
|
|||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
@ -33,4 +34,9 @@ public class LumecornSeedBlock extends EndPlantWithAgeBlock implements Behaviour
|
|||
null
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnEndMoss.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,4 +50,9 @@ public class MurkweedBlock extends EndPlantBlock implements SurvivesOnShadowGras
|
|||
public boolean isPathfindable(BlockState state, BlockGetter world, BlockPos pos, PathComputationType type) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnShadowGrass.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,4 +60,9 @@ public class NeedlegrassBlock extends EndPlantBlock implements SurvivesOnShadowG
|
|||
public boolean isPathfindable(BlockState state, BlockGetter world, BlockPos pos, PathComputationType type) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnShadowGrass.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import org.betterx.bclib.behaviours.BehaviourBuilders;
|
|||
import org.betterx.bclib.behaviours.interfaces.BehaviourWaterPlant;
|
||||
import org.betterx.bclib.interfaces.tools.AddMineableShears;
|
||||
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
|
||||
import org.betterx.betterend.interfaces.survives.SurvivesOnEndStone;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
|
@ -20,7 +21,7 @@ import net.minecraft.world.phys.shapes.VoxelShape;
|
|||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
public class PondAnemoneBlock extends EndUnderwaterPlantBlock implements BehaviourWaterPlant, AddMineableShears {
|
||||
public class PondAnemoneBlock extends EndUnderwaterPlantBlock implements BehaviourWaterPlant, AddMineableShears, SurvivesOnEndStone {
|
||||
private static final VoxelShape SHAPE = Block.box(2, 0, 2, 14, 14, 14);
|
||||
|
||||
public PondAnemoneBlock() {
|
||||
|
@ -55,4 +56,9 @@ public class PondAnemoneBlock extends EndUnderwaterPlantBlock implements Behavio
|
|||
public boolean isBonemealSuccess(Level world, RandomSource random, BlockPos pos, BlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnEndStone.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,4 +99,9 @@ public class SmallAmaranitaBlock extends EndPlantBlock implements SurvivesOnEndB
|
|||
public boolean isBonemealSuccess(Level world, RandomSource random, BlockPos pos, BlockState state) {
|
||||
return random.nextInt(8) == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnEndBone.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import org.betterx.bclib.interfaces.SurvivesOnBlocks;
|
|||
import org.betterx.betterend.blocks.basis.EndPlantBlock;
|
||||
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -25,4 +26,9 @@ public class TerrainPlantBlock extends EndPlantBlock implements SurvivesOnBlocks
|
|||
public List<Block> getSurvivableBlocks() {
|
||||
return ground;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnBlocks.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,4 +47,9 @@ public class TwistedUmbrellaMossBlock extends EndPlantBlock implements Behaviour
|
|||
BlocksHelper.setWithoutUpdate(world, pos, bs);
|
||||
BlocksHelper.setWithoutUpdate(world, pos.above(), bs.setValue(BaseDoublePlantBlock.TOP, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnJungleMossOrMycelium.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,4 +46,9 @@ public class UmbrellaMossBlock extends EndPlantBlock implements BehaviourPlant,
|
|||
BlocksHelper.setWithoutUpdate(world, pos, bs);
|
||||
BlocksHelper.setWithoutUpdate(world, pos.above(), bs.setValue(BaseDoublePlantBlock.TOP, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnJungleMossOrMycelium.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,20 +2,14 @@ package org.betterx.betterend.blocks.basis;
|
|||
|
||||
import org.betterx.bclib.blocks.BasePlantBlock;
|
||||
import org.betterx.betterend.interfaces.PottablePlant;
|
||||
import org.betterx.worlds.together.tag.v3.CommonBlockTags;
|
||||
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public abstract class EndPlantBlock extends BasePlantBlock implements PottablePlant {
|
||||
protected EndPlantBlock(Properties props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return state.is(CommonBlockTags.END_STONES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlantOn(Block block) {
|
||||
|
|
|
@ -1,18 +1,9 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import org.betterx.bclib.blocks.BasePlantWithAgeBlock;
|
||||
import org.betterx.worlds.together.tag.v3.CommonBlockTags;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public abstract class EndPlantWithAgeBlock extends BasePlantWithAgeBlock {
|
||||
|
||||
public EndPlantWithAgeBlock(Properties settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return state.is(CommonBlockTags.END_STONES);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,9 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import org.betterx.bclib.blocks.UnderwaterPlantBlock;
|
||||
import org.betterx.worlds.together.tag.v3.CommonBlockTags;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public class EndUnderwaterPlantBlock extends UnderwaterPlantBlock {
|
||||
public abstract class EndUnderwaterPlantBlock extends UnderwaterPlantBlock {
|
||||
public EndUnderwaterPlantBlock(Properties settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.is(CommonBlockTags.END_STONES);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ public class EndUnderwaterWallPlantBlock extends BaseUnderwaterWallPlantBlock im
|
|||
super(BehaviourBuilders.createWaterPlant(color));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnEndStone.super.isTerrain(state);
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import org.betterx.bclib.blocks.WallMushroomBlock;
|
||||
import org.betterx.worlds.together.tag.v3.CommonBlockTags;
|
||||
import org.betterx.betterend.interfaces.survives.SurvivesOnEndStone;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public class EndWallMushroom extends WallMushroomBlock {
|
||||
public class EndWallMushroom extends WallMushroomBlock implements SurvivesOnEndStone {
|
||||
|
||||
public EndWallMushroom(int light) {
|
||||
super(light);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.is(CommonBlockTags.END_STONES);
|
||||
public boolean isTerrain(BlockState state) {
|
||||
return SurvivesOnEndStone.super.isTerrain(state);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue