Infusion Pedestal
This commit is contained in:
parent
ff0f9f18a9
commit
e96d06337e
5 changed files with 60 additions and 11 deletions
|
@ -1,16 +1,25 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
|
import net.minecraft.block.ShapeContext;
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
import net.minecraft.block.entity.BlockEntity;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
|
import net.minecraft.util.shape.VoxelShapes;
|
||||||
import net.minecraft.world.BlockView;
|
import net.minecraft.world.BlockView;
|
||||||
|
|
||||||
import ru.betterend.blocks.basis.BlockPedestal;
|
import ru.betterend.blocks.basis.BlockPedestal;
|
||||||
import ru.betterend.blocks.entities.InfusionPedestalEntity;
|
import ru.betterend.blocks.entities.InfusionPedestalEntity;
|
||||||
|
|
||||||
public class InfusionPedestal extends BlockPedestal {
|
public class InfusionPedestal extends BlockPedestal {
|
||||||
|
private static final VoxelShape SHAPE_DEFAULT;
|
||||||
|
private static final VoxelShape SHAPE_PEDESTAL_TOP;
|
||||||
|
|
||||||
public InfusionPedestal() {
|
public InfusionPedestal() {
|
||||||
super(Blocks.OBSIDIAN);
|
super(Blocks.OBSIDIAN);
|
||||||
this.height = 1.1F;
|
this.height = 1.08F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -18,4 +27,35 @@ public class InfusionPedestal extends BlockPedestal {
|
||||||
return new InfusionPedestalEntity();
|
return new InfusionPedestalEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
|
if (state.isOf(this)) {
|
||||||
|
switch(state.get(STATE)) {
|
||||||
|
case PEDESTAL_TOP: {
|
||||||
|
return SHAPE_PEDESTAL_TOP;
|
||||||
|
}
|
||||||
|
case DEFAULT: {
|
||||||
|
return SHAPE_DEFAULT;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
return super.getOutlineShape(state, world, pos, context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.getOutlineShape(state, world, pos, context);
|
||||||
|
}
|
||||||
|
|
||||||
|
static {
|
||||||
|
VoxelShape basinUp = Block.createCuboidShape(2, 3, 2, 14, 4, 14);
|
||||||
|
VoxelShape basinDown = Block.createCuboidShape(0, 0, 0, 16, 3, 16);
|
||||||
|
VoxelShape pedestalTop = Block.createCuboidShape(1, 9, 1, 15, 11, 15);
|
||||||
|
VoxelShape pedestalDefault = Block.createCuboidShape(1, 13, 1, 15, 15, 15);
|
||||||
|
VoxelShape pillar = Block.createCuboidShape(3, 0, 3, 13, 9, 13);
|
||||||
|
VoxelShape pillarDefault = Block.createCuboidShape(3, 4, 3, 13, 13, 13);
|
||||||
|
VoxelShape eyeDefault = Block.createCuboidShape(4, 15, 4, 12, 16, 12);
|
||||||
|
VoxelShape eyeTop = Block.createCuboidShape(4, 11, 4, 12, 12, 12);
|
||||||
|
VoxelShape basin = VoxelShapes.union(basinDown, basinUp);
|
||||||
|
SHAPE_DEFAULT = VoxelShapes.union(basin, pillarDefault, pedestalDefault, eyeDefault);
|
||||||
|
SHAPE_PEDESTAL_TOP = VoxelShapes.union(pillar, pedestalTop, eyeTop);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,13 @@ public class CraftingRecipes {
|
||||||
registerPedestal("quartz_pedestal", EndBlocks.QUARTZ_PEDESTAL, Blocks.QUARTZ_SLAB, Blocks.QUARTZ_PILLAR);
|
registerPedestal("quartz_pedestal", EndBlocks.QUARTZ_PEDESTAL, Blocks.QUARTZ_SLAB, Blocks.QUARTZ_PILLAR);
|
||||||
registerPedestal("purpur_pedestal", EndBlocks.PURPUR_PEDESTAL, Blocks.PURPUR_SLAB, Blocks.PURPUR_PILLAR);
|
registerPedestal("purpur_pedestal", EndBlocks.PURPUR_PEDESTAL, Blocks.PURPUR_SLAB, Blocks.PURPUR_PILLAR);
|
||||||
|
|
||||||
|
GridRecipe.make("infusion_pedestal", EndBlocks.INFUSION_PEDESTAL)
|
||||||
|
.setShape(new String[] { " Y ", "O#O", " # " })
|
||||||
|
.addMaterial('O', Items.ENDER_PEARL)
|
||||||
|
.addMaterial('Y', Items.ENDER_EYE)
|
||||||
|
.addMaterial('#', Blocks.OBSIDIAN)
|
||||||
|
.build();
|
||||||
|
|
||||||
String material = "terminite";
|
String material = "terminite";
|
||||||
GridRecipe.make(material + "_block", EndBlocks.TERMINITE_BLOCK)
|
GridRecipe.make(material + "_block", EndBlocks.TERMINITE_BLOCK)
|
||||||
.setShape(new String[] { "III", "III", "III" })
|
.setShape(new String[] { "III", "III", "III" })
|
||||||
|
|
|
@ -168,6 +168,7 @@
|
||||||
"block.betterend.granite_pedestal": "Granite Pedestal",
|
"block.betterend.granite_pedestal": "Granite Pedestal",
|
||||||
"block.betterend.purpur_pedestal": "Purpur Pedestal",
|
"block.betterend.purpur_pedestal": "Purpur Pedestal",
|
||||||
"block.betterend.quartz_pedestal": "Quartz Pedestal",
|
"block.betterend.quartz_pedestal": "Quartz Pedestal",
|
||||||
|
"block.betterend.infusion_pedestal": "Infusion Pedestal",
|
||||||
|
|
||||||
"block.betterend.end_lotus_seed": "End Lotus Seed",
|
"block.betterend.end_lotus_seed": "End Lotus Seed",
|
||||||
"block.betterend.end_lotus_stem": "End Lotus Stem",
|
"block.betterend.end_lotus_stem": "End Lotus Stem",
|
||||||
|
|
|
@ -168,6 +168,7 @@
|
||||||
"block.betterend.granite_pedestal": "Пьедестал из гранита",
|
"block.betterend.granite_pedestal": "Пьедестал из гранита",
|
||||||
"block.betterend.purpur_pedestal": "Пьедестал из пурпура",
|
"block.betterend.purpur_pedestal": "Пьедестал из пурпура",
|
||||||
"block.betterend.quartz_pedestal": "Пьедестал из кварца",
|
"block.betterend.quartz_pedestal": "Пьедестал из кварца",
|
||||||
|
"block.betterend.infusion_pedestal": "Пьедестал Наполнения",
|
||||||
|
|
||||||
"block.betterend.end_lotus_seed": "Семя лотоса края",
|
"block.betterend.end_lotus_seed": "Семя лотоса края",
|
||||||
"block.betterend.end_lotus_stem": "Стебель лотоса края",
|
"block.betterend.end_lotus_stem": "Стебель лотоса края",
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"__comment": "eye",
|
"__comment": "eye",
|
||||||
"from": [ 4, 10, 4 ],
|
"from": [ 4, 11, 4 ],
|
||||||
"to": [ 12, 11, 12 ],
|
"to": [ 12, 12, 12 ],
|
||||||
"faces": {
|
"faces": {
|
||||||
"up": { "uv": [ 4, 4, 12, 12 ], "texture": "#top" },
|
"up": { "uv": [ 4, 4, 12, 12 ], "texture": "#top" },
|
||||||
"north": { "uv": [ 4, 4, 12, 5 ], "texture": "#top" },
|
"north": { "uv": [ 4, 4, 12, 5 ], "texture": "#top" },
|
||||||
|
@ -22,18 +22,18 @@
|
||||||
{
|
{
|
||||||
"__comment": "pillar",
|
"__comment": "pillar",
|
||||||
"from": [ 3, 0, 3 ],
|
"from": [ 3, 0, 3 ],
|
||||||
"to": [ 13, 8, 13 ],
|
"to": [ 13, 9, 13 ],
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": { "uv": [ 3, 0, 13, 8 ], "texture": "#pillar" },
|
"north": { "uv": [ 3, 0, 13, 9 ], "texture": "#pillar" },
|
||||||
"south": { "uv": [ 3, 0, 13, 8 ], "texture": "#pillar" },
|
"south": { "uv": [ 3, 0, 13, 9 ], "texture": "#pillar" },
|
||||||
"west": { "uv": [ 3, 0, 13, 8 ], "texture": "#pillar" },
|
"west": { "uv": [ 3, 0, 13, 9 ], "texture": "#pillar" },
|
||||||
"east": { "uv": [ 3, 0, 13, 8 ], "texture": "#pillar" }
|
"east": { "uv": [ 3, 0, 13, 9 ], "texture": "#pillar" }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__comment": "top",
|
"__comment": "top",
|
||||||
"from": [ 1, 8, 1 ],
|
"from": [ 1, 9, 1 ],
|
||||||
"to": [ 15, 10, 15 ],
|
"to": [ 15, 11, 15 ],
|
||||||
"faces": {
|
"faces": {
|
||||||
"down": { "uv": [ 1, 1, 15, 15 ], "texture": "#base" },
|
"down": { "uv": [ 1, 1, 15, 15 ], "texture": "#base" },
|
||||||
"up": { "uv": [ 1, 1, 15, 15 ], "texture": "#top" },
|
"up": { "uv": [ 1, 1, 15, 15 ], "texture": "#top" },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue