Bone meal usage

This commit is contained in:
paulevsGitch 2020-10-08 13:02:54 +03:00
parent a2ce936b31
commit 4356a54e2b
3 changed files with 18 additions and 1 deletions

View file

@ -2,6 +2,7 @@ package ru.betterend.registry;
import net.fabricmc.fabric.api.tag.TagRegistry;
import net.minecraft.block.Block;
import net.minecraft.tag.BlockTags;
import net.minecraft.tag.Tag;
import net.minecraft.tag.Tag.Identified;
import ru.betterend.BetterEnd;
@ -16,5 +17,6 @@ public class BlockTagRegistry {
public static void register() {
TagHelper.addTag(END_GROUND, BlockRegistry.END_MOSS, BlockRegistry.END_MYCELIUM);
TagHelper.addTag(BlockTags.NYLIUM, BlockRegistry.END_MOSS, BlockRegistry.END_MYCELIUM);
}
}

View file

@ -9,6 +9,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.FallingBlock;
import net.minecraft.state.property.Property;
import net.minecraft.tag.BlockTags;
import net.minecraft.util.BlockMirror;
import net.minecraft.util.BlockRotation;
import net.minecraft.util.math.BlockPos;
@ -19,6 +20,7 @@ import net.minecraft.world.WorldAccess;
import ru.betterend.blocks.BlockBlueVine;
import ru.betterend.blocks.basis.BlockDoublePlant;
import ru.betterend.blocks.basis.BlockGlowingFur;
import ru.betterend.registry.BlockTagRegistry;
public class BlocksHelper {
public static final int FLAG_UPDATE_BLOCK = 1;
@ -28,7 +30,7 @@ public class BlocksHelper {
public static final int FLAG_IGNORE_OBSERVERS = 16;
public static final int SET_SILENT = FLAG_UPDATE_BLOCK | FLAG_IGNORE_OBSERVERS | FLAG_SEND_CLIENT_CHANGES;
public static final Direction[] HORIZONTAL = new Direction[] { Direction.NORTH, Direction.SOUTH, Direction.EAST, Direction.WEST };
public static final Direction[] HORIZONTAL = makeHorizontal();
private static final Mutable POS = new Mutable();
protected static final BlockState AIR = Blocks.AIR.getDefaultState();
@ -188,4 +190,16 @@ public class BlocksHelper {
}
}
}
public static boolean isEndNylium(Block block) {
return block.isIn(BlockTags.NYLIUM) && block.isIn(BlockTagRegistry.END_GROUND);
}
public static boolean isEndNylium(BlockState state) {
return isEndNylium(state.getBlock());
}
public static Direction[] makeHorizontal() {
return new Direction[] { Direction.NORTH, Direction.SOUTH, Direction.EAST, Direction.WEST };
}
}

View file

@ -16,6 +16,7 @@
"RecipeManagerMixin",
"AbstractBlockMixin",
"LivingEntityMixin",
"BoneMealItemMixin",
"SlimeEntityMixin",
"BrewingAccessor",
"BiomeMixin"