Removed terrain json blockstates, plants for "savanna" biome
This commit is contained in:
parent
8e5996524d
commit
daf3af06c9
82 changed files with 221 additions and 438 deletions
|
@ -2,6 +2,9 @@ package ru.betterend.blocks;
|
|||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -13,10 +16,13 @@ import net.minecraft.enchantment.Enchantments;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.loot.context.LootContext;
|
||||
import net.minecraft.loot.context.LootContextParameters;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.world.BlockView;
|
||||
import ru.betterend.blocks.basis.BlockBaseNotFull;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class EndPathBlock extends BlockBaseNotFull {
|
||||
private static final VoxelShape SHAPE = Block.createCuboidShape(0, 0, 0, 16, 15, 16);
|
||||
|
@ -47,4 +53,18 @@ public class EndPathBlock extends BlockBaseNotFull {
|
|||
public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ePos) {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String block) {
|
||||
String name = Registry.BLOCK.getId(this).getPath();
|
||||
Map<String, String> map = Maps.newHashMap();
|
||||
map.put("%top%", name + "_top");
|
||||
map.put("%side%", name.replace("_path", "") + "_side");
|
||||
return Patterns.createJson(Patterns.BLOCK_PATH, map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterns.STATE_ROTATED_TOP;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,8 +2,11 @@ package ru.betterend.blocks;
|
|||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -23,13 +26,16 @@ import net.minecraft.sound.SoundCategory;
|
|||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldView;
|
||||
import net.minecraft.world.chunk.light.ChunkLightProvider;
|
||||
import ru.betterend.blocks.basis.BlockBase;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class EndTerrainBlock extends BlockBase {
|
||||
private Block pathBlock;
|
||||
|
@ -74,15 +80,32 @@ public class EndTerrainBlock extends BlockBase {
|
|||
}
|
||||
|
||||
public static boolean canSurvive(BlockState state, WorldView worldView, BlockPos pos) {
|
||||
BlockPos blockPos = pos.up();
|
||||
BlockState blockState = worldView.getBlockState(blockPos);
|
||||
if (blockState.isOf(Blocks.SNOW) && (Integer)blockState.get(SnowBlock.LAYERS) == 1) {
|
||||
return true;
|
||||
} else if (blockState.getFluidState().getLevel() == 8) {
|
||||
return false;
|
||||
} else {
|
||||
int i = ChunkLightProvider.getRealisticOpacity(worldView, state, pos, blockState, blockPos, Direction.UP, blockState.getOpacity(worldView, blockPos));
|
||||
return i < 5;
|
||||
}
|
||||
}
|
||||
BlockPos blockPos = pos.up();
|
||||
BlockState blockState = worldView.getBlockState(blockPos);
|
||||
if (blockState.isOf(Blocks.SNOW) && (Integer) blockState.get(SnowBlock.LAYERS) == 1) {
|
||||
return true;
|
||||
}
|
||||
else if (blockState.getFluidState().getLevel() == 8) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
int i = ChunkLightProvider.getRealisticOpacity(worldView, state, pos, blockState, blockPos, Direction.UP, blockState.getOpacity(worldView, blockPos));
|
||||
return i < 5;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String block) {
|
||||
String name = Registry.BLOCK.getId(this).getPath();
|
||||
Map<String, String> map = Maps.newHashMap();
|
||||
map.put("%top%", "betterend:block/" + name + "_top");
|
||||
map.put("%side%", "betterend:block/" + name + "_side");
|
||||
map.put("%bottom%", "minecraft:block/end_stone");
|
||||
return Patterns.createJson(Patterns.BLOCK_TOP_SIDE_BOTTOM, map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterns.STATE_ROTATED_TOP;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ public class Patterns {
|
|||
public final static Identifier STATE_CHAIN = BetterEnd.makeID("patterns/blockstate/chain.json");
|
||||
public final static Identifier STATE_CHANDELIER = BetterEnd.makeID("patterns/blockstate/chandelier.json");
|
||||
public final static Identifier STATE_FURNACE = BetterEnd.makeID("patterns/blockstate/furnace.json");
|
||||
public final static Identifier STATE_ROTATED_TOP = BetterEnd.makeID("patterns/blockstate/rotated_top.json");
|
||||
|
||||
//Models Block
|
||||
public final static Identifier BLOCK_EMPTY = BetterEnd.makeID("patterns/block/empty.json");
|
||||
|
@ -100,6 +101,8 @@ public class Patterns {
|
|||
public final static Identifier BLOCK_CHANDELIER_CEIL = BetterEnd.makeID("patterns/block/chandelier_ceil.json");
|
||||
public final static Identifier BLOCK_FURNACE = BetterEnd.makeID("patterns/block/furnace.json");
|
||||
public final static Identifier BLOCK_FURNACE_GLOW = BetterEnd.makeID("patterns/block/furnace_glow.json");
|
||||
public final static Identifier BLOCK_TOP_SIDE_BOTTOM = BetterEnd.makeID("patterns/block/top_side_bottom.json");
|
||||
public final static Identifier BLOCK_PATH = BetterEnd.makeID("patterns/block/path.json");
|
||||
|
||||
//Models Item
|
||||
public final static Identifier ITEM_WALL = BetterEnd.makeID("patterns/item/pattern_wall.json");
|
||||
|
|
|
@ -121,7 +121,8 @@ public class EndBlocks {
|
|||
public static final Block SHADOW_GRASS = registerBlock("shadow_grass", new ShadowGrassBlock());
|
||||
public static final Block PINK_MOSS = registerBlock("pink_moss", new EndTerrainBlock(MaterialColor.PINK));
|
||||
public static final Block AMBER_MOSS = registerBlock("amber_moss", new EndTerrainBlock(MaterialColor.ORANGE));
|
||||
public static final Block JUNGLE_MOSS = registerBlock("jungle_moss", new EndTerrainBlock(MaterialColor.ORANGE));
|
||||
public static final Block JUNGLE_MOSS = registerBlock("jungle_moss", new EndTerrainBlock(MaterialColor.GREEN));
|
||||
public static final Block RUTISCUS = registerBlock("rutiscus", new EndTerrainBlock(MaterialColor.ORANGE));
|
||||
|
||||
// Roads //
|
||||
public static final Block END_MYCELIUM_PATH = registerBlock("end_mycelium_path", new EndPathBlock(END_MYCELIUM));
|
||||
|
@ -133,6 +134,7 @@ public class EndBlocks {
|
|||
public static final Block PINK_MOSS_PATH = registerBlock("pink_moss_path", new EndPathBlock(PINK_MOSS));
|
||||
public static final Block AMBER_MOSS_PATH = registerBlock("amber_moss_path", new EndPathBlock(AMBER_MOSS));
|
||||
public static final Block JUNGLE_MOSS_PATH = registerBlock("jungle_moss_path", new EndPathBlock(JUNGLE_MOSS));
|
||||
public static final Block RUTISCUS_PATH = registerBlock("rutiscus_path", new EndPathBlock(RUTISCUS));
|
||||
|
||||
public static final Block MOSSY_OBSIDIAN = registerBlock("mossy_obsidian", new MossyObsidian());
|
||||
|
||||
|
@ -222,6 +224,10 @@ public class EndBlocks {
|
|||
public static final Block SALTEAGO = registerBlock("salteago", new TerrainPlantBlock(END_MOSS));
|
||||
public static final Block VAIOLUSH_FERN = registerBlock("vaiolush_fern", new TerrainPlantBlock(END_MOSS));
|
||||
public static final Block FRACTURN = registerBlock("fracturn", new TerrainPlantBlock(END_MOSS));
|
||||
public static final Block ORANGO = registerBlock("orango", new TerrainPlantBlock(RUTISCUS));
|
||||
public static final Block AERIDIUM = registerBlock("aeridium", new TerrainPlantBlock(RUTISCUS));
|
||||
public static final Block LUTEBUS = registerBlock("lutebus", new TerrainPlantBlock(RUTISCUS));
|
||||
public static final Block LAMELLARIUM = registerBlock("lamellarium", new TerrainPlantBlock(RUTISCUS));
|
||||
|
||||
public static final Block BLUE_VINE_SEED = registerBlock("blue_vine_seed", new BlueVineSeedBlock());
|
||||
public static final Block BLUE_VINE = registerBlockNI("blue_vine", new BlueVineBlock());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue