switch to primitive boolean rather than Boolean

thanks to Elspeth on Discord for letting me know about the difference!
This commit is contained in:
TheTechRobo 2022-06-08 16:57:30 -04:00
parent 8e504744ea
commit 9b0c12e669
2 changed files with 7 additions and 7 deletions

View File

@ -42,7 +42,7 @@ public class DeathListener implements Listener {
public void onPlayerJoin(PlayerJoinEvent e) {
this.scores.addPlayerToScoreboard(e.getPlayer());
// v ITEM DUPING PREVENTION
Boolean banned = (this.scores.load(e.getPlayer(), "bannedByLSPLUGIN", 0, false) == 1);
boolean banned = (this.scores.load(e.getPlayer(), "bannedByLSPLUGIN", 0, false) == 1);
if (banned) {
e.getPlayer().getInventory().clear();
Bukkit.getLogger().info("Player was UNBANNED after being BANNED.");
@ -57,11 +57,11 @@ public class DeathListener implements Listener {
ItemStack i = p.getInventory().getItemInMainHand();
if (!(i.hasItemMeta())) return;
Boolean rightclickair = (e.getAction() == Action.RIGHT_CLICK_AIR);
boolean rightclickair = (e.getAction() == Action.RIGHT_CLICK_AIR);
if (!rightclickair) {
return;
}
Boolean heartblock = (i.getType() == Material.PLAYER_HEAD && rightclickair);
boolean heartblock = (i.getType() == Material.PLAYER_HEAD && rightclickair);
if (heartblock) {
this.scores.dieHearts(p, -4.0);
ItemStack newi = i.clone();
@ -74,15 +74,15 @@ public class DeathListener implements Listener {
}
Life d = new Life();
d.create();
Boolean condition1a = (i.getItemMeta().getDisplayName().equals(d.dn));
boolean condition1a = (i.getItemMeta().getDisplayName().equals(d.dn));
// DO NOT CHANGE THIS TO
// i.getItemMeta().displayName().equals(Component.text(d.dn))
// IT DOES NOT WORK. I am sick of figuring out why.
// It caused many minutes of frustration at the computer.
// Just... don't.
// Unless you're ready to deal with insanity.
Boolean condition1b = (i.getType() == d.m);
Boolean lifeblock = (condition1a && condition1b);
boolean condition1b = (i.getType() == d.m);
boolean lifeblock = (condition1a && condition1b);
if (lifeblock) {
this.scores.die(p, -1);
p.getInventory().removeItem(d.item);

View File

@ -61,7 +61,7 @@ public class LifestealPlugin extends JavaPlugin {
recipe = new ShapedRecipe(key, item);
recipe.shape("RRR", "RDR", "RRR");
recipe.setIngredient('R', Material.REDSTONE_BLOCK);
recipe.setIngredient('D', Material.DIAMOND);
recipe.setIngredient('D', Material.NETHERITE_SCRAP);
Bukkit.addRecipe(recipe);
}
@Override