This commit is contained in:
paulevsGitch 2020-10-20 22:02:24 +03:00
parent cac7be60b1
commit bf2249335e
10 changed files with 57 additions and 186 deletions

View file

@ -17,7 +17,7 @@ public class BlockEndLotusFlower extends BlockPlant {
private static final VoxelShape SHAPE_COLLISION = Block.createCuboidShape(0, 0, 0, 16, 2, 16);
public BlockEndLotusFlower() {
super(FabricBlockSettings.of(Material.PLANT).lightLevel(15));
super(FabricBlockSettings.of(Material.PLANT).nonOpaque().lightLevel(15));
}
@Override

View file

@ -25,7 +25,7 @@ public class BlockEndLotusLeaf extends BlockBaseNotFull {
private static final VoxelShape VSHAPE = Block.createCuboidShape(0, 0, 0, 16, 1, 16);
public BlockEndLotusLeaf() {
super(FabricBlockSettings.of(Material.PLANT).sounds(BlockSoundGroup.WET_GRASS));
super(FabricBlockSettings.of(Material.PLANT).nonOpaque().sounds(BlockSoundGroup.WET_GRASS));
}
@Override

View file

@ -45,7 +45,6 @@ public class BlockEndLotusSeed extends BlockUnderwaterPlantWithAge {
bpos.setY(bpos.getY() + 1);
for (int i = 1; i <= height; i++) {
if (!world.isAir(bpos)) {
System.out.println("Set incorrect flower!");
bpos.setY(bpos.getY() - 1);
BlocksHelper.setWithoutUpdate(world, bpos, flower);
bpos.setY(bpos.getY() - 1);
@ -61,7 +60,6 @@ public class BlockEndLotusSeed extends BlockUnderwaterPlantWithAge {
bpos.setY(bpos.getY() - 1);
}
System.out.println("Set flower!");
BlocksHelper.setWithoutUpdate(world, bpos, flower);
bpos.setY(bpos.getY() - 1);
stem = world.getBlockState(bpos);
@ -100,7 +98,7 @@ public class BlockEndLotusSeed extends BlockUnderwaterPlantWithAge {
p.setX(pos.getX() + x);
for (int z = -1; z < 2; z ++) {
p.setZ(pos.getZ() + z);
if (world.isAir(p))
if (world.isAir(p) && !world.getFluidState(p.down()).isEmpty())
count ++;
}
}

View file

@ -41,8 +41,8 @@ public class FeatureRegistry {
public static final EndFeature BUBBLE_CORAL_RARE = new EndFeature("bubble_coral_rare", new UnderwaterPlantFeature(BlockRegistry.BUBBLE_CORAL, 3), 2);
public static final EndFeature END_LILY = new EndFeature("end_lily", new EndLilyFeature(10), 10);
public static final EndFeature END_LILY_RARE = new EndFeature("end_lily_rare", new EndLilyFeature(3), 1);
public static final EndFeature END_LOTUS = new EndFeature("end_lotus", new EndLotusFeature(5), 5);
public static final EndFeature END_LOTUS_LEAF = new EndFeature("end_lotus_leaf", new EndLotusLeafFeature(5), 5);
public static final EndFeature END_LOTUS = new EndFeature("end_lotus", new EndLotusFeature(7), 5);
public static final EndFeature END_LOTUS_LEAF = new EndFeature("end_lotus_leaf", new EndLotusLeafFeature(20), 25);
// Features //
public static final EndFeature END_LAKE = EndFeature.makeLakeFeature("end_lake", new EndLakeFeature(), 4);

View file

@ -47,7 +47,6 @@ public class EndFeature {
this.featureStep = GenerationStep.Feature.VEGETAL_DECORATION;
this.feature = Registry.register(Registry.FEATURE, id, feature);
this.featureConfigured = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, id, feature.configure(FeatureConfig.DEFAULT).decorate(ConfiguredFeatures.Decorators.SQUARE_HEIGHTMAP).repeatRandomly(density));
//return new EndFeature(name, feature, GenerationStep.Feature.VEGETAL_DECORATION, feature.configure(FeatureConfig.DEFAULT).decorate(ConfiguredFeatures.Decorators.SQUARE_HEIGHTMAP).repeatRandomly(4));
}
public static EndFeature makeRawGenFeature(String name, Feature<DefaultFeatureConfig> feature, int chance) {

View file

@ -20,7 +20,7 @@ public class EndLotusLeafFeature extends ScatterFeature {
@Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
if (hasLeaf(world, blockPos)) {
if (canGenerate(world, blockPos)) {
generateLeaf(world, blockPos);
}
}
@ -49,7 +49,7 @@ public class EndLotusLeafFeature extends ScatterFeature {
}
}
private boolean hasLeaf(StructureWorldAccess world, BlockPos pos) {
private boolean canGenerate(StructureWorldAccess world, BlockPos pos) {
Mutable p = new Mutable();
p.setY(pos.getY());
int count = 0;
@ -57,7 +57,7 @@ public class EndLotusLeafFeature extends ScatterFeature {
p.setX(pos.getX() + x);
for (int z = -1; z < 2; z ++) {
p.setZ(pos.getZ() + z);
if (world.isAir(p))
if (world.isAir(p) && world.getBlockState(p.down()).isOf(Blocks.WATER))
count ++;
}
}

View file

@ -1,3 +1,22 @@
{
"defaultMaterial": "betterend:glow_inc"
"defaultMap": {
"spriteMap": [
{
"sprite": "betterend:block/end_lotus_petal",
"material": "betterend:waving_floor_glow_inc"
},
{
"sprite": "betterend:block/end_lotus_petal_2",
"material": "betterend:waving_floor_glow_inc"
},
{
"sprite": "betterend:block/end_lotus_center",
"material": "betterend:glow_inc"
},
{
"sprite": "betterend:block/end_lotus_center_2",
"material": "betterend:glow_inc"
}
]
}
}

View file

@ -0,0 +1,10 @@
{
"layers": [
{
"vertexSource": "betterend:shaders/material/wave_floor.vert",
"fragmentSource": "betterend:shaders/material/glow_inc.frag",
"disableAo": true,
"disableDiffuse": true
}
]
}

View file

@ -32,8 +32,8 @@
},
{
"__comment": "PlaneY2",
"from": [ -0.5, 7.5, 17.5 ],
"to": [ 15.5, 7.501, 25.5 ],
"from": [ -0.5, 7.502, 17.5 ],
"to": [ 15.5, 7.502, 25.5 ],
"shade": false,
"faces": {
"down": { "uv": [ 16, 0, 0, 8 ], "texture": "#petal" },
@ -53,8 +53,8 @@
},
{
"__comment": "PlaneY2",
"from": [ 0.5, 7.5, -9.5 ],
"to": [ 16.5, 7.501, -1.5 ],
"from": [ 0.5, 7.502, -9.5 ],
"to": [ 16.5, 7.502, -1.5 ],
"shade": false,
"faces": {
"down": { "uv": [ 16, 0, 0, 8 ], "texture": "#petal", "rotation": 180 },
@ -74,8 +74,8 @@
},
{
"__comment": "PlaneY12",
"from": [ 17.5, 7.5, 0.5 ],
"to": [ 25.5, 7.501, 16.5 ],
"from": [ 17.5, 7.505, 0.5 ],
"to": [ 25.5, 7.505, 16.5 ],
"shade": false,
"faces": {
"down": { "uv": [ 16, 0, 0, 8 ], "texture": "#petal", "rotation": 90 },
@ -95,8 +95,8 @@
},
{
"__comment": "PlaneY12",
"from": [ -9.5, 7.5, -0.5 ],
"to": [ -1.5, 7.501, 15.5 ],
"from": [ -9.5, 7.505, -0.5 ],
"to": [ -1.5, 7.505, 15.5 ],
"shade": false,
"faces": {
"down": { "uv": [ 16, 0, 0, 8 ], "texture": "#petal", "rotation": 270 },
@ -105,8 +105,8 @@
},
{
"__comment": "PlaneY10",
"from": [ 15.5, 2, -10.5 ],
"to": [ 31.5, 2.001, 5.5 ],
"from": [ 15.5, 2.02, -10.5 ],
"to": [ 31.5, 2.02, 5.5 ],
"rotation": { "origin": [ 15.5, 2, -10.5 ], "axis": "y", "angle": -45 },
"shade": false,
"faces": {
@ -116,8 +116,8 @@
},
{
"__comment": "PlaneY10",
"from": [ 10.5, 2, -0.5 ],
"to": [ 26.5, 2.001, 15.5 ],
"from": [ 10.5, 2.04, -0.5 ],
"to": [ 26.5, 2.04, 15.5 ],
"rotation": { "origin": [ 26.5, 2, 15.5 ], "axis": "y", "angle": 45 },
"shade": false,
"faces": {
@ -127,8 +127,8 @@
},
{
"__comment": "PlaneY10",
"from": [ -15.5, 2, 10.5 ],
"to": [ 0.5, 2.001, 26.5 ],
"from": [ -15.5, 2.06, 10.5 ],
"to": [ 0.5, 2.06, 26.5 ],
"rotation": { "origin": [ 0.5, 2, 26.5 ], "axis": "y", "angle": -45 },
"shade": false,
"faces": {
@ -138,8 +138,8 @@
},
{
"__comment": "PlaneY10",
"from": [ -10.4999, 2, 0.4999 ],
"to": [ 5.5001, 2.001, 16.4999 ],
"from": [ -10.4999, 2.08, 0.4999 ],
"to": [ 5.5001, 2.08, 16.4999 ],
"rotation": { "origin": [ -10.5, 2, 0.5 ], "axis": "y", "angle": 45 },
"shade": false,
"faces": {

View file

@ -1,163 +1,8 @@
{
"__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio",
"parent": "betterend:block/end_lotus_flower",
"textures": {
"particle": "betterend:block/end_lotus_center_2",
"texture": "betterend:block/end_lotus_center_2",
"petal": "betterend:block/end_lotus_petal_2"
},
"elements": [
{
"__comment": "Box1",
"from": [ 4, 0, 4 ],
"to": [ 12, 11, 12 ],
"faces": {
"down": { "uv": [ 8, 8, 16, 16 ], "texture": "#texture" },
"up": { "uv": [ 8, 0, 16, 8 ], "texture": "#texture" },
"north": { "uv": [ 0, 4, 8, 16 ], "texture": "#texture" },
"south": { "uv": [ 0, 5, 8, 16 ], "texture": "#texture" },
"west": { "uv": [ 0, 5, 8, 16 ], "texture": "#texture" },
"east": { "uv": [ 0, 5, 8, 16 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY2",
"from": [ -0.5, 2, 12 ],
"to": [ 15.5, 2.001, 20 ],
"rotation": { "origin": [ -0.5, 2, 12 ], "axis": "x", "angle": -45 },
"shade": false,
"faces": {
"down": { "uv": [ 16, 8, 0, 16 ], "texture": "#petal" },
"up": { "uv": [ 0, 8, 16, 16 ], "texture": "#petal", "rotation": 180 }
}
},
{
"__comment": "PlaneY2",
"from": [ -0.5, 7.5, 17.5 ],
"to": [ 15.5, 7.501, 25.5 ],
"shade": false,
"faces": {
"down": { "uv": [ 16, 0, 0, 8 ], "texture": "#petal" },
"up": { "uv": [ 0, 0, 16, 8 ], "texture": "#petal", "rotation": 180 }
}
},
{
"__comment": "PlaneY2",
"from": [ 0.5, 1.999, -4 ],
"to": [ 16.5, 2, 4 ],
"rotation": { "origin": [ 0.5, 2, 4 ], "axis": "x", "angle": 45 },
"shade": false,
"faces": {
"down": { "uv": [ 16, 8, 0, 16 ], "texture": "#petal", "rotation": 180 },
"up": { "uv": [ 0, 8, 16, 16 ], "texture": "#petal" }
}
},
{
"__comment": "PlaneY2",
"from": [ 0.5, 7.5, -9.5 ],
"to": [ 16.5, 7.501, -1.5 ],
"shade": false,
"faces": {
"down": { "uv": [ 16, 0, 0, 8 ], "texture": "#petal", "rotation": 180 },
"up": { "uv": [ 0, 0, 16, 8 ], "texture": "#petal" }
}
},
{
"__comment": "PlaneY12",
"from": [ 12, 2, 0.5 ],
"to": [ 20, 2.001, 16.5 ],
"rotation": { "origin": [ 12, 2, 0.5 ], "axis": "z", "angle": 45 },
"shade": false,
"faces": {
"down": { "uv": [ 16, 8, 0, 16 ], "texture": "#petal", "rotation": 90 },
"up": { "uv": [ 0, 8, 16, 16 ], "texture": "#petal", "rotation": 90 }
}
},
{
"__comment": "PlaneY12",
"from": [ 17.5, 7.5, 0.5 ],
"to": [ 25.5, 7.501, 16.5 ],
"shade": false,
"faces": {
"down": { "uv": [ 16, 0, 0, 8 ], "texture": "#petal", "rotation": 90 },
"up": { "uv": [ 0, 0, 16, 8 ], "texture": "#petal", "rotation": 90 }
}
},
{
"__comment": "PlaneY12",
"from": [ -4, 1.999, -0.5 ],
"to": [ 4, 2, 15.5 ],
"rotation": { "origin": [ 4, 2, -0.5 ], "axis": "z", "angle": -45 },
"shade": false,
"faces": {
"down": { "uv": [ 16, 8, 0, 16 ], "texture": "#petal", "rotation": 270 },
"up": { "uv": [ 0, 8, 16, 16 ], "texture": "#petal", "rotation": 270 }
}
},
{
"__comment": "PlaneY12",
"from": [ -9.5, 7.5, -0.5 ],
"to": [ -1.5, 7.501, 15.5 ],
"shade": false,
"faces": {
"down": { "uv": [ 16, 0, 0, 8 ], "texture": "#petal", "rotation": 270 },
"up": { "uv": [ 0, 0, 16, 8 ], "texture": "#petal", "rotation": 270 }
}
},
{
"__comment": "PlaneY10",
"from": [ 15.5, 2, -10.5 ],
"to": [ 31.5, 2.001, 5.5 ],
"rotation": { "origin": [ 15.5, 2, -10.5 ], "axis": "y", "angle": -45 },
"shade": false,
"faces": {
"down": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal", "rotation": 180 },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal" }
}
},
{
"__comment": "PlaneY10",
"from": [ 10.5, 2, -0.5 ],
"to": [ 26.5, 2.001, 15.5 ],
"rotation": { "origin": [ 26.5, 2, 15.5 ], "axis": "y", "angle": 45 },
"shade": false,
"faces": {
"down": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal" },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 180 }
}
},
{
"__comment": "PlaneY10",
"from": [ -15.5, 2, 10.5 ],
"to": [ 0.5, 2.001, 26.5 ],
"rotation": { "origin": [ 0.5, 2, 26.5 ], "axis": "y", "angle": -45 },
"shade": false,
"faces": {
"down": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal" },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 180 }
}
},
{
"__comment": "PlaneY10",
"from": [ -10.4999, 2, 0.4999 ],
"to": [ 5.5001, 2.001, 16.4999 ],
"rotation": { "origin": [ -10.5, 2, 0.5 ], "axis": "y", "angle": 45 },
"shade": false,
"faces": {
"down": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal", "rotation": 180 },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal" }
}
},
{
"__comment": "Box15",
"from": [ 5, 11, 5 ],
"to": [ 11, 12, 11 ],
"faces": {
"up": { "uv": [ 9, 1, 15, 7 ], "texture": "#texture" },
"north": { "uv": [ 1, 4, 7, 5 ], "texture": "#texture" },
"south": { "uv": [ 1, 4, 7, 5 ], "texture": "#texture" },
"west": { "uv": [ 1, 4, 7, 5 ], "texture": "#texture" },
"east": { "uv": [ 5, 4, 11, 5 ], "texture": "#texture" }
}
}
]
}
}