diff options
author | My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> | 2020-12-06 09:57:34 -0500 |
---|---|---|
committer | My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> | 2020-12-06 09:57:34 -0500 |
commit | 9ec9e1cb376ab39471a3a9fe3888d52626b3ee3b (patch) | |
tree | 92779525561b12c303ac5436041987a15262fd34 /src/main | |
parent | 200fbc71fee0a00ebbf290836e6b178279c79e8e (diff) | |
download | SkyblockMod-9ec9e1cb376ab39471a3a9fe3888d52626b3ee3b.tar.gz SkyblockMod-9ec9e1cb376ab39471a3a9fe3888d52626b3ee3b.tar.bz2 SkyblockMod-9ec9e1cb376ab39471a3a9fe3888d52626b3ee3b.zip |
Block AOTD and Livid Dagger ability when looking at a block
Fixes issue #25
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/me/Danker/DankersSkyblockMod.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index b79052a..47c5313 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -7,6 +7,7 @@ import me.Danker.handlers.*; import me.Danker.utils.TicTacToeUtils; import me.Danker.utils.Utils; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.Gui; @@ -2778,6 +2779,52 @@ public class DankersSkyblockMod event.setCanceled(true); } } + + if(event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { + IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(event.pos); + Block block = blockState.getBlock(); + List<Block> interactables = Arrays.asList( + Blocks.acacia_door, + Blocks.acacia_fence_gate, + Blocks.anvil, + Blocks.beacon, + Blocks.bed, + Blocks.birch_door, + Blocks.birch_fence_gate, + Blocks.brewing_stand, + Blocks.command_block, + Blocks.chest, + Blocks.dark_oak_door, + Blocks.dark_oak_fence_gate, + Blocks.daylight_detector, + Blocks.daylight_detector_inverted, + Blocks.dispenser, + Blocks.dropper, + Blocks.enchanting_table, + Blocks.ender_chest, + Blocks.oak_fence_gate, + Blocks.furnace, + Blocks.hopper, + Blocks.jungle_door, + Blocks.jungle_fence_gate, + Blocks.lever, + Blocks.noteblock, + Blocks.powered_comparator, + Blocks.unpowered_comparator, + Blocks.powered_repeater, + Blocks.unpowered_repeater, + Blocks.standing_sign, + Blocks.wall_sign, + Blocks.trapdoor, + Blocks.trapped_chest, + Blocks.wall_sign, + Blocks.wooden_button, + Blocks.stone_button, + Blocks.oak_door, + Blocks.skull + ); + if(!interactables.contains(block)) if(event.isCancelable()) event.setCanceled(true); + } } @SubscribeEvent |