From bc403d9a7da3c16ed35129daeae98ab71d70e902 Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Mon, 14 Dec 2020 21:39:57 +0300 Subject: [PATCH] Crafring recipe --- src/main/java/ru/betterend/blocks/BlockRespawnObelisk.java | 4 ++-- src/main/java/ru/betterend/recipe/CraftingRecipes.java | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/ru/betterend/blocks/BlockRespawnObelisk.java b/src/main/java/ru/betterend/blocks/BlockRespawnObelisk.java index 8a315450..54152b45 100644 --- a/src/main/java/ru/betterend/blocks/BlockRespawnObelisk.java +++ b/src/main/java/ru/betterend/blocks/BlockRespawnObelisk.java @@ -157,7 +157,7 @@ public class BlockRespawnObelisk extends BlockBase implements IColorProvider, IR @Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { ItemStack itemStack = player.getStackInHand(hand); - boolean canActivate = itemStack.getItem() == EndItems.AMBER_GEM && itemStack.getCount() > 3; + boolean canActivate = itemStack.getItem() == EndItems.AMBER_GEM && itemStack.getCount() > 5; if (hand != Hand.MAIN_HAND || !canActivate) { if (!world.isClient && !(itemStack.getItem() instanceof BlockItem)) { ServerPlayerEntity serverPlayerEntity = (ServerPlayerEntity) player; @@ -171,7 +171,7 @@ public class BlockRespawnObelisk extends BlockBase implements IColorProvider, IR serverPlayerEntity.sendMessage(new TranslatableText("message.betterend.set_spawn"), true); world.playSound(null, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, SoundEvents.BLOCK_RESPAWN_ANCHOR_SET_SPAWN, SoundCategory.BLOCKS, 1.0F, 1.0F); if (!player.isCreative()) { - itemStack.decrement(4); + itemStack.decrement(6); } } return player.isCreative() ? ActionResult.PASS : ActionResult.success(world.isClient); diff --git a/src/main/java/ru/betterend/recipe/CraftingRecipes.java b/src/main/java/ru/betterend/recipe/CraftingRecipes.java index 8cb19f59..aca65264 100644 --- a/src/main/java/ru/betterend/recipe/CraftingRecipes.java +++ b/src/main/java/ru/betterend/recipe/CraftingRecipes.java @@ -159,6 +159,13 @@ public class CraftingRecipes { GridRecipe.make("charnia_orange_dye", Items.ORANGE_DYE).setList("#").addMaterial('#', EndBlocks.CHARNIA_ORANGE).build(); GridRecipe.make("charnia_purple_dye", Items.PURPLE_DYE).setList("#").addMaterial('#', EndBlocks.CHARNIA_PURPLE).build(); GridRecipe.make("charnia_red_dye", Items.RED_DYE).setList("#").addMaterial('#', EndBlocks.CHARNIA_RED).build(); + + GridRecipe.make("respawn_obelisk", EndBlocks.RESPAWN_OBELISK) + .setShape("CSC", "CSC", "AAA") + .addMaterial('C', EndBlocks.AURORA_CRYSTAL) + .addMaterial('S', EndItems.ETERNAL_CRYSTAL) + .addMaterial('A', EndBlocks.AMBER_BLOCK) + .build(); } private static void registerLantern(String name, Block lantern, Block slab) {