diff options
author | Falkreon <falkreon@gmail.com> | 2019-10-24 08:49:49 -0500 |
---|---|---|
committer | Falkreon <falkreon@gmail.com> | 2019-10-24 08:49:49 -0500 |
commit | 6b40020b11fb6568c69699885f2836b552c40dc1 (patch) | |
tree | 7a0507f20fc988070b956812cfa5cc92ab3fc9c3 /GuiTest/src/main/java | |
parent | dcf3d2f0cbe9d680f94fac26bda1f0c2936e7a57 (diff) | |
download | LibGui-6b40020b11fb6568c69699885f2836b552c40dc1.tar.gz LibGui-6b40020b11fb6568c69699885f2836b552c40dc1.tar.bz2 LibGui-6b40020b11fb6568c69699885f2836b552c40dc1.zip |
Update to 19w42a
Diffstat (limited to 'GuiTest/src/main/java')
-rw-r--r-- | GuiTest/src/main/java/io/github/cottonmc/test/GuiBlock.java | 6 | ||||
-rw-r--r-- | GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/GuiBlock.java b/GuiTest/src/main/java/io/github/cottonmc/test/GuiBlock.java index ec37c55..ded6fcb 100644 --- a/GuiTest/src/main/java/io/github/cottonmc/test/GuiBlock.java +++ b/GuiTest/src/main/java/io/github/cottonmc/test/GuiBlock.java @@ -8,6 +8,7 @@ import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.util.Identifier; import net.minecraft.util.hit.BlockHitResult; @@ -21,13 +22,12 @@ public class GuiBlock extends Block implements BlockEntityProvider { super(FabricBlockSettings.copy(Blocks.IRON_BLOCK).build()); } - @Override - public boolean activate(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hitResult) { + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hitResult) { if (!world.isClient) { ContainerProviderRegistry.INSTANCE.openContainer(new Identifier(LibGuiTest.MODID, "gui"), player, (buf)->buf.writeBlockPos(pos)); } - return true; + return ActionResult.SUCCESS; } diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java b/GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java index 37b98f6..b777361 100644 --- a/GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java +++ b/GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java @@ -25,6 +25,6 @@ public class GuiItem extends Item { MinecraftClient.getInstance().openScreen(new CottonClientScreen(new TestClientGui())); } - return new TypedActionResult<ItemStack>(ActionResult.SUCCESS, (hand==Hand.MAIN_HAND) ? player.getMainHandStack() : player.getOffHandStack(), false); + return new TypedActionResult<ItemStack>(ActionResult.SUCCESS, (hand==Hand.MAIN_HAND) ? player.getMainHandStack() : player.getOffHandStack()); } } |