Flower enhancements

This commit is contained in:
paulevsGitch 2020-12-04 22:27:42 +03:00
parent 77ce5a80a0
commit eb6d36b5dd
25 changed files with 215 additions and 101 deletions

View file

@ -1,12 +1,20 @@
package ru.betterend.blocks;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import com.google.common.collect.Lists;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.EnumProperty;
@ -17,6 +25,7 @@ import net.minecraft.world.WorldView;
import ru.betterend.blocks.BlockProperties.HydraluxShape;
import ru.betterend.blocks.basis.BlockUnderwaterPlant;
import ru.betterend.registry.EndBlocks;
import ru.betterend.util.MHelper;
public class BlockHydralux extends BlockUnderwaterPlant {
public static final EnumProperty<HydraluxShape> SHAPE = BlockProperties.HYDRALUX_SHAPE;
@ -59,4 +68,19 @@ public class BlockHydralux extends BlockUnderwaterPlant {
public boolean canGrow(World world, Random random, BlockPos pos, BlockState state) {
return false;
}
@Override
@Environment(EnvType.CLIENT)
public ItemStack getPickStack(BlockView world, BlockPos pos, BlockState state) {
return new ItemStack(EndBlocks.HYDRALUX_SAPLING);
}
@Override
public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder builder) {
HydraluxShape shape = state.get(SHAPE);
if (shape == HydraluxShape.ROOTS) {
return Lists.newArrayList(new ItemStack(EndBlocks.HYDRALUX_SAPLING, MHelper.randRange(1, 2, MHelper.RANDOM)));
}
return Collections.emptyList();
}
}

View file

