Skip to content

Commit

Permalink
feat(BedWars): Add Fireball notifications
Browse files Browse the repository at this point in the history
Adds a setting to enable notifications for Fireballs in the BedWars module, mirroring the existing functionality for Ender Pearls and Obsidian. This allows players to receive alerts when these valuable resources are nearby.
  • Loading branch information
TejasLamba2006 committed Jul 9, 2024
1 parent 83d4e45 commit 1ed2e03
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemEnderPearl;
import net.minecraft.item.ItemFireball;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
Expand All @@ -34,6 +35,7 @@ public class BedWars extends Module {
public static ButtonSetting whitelistOwnBed;
private final ButtonSetting diamondArmor;
private final ButtonSetting enderPearl;
private final ButtonSetting fireball;
private final ButtonSetting obsidian;
private final ButtonSetting shouldPing;
private BlockPos spawnPos;
Expand All @@ -51,6 +53,7 @@ public BedWars() {
this.registerSetting(whitelistOwnBed = new ButtonSetting("Whitelist own bed", true));
this.registerSetting(diamondArmor = new ButtonSetting("Diamond armor", true));
this.registerSetting(enderPearl = new ButtonSetting("Ender pearl", true));
this.registerSetting(fireball = new ButtonSetting("Fireball", true));
this.registerSetting(obsidian = new ButtonSetting("Obsidian", true));
this.registerSetting(shouldPing = new ButtonSetting("Should ping", true));
}
Expand Down Expand Up @@ -190,6 +193,8 @@ private String getItemType(ItemStack item) {
return "&7an §3Ender Pearl";
} else if (unlocalizedName.contains("tile.obsidian") && obsidian.isToggled()) {
return "§dObsidian";
} else if (item.getItem() instanceof ItemFireball && fireball.isToggled()) {
return "&7a §cFireball";
}
return null;
}
Expand Down

0 comments on commit 1ed2e03

Please sign in to comment.