Fixed missing vines & texture overlays

This commit is contained in:
paulevsGitch 2021-02-13 23:47:16 +03:00
parent f57df6ac0b
commit 70d44fa825
214 changed files with 129 additions and 27 deletions

View file

@ -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());

View file

@ -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) {

View file

@ -77,6 +77,10 @@ public class VineBlock extends BlockBaseNotFull implements IRenderTypeable, Fert
public AbstractBlock.OffsetType getOffsetType() {
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) {

View file

@ -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;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,6 @@
{
"animation": {
"interpolate": true,
"frametime": 32
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

View file

@ -0,0 +1,6 @@
{
"animation": {
"interpolate": true,
"frametime": 32
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

View file

@ -0,0 +1,6 @@
{
"animation": {
"interpolate": true,
"frametime": 32
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 873 B

After

Width:  |  Height:  |  Size: 2.4 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,12 @@
{
"animation": {
"interpolate": true,
"frametime": 8,
"frames": [
0,
1,
2,
3
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -0,0 +1,12 @@
{
"animation": {
"interpolate": true,
"frametime": 8,
"frames": [
0,
1,
2,
3
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -0,0 +1,12 @@
{
"animation": {
"interpolate": true,
"frametime": 8,
"frames": [
0,
1,
2,
3
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -0,0 +1,12 @@
{
"animation": {
"interpolate": true,
"frametime": 8,
"frames": [
0,
1,
2,
3
]
}
}

View file

@ -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

View file

@ -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

Some files were not shown because too many files have changed in this diff Show more