Fixed missing vines & texture overlays
|
@ -11,7 +11,7 @@ import ru.betterend.patterns.Patterns;
|
|||
import ru.betterend.registry.EndBlocks;
|
||||
|
||||
public class AeterniumAnvil extends EndAnvilBlock {
|
||||
public static final IntProperty DESTRUCTION = BlockProperties.DESTRUCTION_LONG;
|
||||
private static final IntProperty DESTRUCTION = BlockProperties.DESTRUCTION_LONG;
|
||||
|
||||
public AeterniumAnvil() {
|
||||
super(EndBlocks.AETERNIUM_BLOCK.getDefaultMaterialColor(), EndToolMaterial.AETERNIUM.getMiningLevel());
|
||||
|
|
|
@ -24,7 +24,7 @@ import ru.betterend.patterns.BlockPatterned;
|
|||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class EndAnvilBlock extends AnvilBlock implements BlockPatterned {
|
||||
public static final IntProperty DESTRUCTION = BlockProperties.DESTRUCTION;
|
||||
private static final IntProperty DESTRUCTION = BlockProperties.DESTRUCTION;
|
||||
protected final int level;
|
||||
|
||||
public EndAnvilBlock(MaterialColor color, int level) {
|
||||
|
|
|
@ -78,6 +78,10 @@ public class VineBlock extends BlockBaseNotFull implements IRenderTypeable, Fert
|
|||
return AbstractBlock.OffsetType.XZ;
|
||||
}
|
||||
|
||||
public boolean canGenerate(BlockState state, WorldView world, BlockPos pos) {
|
||||
return isSupport(state, world, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
|
||||
return isSupport(state, world, pos);
|
||||
|
|
|
@ -3,36 +3,68 @@ package ru.betterend.world.features;
|
|||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import ru.betterend.blocks.BlockProperties;
|
||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||
import ru.betterend.blocks.basis.VineBlock;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class VineFeature extends InvertedScatterFeature {
|
||||
private final Block vineBlock;
|
||||
private final int maxLength;
|
||||
private final boolean vine;
|
||||
|
||||
public VineFeature(Block vineBlock, int maxLength) {
|
||||
super(6);
|
||||
this.vineBlock = vineBlock;
|
||||
this.maxLength = maxLength;
|
||||
this.vine = vineBlock instanceof VineBlock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canGenerate(StructureWorldAccess world, Random random, BlockPos center, BlockPos blockPos, float radius) {
|
||||
return world.isAir(blockPos) && vineBlock.canPlaceAt(AIR, world, blockPos);
|
||||
BlockState state = world.getBlockState(blockPos);
|
||||
return state.getMaterial().isReplaceable() && canPlaceBlock(state, world, blockPos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
|
||||
int h = BlocksHelper.downRay(world, blockPos, random.nextInt(maxLength)) - 1;
|
||||
if (h > 2) {
|
||||
BlocksHelper.setWithoutUpdate(world, blockPos, vineBlock.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP));
|
||||
BlockState top = getTopState();
|
||||
BlockState middle = getMiggleState();
|
||||
BlockState bottom = getBottomState();
|
||||
BlocksHelper.setWithoutUpdate(world, blockPos, top);
|
||||
for (int i = 1; i < h; i++) {
|
||||
BlocksHelper.setWithoutUpdate(world, blockPos.down(i), vineBlock.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE));
|
||||
BlocksHelper.setWithoutUpdate(world, blockPos.down(i), middle);
|
||||
}
|
||||
BlocksHelper.setWithoutUpdate(world, blockPos.down(h), vineBlock.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM));
|
||||
BlocksHelper.setWithoutUpdate(world, blockPos.down(h), bottom);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canPlaceBlock(BlockState state, StructureWorldAccess world, BlockPos blockPos) {
|
||||
if (vine) {
|
||||
return ((VineBlock) vineBlock).canGenerate(state, world, blockPos);
|
||||
}
|
||||
else {
|
||||
return vineBlock.canPlaceAt(state, world, blockPos);
|
||||
}
|
||||
}
|
||||
|
||||
private BlockState getTopState() {
|
||||
BlockState state = vineBlock.getDefaultState();
|
||||
return vine ? state.with(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP) : state;
|
||||
}
|
||||
|
||||
private BlockState getMiggleState() {
|
||||
BlockState state = vineBlock.getDefaultState();
|
||||
return vine ? state.with(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE) : state;
|
||||
}
|
||||
|
||||
private BlockState getBottomState() {
|
||||
BlockState state = vineBlock.getDefaultState();
|
||||
return vine ? state.with(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM) : state;
|
||||
}
|
||||
}
|
||||
|
|
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.8 KiB |
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"animation": {
|
||||
"interpolate": true,
|
||||
"frametime": 32
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 416 B |
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"animation": {
|
||||
"interpolate": true,
|
||||
"frametime": 32
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 284 B |
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"animation": {
|
||||
"interpolate": true,
|
||||
"frametime": 32
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 447 B |
Before Width: | Height: | Size: 873 B After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.8 KiB |
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"animation": {
|
||||
"interpolate": true,
|
||||
"frametime": 8,
|
||||
"frames": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3
|
||||
]
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 2 KiB |
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"animation": {
|
||||
"interpolate": true,
|
||||
"frametime": 8,
|
||||
"frames": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3
|
||||
]
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 207 B |
After Width: | Height: | Size: 196 B |
After Width: | Height: | Size: 248 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2 KiB |
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"animation": {
|
||||
"interpolate": true,
|
||||
"frametime": 8,
|
||||
"frames": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3
|
||||
]
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2 KiB |
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"animation": {
|
||||
"interpolate": true,
|
||||
"frametime": 8,
|
||||
"frames": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3
|
||||
]
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
@ -0,0 +1,7 @@
|
|||
matchBlocks=minecraft:end_stone betterend:endstone_dust byg:ivis_phylium byg:vermilion_sculk byg:shulkren_phylium
|
||||
connectBlocks=betterend:cave_moss
|
||||
connect=block
|
||||
method=overlay
|
||||
layer=cutout
|
||||
tiles=0-16
|
||||
faces=top
|
Before Width: | Height: | Size: 998 B After Width: | Height: | Size: 998 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1,002 B After Width: | Height: | Size: 1,002 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 999 B After Width: | Height: | Size: 999 B |
Before Width: | Height: | Size: 998 B After Width: | Height: | Size: 998 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
@ -0,0 +1,7 @@
|
|||
matchBlocks=minecraft:end_stone betterend:endstone_dust betterend:cave_moss betterend:shadow_grass byg:ivis_phylium byg:vermilion_sculk byg:shulkren_phylium
|
||||
connectBlocks=betterend:end_mycelium
|
||||
connect=block
|
||||
method=overlay
|
||||
layer=cutout
|
||||
tiles=0-16
|
||||
faces=top
|
Before Width: | Height: | Size: 1,001 B After Width: | Height: | Size: 1,001 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 999 B After Width: | Height: | Size: 999 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 996 B After Width: | Height: | Size: 996 B |
Before Width: | Height: | Size: 1,001 B After Width: | Height: | Size: 1,001 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |