Tag switching (WIP)

This commit is contained in:
paulevsGitch 2021-05-26 17:13:36 +03:00
parent 0486d7d89c
commit 41df84404b
72 changed files with 303 additions and 628 deletions

View file

@ -26,8 +26,8 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import ru.bclib.api.TagAPI;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper;
import ru.betterend.world.generator.GeneratorOptions;
@ -54,7 +54,7 @@ public abstract class ChorusFlowerBlockMixin extends Block {
@Inject(method = "randomTick", at = @At("HEAD"), cancellable = true)
private void be_randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random, CallbackInfo info) {
if (world.getBlockState(pos.below()).is(EndTags.END_GROUND)) {
if (world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) {
BlockPos up = pos.above();
if (world.isEmptyBlock(up) && up.getY() < 256) {
int i = state.getValue(ChorusFlowerBlock.AGE);
@ -102,7 +102,7 @@ public abstract class ChorusFlowerBlockMixin extends Block {
@Inject(method = "placeDeadFlower", at = @At("HEAD"), cancellable = true)
private void be_placeDeadFlower(Level world, BlockPos pos, CallbackInfo info) {
BlockState down = world.getBlockState(pos.below());
if (down.is(Blocks.CHORUS_PLANT) || down.is(EndTags.GEN_TERRAIN)) {
if (down.is(Blocks.CHORUS_PLANT) || down.is(TagAPI.GEN_TERRAIN)) {
world.setBlock(pos, this.defaultBlockState().setValue(BlockStateProperties.AGE_5, 5), 2);
world.levelEvent(1034, pos, 0);
}