From 7af09ff4d3bd91cee8efeca0d4c1f56bcac694f4 Mon Sep 17 00:00:00 2001 From: bconlon Date: Fri, 25 Dec 2020 18:54:11 -0800 Subject: [PATCH] Shift right clicking the Cloud Staff will clear Cloud Minions. Note: This can become wasteful of durability if used too much since whenever you activate it again it'll use up a durability point (as is how the staff is designed to work). --- .../the_aether/items/staffs/ItemCloudStaff.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/com/gildedgames/the_aether/items/staffs/ItemCloudStaff.java b/src/main/java/com/gildedgames/the_aether/items/staffs/ItemCloudStaff.java index 084ced2..9d39dde 100644 --- a/src/main/java/com/gildedgames/the_aether/items/staffs/ItemCloudStaff.java +++ b/src/main/java/com/gildedgames/the_aether/items/staffs/ItemCloudStaff.java @@ -4,6 +4,7 @@ import com.gildedgames.the_aether.entities.passive.EntityMiniCloud; import com.gildedgames.the_aether.items.ItemsAether; import com.gildedgames.the_aether.player.PlayerAether; import com.gildedgames.the_aether.registry.creative_tabs.AetherCreativeTabs; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; @@ -44,6 +45,16 @@ public class ItemCloudStaff extends Item { stack.damageItem(1, entityplayer); } + else if (entityplayer.isSneaking()) + { + for (Entity cloud : playerAether.clouds) + { + if (cloud instanceof EntityMiniCloud) + { + ((EntityMiniCloud) cloud).lifeSpan = 0; + } + } + } return stack; }