Tag switching (WIP)
This commit is contained in:
parent
0486d7d89c
commit
41df84404b
72 changed files with 303 additions and 628 deletions
|
@ -7,17 +7,17 @@ import net.minecraft.tags.BlockTags;
|
|||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class BulbVineSeedBlock extends EndPlantWithAgeBlock {
|
||||
@Override
|
||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||
BlockState up = world.getBlockState(pos.above());
|
||||
return up.is(EndTags.GEN_TERRAIN) || up.is(BlockTags.LOGS) || up.is(BlockTags.LEAVES);
|
||||
return up.is(TagAPI.GEN_TERRAIN) || up.is(BlockTags.LOGS) || up.is(BlockTags.LEAVES);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,6 +22,7 @@ import net.minecraft.world.level.material.Material;
|
|||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.blocks.BlockProperties.LumecornShape;
|
||||
import ru.betterend.blocks.basis.BlockBaseNotFull;
|
||||
|
@ -29,7 +30,6 @@ import ru.betterend.client.render.ERenderLayer;
|
|||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndItems;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class LumecornBlock extends BlockBaseNotFull implements IRenderTypeable {
|
||||
public static final EnumProperty<LumecornShape> SHAPE = EnumProperty.create("shape", LumecornShape.class);
|
||||
|
@ -62,7 +62,7 @@ public class LumecornBlock extends BlockBaseNotFull implements IRenderTypeable {
|
|||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||
LumecornShape shape = state.getValue(SHAPE);
|
||||
if (shape == LumecornShape.BOTTOM_BIG || shape == LumecornShape.BOTTOM_SMALL) {
|
||||
return world.getBlockState(pos.below()).is(EndTags.END_GROUND);
|
||||
return world.getBlockState(pos.below()).is(TagAPI.END_GROUND);
|
||||
}
|
||||
else if (shape == LumecornShape.LIGHT_TOP) {
|
||||
return world.getBlockState(pos.below()).is(this);
|
||||
|
|
|
@ -37,6 +37,7 @@ import net.minecraft.world.level.material.Fluids;
|
|||
import net.minecraft.world.level.pathfinder.PathComputationType;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.blocks.BlockProperties.CactusBottom;
|
||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||
|
@ -44,7 +45,6 @@ import ru.betterend.blocks.basis.BlockBaseNotFull;
|
|||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class NeonCactusPlantBlock extends BlockBaseNotFull implements SimpleWaterloggedBlock, IRenderTypeable {
|
||||
|
@ -311,7 +311,7 @@ public class NeonCactusPlantBlock extends BlockBaseNotFull implements SimpleWate
|
|||
mut.move(dir);
|
||||
state = world.getBlockState(mut);
|
||||
if (!state.is(this)) {
|
||||
if (!state.is(EndTags.END_GROUND)) {
|
||||
if (!state.is(TagAPI.END_GROUND)) {
|
||||
length = -1;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -29,11 +29,11 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
|||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.blocks.basis.AttachedBlock;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class SmallJellyshroomBlock extends AttachedBlock implements IRenderTypeable, BonemealableBlock {
|
||||
|
@ -87,7 +87,7 @@ public class SmallJellyshroomBlock extends AttachedBlock implements IRenderTypea
|
|||
|
||||
@Override
|
||||
public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) {
|
||||
return state.getValue(FACING) == Direction.UP && world.getBlockState(pos.below()).is(EndTags.END_GROUND);
|
||||
return state.getValue(FACING) == Direction.UP && world.getBlockState(pos.below()).is(TagAPI.END_GROUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -34,10 +34,10 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
|||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.blocks.BlockProperties;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class DoublePlantBlock extends BlockBaseNotFull implements IRenderTypeable, BonemealableBlock {
|
||||
|
@ -94,7 +94,7 @@ public class DoublePlantBlock extends BlockBaseNotFull implements IRenderTypeabl
|
|||
}
|
||||
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.is(EndTags.END_GROUND);
|
||||
return state.is(TagAPI.END_GROUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -30,9 +30,9 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
|||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class EndPlantBlock extends BlockBaseNotFull implements IRenderTypeable, BonemealableBlock {
|
||||
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 14, 12);
|
||||
|
@ -84,7 +84,7 @@ public class EndPlantBlock extends BlockBaseNotFull implements IRenderTypeable,
|
|||
}
|
||||
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.is(EndTags.END_GROUND);
|
||||
return state.is(TagAPI.END_GROUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -28,12 +28,12 @@ import net.minecraft.world.level.material.Material;
|
|||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.client.models.BlockModelProvider;
|
||||
import ru.betterend.client.models.ModelsHelper;
|
||||
import ru.betterend.client.models.Patterns;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public abstract class FeatureSaplingBlock extends SaplingBlock implements IRenderTypeable, BlockModelProvider {
|
||||
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 14, 12);
|
||||
|
@ -71,7 +71,7 @@ public abstract class FeatureSaplingBlock extends SaplingBlock implements IRende
|
|||
|
||||
@Override
|
||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||
return world.getBlockState(pos.below()).is(EndTags.END_GROUND);
|
||||
return world.getBlockState(pos.below()).is(TagAPI.END_GROUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -34,10 +34,10 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
|||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class UnderwaterPlantBlock extends BlockBaseNotFull implements IRenderTypeable, BonemealableBlock, LiquidBlockContainer {
|
||||
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 14, 12);
|
||||
|
@ -82,7 +82,7 @@ public class UnderwaterPlantBlock extends BlockBaseNotFull implements IRenderTyp
|
|||
}
|
||||
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.is(EndTags.END_GROUND) || state.getBlock() == EndBlocks.ENDSTONE_DUST;
|
||||
return state.is(TagAPI.END_GROUND) || state.getBlock() == EndBlocks.ENDSTONE_DUST;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,9 +26,9 @@ import net.minecraft.world.level.storage.loot.LootContext;
|
|||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class UpDownPlantBlock extends BlockBaseNotFull implements IRenderTypeable {
|
||||
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 16, 12);
|
||||
|
@ -54,7 +54,7 @@ public class UpDownPlantBlock extends BlockBaseNotFull implements IRenderTypeabl
|
|||
}
|
||||
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.is(EndTags.END_GROUND);
|
||||
return state.is(TagAPI.END_GROUND);
|
||||
}
|
||||
|
||||
protected boolean isSupport(BlockState state, LevelReader world, BlockPos pos) {
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraft.tags.ItemTags;
|
|||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.TagHelper;
|
||||
import ru.betterend.blocks.EndPedestal;
|
||||
import ru.betterend.blocks.basis.BlockBase;
|
||||
|
@ -21,7 +22,6 @@ import ru.betterend.recipe.CraftingRecipes;
|
|||
import ru.betterend.recipe.builders.GridRecipe;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndItems;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class StoneMaterial {
|
||||
public final Block stone;
|
||||
|
@ -90,15 +90,15 @@ public class StoneMaterial {
|
|||
TagHelper.addTag(ItemTags.STONE_BRICKS, bricks);
|
||||
TagHelper.addTag(ItemTags.STONE_CRAFTING_MATERIALS, stone);
|
||||
TagHelper.addTag(ItemTags.STONE_TOOL_MATERIALS, stone);
|
||||
TagHelper.addTag(EndTags.FURNACES, furnace);
|
||||
TagHelper.addTag(TagAPI.FURNACES, furnace);
|
||||
|
||||
// Block Tags //
|
||||
TagHelper.addTag(BlockTags.STONE_BRICKS, bricks);
|
||||
TagHelper.addTag(BlockTags.WALLS, wall, brick_wall);
|
||||
TagHelper.addTag(BlockTags.SLABS, slab, brick_slab);
|
||||
TagHelper.addTags(pressure_plate, BlockTags.PRESSURE_PLATES, BlockTags.STONE_PRESSURE_PLATES);
|
||||
TagHelper.addTag(EndTags.END_STONES, stone);
|
||||
TagHelper.addTag(TagAPI.END_STONES, stone);
|
||||
|
||||
TagHelper.addTag(EndTags.DRAGON_IMMUNE, stone, stairs, slab, wall);
|
||||
TagHelper.addTag(TagAPI.DRAGON_IMMUNE, stone, stairs, slab, wall);
|
||||
}
|
||||
}
|
|
@ -11,7 +11,9 @@ import net.minecraft.world.level.block.Block;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.TagHelper;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.blocks.basis.BarkBlock;
|
||||
import ru.betterend.blocks.basis.BlockBase;
|
||||
import ru.betterend.blocks.basis.EndBarrelBlock;
|
||||
|
@ -34,7 +36,6 @@ import ru.betterend.blocks.basis.EndWoodenPlateBlock;
|
|||
import ru.betterend.blocks.basis.StrippableBarkBlock;
|
||||
import ru.betterend.recipe.builders.GridRecipe;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class WoodenMaterial {
|
||||
public final Block log;
|
||||
|
@ -127,7 +128,7 @@ public class WoodenMaterial {
|
|||
TagHelper.addTags(slab, ItemTags.WOODEN_SLABS, ItemTags.SLABS);
|
||||
TagHelper.addTags(stairs, ItemTags.WOODEN_STAIRS, ItemTags.STAIRS);
|
||||
TagHelper.addTags(trapdoor, ItemTags.WOODEN_TRAPDOORS, ItemTags.TRAPDOORS);
|
||||
TagHelper.addTag(EndTags.ITEM_CHEST, chest);
|
||||
TagHelper.addTag(TagAPI.ITEM_CHEST, chest);
|
||||
|
||||
// Block Tags //
|
||||
TagHelper.addTag(BlockTags.PLANKS, planks);
|
||||
|
@ -141,11 +142,11 @@ public class WoodenMaterial {
|
|||
TagHelper.addTags(slab, BlockTags.WOODEN_SLABS, BlockTags.SLABS);
|
||||
TagHelper.addTags(stairs, BlockTags.WOODEN_STAIRS, BlockTags.STAIRS);
|
||||
TagHelper.addTags(trapdoor, BlockTags.WOODEN_TRAPDOORS, BlockTags.TRAPDOORS);
|
||||
TagHelper.addTag(EndTags.BOOKSHELVES, shelf);
|
||||
TagHelper.addTag(EndTags.BLOCK_CHEST, chest);
|
||||
TagHelper.addTag(TagAPI.BOOKSHELVES, shelf);
|
||||
TagHelper.addTag(TagAPI.BLOCK_CHEST, chest);
|
||||
|
||||
logBlockTag = EndTags.makeBlockTag(name + "_logs");
|
||||
logItemTag = EndTags.makeItemTag(name + "_logs");
|
||||
logBlockTag = TagAPI.makeBlockTag(BetterEnd.MOD_ID, name + "_logs");
|
||||
logItemTag = TagAPI.makeItemTag(BetterEnd.MOD_ID, name + "_logs");
|
||||
TagHelper.addTag(logBlockTag, log_stripped, bark_stripped, log, bark);
|
||||
TagHelper.addTag(logItemTag, log_stripped, bark_stripped, log, bark);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue