Skip to content

Commit 596a699

Browse files
author
BuildTools
committed
1.3 Released!
-Removed the Ban Hammer's crafting recipe, since it was too overpowered and weird. Might return later! -Fixed a bug where nukes could be lit by means other than players lighting them, including other nukes. -HEAVY BUFFED the crafting recipe for Nukes, so that it's more fair for everyone, since they're too easy to get -Sterilized all "old" nukes crafted before this mod, rendering them useless. Sorry you had to waste all those materials, but this was getting out of hand. Sterilized nukes can be shown to an admin to get your materials back, if the admin is nice enough. -Added super and hyper compressed gunpowder blocks. Nukes now require 91 stacks plus eight gunpowder total, plus netherite blocks, heavy cores, nether stars, and so on and so forth. Enjoy! I gotta do hw now T_T
1 parent 7824c9e commit 596a699

File tree

10 files changed

+101
-127
lines changed

10 files changed

+101
-127
lines changed

nukePlugin/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
}
44

55
group = 'epin'
6-
version = '1.2'
6+
version = '1.3'
77

88
repositories {
99
mavenCentral()
Binary file not shown.
Binary file not shown.
Binary file not shown.
-9.16 KB
Binary file not shown.
-48 Bytes
Binary file not shown.

nukePlugin/src/main/java/epin/nukePlugin/EventManager.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package epin.nukePlugin;
22

3+
import com.destroystokyo.paper.event.player.PlayerJumpEvent;
34
import net.kyori.adventure.text.Component;
45
import org.bukkit.ChatColor;
56
import org.bukkit.Location;
@@ -15,8 +16,6 @@
1516
import org.bukkit.event.block.TNTPrimeEvent;
1617
import org.bukkit.event.entity.EntityDamageByEntityEvent;
1718
import org.bukkit.event.entity.EntityExplodeEvent;
18-
import org.bukkit.event.inventory.FurnaceSmeltEvent;
19-
import org.bukkit.event.inventory.FurnaceStartSmeltEvent;
2019
import org.bukkit.event.player.PlayerDropItemEvent;
2120
import org.bukkit.event.player.PlayerInteractEntityEvent;
2221
import org.bukkit.event.player.PlayerJoinEvent;
@@ -34,6 +33,10 @@ public class EventManager implements Listener {
3433

3534
@EventHandler
3635
public void onPlaceCustom(BlockPlaceEvent ev) {
36+
if (ev.getItemInHand().hasItemMeta() && ev.getItemInHand().getItemMeta().hasLore() && ev.getItemInHand().getItemMeta().hasCustomName() && ev.getItemInHand().getItemMeta().customName().equals(Component.text(ChatColor.LIGHT_PURPLE + "Nuke")) && ev.getItemInHand().getItemMeta().lore().get(0).equals(Component.text("Part of the Nuke plugin by Ep1n"))) {
37+
ev.getPlayer().getInventory().setItemInMainHand(new ItemStack(nukePlugin.instance.nuke.asQuantity(ev.getItemInHand().getAmount())));
38+
ev.setCancelled(true);
39+
}
3740
if (nukePlugin.instance.items.contains(ev.getItemInHand().asOne())) {
3841
blockMap.put(ev.getBlockPlaced().getLocation(), nukePlugin.instance.items.get(nukePlugin.instance.items.indexOf(ev.getItemInHand().asOne())));
3942
}
@@ -62,7 +65,8 @@ public void onDropCore(PlayerDropItemEvent ev) {
6265

6366
@EventHandler
6467
public void onLightNuke(TNTPrimeEvent ev) {
65-
if (blockMap.containsKey(ev.getBlock().getLocation())) {
68+
if (blockMap.get(ev.getBlock().getLocation()).equals(nukePlugin.instance.neoNuke)) {
69+
if (!(ev.getCause().equals(TNTPrimeEvent.PrimeCause.PLAYER))) return;
6670
if (ev.getPrimingEntity() instanceof Player) ev.getPrimingEntity().getServer().broadcastMessage(ChatColor.RED + ev.getPrimingEntity().getName().toUpperCase() + ChatColor.WHITE + " HAS LIT A " + ChatColor.RED + "NUKE!");
6771
//cancel the event and set the block to air
6872
ev.setCancelled(true);
@@ -73,12 +77,10 @@ public void onLightNuke(TNTPrimeEvent ev) {
7377
tnt.setGlowing(true);
7478
List<Entity> list = tnt.getNearbyEntities(25, 25, 25);
7579
for (Entity k : list) {
76-
if (k instanceof Player) {
77-
Player p = (Player) k;
80+
if (k instanceof Player p) {
7881
if (!(ev.getCause().equals(TNTPrimeEvent.PrimeCause.EXPLOSION))) p.sendMessage(ChatColor.RED + "YOU ARE WITHIN BLAST RADIUS. " + ChatColor.BOLD + "RUN.");
7982
}
8083
}
81-
if (ev.getCause().equals(TNTPrimeEvent.PrimeCause.EXPLOSION)) tnt.setFuseTicks(0);
8284
//check in another method when it explodes and make the explosion size bigger
8385
tnt.getPersistentDataContainer().set(nukePlugin.instance.isNuke, PersistentDataType.BOOLEAN, true);
8486
}
@@ -89,7 +91,7 @@ public void onDefuseAttempt(PlayerInteractEntityEvent ev) {
8991
if (ev.getPlayer().getInventory().getItemInMainHand().getType().equals(Material.FLINT_AND_STEEL)) {
9092
if (ev.getRightClicked().getPersistentDataContainer().has(nukePlugin.instance.isNuke, PersistentDataType.BOOLEAN) && ev.getRightClicked().getPersistentDataContainer().get(nukePlugin.instance.isNuke, PersistentDataType.BOOLEAN)) {
9193
ev.getRightClicked().getLocation().getBlock().setType(Material.TNT);
92-
blockMap.put(ev.getRightClicked().getLocation(), nukePlugin.instance.nuke);
94+
blockMap.put(ev.getRightClicked().getLocation(), nukePlugin.instance.neoNuke);
9395
ev.getPlayer().getServer().broadcastMessage(ChatColor.GREEN + ev.getPlayer().getName().toUpperCase() + ChatColor.WHITE + " defused the bomb. Crisis Averted");
9496
ev.getRightClicked().remove();
9597
}
@@ -131,7 +133,7 @@ public void onBanHammerSlam(EntityDamageByEntityEvent ev) {
131133

132134
@EventHandler
133135
public void onPlayerJoin(PlayerJoinEvent ev) {
134-
for(NamespacedKey key : nukePlugin.instance.keys) {
136+
for (NamespacedKey key : nukePlugin.instance.keys) {
135137
if (ev.getPlayer().hasDiscoveredRecipe(key)) {
136138
ev.getPlayer().discoverRecipe(key);
137139
}

nukePlugin/src/main/java/epin/nukePlugin/NukeBlockManager.java

Lines changed: 0 additions & 104 deletions
This file was deleted.

nukePlugin/src/main/java/epin/nukePlugin/nukePlugin.java

Lines changed: 89 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,22 @@ public final class nukePlugin extends JavaPlugin {
2727

2828
public ItemStack nuke;
2929

30+
public ItemStack neoNuke;
31+
3032
public NamespacedKey nukeKey;
3133

3234
public ItemStack gpdrBlock;
3335

3436
public NamespacedKey gpdrBlkKey;
3537

38+
public ItemStack superGpdrBlock;
39+
40+
public NamespacedKey superGpdrKey;
41+
42+
public ItemStack hyperGpdrBlock;
43+
44+
public NamespacedKey hyperGpdrKey;
45+
3646
public ItemStack unstableCore;
3747

3848
public NamespacedKey unCoreKey;
@@ -60,26 +70,60 @@ public void onEnable() {
6070
};
6171

6272
nuke = new ItemStack(Material.TNT);
73+
ItemMeta oldNukeMeta = nuke.getItemMeta();
74+
oldNukeMeta.customName(Component.text("Sterilized Nuke"));
75+
ArrayList<Component> oldNukeLore = new ArrayList<>();
76+
oldNukeLore.add(Component.text("A deprecated part of the Nuke Plugin."));
77+
oldNukeLore.add(Component.text("All the explosive power radiated away."));
78+
oldNukeLore.add(Component.text("Literally just a normal TNT now. Toss this away."));
79+
oldNukeMeta.lore(oldNukeLore);
80+
nuke.setItemMeta(oldNukeMeta);
81+
items.add(nuke);
82+
83+
neoNuke = new ItemStack(Material.TNT);
6384
isNuke = new NamespacedKey(this, "isNuke");
6485
nukeKey = new NamespacedKey(this, "nuke");
6586
keys.add(nukeKey);
66-
ItemMeta nukeMeta = nuke.getItemMeta();
87+
ItemMeta nukeMeta = neoNuke.getItemMeta();
6788
nukeMeta.customName(Component.text(ChatColor.LIGHT_PURPLE + "Nuke"));
68-
nukeMeta.lore(genLore);
69-
nuke.setItemMeta(nukeMeta);
89+
ArrayList<Component> nukeLore = new ArrayList<>();
90+
nukeLore.add(Component.text("The culmination of your work."));
91+
nukeLore.add(Component.text("Goes through water, through walls,"));
92+
nukeLore.add(Component.text("and any hope the enemy has left."));
93+
nukeLore.add(genLore.get(0));
94+
nukeMeta.lore(nukeLore);
95+
neoNuke.setItemMeta(nukeMeta);
7096
getServer().getPluginManager().registerEvents(new EventManager(), this);
7197
getCommand("gimme").setExecutor(new GiveNukeCommand());
72-
items.add(nuke);
98+
items.add(neoNuke);
7399

74100
gpdrBlkKey = new NamespacedKey(this, "gunpowder_block");
75101
keys.add(gpdrBlkKey);
76-
gpdrBlock = new ItemStack(Material.GRAY_CONCRETE_POWDER);
102+
gpdrBlock = new ItemStack(Material.LIGHT_GRAY_CONCRETE_POWDER);
77103
ItemMeta gpdrMeta = gpdrBlock.getItemMeta();
78104
gpdrMeta.customName(Component.text("Block of Gunpowder"));
79105
gpdrMeta.lore(genLore);
80106
gpdrBlock.setItemMeta(gpdrMeta);
81107
items.add(gpdrBlock);
82108

109+
superGpdrKey = new NamespacedKey(this, "compressed_gunpowder_block");
110+
keys.add(superGpdrKey);
111+
superGpdrBlock = new ItemStack(Material.GRAY_CONCRETE_POWDER);
112+
ItemMeta sgpdrMeta = superGpdrBlock.getItemMeta();
113+
sgpdrMeta.customName(Component.text("Compressed Block of Gunpowder"));
114+
sgpdrMeta.lore(genLore);
115+
superGpdrBlock.setItemMeta(sgpdrMeta);
116+
items.add(superGpdrBlock);
117+
118+
hyperGpdrKey = new NamespacedKey(this, "super_compressed_gunpowder_block");
119+
keys.add(hyperGpdrKey);
120+
hyperGpdrBlock = new ItemStack(Material.BLACK_CONCRETE_POWDER);
121+
ItemMeta hgpdrMeta = hyperGpdrBlock.getItemMeta();
122+
hgpdrMeta.customName(Component.text("Ultra-Compressed Block of Gunpowder"));
123+
hgpdrMeta.lore(genLore);
124+
hyperGpdrBlock.setItemMeta(hgpdrMeta);
125+
items.add(hyperGpdrBlock);
126+
83127
unCoreKey = new NamespacedKey(this, "unstable_core");
84128
keys.add(unCoreKey);
85129
unstableCore = new ItemStack(Material.WAXED_COPPER_BULB);
@@ -138,29 +182,61 @@ public void onEnable() {
138182
blockToGpwd.addIngredient(gpdrBlock);
139183
getServer().addRecipe(blockToGpwd, true);
140184

185+
//compressed gunpowder block
186+
ShapedRecipe superGpwdBlockRecipe = new ShapedRecipe(superGpdrKey, superGpdrBlock);
187+
superGpwdBlockRecipe.shape("GGG",
188+
"GGG",
189+
"GGG");
190+
superGpwdBlockRecipe.setIngredient('G', gpdrBlock);
191+
getServer().addRecipe(superGpwdBlockRecipe, true);
192+
193+
//gunpowder block from compressed gunpowder block
194+
NamespacedKey gpwdBlock = new NamespacedKey(this, "super_to_gunpowder_block");
195+
keys.add(gpwdBlock);
196+
ShapelessRecipe superToBlock = new ShapelessRecipe(gpwdBlock, gpdrBlock.asQuantity(9));
197+
superToBlock.addIngredient(superGpdrBlock);
198+
getServer().addRecipe(superToBlock, true);
199+
200+
//ultra-compressed gunpowder block
201+
ShapedRecipe hyperGpwdBlockRecipe = new ShapedRecipe(hyperGpdrKey, hyperGpdrBlock);
202+
hyperGpwdBlockRecipe.shape("GGG",
203+
"GGG",
204+
"GGG");
205+
hyperGpwdBlockRecipe.setIngredient('G', superGpdrBlock);
206+
getServer().addRecipe(hyperGpwdBlockRecipe, true);
207+
208+
//ultra-compressed gunpowder block into compressed gunpowder blocks
209+
NamespacedKey superGpwdBlock = new NamespacedKey(this, "hyper_to_super_gunpowder_block");
210+
keys.add(superGpwdBlock);
211+
ShapelessRecipe hyperToSuper = new ShapelessRecipe(superGpwdBlock, superGpdrBlock.asQuantity(9));
212+
hyperToSuper.addIngredient(hyperGpdrBlock);
213+
getServer().addRecipe(hyperToSuper, true);
214+
141215
//unstable core
142216
ShapedRecipe unstableCoreRecipe = new ShapedRecipe(unCoreKey, unstableCore);
143-
unstableCoreRecipe.shape("NGS",
217+
unstableCoreRecipe.shape("NCS",
144218
"GTG",
145-
"SGN");
146-
unstableCoreRecipe.setIngredient('N', Material.NETHERITE_INGOT);
219+
"SEN");
220+
unstableCoreRecipe.setIngredient('N', Material.NETHERITE_BLOCK);
147221
unstableCoreRecipe.setIngredient('G', Material.GLOWSTONE);
148222
unstableCoreRecipe.setIngredient('T', Material.TNT);
149-
unstableCoreRecipe.setIngredient('S', Material.WITHER_SKELETON_SKULL);
223+
unstableCoreRecipe.setIngredient('S', Material.NETHER_STAR);
224+
unstableCoreRecipe.setIngredient('C', Material.HEAVY_CORE);
225+
unstableCoreRecipe.setIngredient('E', Material.ECHO_SHARD);
150226
getServer().addRecipe(unstableCoreRecipe, true);
151227

152228
//stable core
153-
BlastingRecipe stableCoreRecipe = new BlastingRecipe(coreKey, stableCore, new RecipeChoice.ExactChoice(unstableCore), 2, 7200);
229+
BlastingRecipe stableCoreRecipe = new BlastingRecipe(coreKey, stableCore, new RecipeChoice.ExactChoice(unstableCore), 2, 9999);
154230
getServer().addRecipe(stableCoreRecipe, true);
155231
//a furnace full of blaze rods will be able to smelt 2 total
156232
//check onSmeltBypass if this doesn't work
157233

158234
//the big boy
159-
ShapedRecipe nukeRecipe = new ShapedRecipe(nukeKey, nuke);
235+
ShapedRecipe nukeRecipe = new ShapedRecipe(nukeKey, neoNuke);
160236
nukeRecipe.shape("GGG",
161237
"GTG",
162238
"GGG");
163-
nukeRecipe.setIngredient('G', gpdrBlock);
239+
nukeRecipe.setIngredient('G', hyperGpdrBlock);
164240
nukeRecipe.setIngredient('T', stableCore);
165241
getServer().addRecipe(nukeRecipe, true);
166242

@@ -175,7 +251,7 @@ public void onEnable() {
175251
banRecipe.setIngredient('C', Material.HEAVY_CORE);
176252
banRecipe.setIngredient('b', new ItemStack(Material.BREEZE_ROD).asQuantity(32));
177253
banRecipe.setIngredient('s', new ItemStack(Material.RESIN_BRICK).asQuantity(64));
178-
getServer().addRecipe(banRecipe, true);
254+
//getServer().addRecipe(banRecipe, true);
179255

180256
for(Player p : getServer().getOnlinePlayers()) {
181257
unlockRecipes(p);

nukePlugin/src/main/resources/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: nukePlugin
2-
version: '1.2'
2+
version: '1.3'
33
main: epin.nukePlugin.nukePlugin
44
api-version: '1.21'
55
authors: [ Ep1n ]

0 commit comments

Comments
 (0)