@ -13,7 +13,7 @@ import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper;
public class BlockHydraluxSpore extends BlockUnderwaterPlantWithAge {
public class BlockHydraluxSapling extends BlockUnderwaterPlantWithAge {
@Override
public void grow(StructureWorldAccess world, Random random, BlockPos pos) {
int h = MHelper.randRange(4, 8, random);

View file

@ -29,7 +29,7 @@ import ru.betterend.blocks.BlockEndLotusStem;
import ru.betterend.blocks.BlockEndstoneDust;
import ru.betterend.blocks.BlockGlowingMoss;
import ru.betterend.blocks.BlockHydralux;
import ru.betterend.blocks.BlockHydraluxSpore;
import ru.betterend.blocks.BlockHydraluxSapling;
import ru.betterend.blocks.BlockHydrothermalVent;
import ru.betterend.blocks.BlockLacugroveSapling;
import ru.betterend.blocks.BlockMossyGlowshroomCap;
@ -166,7 +166,7 @@ public class EndBlocks {
public static final Block END_LILY = registerBlockNI("end_lily", new BlockEndLily());
public static final Block END_LILY_SEED = registerBlock("end_lily_seed", new BlockEndLilySeed());
public static final Block HYDRALUX_SPORE = registerBlock("hydralux_spore", new BlockHydraluxSpore());
public static final Block HYDRALUX_SAPLING = registerBlock("hydralux_sapling", new BlockHydraluxSapling());
public static final Block HYDRALUX = registerBlock("hydralux", new BlockHydralux());
public static final Block CAVE_BUSH = registerBlock("cave_bush", new BlockSimpleLeaves(MaterialColor.MAGENTA));

View file

@ -0,0 +1,8 @@
{
"variants": {
"age=0": { "model": "betterend:block/hydralux_sapling_1" },
"age=1": { "model": "betterend:block/hydralux_sapling_2" },
"age=2": { "model": "betterend:block/hydralux_sapling_3" },
"age=3": { "model": "betterend:block/hydralux_sapling_4" }
}
}

View file

@ -1,8 +0,0 @@
{
"variants": {
"age=0": { "model": "betterend:block/hydralux_spore" },
"age=1": { "model": "betterend:block/hydralux_spore" },
"age=2": { "model": "betterend:block/hydralux_spore" },
"age=3": { "model": "betterend:block/hydralux_spore" }
}
}

View file

@ -0,0 +1,42 @@
{
"defaultMap": {
"spriteMap": [
{
"sprite": "betterend:block/hydralux_flower_petal",
"material": "betterend:waving_glow_inc"
},
{
"sprite": "betterend:block/hydralux_flower_bud_petal_side",
"material": "betterend:waving_glow_inc"
},
{
"sprite": "betterend:block/hydralux_flower_bud_petal_top",
"material": "betterend:waving_glow_inc"
},
{
"sprite": "betterend:block/hydralux_bloom_bottom",
"material": "betterend:waving"
},
{
"sprite": "betterend:block/hydralux_bloom_top",
"material": "betterend:waving"
},
{
"sprite": "betterend:block/hydralux_vine",
"material": "betterend:waving"
},
{
"sprite": "betterend:block/hydralux_flower_bottom",
"material": "betterend:waving_glow_inc"
},
{
"sprite": "betterend:block/hydralux_flower_bud",
"material": "betterend:waving"
},
{
"sprite": "betterend:block/hydralux_vine_bottom",
"material": "betterend:waving_floor"
}
]
}
}

View file

@ -3,7 +3,7 @@
"textures": {
"particle": "betterend:block/hydralux_flower_bottom",
"texture": "betterend:block/hydralux_flower_bottom",
"petal_bottom": "betterend:block/hydralux_flower_bud_petal_bottom",
"petal_bottom": "betterend:block/hydralux_bloom_bottom",
"petal_side": "betterend:block/hydralux_flower_bud_petal_side",
"petal": "betterend:block/hydralux_flower_petal",
"top": "betterend:block/hydralux_bloom_top"
@ -49,7 +49,7 @@
"to": [ 13, 16, 13 ],
"shade": false,
"faces": {
"down": { "uv": [ 3, 3, 13, 13 ], "texture": "#texture" },
"down": { "uv": [ 3, 3, 13, 13 ], "texture": "#petal_bottom" },
"up": { "uv": [ 3, 3, 13, 13 ], "texture": "#top" },
"north": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" },
"south": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" },

View file

@ -3,7 +3,7 @@
"textures": {
"particle": "betterend:block/hydralux_flower_bottom",
"texture": "betterend:block/hydralux_flower_bottom",
"petal_bottom": "betterend:block/hydralux_flower_bud_petal_bottom",
"petal_bottom": "betterend:block/hydralux_bloom_bottom",
"petal_side": "betterend:block/hydralux_flower_bud_petal_side",
"petal": "betterend:block/hydralux_flower_petal",
"top": "betterend:block/hydralux_bloom_top"
@ -49,7 +49,7 @@
"to": [ 13, 16, 13 ],
"shade": false,
"faces": {
"down": { "uv": [ 3, 3, 13, 13 ], "texture": "#texture" },
"down": { "uv": [ 3, 3, 13, 13 ], "texture": "#petal_bottom" },
"up": { "uv": [ 3, 3, 13, 13 ], "texture": "#top" },
"north": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" },
"south": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" },
@ -81,7 +81,6 @@
"__comment": "PlaneY7",
"from": [ 13, 16, 0 ],
"to": [ 29, 16.001, 16 ],
"rotation": { "origin": [ 13, 16, 0 ], "axis": "z", "angle": 0 },
"shade": false,
"faces": {
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 90 },

View file

@ -3,7 +3,7 @@
"textures": {
"particle": "betterend:block/hydralux_flower_bottom",
"texture": "betterend:block/hydralux_flower_bottom",
"petal_bottom": "betterend:block/hydralux_flower_bud_petal_bottom",
"petal_bottom": "betterend:block/hydralux_bloom_bottom",
"petal_side": "betterend:block/hydralux_flower_bud_petal_side",
"petal": "betterend:block/hydralux_flower_petal",
"top": "betterend:block/hydralux_bloom_top"
@ -49,7 +49,7 @@
"to": [ 13, 16, 13 ],
"shade": false,
"faces": {
"down": { "uv": [ 3, 3, 13, 13 ], "texture": "#texture" },
"down": { "uv": [ 3, 3, 13, 13 ], "texture": "#petal_bottom" },
"up": { "uv": [ 3, 3, 13, 13 ], "texture": "#top" },
"north": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" },
"south": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" },

View file

@ -7,14 +7,14 @@
"elements": [
{
"__comment": "Box3",
"from": [ 4, 0, 4 ],
"to": [ 12, 3, 12 ],
"from": [ 5, 0, 5 ],
"to": [ 11, 2, 11 ],
"faces": {
"up": { "uv": [ 0, 0, 8, 8 ], "texture": "#texture" },
"north": { "uv": [ 0, 8, 8, 11 ], "texture": "#texture" },
"south": { "uv": [ 0, 8, 8, 11 ], "texture": "#texture" },
"west": { "uv": [ 0, 8, 8, 11 ], "texture": "#texture" },
"east": { "uv": [ 0, 8, 8, 11 ], "texture": "#texture" }
"up": { "uv": [ 1, 1, 7, 7 ], "texture": "#texture" },
"north": { "uv": [ 1, 8, 7, 10 ], "texture": "#texture" },
"south": { "uv": [ 1, 8, 7, 10 ], "texture": "#texture" },
"west": { "uv": [ 1, 8, 7, 10 ], "texture": "#texture" },
"east": { "uv": [ 1, 8, 7, 10 ], "texture": "#texture" }
}
},
{

View file

@ -1,9 +1,8 @@
{
"__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio",
"textures": {
"particle": "betterend:block/hydralux_vine",
"texture": "betterend:block/hydralux_vine",
"roots": "betterend:block/hydralux_roots"
"particle": "betterend:block/hydralux_vine_bottom",
"texture": "betterend:block/hydralux_vine_bottom"
},
"elements": [
{
@ -27,50 +26,6 @@
"west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" },
"east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneX4",
"from": [ 5, 0, 0.5 ],
"to": [ 5.001, 16, 16.5 ],
"rotation": { "origin": [ 5, 0, 0.5 ], "axis": "y", "angle": 22.5 },
"shade": false,
"faces": {
"west": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" },
"east": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }
}
},
{
"__comment": "PlaneZ5",
"from": [ 0.5, 0, 11 ],
"to": [ 16.5, 16, 11.001 ],
"rotation": { "origin": [ 0.5, 0, 11 ], "axis": "y", "angle": 22.5 },
"shade": false,
"faces": {
"north": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" },
"south": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }
}
},
{
"__comment": "PlaneX4",
"from": [ 11, 0, 0.5 ],
"to": [ 11.001, 16, 16.5 ],
"rotation": { "origin": [ 11, 0, 0.5 ], "axis": "y", "angle": -22.5 },
"shade": false,
"faces": {
"west": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" },
"east": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }
}
},
{
"__comment": "PlaneZ5",
"from": [ 0.5, 0, 5 ],
"to": [ 16.5, 16, 5.001 ],
"rotation": { "origin": [ 0.5, 0, 5 ], "axis": "y", "angle": -22.5 },
"shade": false,
"faces": {
"north": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" },
"south": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }
}
}
]
}

View file

@ -1,6 +1,6 @@
{
"parent": "betterend:block/cross_no_distortion",
"textures": {
"texture": "betterend:block/hydralux_spore"
"texture": "betterend:block/hydralux_sapling_1"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "betterend:block/cross_no_distortion",
"textures": {
"texture": "betterend:block/hydralux_sapling_2"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "betterend:block/cross_no_distortion",
"textures": {
"texture": "betterend:block/hydralux_sapling_3"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "betterend:block/cross_no_distortion",
"textures": {
"texture": "betterend:block/hydralux_sapling_4"
}
}

View file

@ -0,0 +1,76 @@
{
"__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio",
"textures": {
"particle": "betterend:block/hydralux_vine_bottom",
"texture": "betterend:block/hydralux_vine_bottom",
"roots": "betterend:block/hydralux_roots"
},
"elements": [
{
"__comment": "PlaneX1",
"from": [ 2.375, 0, 2.25 ],
"to": [ 2.376, 16, 18.25 ],
"rotation": { "origin": [ 2.375, 0, 2.25 ], "axis": "y", "angle": 45 },
"shade": false,
"faces": {
"west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" },
"east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneX1",
"from": [ 13.75, 0, 2.25 ],
"to": [ 13.751, 16, 18.25 ],
"rotation": { "origin": [ 13.75, 0, 2.25 ], "axis": "y", "angle": -45 },
"shade": false,
"faces": {
"west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" },
"east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneX4",
"from": [ 5, 0, 0.5 ],
"to": [ 5.001, 16, 16.5 ],
"rotation": { "origin": [ 5, 0, 0.5 ], "axis": "y", "angle": 22.5 },
"shade": false,
"faces": {
"west": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" },
"east": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }
}
},
{
"__comment": "PlaneZ5",
"from": [ 0.5, 0, 11 ],
"to": [ 16.5, 16, 11.001 ],
"rotation": { "origin": [ 0.5, 0, 11 ], "axis": "y", "angle": 22.5 },
"shade": false,
"faces": {
"north": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" },
"south": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }
}
},
{
"__comment": "PlaneX4",
"from": [ 11, 0, 0.5 ],
"to": [ 11.001, 16, 16.5 ],
"rotation": { "origin": [ 11, 0, 0.5 ], "axis": "y", "angle": -22.5 },
"shade": false,
"faces": {
"west": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" },
"east": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }
}
},
{
"__comment": "PlaneZ5",
"from": [ 0.5, 0, 5 ],
"to": [ 16.5, 16, 5.001 ],
"rotation": { "origin": [ 0.5, 0, 5 ], "axis": "y", "angle": -22.5 },
"shade": false,
"faces": {
"north": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" },
"south": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }
}
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 363 B

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B