Lotus stem states

This commit is contained in:
paulevsGitch 2020-10-20 17:33:50 +03:00
parent 00eafec536
commit bd8ba7df7a
13 changed files with 135 additions and 24 deletions

View file

@ -10,7 +10,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import ru.betterend.blocks.basis.BlockPlant; import ru.betterend.blocks.basis.BlockPlant;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.BlockRegistry;
public class BlockEndLotusFlower extends BlockPlant { public class BlockEndLotusFlower extends BlockPlant {
private static final VoxelShape SHAPE_OUTLINE = Block.createCuboidShape(2, 0, 2, 14, 14, 14); private static final VoxelShape SHAPE_OUTLINE = Block.createCuboidShape(2, 0, 2, 14, 14, 14);
@ -22,7 +22,7 @@ public class BlockEndLotusFlower extends BlockPlant {
@Override @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.isIn(BlockTagRegistry.END_GROUND); return state.isOf(BlockRegistry.END_LOTUS_FLOWER);
} }
@Override @Override

View file

@ -11,31 +11,34 @@ import net.minecraft.fluid.Fluids;
import net.minecraft.item.ItemPlacementContext; import net.minecraft.item.ItemPlacementContext;
import net.minecraft.state.StateManager; import net.minecraft.state.StateManager;
import net.minecraft.state.property.BooleanProperty; import net.minecraft.state.property.BooleanProperty;
import net.minecraft.state.property.EnumProperty;
import net.minecraft.state.property.Properties; import net.minecraft.state.property.Properties;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import net.minecraft.world.WorldAccess; import net.minecraft.world.WorldAccess;
import ru.betterend.blocks.BlockProperties.TripleShape;
import ru.betterend.blocks.basis.BlockBase; import ru.betterend.blocks.basis.BlockBase;
public class BlockEndLotusStem extends BlockBase implements Waterloggable { public class BlockEndLotusStem extends BlockBase implements Waterloggable {
private static final VoxelShape SHAPE = Block.createCuboidShape(5, 0, 5, 11, 16, 11);
public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED; public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED;
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
private static final VoxelShape VSHAPE = Block.createCuboidShape(6, 0, 6, 10, 16, 10);
public BlockEndLotusStem() { public BlockEndLotusStem() {
super(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS)); super(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS));
this.setDefaultState(getDefaultState().with(WATERLOGGED, false)); this.setDefaultState(getDefaultState().with(WATERLOGGED, false).with(SHAPE, TripleShape.MIDDLE));
} }
@Override @Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ePos) { public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ePos) {
return SHAPE; return VSHAPE;
} }
@Override @Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) { protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
builder.add(WATERLOGGED); builder.add(WATERLOGGED, SHAPE);
} }
@Override @Override

View file

@ -5,7 +5,6 @@ import java.util.Random;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.block.NetherPortalBlock; import net.minecraft.block.NetherPortalBlock;
@ -17,7 +16,6 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.WorldAccess; import net.minecraft.world.WorldAccess;
import ru.betterend.client.ERenderLayer; import ru.betterend.client.ERenderLayer;
import ru.betterend.client.IRenderTypeable; import ru.betterend.client.IRenderTypeable;
import ru.betterend.registry.ParticleRegistry; import ru.betterend.registry.ParticleRegistry;

View file

@ -2,10 +2,8 @@ package ru.betterend.client;
import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.RenderLayer;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import ru.betterend.registry.BlockEntityRenderRegistry; import ru.betterend.registry.BlockEntityRenderRegistry;
import ru.betterend.registry.EntityRenderRegistry; import ru.betterend.registry.EntityRenderRegistry;
import ru.betterend.registry.ParticleRegistry; import ru.betterend.registry.ParticleRegistry;

View file

