aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/features/BlockPlacingFlowers.java
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2021-11-24 17:48:30 -0500
committerbowser0000 <bowser0000@gmail.com>2021-11-24 17:48:30 -0500
commit871e4e7b1257ceb459cd78b33c9f4b107a8ab9bb (patch)
treeb251e5274c1d0370436df9f8443ed944b7644c46 /src/main/java/me/Danker/features/BlockPlacingFlowers.java
parenta63cb87198b563edd4ac88b226fd004d0c616360 (diff)
downloadSkyblockMod-871e4e7b1257ceb459cd78b33c9f4b107a8ab9bb.tar.gz
SkyblockMod-871e4e7b1257ceb459cd78b33c9f4b107a8ab9bb.tar.bz2
SkyblockMod-871e4e7b1257ceb459cd78b33c9f4b107a8ab9bb.zip
Re-add blocking click features
Add blocking starting wrong slayer quest Add block placing flower weapons Add blocking misclicks in solvers Add F7 arrow terminal solver (Source: https://cdn.discordapp.com/attachments/823769568933576764/906101631861526559/unknown.png)
Diffstat (limited to 'src/main/java/me/Danker/features/BlockPlacingFlowers.java')
-rw-r--r--src/main/java/me/Danker/features/BlockPlacingFlowers.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/features/BlockPlacingFlowers.java b/src/main/java/me/Danker/features/BlockPlacingFlowers.java
new file mode 100644
index 0000000..580c010
--- /dev/null
+++ b/src/main/java/me/Danker/features/BlockPlacingFlowers.java
@@ -0,0 +1,45 @@
+package me.Danker.features;
+
+import me.Danker.commands.ToggleCommand;
+import me.Danker.utils.Utils;
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.event.entity.player.PlayerInteractEvent;
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+public class BlockPlacingFlowers {
+
+ ArrayList<Block> flowerPlaceable = new ArrayList<>(Arrays.asList(
+ Blocks.grass,
+ Blocks.dirt,
+ Blocks.flower_pot,
+ Blocks.tallgrass,
+ Blocks.double_plant
+ ));
+
+ @SubscribeEvent
+ public void onInteract(PlayerInteractEvent event) {
+ if (!Utils.inSkyblock || Minecraft.getMinecraft().thePlayer != event.entityPlayer) return;
+ ItemStack item = event.entityPlayer.getHeldItem();
+ if (item == null) return;
+
+ if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
+ Block block = Minecraft.getMinecraft().theWorld.getBlockState(event.pos).getBlock();
+
+ if (flowerPlaceable.contains(block)) {
+ if (ToggleCommand.flowerWeaponsToggled && item.getDisplayName().contains("Flower of Truth")) {
+ event.setCanceled(true);
+ }
+ if (ToggleCommand.flowerWeaponsToggled && item.getDisplayName().contains("Spirit Sceptre")) {
+ event.setCanceled(true);
+ }
+ }
+ }
+ }
+
+}