From bf2249335edb9f87bad33a621e2299360697001b Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Tue, 20 Oct 2020 22:02:24 +0300 Subject: [PATCH] Fixes --- .../betterend/blocks/BlockEndLotusFlower.java | 2 +- .../betterend/blocks/BlockEndLotusLeaf.java | 2 +- .../betterend/blocks/BlockEndLotusSeed.java | 4 +- .../betterend/registry/FeatureRegistry.java | 4 +- .../betterend/world/features/EndFeature.java | 1 - .../world/features/EndLotusLeafFeature.java | 6 +- .../materialmaps/block/end_lotus_flower.json | 23 ++- .../materials/waving_floor_glow_inc.json | 10 ++ .../models/block/end_lotus_flower.json | 32 ++-- .../models/block/end_lotus_flower_2.json | 159 +----------------- 10 files changed, 57 insertions(+), 186 deletions(-) create mode 100644 src/main/resources/assets/betterend/materials/waving_floor_glow_inc.json diff --git a/src/main/java/ru/betterend/blocks/BlockEndLotusFlower.java b/src/main/java/ru/betterend/blocks/BlockEndLotusFlower.java index 5e43a99f..084698b5 100644 --- a/src/main/java/ru/betterend/blocks/BlockEndLotusFlower.java +++ b/src/main/java/ru/betterend/blocks/BlockEndLotusFlower.java @@ -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 diff --git a/src/main/java/ru/betterend/blocks/BlockEndLotusLeaf.java b/src/main/java/ru/betterend/blocks/BlockEndLotusLeaf.java index 4c4f3762..9c8d0631 100644 --- a/src/main/java/ru/betterend/blocks/BlockEndLotusLeaf.java +++ b/src/main/java/ru/betterend/blocks/BlockEndLotusLeaf.java @@ -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 diff --git a/src/main/java/ru/betterend/blocks/BlockEndLotusSeed.java b/src/main/java/ru/betterend/blocks/BlockEndLotusSeed.java index 3732f378..3db2190e 100644 --- a/src/main/java/ru/betterend/blocks/BlockEndLotusSeed.java +++ b/src/main/java/ru/betterend/blocks/BlockEndLotusSeed.java @@ -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 ++; } } diff --git a/src/main/java/ru/betterend/registry/FeatureRegistry.java b/src/main/java/ru/betterend/registry/FeatureRegistry.java index bcff8e67..a6045bae 100644 --- a/src/main/java/ru/betterend/registry/FeatureRegistry.java +++ b/src/main/java/ru/betterend/registry/FeatureRegistry.java @@ -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); diff --git a/src/main/java/ru/betterend/world/features/EndFeature.java b/src/main/java/ru/betterend/world/features/EndFeature.java index 972b8a28..de94c8fd 100644 --- a/src/main/java/ru/betterend/world/features/EndFeature.java +++ b/src/main/java/ru/betterend/world/features/EndFeature.java @@ -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 feature, int chance) { diff --git a/src/main/java/ru/betterend/world/features/EndLotusLeafFeature.java b/src/main/java/ru/betterend/world/features/EndLotusLeafFeature.java index 4d333019..afc6c1fe 100644 --- a/src/main/java/ru/betterend/world/features/EndLotusLeafFeature.java +++ b/src/main/java/ru/betterend/world/features/EndLotusLeafFeature.java @@ -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 ++; } } diff --git a/src/main/resources/assets/betterend/materialmaps/block/end_lotus_flower.json b/src/main/resources/assets/betterend/materialmaps/block/end_lotus_flower.json index 2163812f..92a8e29c 100644 --- a/src/main/resources/assets/betterend/materialmaps/block/end_lotus_flower.json +++ b/src/main/resources/assets/betterend/materialmaps/block/end_lotus_flower.json @@ -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" + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/materials/waving_floor_glow_inc.json b/src/main/resources/assets/betterend/materials/waving_floor_glow_inc.json new file mode 100644 index 00000000..3d37d15d --- /dev/null +++ b/src/main/resources/assets/betterend/materials/waving_floor_glow_inc.json @@ -0,0 +1,10 @@ +{ + "layers": [ + { + "vertexSource": "betterend:shaders/material/wave_floor.vert", + "fragmentSource": "betterend:shaders/material/glow_inc.frag", + "disableAo": true, + "disableDiffuse": true + } + ] +} diff --git a/src/main/resources/assets/betterend/models/block/end_lotus_flower.json b/src/main/resources/assets/betterend/models/block/end_lotus_flower.json index 22ab1d75..68312cdc 100644 --- a/src/main/resources/assets/betterend/models/block/end_lotus_flower.json +++ b/src/main/resources/assets/betterend/models/block/end_lotus_flower.json @@ -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": { diff --git a/src/main/resources/assets/betterend/models/block/end_lotus_flower_2.json b/src/main/resources/assets/betterend/models/block/end_lotus_flower_2.json index 5ac7e3fd..a6b97869 100644 --- a/src/main/resources/assets/betterend/models/block/end_lotus_flower_2.json +++ b/src/main/resources/assets/betterend/models/block/end_lotus_flower_2.json @@ -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" } - } - } - ] + } } \ No newline at end of file