@ -8,9 +8,7 @@ import com.google.common.collect.Multimap;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import io.netty.util.internal.ThreadLocalRandom; import io.netty.util.internal.ThreadLocalRandom;
import net.fabricmc.fabric.api.tool.attribute.v1.DynamicAttributeTool; import net.fabricmc.fabric.api.tool.attribute.v1.DynamicAttributeTool;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.block.Material; import net.minecraft.block.Material;
@ -28,7 +26,6 @@ import net.minecraft.tag.Tag;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
import ru.betterend.registry.ItemTagRegistry; import ru.betterend.registry.ItemTagRegistry;
public class EndHammer extends MiningToolItem implements DynamicAttributeTool { public class EndHammer extends MiningToolItem implements DynamicAttributeTool {

View file

@ -5,7 +5,6 @@ import net.minecraft.block.MaterialColor;
import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItem;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.blocks.AeterniumBlock; import ru.betterend.blocks.AeterniumBlock;
import ru.betterend.blocks.AuroraCrystalBlock; import ru.betterend.blocks.AuroraCrystalBlock;

View file

@ -1,5 +1,7 @@
{ {
"variants": { "variants": {
"": { "model": "betterend:block/end_lotus_stem" } "shape=top": { "model": "betterend:block/end_lotus_stem_top" },
"shape=middle": { "model": "betterend:block/end_lotus_stem" },
"shape=bottom": { "model": "betterend:block/end_lotus_roots" }
} }
} }

View file

@ -24,6 +24,7 @@
"from": [ -0.5, 2, 12 ], "from": [ -0.5, 2, 12 ],
"to": [ 15.5, 2.001, 20 ], "to": [ 15.5, 2.001, 20 ],
"rotation": { "origin": [ -0.5, 2, 12 ], "axis": "x", "angle": -45 }, "rotation": { "origin": [ -0.5, 2, 12 ], "axis": "x", "angle": -45 },
"shade": false,
"faces": { "faces": {
"down": { "uv": [ 16, 8, 0, 16 ], "texture": "#petal" }, "down": { "uv": [ 16, 8, 0, 16 ], "texture": "#petal" },
"up": { "uv": [ 0, 8, 16, 16 ], "texture": "#petal", "rotation": 180 } "up": { "uv": [ 0, 8, 16, 16 ], "texture": "#petal", "rotation": 180 }
@ -33,6 +34,7 @@
"__comment": "PlaneY2", "__comment": "PlaneY2",
"from": [ -0.5, 7.5, 17.5 ], "from": [ -0.5, 7.5, 17.5 ],
"to": [ 15.5, 7.501, 25.5 ], "to": [ 15.5, 7.501, 25.5 ],
"shade": false,
"faces": { "faces": {
"down": { "uv": [ 16, 0, 0, 8 ], "texture": "#petal" }, "down": { "uv": [ 16, 0, 0, 8 ], "texture": "#petal" },
"up": { "uv": [ 0, 0, 16, 8 ], "texture": "#petal", "rotation": 180 } "up": { "uv": [ 0, 0, 16, 8 ], "texture": "#petal", "rotation": 180 }
@ -43,6 +45,7 @@
"from": [ 0.5, 1.999, -4 ], "from": [ 0.5, 1.999, -4 ],
"to": [ 16.5, 2, 4 ], "to": [ 16.5, 2, 4 ],
"rotation": { "origin": [ 0.5, 2, 4 ], "axis": "x", "angle": 45 }, "rotation": { "origin": [ 0.5, 2, 4 ], "axis": "x", "angle": 45 },
"shade": false,
"faces": { "faces": {
"down": { "uv": [ 16, 8, 0, 16 ], "texture": "#petal", "rotation": 180 }, "down": { "uv": [ 16, 8, 0, 16 ], "texture": "#petal", "rotation": 180 },
"up": { "uv": [ 0, 8, 16, 16 ], "texture": "#petal" } "up": { "uv": [ 0, 8, 16, 16 ], "texture": "#petal" }
@ -52,6 +55,7 @@
"__comment": "PlaneY2", "__comment": "PlaneY2",
"from": [ 0.5, 7.5, -9.5 ], "from": [ 0.5, 7.5, -9.5 ],
"to": [ 16.5, 7.501, -1.5 ], "to": [ 16.5, 7.501, -1.5 ],
"shade": false,
"faces": { "faces": {
"down": { "uv": [ 16, 0, 0, 8 ], "texture": "#petal", "rotation": 180 }, "down": { "uv": [ 16, 0, 0, 8 ], "texture": "#petal", "rotation": 180 },
"up": { "uv": [ 0, 0, 16, 8 ], "texture": "#petal" } "up": { "uv": [ 0, 0, 16, 8 ], "texture": "#petal" }
@ -62,6 +66,7 @@
"from": [ 12, 2, 0.5 ], "from": [ 12, 2, 0.5 ],
"to": [ 20, 2.001, 16.5 ], "to": [ 20, 2.001, 16.5 ],
"rotation": { "origin": [ 12, 2, 0.5 ], "axis": "z", "angle": 45 }, "rotation": { "origin": [ 12, 2, 0.5 ], "axis": "z", "angle": 45 },
"shade": false,
"faces": { "faces": {
"down": { "uv": [ 16, 8, 0, 16 ], "texture": "#petal", "rotation": 90 }, "down": { "uv": [ 16, 8, 0, 16 ], "texture": "#petal", "rotation": 90 },
"up": { "uv": [ 0, 8, 16, 16 ], "texture": "#petal", "rotation": 90 } "up": { "uv": [ 0, 8, 16, 16 ], "texture": "#petal", "rotation": 90 }
@ -71,7 +76,7 @@
"__comment": "PlaneY12", "__comment": "PlaneY12",
"from": [ 17.5, 7.5, 0.5 ], "from": [ 17.5, 7.5, 0.5 ],
"to": [ 25.5, 7.501, 16.5 ], "to": [ 25.5, 7.501, 16.5 ],
"rotation": { "origin": [ 17.5, 7.5, 0.5 ], "axis": "z", "angle": 0 }, "shade": false,
"faces": { "faces": {
"down": { "uv": [ 16, 0, 0, 8 ], "texture": "#petal", "rotation": 90 }, "down": { "uv": [ 16, 0, 0, 8 ], "texture": "#petal", "rotation": 90 },
"up": { "uv": [ 0, 0, 16, 8 ], "texture": "#petal", "rotation": 90 } "up": { "uv": [ 0, 0, 16, 8 ], "texture": "#petal", "rotation": 90 }
@ -82,6 +87,7 @@
"from": [ -4, 1.999, -0.5 ], "from": [ -4, 1.999, -0.5 ],
"to": [ 4, 2, 15.5 ], "to": [ 4, 2, 15.5 ],
"rotation": { "origin": [ 4, 2, -0.5 ], "axis": "z", "angle": -45 }, "rotation": { "origin": [ 4, 2, -0.5 ], "axis": "z", "angle": -45 },
"shade": false,
"faces": { "faces": {
"down": { "uv": [ 16, 8, 0, 16 ], "texture": "#petal", "rotation": 270 }, "down": { "uv": [ 16, 8, 0, 16 ], "texture": "#petal", "rotation": 270 },
"up": { "uv": [ 0, 8, 16, 16 ], "texture": "#petal", "rotation": 270 } "up": { "uv": [ 0, 8, 16, 16 ], "texture": "#petal", "rotation": 270 }
@ -91,6 +97,7 @@
"__comment": "PlaneY12", "__comment": "PlaneY12",
"from": [ -9.5, 7.5, -0.5 ], "from": [ -9.5, 7.5, -0.5 ],
"to": [ -1.5, 7.501, 15.5 ], "to": [ -1.5, 7.501, 15.5 ],
"shade": false,
"faces": { "faces": {
"down": { "uv": [ 16, 0, 0, 8 ], "texture": "#petal", "rotation": 270 }, "down": { "uv": [ 16, 0, 0, 8 ], "texture": "#petal", "rotation": 270 },
"up": { "uv": [ 0, 0, 16, 8 ], "texture": "#petal", "rotation": 270 } "up": { "uv": [ 0, 0, 16, 8 ], "texture": "#petal", "rotation": 270 }
@ -101,6 +108,7 @@
"from": [ 15.5, 2, -10.5 ], "from": [ 15.5, 2, -10.5 ],
"to": [ 31.5, 2.001, 5.5 ], "to": [ 31.5, 2.001, 5.5 ],
"rotation": { "origin": [ 15.5, 2, -10.5 ], "axis": "y", "angle": -45 }, "rotation": { "origin": [ 15.5, 2, -10.5 ], "axis": "y", "angle": -45 },
"shade": false,
"faces": { "faces": {
"down": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal", "rotation": 180 }, "down": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal", "rotation": 180 },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal" } "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal" }
@ -111,6 +119,7 @@
"from": [ 10.5, 2, -0.5 ], "from": [ 10.5, 2, -0.5 ],
"to": [ 26.5, 2.001, 15.5 ], "to": [ 26.5, 2.001, 15.5 ],
"rotation": { "origin": [ 26.5, 2, 15.5 ], "axis": "y", "angle": 45 }, "rotation": { "origin": [ 26.5, 2, 15.5 ], "axis": "y", "angle": 45 },
"shade": false,
"faces": { "faces": {
"down": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal" }, "down": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal" },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 180 } "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 180 }
@ -121,6 +130,7 @@
"from": [ -15.5, 2, 10.5 ], "from": [ -15.5, 2, 10.5 ],
"to": [ 0.5, 2.001, 26.5 ], "to": [ 0.5, 2.001, 26.5 ],
"rotation": { "origin": [ 0.5, 2, 26.5 ], "axis": "y", "angle": -45 }, "rotation": { "origin": [ 0.5, 2, 26.5 ], "axis": "y", "angle": -45 },
"shade": false,
"faces": { "faces": {
"down": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal" }, "down": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal" },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 180 } "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 180 }
@ -131,6 +141,7 @@
"from": [ -10.4999, 2, 0.4999 ], "from": [ -10.4999, 2, 0.4999 ],
"to": [ 5.5001, 2.001, 16.4999 ], "to": [ 5.5001, 2.001, 16.4999 ],
"rotation": { "origin": [ -10.5, 2, 0.5 ], "axis": "y", "angle": 45 }, "rotation": { "origin": [ -10.5, 2, 0.5 ], "axis": "y", "angle": 45 },
"shade": false,
"faces": { "faces": {
"down": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal", "rotation": 180 }, "down": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal", "rotation": 180 },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal" } "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal" }

View file

@ -0,0 +1,68 @@
{
"__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio",
"parent": "block/block",
"textures": {
"particle": "betterend:block/end_lotus_stem",
"texture": "betterend:block/end_lotus_stem",
"roots": "betterend:block/end_lotus_roots"
},
"elements": [
{
"__comment": "Box1",
"from": [ 6, 0, 6 ],
"to": [ 10, 16, 10 ],
"faces": {
"down": { "uv": [ 4, 0, 8, 4 ], "texture": "#texture", "cullface": "down" },
"up": { "uv": [ 4, 0, 8, 4 ], "texture": "#texture", "cullface": "up" },
"north": { "uv": [ 0, 0, 4, 16 ], "texture": "#texture" },
"south": { "uv": [ 0, 0, 4, 16 ], "texture": "#texture" },
"west": { "uv": [ 0, 0, 4, 16 ], "texture": "#texture" },
"east": { "uv": [ 0, 0, 4, 16 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneX2",
"from": [ 5, 0, 1 ],
"to": [ 5.001, 16, 17 ],
"rotation": { "origin": [ 5, 0, 1 ], "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": "PlaneX2",
"from": [ 11, 0, 1 ],
"to": [ 11.001, 16, 17 ],
"rotation": { "origin": [ 11, 0, 1 ], "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": "PlaneX2",
"from": [ 0.5, 0, 4.999 ],
"to": [ 16.5, 16, 5 ],
"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" }
}
},
{
"__comment": "PlaneX2",
"from": [ 0.5, 0, 10.999 ],
"to": [ 16.5, 16, 11 ],
"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" }
}
}
]
}

View file

@ -8,15 +8,15 @@
"elements": [ "elements": [
{ {
"__comment": "Box1", "__comment": "Box1",
"from": [ 5, 0, 5 ], "from": [ 6, 0, 6 ],
"to": [ 11, 16, 11 ], "to": [ 10, 16, 10 ],
"faces": { "faces": {
"down": { "uv": [ 6, 0, 12, 6 ], "texture": "#texture", "cullface": "down" }, "down": { "uv": [ 4, 0, 8, 4 ], "texture": "#texture", "cullface": "down" },
"up": { "uv": [ 6, 0, 12, 6 ], "texture": "#texture", "cullface": "up" }, "up": { "uv": [ 4, 0, 8, 4 ], "texture": "#texture", "cullface": "up" },
"north": { "uv": [ 0, 0, 6, 16 ], "texture": "#texture" }, "north": { "uv": [ 0, 0, 4, 16 ], "texture": "#texture" },
"south": { "uv": [ 0, 0, 6, 16 ], "texture": "#texture" }, "south": { "uv": [ 0, 0, 4, 16 ], "texture": "#texture" },
"west": { "uv": [ 0, 0, 6, 16 ], "texture": "#texture" }, "west": { "uv": [ 0, 0, 4, 16 ], "texture": "#texture" },
"east": { "uv": [ 0, 0, 6, 16 ], "texture": "#texture" } "east": { "uv": [ 0, 0, 4, 16 ], "texture": "#texture" }
} }
} }
] ]

View file

@ -0,0 +1,35 @@
{
"__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio",
"parent": "block/block",
"textures": {
"particle": "betterend:block/end_lotus_stem",
"texture": "betterend:block/end_lotus_stem"
},
"elements": [
{
"__comment": "Box1",
"from": [ 6, 0, 6 ],
"to": [ 10, 12, 10 ],
"faces": {
"down": { "uv": [ 4, 0, 8, 4 ], "texture": "#texture", "cullface": "down" },
"north": { "uv": [ 0, 4, 4, 16 ], "texture": "#texture" },
"south": { "uv": [ 0, 4, 4, 16 ], "texture": "#texture" },
"west": { "uv": [ 0, 4, 4, 16 ], "texture": "#texture" },
"east": { "uv": [ 0, 4, 4, 16 ], "texture": "#texture" }
}
},
{
"__comment": "Box2",
"from": [ 5, 12, 5 ],
"to": [ 11, 16, 11 ],
"faces": {
"down": { "uv": [ 4, 8, 10, 14 ], "texture": "#texture" },
"up": { "uv": [ 4, 8, 10, 14 ], "texture": "#texture", "cullface": "up" },
"north": { "uv": [ 4, 4, 10, 8 ], "texture": "#texture" },
"south": { "uv": [ 4, 4, 10, 8 ], "texture": "#texture" },
"west": { "uv": [ 4, 4, 10, 8 ], "texture": "#texture" },
"east": { "uv": [ 4, 4, 10, 8 ], "texture": "#texture" }
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Before After
Before After