diff --git a/psd/infusion_pedestal.psd b/psd/infusion_pedestal.psd new file mode 100644 index 00000000..c42ca618 Binary files /dev/null and b/psd/infusion_pedestal.psd differ diff --git a/src/main/java/ru/betterend/blocks/BlockProperties.java b/src/main/java/ru/betterend/blocks/BlockProperties.java index e6364093..26cecf72 100644 --- a/src/main/java/ru/betterend/blocks/BlockProperties.java +++ b/src/main/java/ru/betterend/blocks/BlockProperties.java @@ -33,21 +33,27 @@ public class BlockProperties { } public static enum PedestalState implements StringIdentifiable { - PEDESTAL_TOP, - COLUMN_TOP, - BOTTOM, - PILLAR, - COLUMN, - DEFAULT; + PEDESTAL_TOP("pedestal_top"), + COLUMN_TOP("column_top"), + BOTTOM("bottom"), + PILLAR("pillar"), + COLUMN("column"), + DEFAULT("default"); + + private final String name; + + PedestalState(String name) { + this.name = name; + } @Override public String asString() { - return this.name().toLowerCase(); + return this.name; } @Override public String toString() { - return this.asString(); + return this.name; } } } diff --git a/src/main/java/ru/betterend/blocks/InfusionPedestal.java b/src/main/java/ru/betterend/blocks/InfusionPedestal.java index 4d96043a..8301b4be 100644 --- a/src/main/java/ru/betterend/blocks/InfusionPedestal.java +++ b/src/main/java/ru/betterend/blocks/InfusionPedestal.java @@ -1,12 +1,22 @@ package ru.betterend.blocks; -import net.minecraft.block.Block; +import net.minecraft.block.Blocks; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.world.BlockView; + import ru.betterend.blocks.basis.BlockPedestal; +import ru.betterend.blocks.entities.InfusionPedestalEntity; public class InfusionPedestal extends BlockPedestal { - public InfusionPedestal(Block parent) { - super(parent); + public InfusionPedestal() { + super(Blocks.OBSIDIAN); + this.height = 1.1F; + } + + @Override + public BlockEntity createBlockEntity(BlockView world) { + return new InfusionPedestalEntity(); } } diff --git a/src/main/java/ru/betterend/blocks/basis/BlockPedestal.java b/src/main/java/ru/betterend/blocks/basis/BlockPedestal.java index b273e93d..ec785d7c 100644 --- a/src/main/java/ru/betterend/blocks/basis/BlockPedestal.java +++ b/src/main/java/ru/betterend/blocks/basis/BlockPedestal.java @@ -78,6 +78,7 @@ public class BlockPedestal extends BlockBaseNotFull implements BlockEntityProvid } protected final Block parent; + protected float height = 1.0F; public BlockPedestal(Block parent) { super(FabricBlockSettings.copyOf(parent)); @@ -85,6 +86,13 @@ public class BlockPedestal extends BlockBaseNotFull implements BlockEntityProvid this.parent = parent; } + public float getHeight(BlockState state) { + if (state.getBlock() instanceof BlockPedestal && state.get(STATE) == PedestalState.PEDESTAL_TOP) { + return this.height - 0.2F; + } + return this.height; + } + @Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { if (world.isClient || !state.isOf(this)) return ActionResult.CONSUME; diff --git a/src/main/java/ru/betterend/blocks/entities/render/PedestalItemRenderer.java b/src/main/java/ru/betterend/blocks/entities/render/PedestalItemRenderer.java index 8b33b6b6..bc2632d3 100644 --- a/src/main/java/ru/betterend/blocks/entities/render/PedestalItemRenderer.java +++ b/src/main/java/ru/betterend/blocks/entities/render/PedestalItemRenderer.java @@ -2,6 +2,7 @@ package ru.betterend.blocks.entities.render; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; + import net.minecraft.block.BlockState; import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.RenderLayer; @@ -19,7 +20,7 @@ import net.minecraft.item.Items; import net.minecraft.util.DyeColor; import net.minecraft.util.Identifier; import net.minecraft.util.math.MathHelper; -import ru.betterend.blocks.BlockProperties.PedestalState; + import ru.betterend.blocks.EternalPedestal; import ru.betterend.blocks.basis.BlockPedestal; import ru.betterend.blocks.entities.PedestalBlockEntity; @@ -46,12 +47,9 @@ public class PedestalItemRenderer extends BlockEntityRenderer ETERNAL_PEDESTAL = registerBlockEntity("eternal_pedestal", BlockEntityType.Builder.create(EternalPedestalEntity::new, EndBlocks.ETERNAL_PEDESTAL)); + public final static BlockEntityType INFUSION_PEDESTAL = registerBlockEntity("infusion_pedestal", + BlockEntityType.Builder.create(InfusionPedestalEntity::new, EndBlocks.INFUSION_PEDESTAL)); public static final BlockEntityType CHEST = registerBlockEntity("chest", BlockEntityType.Builder.create(EChestBlockEntity::new, getChests())); public static final BlockEntityType BARREL = registerBlockEntity("barrel", diff --git a/src/main/java/ru/betterend/registry/EndBlocks.java b/src/main/java/ru/betterend/registry/EndBlocks.java index f4409edb..4b03e41c 100644 --- a/src/main/java/ru/betterend/registry/EndBlocks.java +++ b/src/main/java/ru/betterend/registry/EndBlocks.java @@ -43,6 +43,7 @@ import ru.betterend.blocks.EndStoneSmelter; import ru.betterend.blocks.EnderBlock; import ru.betterend.blocks.EternalPedestal; import ru.betterend.blocks.EternalRunedFlavolite; +import ru.betterend.blocks.InfusionPedestal; import ru.betterend.blocks.PedestalVanilla; import ru.betterend.blocks.RunedFlavolite; import ru.betterend.blocks.TerminiteBlock; @@ -158,6 +159,7 @@ public class EndBlocks { // Blocks With Entity // public static final Block END_STONE_SMELTER = registerBlock("end_stone_smelter", new EndStoneSmelter()); public static final Block ETERNAL_PEDESTAL = registerBlock("eternal_pedestal", new EternalPedestal()); + public static final Block INFUSION_PEDESTAL = registerBlock("infusion_pedestal", new InfusionPedestal()); //Technical public static final Block END_PORTAL_BLOCK = registerBlock("end_portal_block", new EndPortalBlock()); diff --git a/src/main/java/ru/betterend/rituals/InfusionRitual.java b/src/main/java/ru/betterend/rituals/InfusionRitual.java index f9d84014..2887283e 100644 --- a/src/main/java/ru/betterend/rituals/InfusionRitual.java +++ b/src/main/java/ru/betterend/rituals/InfusionRitual.java @@ -3,11 +3,9 @@ package ru.betterend.rituals; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.Inventory; import net.minecraft.item.ItemStack; -import net.minecraft.util.Tickable; -public class InfusionRitual implements Tickable, Inventory { +public class InfusionRitual implements Inventory { - @Override public void tick() { // TODO } diff --git a/src/main/resources/assets/betterend/blockstates/infusion_pedestal.json b/src/main/resources/assets/betterend/blockstates/infusion_pedestal.json new file mode 100644 index 00000000..361a4d38 --- /dev/null +++ b/src/main/resources/assets/betterend/blockstates/infusion_pedestal.json @@ -0,0 +1,22 @@ +{ + "variants": { + "state=default": { + "model": "betterend:block/infusion_pedestal_default" + }, + "state=pedestal_top": { + "model": "betterend:block/infusion_pedestal_top" + }, + "state=column": { + "model": "betterend:block/infusion_pedestal_column" + }, + "state=column_top": { + "model": "betterend:block/infusion_pedestal_column_top" + }, + "state=bottom": { + "model": "betterend:block/infusion_pedestal_bottom" + }, + "state=pillar": { + "model": "betterend:block/infusion_pedestal_pillar" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/infusion_pedestal_bottom.json b/src/main/resources/assets/betterend/models/block/infusion_pedestal_bottom.json new file mode 100644 index 00000000..2cddb558 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/infusion_pedestal_bottom.json @@ -0,0 +1,8 @@ +{ + "parent": "betterend:block/pedestal_bottom", + "textures": { + "base": "betterend:block/infusion_pedestal_base", + "pillar": "betterend:block/infusion_pedestal_pillar", + "bottom": "betterend:block/infusion_pedestal_base" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/infusion_pedestal_column.json b/src/main/resources/assets/betterend/models/block/infusion_pedestal_column.json new file mode 100644 index 00000000..a14800d7 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/infusion_pedestal_column.json @@ -0,0 +1,8 @@ +{ + "parent": "betterend:block/pedestal_column", + "textures": { + "base": "betterend:block/infusion_pedestal_base", + "pillar": "betterend:block/infusion_pedestal_pillar", + "bottom": "betterend:block/infusion_pedestal_base" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/infusion_pedestal_column_top.json b/src/main/resources/assets/betterend/models/block/infusion_pedestal_column_top.json new file mode 100644 index 00000000..f934033d --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/infusion_pedestal_column_top.json @@ -0,0 +1,7 @@ +{ + "parent": "betterend:block/pedestal_column_top", + "textures": { + "base": "betterend:block/infusion_pedestal_base", + "pillar": "betterend:block/infusion_pedestal_pillar" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/infusion_pedestal_default.json b/src/main/resources/assets/betterend/models/block/infusion_pedestal_default.json new file mode 100644 index 00000000..7e9504a0 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/infusion_pedestal_default.json @@ -0,0 +1,73 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "top": "betterend:block/infusion_pedestal_top", + "base": "betterend:block/infusion_pedestal_base", + "pillar": "betterend:block/infusion_pedestal_pillar", + "bottom": "betterend:block/infusion_pedestal_base", + "particle": "#base" + }, + "elements": [ + { + "__comment": "eye", + "from": [ 4, 15, 4 ], + "to": [ 12, 16, 12 ], + "faces": { + "up": { "uv": [ 4, 4, 12, 12 ], "texture": "#top" }, + "north": { "uv": [ 4, 4, 12, 5 ], "texture": "#top" }, + "south": { "uv": [ 4, 4, 12, 5 ], "texture": "#top" }, + "west": { "uv": [ 4, 4, 12, 5 ], "texture": "#top" }, + "east": { "uv": [ 4, 4, 12, 5 ], "texture": "#top" } + } + }, + { + "__comment": "basin_1", + "from": [ 0, 0, 0 ], + "to": [ 16, 3, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom" }, + "north": { "uv": [ 0, 0, 16, 3 ], "texture": "#bottom" }, + "south": { "uv": [ 0, 0, 16, 3 ], "texture": "#bottom" }, + "west": { "uv": [ 0, 0, 16, 3 ], "texture": "#bottom" }, + "east": { "uv": [ 0, 0, 16, 3 ], "texture": "#bottom" } + } + }, + { + "__comment": "basin_2", + "from": [ 2, 3, 2 ], + "to": [ 14, 4, 14 ], + "faces": { + "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#bottom" }, + "north": { "uv": [ 3, 3, 14, 4 ], "texture": "#bottom" }, + "south": { "uv": [ 3, 3, 14, 4 ], "texture": "#bottom" }, + "west": { "uv": [ 3, 3, 14, 4 ], "texture": "#bottom" }, + "east": { "uv": [ 3, 3, 14, 4 ], "texture": "#bottom" } + } + }, + { + "__comment": "pillar", + "from": [ 3, 4, 3 ], + "to": [ 13, 13, 13 ], + "faces": { + "north": { "uv": [ 3, 4, 13, 13 ], "texture": "#pillar" }, + "south": { "uv": [ 3, 4, 13, 13 ], "texture": "#pillar" }, + "west": { "uv": [ 3, 4, 13, 13 ], "texture": "#pillar" }, + "east": { "uv": [ 3, 4, 13, 13 ], "texture": "#pillar" } + } + }, + { + "__comment": "top", + "from": [ 1, 13, 1 ], + "to": [ 15, 15, 15 ], + "faces": { + "down": { "uv": [ 1, 1, 15, 15 ], "texture": "#base" }, + "up": { "uv": [ 1, 1, 15, 15 ], "texture": "#top" }, + "north": { "uv": [ 1, 14, 15, 16 ], "texture": "#top" }, + "south": { "uv": [ 1, 14, 15, 16 ], "texture": "#top" }, + "west": { "uv": [ 1, 14, 15, 16 ], "texture": "#top" }, + "east": { "uv": [ 15, 16, 1, 14 ], "texture": "#top" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/infusion_pedestal_pillar.json b/src/main/resources/assets/betterend/models/block/infusion_pedestal_pillar.json new file mode 100644 index 00000000..268ab428 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/infusion_pedestal_pillar.json @@ -0,0 +1,6 @@ +{ + "parent": "betterend:block/pedestal_pillar", + "textures": { + "pillar": "betterend:block/infusion_pedestal_pillar" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/infusion_pedestal_top.json b/src/main/resources/assets/betterend/models/block/infusion_pedestal_top.json new file mode 100644 index 00000000..e4f66fc4 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/infusion_pedestal_top.json @@ -0,0 +1,47 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "top": "betterend:block/infusion_pedestal_top", + "base": "betterend:block/infusion_pedestal_base", + "pillar": "betterend:block/infusion_pedestal_pillar", + "particle": "#base" + }, + "elements": [ + { + "__comment": "eye", + "from": [ 4, 10, 4 ], + "to": [ 12, 11, 12 ], + "faces": { + "up": { "uv": [ 4, 4, 12, 12 ], "texture": "#top" }, + "north": { "uv": [ 4, 4, 12, 5 ], "texture": "#top" }, + "south": { "uv": [ 4, 4, 12, 5 ], "texture": "#top" }, + "west": { "uv": [ 4, 4, 12, 5 ], "texture": "#top" }, + "east": { "uv": [ 4, 4, 12, 5 ], "texture": "#top" } + } + }, + { + "__comment": "pillar", + "from": [ 3, 0, 3 ], + "to": [ 13, 8, 13 ], + "faces": { + "north": { "uv": [ 3, 0, 13, 8 ], "texture": "#pillar" }, + "south": { "uv": [ 3, 0, 13, 8 ], "texture": "#pillar" }, + "west": { "uv": [ 3, 0, 13, 8 ], "texture": "#pillar" }, + "east": { "uv": [ 3, 0, 13, 8 ], "texture": "#pillar" } + } + }, + { + "__comment": "top", + "from": [ 1, 8, 1 ], + "to": [ 15, 10, 15 ], + "faces": { + "down": { "uv": [ 1, 1, 15, 15 ], "texture": "#base" }, + "up": { "uv": [ 1, 1, 15, 15 ], "texture": "#top" }, + "north": { "uv": [ 1, 14, 15, 16 ], "texture": "#top" }, + "south": { "uv": [ 1, 14, 15, 16 ], "texture": "#top" }, + "west": { "uv": [ 1, 14, 15, 16 ], "texture": "#top" }, + "east": { "uv": [ 15, 16, 1, 14 ], "texture": "#top" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/pedestal_default.json b/src/main/resources/assets/betterend/models/block/pedestal_default.json index 0ea02919..43fdecb9 100644 --- a/src/main/resources/assets/betterend/models/block/pedestal_default.json +++ b/src/main/resources/assets/betterend/models/block/pedestal_default.json @@ -3,7 +3,7 @@ "textures": { "particle": "#base" }, - "elements": [ + "elements": [ { "__comment": "basin_1", "from": [ 0, 0, 0 ], diff --git a/src/main/resources/assets/betterend/models/item/infusion_pedestal.json b/src/main/resources/assets/betterend/models/item/infusion_pedestal.json new file mode 100644 index 00000000..ad8068fc --- /dev/null +++ b/src/main/resources/assets/betterend/models/item/infusion_pedestal.json @@ -0,0 +1,3 @@ +{ + "parent": "betterend:block/infusion_pedestal_default" +} diff --git a/src/main/resources/assets/betterend/textures/block/infusion_pedestal_base.png b/src/main/resources/assets/betterend/textures/block/infusion_pedestal_base.png new file mode 100644 index 00000000..b2900328 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/infusion_pedestal_base.png differ diff --git a/src/main/resources/assets/betterend/textures/block/infusion_pedestal_pillar.png b/src/main/resources/assets/betterend/textures/block/infusion_pedestal_pillar.png new file mode 100644 index 00000000..d16d3983 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/infusion_pedestal_pillar.png differ diff --git a/src/main/resources/assets/betterend/textures/block/infusion_pedestal_top.png b/src/main/resources/assets/betterend/textures/block/infusion_pedestal_top.png new file mode 100644 index 00000000..34e01647 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/infusion_pedestal_top.png differ