#help-development

1 messages · Page 230 of 1

fresh timber
#

no

undone kernel
fresh timber
#

the event is not me making the class

ebon isle
#

implements TabExecutor

fresh timber
#

uh ok

undone kernel
fresh timber
#

instead of listener or botg>

remote swallow
fresh timber
#

both

ebon isle
#

oh, I thought spigot

#

sorry-2

fresh timber
#

xd

#

spigot is easy i dont understand why this is so confusing on bungee

undone kernel
#

i decided to try and make a command

#

couldn't figure it out

#

then gave up

fresh timber
#

commands are not hard on bungee

undone kernel
#

ah but you missed one thing

#

i am an idiot

fresh timber
#

m

#

can you just give me an example class of a command being tab compleated?

#

im confused

undone kernel
#
    private final ServerThings plugin;

    public MS(ServerThings plugin) {
        this.plugin = plugin;
    }
    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
        String noPermission = this.plugin.getConfig().getString("No-Permission-MSG");
        if (sender instanceof Player) {
            Player p = (Player) sender;
            if (sender.hasPermission("server.multisummon")) {
                if (args.length >= 2) {
                    try {
                        EntityType entity = EntityType.valueOf(args[0].toUpperCase());
                        int amount = Integer.parseInt(args[1]);
                        for (int i = 0; i < amount; i++) {
                            p.getWorld().spawnEntity(p.getLocation(), entity);
                        }
                        p.sendMessage(colorize("&aYou've spawned &e" + args[1] + " " + args[0] + "s"));
                    } catch (IllegalArgumentException e) {
                        p.sendMessage(colorize("&4This is not an entity."));
                    }
                } else {
                    p.sendMessage(colorize("&4/multisummon [mob] [amount]."));
                }
            } else {
                p.sendMessage(colorize(noPermission));
            }
        } else {
            sender.sendMessage(colorize("&4You cannot do this. "));
        }
        return true;
    }```
I want to make this less arrow
fresh timber
#

wdym

remote swallow
#

instead of wanting to check if its correct, checkif it isnt and if it isnt return

fresh timber
#

yes thats a good way

remote swallow
#

eg if (!(sender instanceof Player)) return

fresh timber
#

but that makes it where if u wanna do smthing after then it wont work

#

if those return true

undone kernel
remote swallow
#

return true;

fresh timber
#

xd

remote swallow
#

it pretty much just ends the method there

undone kernel
#

but I want it to send a message

remote swallow
#

so add the {}

undone kernel
#

so like

if (!(sender instanceof Player)) {sender.sendMessage"tfamIdoing" return true};

remote swallow
#

return true in the {}

#
if (!(sender instanceof Player)) {
  sender.sendMessage"tfamIdoing";
  return false;
}
undone kernel
#

what

#

``java
fecj

remote swallow
#

was trying totype something

#

but failed

remote swallow
echo basalt
#

dumb mfs

undone kernel
remote swallow
#

thats a lie

undone kernel
#

maybe

ebon isle
echo basalt
#

Return false sends the declared command usage

remote swallow
#

theres 3 actually

echo basalt
#

yeah y'all have been speaking nonsense for the past 20 minutes

remote swallow
undone kernel
undone kernel
#

that's why I have return true; in my thing

#

I have no idea how to do the little code box ;- ;

remote swallow
#

three `

#

java at the end to have java formatting

undone kernel
#

thing

echo basalt
#
this

?

undone kernel
#

no

echo basalt
#

this

#

?

undone kernel
#

yes

#

that

echo basalt
#

`this`

remote swallow
#

2 `

undone kernel
#

`hi/

fresh timber
#
this
ebon isle
#

i learn new thing

remote swallow
#

this is werid

undone kernel
#

this

#

yes

fresh timber
#

xd

ebon isle
#

damn this is cool

undone kernel
#

return true;

fresh timber
#

yooooo special text
t

undone kernel
#

oh damn I forgot

#

this command dosen't have the uh reverse operators or smth

fervent panther
#
><+-.,[]
undone kernel
#

whatever this thing is !()

echo basalt
#

where'd the clown stare emote go

#

there

fresh timber
#

H O W T O T A B C O M P L E T E O N A B U N G E E C O R D P L U G I N

undone kernel
#
        if (!(sender instanceof Player)) {
            sender.sendMessage(colorize("&4You cannot do this. "));
        } else {
            Player p = (Player) sender;
            if (!(p.hasPermission("server.multisummon"))) {
                p.sendMessage(colorize(noPermission));
            } else {
                if (args.length >= 2) {
                    try {
                        EntityType entity = EntityType.valueOf(args[0].toUpperCase());
                        int amount = Integer.parseInt(args[1]);
                        for (int i = 0; i < amount; i++) {
                            p.getWorld().spawnEntity(p.getLocation(), entity);
                        }
                        p.sendMessage(colorize("&aYou've spawned &e" + args[1] + " " + args[0] + "s"));
                    } catch (IllegalArgumentException e) {
                        p.sendMessage(colorize("&4This is not an entity."));
                    }
                } else {
                    p.sendMessage(colorize("&4/multisummon [mob] [amount]."));
                }
            }
        }```
I think this is a little less arrow
ancient plank
#

how to not type like an idiot

undone kernel
#

but still some arrow

echo basalt
#

wtf

#

ew no

undone kernel
#

what

fresh timber
echo basalt
#

you can use return statements to avoid nesting

undone kernel
echo basalt
#

yeah

remote swallow
#

if staircases

#

ifs in ifs

echo basalt
#
if(something) {
  if(somethingElse) {
      ...
  }
}
#

this is nesting

undone kernel
#
if (staircases) {
falldown();
}```
ebon isle
echo basalt
#

you can instead do

if(!something) {
  return;
}

if(!somethingElse) {
  return;
}

both conditiomns are true
ancient plank
#

conditiomns

echo basalt
undone kernel
#

wait I can just put ! instead of having it in it's own parentheses

fresh timber
#

nesting is cool 🤩

ebon isle
fresh timber
#

looks amazing

#

like mountain

echo basalt
#

I really hate one part of advanced programming

#

nesting is pretty much unavoidable when dealing with futures and multithreading

undone kernel
#
    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
        String noPermission = this.plugin.getConfig().getString("No-Permission-MSG");
        if (!(sender instanceof Player)) {
            sender.sendMessage(colorize("&4You cannot do this. "));
        } else {
            Player p = (Player) sender;
            if (!p.hasPermission("server.multisummon")) {
                p.sendMessage(colorize(noPermission));
            } else {
                if (!(args.length >= 2)) {
                    p.sendMessage(colorize("&4/multisummon [mob] [amount]."));
                } else {
                    try {
                        EntityType entity = EntityType.valueOf(args[0].toUpperCase());
                        int amount = Integer.parseInt(args[1]);
                        for (int i = 0; i < amount; i++) {
                            p.getWorld().spawnEntity(p.getLocation(), entity);
                        }
                        p.sendMessage(colorize("&aYou've spawned &e" + args[1] + " " + args[0] + "s"));
                    } catch (IllegalArgumentException e) {
                        p.sendMessage(colorize("&4This is not an entity."));
                    }
                }
            }
        }
        return true;
    }``` 
alr illuminati guy I have no idea what i'm supposed to be doing
fresh timber
#

just look at this

            if (item2 != null) {
                if (item2.getType().equals(Material.NETHER_STAR)) {
                    if (item2.hasItemMeta()) {
                        if (item2.getItemMeta().hasDisplayName()) {
                            if (item2.getItemMeta().getDisplayName().equals("§3§lMenu §8(§7Click§8)")) {
                                event.setCancelled(true);
                            }
                        }
                    }
                }
            }
#

beautiful

ebon isle
undone kernel
echo basalt
#

WAIT NO HES COMPARING ITEMS

undone kernel
echo basalt
undone kernel
#
    @EventHandler
    public void onRightClick(PlayerInteractEvent e) {
        Player p = e.getPlayer();
        if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
            if (!(e.getItem() == null)) {
                if (e.getItem().getItemMeta().equals(itemManager.ultimateSword().getItemMeta())) {
                    if (!cooldown.containsKey(p.getUniqueId()) || System.currentTimeMillis() - cooldown.get(p.getUniqueId()) > 5000) {
                        cooldown.put(p.getUniqueId(), System.currentTimeMillis());
                        p.sendMessage(colorize("&aYou've used the Ultimate Ability!"));
                        p.getWorld().createExplosion(p.getLocation(), 15f);
                    } else {
                        p.sendMessage(colorize("&4You can't use this for another &e" + (5000 - (System.currentTimeMillis() - cooldown.get(p.getUniqueId()))) / 1000 + " &4seconds!"));
                    }
                }
                if (e.getItem().getItemMeta().equals(itemManager.ownerSword().getItemMeta())) {
                    p.getWorld().createExplosion(p.getLocation(), 20f);
                }
                if (e.getItem().getItemMeta().equals(itemManager.teliStick().getItemMeta())) {
                    p.teleport(p.getLocation().add(p.getLocation().getDirection().multiply(15)));
                }
                if (e.getItem().getItemMeta().equals(itemManager.ultimateTeliStick().getItemMeta())) {
                    p.teleport(p.getLocation().add(p.getLocation().getDirection().multiply(30)));
                }
            }
        }
        if (e.getAction() == Action.RIGHT_CLICK_AIR) {
            if (Objects.requireNonNull(e.getItem()).getItemMeta().equals(itemManager.ultimateSword().getItemMeta())) {
                if (!cooldown.containsKey(p.getUniqueId()) || System.currentTimeMillis() - cooldown.get(p.getUniqueId()) > 5000) {
                    cooldown.put(p.getUniqueId(), System.currentTimeMillis());
                    p.sendMessage(colorize("&aYou've used the Ultimate Ability!"));
                    p.getWorld().createExplosion(p.getLocation(), 15f);
                } else {
                    p.sendMessage(colorize("&4You can't use this for another &e" + (5000 - (System.currentTimeMillis() - cooldown.get(p.getUniqueId()))) / 1000 + " &4seconds!"));
                }
            }
            if (e.getItem().getItemMeta().equals(itemManager.ownerSword().getItemMeta())) {
                p.getWorld().createExplosion(p.getLocation(), 20f);

            }
            if (e.getItem().getItemMeta().equals(itemManager.teliStick().getItemMeta())) {
                p.teleport(p.getLocation().add(p.getLocation().getDirection().multiply(15)));
            }
            if (e.getItem().getItemMeta().equals(itemManager.ultimateTeliStick().getItemMeta())) {
                p.teleport(p.getLocation().add(p.getLocation().getDirection().multiply(30)));
            }
        }
    }```
remote swallow
#

AH

undone kernel
#

yes

remote swallow
echo basalt
#

LMAO WHAT NO

remote swallow
undone kernel
echo basalt
ancient plank
#

what in the unholy fuck am I looking at

undone kernel
echo basalt
#

backrooms code

ebon isle
#

I'm speechless

remote swallow
#

who do we ask to get the code to no clip out of reality

undone kernel
#
    public ItemStack ultimateSword() {
        ItemStack ultimateSword = new ItemStack(Material.DIAMOND_SWORD, 1);
        ItemMeta meta = ultimateSword.getItemMeta();
        meta.setDisplayName("§4§kscary§1Ultimate Sword§4§kscary");
        meta.addEnchant(Enchantment.DAMAGE_ALL, 10, true);
        meta.addEnchant(Enchantment.SWEEPING_EDGE, 10, true);
        meta.addEnchant(Enchantment.FIRE_ASPECT, 10, true);
        meta.addEnchant(Enchantment.KNOCKBACK, 10, true);
        meta.addEnchant(Enchantment.LOOT_BONUS_MOBS, 10, true);
        meta.addEnchant(Enchantment.DURABILITY, 10, true);
        meta.addEnchant(Enchantment.MENDING, 10, true);
        ultimateSword.setItemMeta(meta);
        return ultimateSword;
    }``` I also have this shit
remote swallow
#

NOPE

drowsy helm
#

use OOP man

undone kernel
#

actually question

echo basalt
#

HEHEHEHAW

#

WHAT No

remote swallow
#

EVERYONE RUNNNNNNNNNNNNNNNNN

undone kernel
#

is there a way to get all those enchants inside one line of code

vital yacht
#

Yes

undone kernel
#

and how is that

drowsy helm
#

use oop

undone kernel
vital yacht
fresh timber
#

this is my infamous one-liner

int i = Integer.parseInt(player.getInventory().getItem(36).getItemMeta().getLore().get(0).substring(12, player.getInventory().getItem(36).getItemMeta().getLore().get(0).toCharArray().length));
undone kernel
vital yacht
#

Well then don’t make it one line lol

fresh timber
#

i like it

#

most ppl dont

ancient plank
#
boolean smile = potato.equals(potato2) ? true : false;
remote swallow
#

Map<Enchantment,Integer> of ench and level

vital yacht
#

No checks at all

undone kernel
#

i've used like one thing that includes map.of.stream

#
return StringUtil.copyPartialMatches(args[0].toLowerCase(), Stream.of(EntityType.values()).map(Enum::name).map(String::toLowerCase).collect(Collectors.toList()), new ArrayList<>());
remote swallow
#

i hate that

undone kernel
#

WHAT'S WRONG WITH IT

remote swallow
#

its long

undone kernel
#

DO YOU EVENT KNOW WHAT IT IS FOR

remote swallow
#

also why are you args[0]#toLowerCase()

ancient plank
#

null checks amirite

undone kernel
#

exactly you don't know what it is for

#

it's for a tab completer

remote swallow
#

it returns all entity types

undone kernel
#

so you don't have everything in uppercase when you tab complete

undone kernel
#

haha yes

echo basalt
#

nonononono

remote swallow
undone kernel
#

if it works don't change it

echo basalt
#

my man

remote swallow
#

my brain is going smooth again

echo basalt
#

I've been making plugins for 6 years

#

have over 400 projects on my ideaprojects folder

#

I have never seen something this fucked up

undone kernel
#

it's one line

ebon isle
#

🥲

echo basalt
#

Not even @torn shuttle 's code is this bad

undone kernel
#

and it does the job

echo basalt
#

and we have beef

undone kernel
echo basalt
#

even his code is better than what ungodly fuck you have written

undone kernel
#
return StringUtil.copyPartialMatches(args[0].toLowerCase(), Stream.of(EntityType.values()).map(Enum::name).map(String::toLowerCase).collect(Collectors.toList()), new ArrayList<>());

this?

echo basalt
#

all

ebon isle
#

At least make it expandable, if it's too long extract method and name it properly.

#

Idk one liner is good for this

undone kernel
# echo basalt all

feast on this

    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
        String noPermission = this.plugin.getConfig().getString("No-Permission-MSG");
        if (!(sender instanceof Player)) {
            sender.sendMessage(colorize("&4&bYou can't do this!"));
        } else {
            Player p = (Player) sender;
            if (!(p.hasPermission("eagle.unenchant"))) {
                p.sendMessage(colorize(noPermission));
            } else {
                ItemStack item = p.getInventory().getItemInMainHand();
                ItemMeta itemM = item.getItemMeta();
                for (Enchantment ench : Enchantment.values()) {
                    itemM.removeEnchant(ench);
                }
                item.setItemMeta(itemM);
                p.sendMessage(colorize("&aYou've Un-Enchanted your item!"));
            }
        }
        return true;
    }```
and this 
```java
    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String s, String[] args) {
        String noPermission = this.plugin.getConfig().getString("No-Permission-MSG");
        if (!(sender instanceof Player)) {
            if (Bukkit.getOnlinePlayers().size() > 1) {
                sender.sendMessage(colorize("&aThere are &e" + Bukkit.getOnlinePlayers().size() + " &aplayers online!"));
            } else {
                sender.sendMessage(colorize("&aThere is &e" + Bukkit.getOnlinePlayers().size() + " &aplayer online!"));
            }
        } else {
            Player p = (Player) sender;
            if (!(p.hasPermission("eagle.online"))) {
                p.sendMessage(colorize(noPermission));
            } else {
                if (Bukkit.getOnlinePlayers().size() > 1) {
                    p.sendMessage(colorize("&aThere are &e" + Bukkit.getOnlinePlayers().size() + " &aplayers online!"));
                } else {
                    p.sendMessage(colorize("&aThere is &e" + Bukkit.getOnlinePlayers().size() + " &aplayer online!"));
                }
            }
        }

        return true;
    }```
ebon isle
#

plus my brain can't process that fast what the code does.

echo basalt
#

that's not as bad

#

I've seen worse at work

undone kernel
#

OH NOW YOU WANNA SAY IT'S NOT THAT BAD

#
return StringUtil.copyPartialMatches(args[0].toLowerCase(), Stream.of(EntityType.values()).map(Enum::name).map(String::toLowerCase).collect(Collectors.toList()), new ArrayList<>());

but somehow this is worse

echo basalt
#

yes

#

because I gotta bust out the 40:9 monitor

remote swallow
#

when i was dumb

echo basalt
#

LOL

undone kernel
remote swallow
#

someone asked me for it

#

it then never got used

undone kernel
#

atleast I use swiches

#

switches*

remote swallow
#

i now use switches

undone kernel
#

if-ception

echo basalt
#

who are you to judge

ebon isle
undone kernel
#

them

remote swallow
echo basalt
#

lemme see if I can find anything bad

#

because like

#

my code's pretty clean

remote swallow
#

did you wash it in the dishwasher

undone kernel
echo basalt
#

never made a heal command

undone kernel
#

then let's see how good it is

echo basalt
#

I have so many utils

#

it's quite easy

undone kernel
#

I have none

#

and it's still easy

fresh timber
#

is there an event for like running into a block?

undone kernel
#

i mean you can check if they have a block in front of them

#

imllusion ur typing quite the paragraph

echo basalt
#

no IDE ;)

undone kernel
#

how are you gonna use utils without an ide :kekw:

remote swallow
#

memory

echo basalt
#

I made the code I can recite it

undone kernel
fresh timber
#

ok xd

undone kernel
remote swallow
undone kernel
#

illumanati my code is already written

echo basalt
#
public class HealCommand implements SimpleCommand {
  
  private final MessagesFile messages;

  public HealCommand(MessagesFile messages) {
    this.messages = messages;
  }

  @Override
  public String getIdentifier() {
    return "heal.*";
  }

  @Override
  public String getPermission() {
    return "commands.heal";
  }

  @Override
  public void execute(CommandSender sender, String... args) {
    if(args.length == 0) { // target is the sender itself
      if(!(sender instanceof Player player) {
        messages.send(sender, "console-no-args");
        return;
      }

      healPlayer(player);
      messages.send(sender, "heal-self");
      return;
    }

    String targetName = args[0];
    Player target = Bukkit.getPlayer(targetName);

    if(target == null) {
      messages.send(sender, "target-not-found");
      return;
    }

    healPlayer(target);
    messages.sendMessage(sender, "heal-other", new Placeholder("target", targetName));
    messages.sendMessage(target, "healed-from-other", new Placeholder("healer", sender.getName()));
  }

  private void healPlayer(Player player) {
    double maxHealth = player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue();
    player.setHealth(maxHealth);
  }

}
#

idk

undone kernel
echo basalt
#

people with custom attributes

remote swallow
#

^^

echo basalt
#

you can't always assume the default nms values

undone kernel
#

i've tried using attributes 😦

echo basalt
#

because idiots like me like to change em around

undone kernel
#

imlllusion time to my abomination

#
            if (!(sender instanceof Player)) {
                switch (args.length) {
                    case 0:
                        sender.sendMessage(colorize("&4You need to specify a player!"));
                        break;
                    case 1:
                        Player t = Bukkit.getPlayerExact(args[0]);
                        if (!(t == null)) {
                            t.setHealth(20);
                            t.sendMessage(colorize("&aYou've been healed by the &eConsole&a!"));
                            sender.sendMessage(colorize("&aYou've healed &e" + t.getName()));
                        } else {
                            sender.sendMessage(colorize("&4This person is offline!"));
                        }
                }
            } else {
                Player p = (Player) sender;
                switch (args.length) {
                    case 0:
                        if (!(p.hasPermission("server.heal"))) {
                            p.sendMessage(colorize(noPermission));
                        } else {
                            p.setHealth(20);
                            p.sendMessage(colorize("&aYou've been healed!"));
                        }
                        break;
                    case 1:
                        Player t = Bukkit.getPlayerExact(args[0]);
                        if (!(p.hasPermission("server.heal.others"))) {
                            p.sendMessage(colorize(noPermission));
                        } else {
                            if (!(t == null)) {
                                t.setHealth(20);
                                t.sendMessage(colorize("&aYou've been healed by &e" + p.getName()));
                                p.sendMessage(colorize("&aYou've healed &e" + t.getName()));
                            } else {
                                p.sendMessage(colorize("&4This person is offline!"));
                            }
                        }
                }
            }```
#

actually it's not that bad

remote swallow
#

by the console

echo basalt
#

but being honest I'd probably add more to it

undone kernel
echo basalt
#

!(t == null) -> t != null

#

here let me solve it for you

undone kernel
#

yeah yeah i know I just learned I can use ! without the !()

#

tf am I saying

#

i got confused reading my own writing

remote swallow
#

i forgot i was having a problem earlier and my brain still wont let me see whats wrong

Class: https://paste.md-5.net/giwaqakugo.java
DataConfig: https://paste.md-5.net/otasufemoy.cpp

When i break a Grass Block it runs giveOrDropItem 5 times, 4 times with amount 1 and another with amount 12. Only the amount 12 one should run because its the correct fortune level. But then if i break GRASS (with drop swap) it runs 6 times all with 1 amounts but gives me 3 pink banners and 3 grass somehow and i cant figure out why any of these are happening, attached a video of what i mean

undone kernel
# echo basalt here let me solve it for you

no don't solve my heal thing if u gonna solve smth solve this

    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
        String noPermission = this.plugin.getConfig().getString("No-Permission-MSG");
        if (!(sender instanceof Player)) {
            sender.sendMessage(colorize("&4You cannot do this. "));
        } else {
            Player p = (Player) sender;
            if (!p.hasPermission("server.multisummon")) {
                p.sendMessage(colorize(noPermission));
            } else {
                if (!(args.length >= 2)) {
                    p.sendMessage(colorize("&4/multisummon [mob] [amount]."));
                } else {
                    try {
                        EntityType entity = EntityType.valueOf(args[0].toUpperCase());
                        int amount = Integer.parseInt(args[1]);
                        for (int i = 0; i < amount; i++) {
                            p.getWorld().spawnEntity(p.getLocation(), entity);
                        }
                        p.sendMessage(colorize("&aYou've spawned &e" + args[1] + " " + args[0] + "s"));
                    } catch (IllegalArgumentException e) {
                        p.sendMessage(colorize("&4This is not an entity."));
                    }
                }
            }
        }
        return true;
    }```
undone kernel
#

same thing actully happened to me once

vital yacht
# undone kernel is there a way to get all those enchants inside one line of code

Technically can be one line lol

     return Stream.of(new ItemStack(Material.DIAMOND_SWORD, 1))
                .map(item -> Map.entry(item, item.getItemMeta()))
                        .peek(entry -> List.of(
                                        Enchantment.DAMAGE_ALL,
                                        Enchantment.SWEEPING_EDGE,
                                        Enchantment.FIRE_ASPECT,
                                        Enchantment.KNOCKBACK,
                                        Enchantment.LOOT_BONUS_BLOCKS,
                                        Enchantment.DURABILITY,
                                        Enchantment.MENDING
                                )
                                .forEach(enchantment -> entry.getValue().addEnchant(enchantment, 10, true)))
                .peek(entry -> entry.getValue().setDisplayName("§4§kscary§1Ultimate Sword§4§kscary"))
                .peek(entry -> entry.getKey().setItemMeta(entry.getValue()))
                .map(Map.Entry::getKey)
                .findAny();
echo basalt
#

there

#

fetches from config n all

echo basalt
#

idk what you mean

undone kernel
echo basalt
#

My implementation is good

#

LIke

#

You do realize I'm making bootleg photoshop as my gui engine, right?

undone kernel
echo basalt
#

And that I make a living out of making plugins so...

#

There's no point in competing

remote swallow
undone kernel
echo basalt
#

god why is hastebin so small on 1440p

undone kernel
echo basalt
#

Epic

undone kernel
echo basalt
#

a friend of mine already has that

#

it's actually worse than just using a regular api

undone kernel
echo basalt
#

I mean more like this

undone kernel
echo basalt
#

yes that's how I make guis

undone kernel
#

you don't use themes?

echo basalt
#

:)

#

no I don't use themes

undone kernel
#

tf is wrong with youu

echo basalt
#

no point, base ide looks good enough

remote swallow
#

dark purple is the only good theme

undone kernel
#

my ide is lively

vital yacht
#

What is that

undone kernel
#

all the colors

vital yacht
#

That's worse than all the code you've shown

echo basalt
#

those are distractions

undone kernel
vital yacht
#

How do you use yellow

remote swallow
echo basalt
#

I'm fairly productive with my theme, I don't need more distractions

undone kernel
#

avoid green at all costs

vital yacht
undone kernel
vital yacht
#

lol

undone kernel
#

.peek(entry -> entry.getKey().setItemMeta(entry.getValue()))
.map(Map.Entry::getKey)
.findAny();

echo basalt
#

wait this mf is making a stream

vital yacht
#

Lol

echo basalt
#

you know what can be 1 line?

vital yacht
#

Had to make it one line

undone kernel
#

also I meant the enchants not the whole sword ...

vital yacht
#

Oh well

echo basalt
#
ItemStack item = new ItemBuilder(Material.DIAMOND_SWORD).name("whatever").addEnchantment(DAMAGE_ALL, 10)...
vital yacht
#

Yeah but that's using an outside class

undone kernel
#

yeah

echo basalt
#

so?

vital yacht
#

Obviously if you were actually doing it you would use that

echo basalt
#

like

#

my man

undone kernel
#

so i'm to lazy to figure out how to implment it

vital yacht
#

But this is just to show it in one line without anything else

echo basalt
#

do you actually think it's funny to rewrite your entire codebase every time you create a new project

vital yacht
#

Also new ItemBuilder

vital yacht
#

Instead of ItemBuilder.from or ItemBuilder.of

undone kernel
#

and i suck at it

echo basalt
#

¯_(ツ)_/¯

#

idk why you're arguing

#

you're clearly new

undone kernel
#

imllusion help me with 1 thing

echo basalt
#

no

#

👍

undone kernel
#

sad

remote swallow
echo basalt
#

something tells me you actually gotta apply OOP principles on your config

#

and parse it into an actual object instead of reading it every time someone breaks a block

undone kernel
#

imllusion how do I use uh pdc

echo basalt
#

you read a tutorial

vital yacht
#

?pdc

echo basalt
#

and then do it all in 1 line

#

with streams

vital yacht
#

Yes

vital yacht
undone kernel
#
    public ItemStack ultimateSword() {
        ItemStack ultimateSword = new ItemStack(Material.DIAMOND_SWORD, 1);
        ItemMeta meta = ultimateSword.getItemMeta();
        meta.setDisplayName("§4§kscary§1Ultimate Sword§4§kscary");
        meta.addEnchant(Enchantment.DAMAGE_ALL, 10, true);
        meta.addEnchant(Enchantment.KNOCKBACK, 10, true);
        meta.addEnchant(Enchantment.FIRE_ASPECT, 10, true);
        meta.addEnchant(Enchantment.DURABILITY, 10, true);
        AttributeModifier dmg = new AttributeModifier(UUID.randomUUID(), "generic.attackDamage", 70.0, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlot.HAND);
        meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, dmg);
        ultimateSword.setItemMeta(meta);
        return ultimateSword;
    }```
echo basalt
#

No comment.

undone kernel
#
                if (e.getItem().getItemMeta().equals(itemManager.ultimateSword().getItemMeta())) {
                    if (!cooldown.containsKey(p.getUniqueId()) || System.currentTimeMillis() - cooldown.get(p.getUniqueId()) > 5000) {
                        cooldown.put(p.getUniqueId(), System.currentTimeMillis());
                        p.sendMessage(colorize("&aYou've used the Ultimate Ability!"));
                        p.getWorld().createExplosion(p.getLocation(), 15f);
                    } else {
                        p.sendMessage(colorize("&4You can't use this for another &e" + (5000 - (System.currentTimeMillis() - cooldown.get(p.getUniqueId()))) / 1000 + " &4seconds!"));
                    }
                }```
#

bc sword and event don't work together with attributes

#

but without the damag attribute it works

atomic swift
#

how can i make no message send for PlayerQuitEvent & PlayerJoinEvent

worldly ingot
#

setQuitMessage() and setJoinMessage() iirc

#

There are methods on those events to change it

torn shuttle
#

this is what beauty looks like

winged anvil
#

beautiful

glad prawn
#

No

humble tulip
#

oggly

quaint mantle
#

Hey guys, How Can I get all effects from the potion item?
I tried like below but it's return empty

        PotionMeta meta = (PotionMeta) value.getItemMeta();
            Potion potion = Potion.fromItemStack(value);
            System.out.println(potion.getEffects());
#

This is deprecated? should I not use it?

sonic goblet
#

I fear your IDE might be infested with a demon

glad prawn
#

🤔

quaint mantle
#

nani?

#

how to fix? xD

quiet ice
#

This is an "issue" caused by paper pushing hard for their component API

onyx fjord
#

I forgot to push my item factory to GitHub so I would've showed you

quaint mantle
#

ah alr

undone kernel
glossy venture
undone kernel
quaint mantle
#

alr

remote swallow
glossy venture
#

also totally annoying

remote swallow
#

yes

quaint mantle
#

uhm I have no idea what are you guys talking about lol, I'm a total beginner in java

#

I just know how it works because I worked with js before lol

vague stone
#

PlayerTeleportEvent may only be triggered synchronously. Can someone explain me this error?

remote swallow
#

you are trying to trigger it async i would guess

vague stone
#

how can I trigger teleport synchronously? xd

remote swallow
#

?paste the code

undone axleBOT
vague stone
#

How can I teleport a player when I call the method in a self created Thread?

eternal oxide
#

runTask

#

?scheduling

undone axleBOT
vague stone
#

ty

icy beacon
remote swallow
quiet ice
#

Do Note that bukkit also has components

#

Or Well, Bungee but those are included in spigot

#

These suck, adventure components are nice however

tranquil cedar
#

Is it possible to get CustomModelData item in itemframe

worn tundra
#

and set the itemframe content?

icy beacon
bold gorge
#

can I hire developers for my plugin (not server.) on this discord server?

onyx fjord
#

?services

undone axleBOT
bold gorge
#

I don't qualify for 20 posts though.

#

alright, thank you :)

wet breach
#

why are you doing this the hard way?

#

also what is cost factor?

#

no I mean what is its purpose

#

is it suppose to be like added cost similar to that of taxes?

#

that didn't really explain cost factor

#

seems unnecessary

#

nope, just needed to know its purpose for the math

#

so basically you need to calculate the max you could buy right? And I assume you allow doubles or 2 digits past the decimal ?

cyan trout
#

Why are my Teams dont work?

wet breach
#
cost * wanted quantity = wanted cost

max can buy = wanted cost / currently owned (rounded down on the third decimal since we allow 2 decimal places)
#

you don't know the cost of stuff?

#

how do you not know the cost of items

#

if you don't know how how much 1 item costs, you won't know how much 10 of them costs

#

alright, using that which is the cost

#

you would times that by the wanted quantity which is however much the user is trying to buy. So if that is for like an upgrade, and they want 10 upgrades and lets say the cost is 2.50

#

then its 2.50 * 10 = 25

#

alright don't listen to me

quaint mantle
#

💀

wet breach
#

and I messed up the formula up top, should have been currently owned/wanted cost

#

I gave you the formula above in calculating the maximum you could buy, it is a two step process. Basically instead of a nice formula you don't understand I have broken it down for you in simpler terms

#

you didn't specify that earlier

#

so I assume the cost factor is the exponential part?

#

that was why I was asking about it earlier

#

anyways fortunately it doesn't change the formula much

#

you still have the base cost

#

which is all you need

#

all that is needed so its fine

green plume
#

Why i get the error Cannot resolve the symbole b?

wet breach
#
you could use modulo as well to do the decimal place math as it will give you the remainder.

(cost * exponent)wanted quantity = amount needed (round the second decimal place up if there is a third decimal place in result)

max can buy = currently owned / amount needed (round the decimal down for the second decimal place if there is a third decimal place in result)
#

the math doesn't need to be overly difficult 🙂

#

cost is the base cost

#

exponent is the factor

#

I wasn't referring to exponent as in an actual exponent

#

so once you get the max can buy

#

you just replace the top math where it says wanted quantity with max can buy

#

and that gives you the amount to deduct from their money

#

you might want to toss in a check in there if amount needed exceeds what they own

#

this way, once you have max can buy, you don't have to do the final calculation as you know they will have 0 for a balance lol

#

because it will still calculate what they could still buy

#

even though they wanted 10, the math above will still give you the amount they could buy which could be 8

#

if you really want to use the log method

#

this is how you do it

#

Math.log10(double a)

#

log 10 is base 10 also known as common log

#

if you want a custom base you would do this instead

#

Math.log(double logNumber) / Math.log( doube base)

#

@last temple

#

you shouldn't need custom log though, base 10 is generally what you want 😛

#

custom base is for things like you want it in base 3 or ternary

#

or maybe base 13

robust sinew
#

how do I stop players from being able to hit each other?

#

and how do I hide their name tags to certain other players?

wet breach
#

well, the math functions I gave above removes the need for log. Using log isn't necessarily more optimal since a lookup table is needed for it to be so.

echo basalt
#

like

#

asking us for everything means you're not putting any thought into it

#

Would there be an event that fires when players hit each other? do some research

wet breach
#

there is quite a few different solutions to that problem lol

echo basalt
#

Is the event cancellable, what happens if you cancel it?

tardy delta
#

^^

echo basalt
#

Asking us for a solution to a simple problem that has been documented and solved thousands of times just means you're not putting any effort in

robust sinew
#

currently I'm putting my players on teams for something else

#

using the scoreboard teams thing

#

and with that I can get rid of half of the problem (by turning off friendly fire for it)

#

but then players can hit each other across teams (which isn't so bad, I can probably use it for another thing I'm doing)

#

now I just need to find the event for players hitting each other

#

I will use the secret technique known only to programmers called "googling your problem"

#

oh wati

#

wait

eternal night
#

wielding such power is unheard of

robust sinew
#

I think I used the event for something else earlier

#

EntityDamageByEntityEvent

#

ok I did it

#

now time to go back to the other thing I was doing (this project is so much bigger than I thought it would be)

wet breach
#

most of it ends up being boiler plate code

#

don't worry

cyan trout
#

how to sort tab ?

red sedge
#

is there anyway to do smth like EntityDamageByEntityEvent.setDamage() but like overriding any modifiers

mossy plume
#

Does anyone know this plugin?

#

It's from skill but I don't know what it's called

twin venture
#

Hi , anyone useing this :
WesJD/AnvilGUI

vague stone
#

Can someone explain me why this code doesnt work?

CompassBuffer.java

    private List<PlayerCooldown> player;

    public CompassBuffer(Server server) {
        player = new LinkedList<>();
        server.getOnlinePlayers().forEach(p -> {
            player.add(new PlayerCooldown(p, LocalTime.now()));
        });

    }


    public boolean getCooldown(Player p) {
        LocalTime timeNow = LocalTime.now().plusSeconds(30);
        for (PlayerCooldown pc : player) {
            if (pc.getPlayer().equals(p) && pc.getCoolDownTime().isBefore(timeNow)) {
                System.out.println(pc.toString());
                return true;
            }
        }
        return false;
    }```

My code gets stuck on the if sentence because he thinks that the time from the constructor `for example: 17:14:07.896146292` is not before `for example: 17:14:53.114432111`
twin venture
eternal oxide
#

update your spigot

twin venture
#

no errors but i can't type anything

#

:=:

#

oh is that so

eternal oxide
#

update your spigot build

twin venture
#

i can't

#

my plugin built on 1.8.8 ..

#

i know i know all that talk about its old and other things

#

i really know , but its stable for me , and for the features i want , why update xd?

alpine cairn
vague stone
alpine cairn
#

What is it supposed to do?

vague stone
#

It should ask if the time, the user executed the item was 30seconds ago when not then print "on cooldown" else the item should get used

vague stone
#

the player is the same

#

but it tells that the time isn't before

vocal cloud
#

Have you tried logging the values involved?

vocal cloud
#

Because you can figure out what's wrong?

vague stone
vocal cloud
#

The times?

vague stone
#

both LocalTimes

#

cooldowntime and timenow are both localtimes

vocal cloud
#

Wait a minute. Do you store the player object?

vague stone
#

the player object works

#

but the time doesn't work

#

PlayerCooldownDAO.java

package dao;

import java.time.LocalTime;
import java.util.Objects;

import org.bukkit.entity.Player;

public class PlayerCooldown {

    private Player player;
    private LocalTime coolDownTime;
    
    public PlayerCooldown(Player player, LocalTime coolDownTime) {
        this.player = player;
        this.coolDownTime = coolDownTime;
    }

    public Player getPlayer() {
        return player;
    }
    public LocalTime getCoolDownTime() {
        return coolDownTime;
    }

    public void setCoolDownTime(LocalTime coolDownTime) {
        this.coolDownTime = coolDownTime;
    }

    @Override
    public String toString() {
        return "PlayerCooldown [player=" + player + ", coolDownTime=" + coolDownTime + "]";
    }

    @Override
    public int hashCode() {
        return Objects.hash(coolDownTime, player);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        PlayerCooldown other = (PlayerCooldown) obj;
        return Objects.equals(coolDownTime, other.coolDownTime) && Objects.equals(player, other.player);
    }
    
    
    
    
}
vocal cloud
#

Player isn't persistent. If a player leaves and joins the object is invalidated. Why not store epochs instead of objects for the time? Then you can just time1 > time2

vague stone
vocal cloud
#

Ah well that works I suppose

vague stone
#

The player isn't the problem

#

The time is the problem

#

but I try use epoch now

twin venture
wet breach
#

and then convert the milliseconds to time if you really need it

vague stone
wet breach
#

because it is accurate and will do what you want and there is Java API methods to get such things. You are not doing anything that would require local time

vague stone
#

and uhh how do you mean it

vague stone
#

I just want to put an delay for 30seconds

wet breach
#

yes, and grabbing milliseconds will allow that

#

just divide the milliseconds by 1000 to get seconds

vague stone
#

uh

#

so System.currentTimeMillis() you mean?

#

or which milliseconds do you mean

wet breach
#

30000 milliseconds = 30 seconds

wet breach
vague stone
# wet breach this yes

k, tmm good question is how to implement this xd (dont have experience with currentTimeMillis)

wet breach
#

so, the math to do it is like so

#
Time start = System.currentTimeMillis();

check = (System.currentTimeMillis() - start);

if (check >= 30000) {
//do something here
}

//another way to write
if ((System.currentTimeMillis() - start) >= 30000) {}
#

every time you invoke System.currentTimeMillis() the value is the current time of now.

#

30000 comes from delay * 1000

#

to convert seconds to milliseconds

#

@vague stone provided some example usage

vague stone
#

I'm trying it

wet breach
#

the second way might be the preferred

#

since everytime the if statement is encountered it will check the current time now

#

instead of the former having to invoke check to update

vague stone
#

kk

tardy delta
#

i once was storing a WeakReference<Player> and my ref got invalidated while that player was online 💀

wet breach
#

that is why you need a system in place to re-validate it

tardy delta
#

i told myself to not do that again

wet breach
#

well it is acceptable, you just forgot to have methods in place to re-validate it if it was invalidated

tardy delta
#

im now holding a player object in my user class

#

all references to that user ref get destroyed when the player leaves and so the player object too

wet breach
#

as long that is ensured it should be fine, but why do you need to hold a reference to the entire player object?

#

if you need that why don't you just make a wrapper object

#

unless that is what your user class is

tardy delta
#

ye its some kind of player wrapper

#

dont want to do a map lookup every time i call a method on that user object

#

even when its just for the slightest thing

wet breach
#

see what I would do is just hold a reference to their UUID and then make a method that would return a player object from said UUID when it is needed

tardy delta
#

thats what people tell me yes

wet breach
#

then you can make your user class invoke said method for the player object all the time

#

now you are not storing an entire player object reference and calling it when it is needed as needed

tardy delta
#

i am?

#

that lazy value thing holds a T ref and checks if its still valid on retrieving it

#

there might be better ways tho

wet breach
#

I don't know your code base so can't really say. Personally I typically build off offlineplayer instead

#

as this allows my code to still function even if they are offline

fervent panther
#

I want to make a sword that charges up while in your offhand. What would be the best way of doing that?

tardy delta
#

runnable

vague stone
#

@wet breachNow I'm crying a lot bc of u xD

#

You fixed my problem, ty ❤️

tardy delta
#

im regretting asking md5 for adding uwu

wet breach
#

I like it

tardy delta
#

i did

wet breach
#

I like cats, so the more cat emojis the better

tardy delta
#

cats will eat you when yoi die

wet breach
tardy delta
#

imagine getting eaten by a bird tho

#

couldnt be me

#

why havent i documented my code, now im looking at a mess which i dont even know what it does

fallow violet
#

am i able t oget with mongoDB an arraylist like this or like this?
.get("titles", ArrayList.class); or .get("titles", List.class);

#

or non of it?

tardy delta
#

is titles a ArrayList<String>?

#

if so i believe it knows how to deserialize a string so should work i think

#

or it might get converted to a Document

#

always useful to print out .get("titles").getClass()

fervent panther
ivory sleet
#

no

tardy delta
#

i mean if you want it to charge up with some visual animation on whatever you'd need a runnable, if you just want to set a cooldown on that item, comparing the last time used it is fine

ivory sleet
#

runnables themselves are not costly at all

echo basalt
tardy delta
#

threads are but thats something else

#

dont want a loss on precision but also dont want to use chunky bigdecimals 💀

wet breach
#

at least not in of themselves lol

tardy delta
#

i was talking about being costly :)

#

to create atleast

wet breach
#

well depends really in what you are doing with them

#

in terms of amount of resources, yes but you shouldn't be creating and killing threads off constantly though

tardy delta
#

uhu

#

smh me creating a CharBuffer class even tho java.nio has one

#

that one might actually be faster as it uses unsafe

ivory sleet
wet breach
#

using native code

tardy delta
#

i see

#

love the coding style of some internal java classes 💀

#

and then a few hundred empty lines

dim bronze
#

side effects and naming makes this look like c/++

tardy delta
wet breach
#

typically in native code this is automatic therefore makes it quite nice using such to separate methods source viewing wise

tardy delta
#

ik empty lines are not compiled but how lol :/

#

would it be generated or smth?

wet breach
#

well, native compilers just automatically look for anything that has empty characters on lines that have no non-empty characters. If such exists it automatically just ignores it in the compiling process thus doesn't show up in compiled code

wet breach
#

in Java however, spaces do matter sometimes as it can increase file size, so it is just dependent on your build setup if you have something to remove such things or to ignore it in the compiling process

#

but source viewing wise, it doesn't really matter it is just nicer to look at if methods are separated out like this

tardy delta
#

👀

robust sinew
#

If I add curse of binding to a block that's on the player's head, does the enchantment work normally? (as in does it still stop the player from removing it, or do I have to add something else to stop the player from removing the block)

vocal cloud
#

?tias

tardy delta
#

some nice coding style

wary topaz
#

Quick question, is there a containsStringList in config?

#

or is it getStringList == null?

#

I'm not at my pc rn and I need it for later.

vocal cloud
#

Wouldn't you just check for a key?

tardy delta
#

getStringList() never returns null right

wary topaz
#

Remote desktoping to my pc shows this

#

im trying to see if "hi" exists

tardy delta
#

hi is a configuration section right

wary topaz
#

yes

#

its like a tree

undone kernel
#

tf is hi

wary topaz
#

its a testing thing

undone kernel
#

ah

vocal cloud
#

You can check for a key. You don't need to check if it's a type

wary topaz
#

alr thanks

#

wait but theres no .exists

#

will it return null for a key?

tardy delta
#

how is break unnessecary? doesnt that work in a while or smth?

vocal cloud
#

.contains()

tardy delta
#

ah wait it interprets it as a break in the switch ig

#

how can i break out of the loop lol

#

label would work ig

undone kernel
tardy delta
#

well im trying to break out of the while loop, not the switch

undone kernel
#

ah

#

well i have no idea ;- ;

tardy delta
#

loop: while and break loop works

vocal cloud
#

Change a boolean in the while loop to true

tardy delta
#

ig ill jusst throw an exception when the buffer has no more elems

vocal cloud
#

No

#

Ew

undone kernel
#

no don't do thagt

#

that*

vocal cloud
#

Just use a boolean called isEmpty or something

tardy delta
#

im disallowing any kind of invalid input so should be fine

#

calling this method with an empty buffer would mean we are in an invalid state anyways

#

lemme test

undone kernel
#

ppl rrl paying this much for intellij ultimate :kekw:

vocal cloud
#

No individual pays that

#

Check your tab FacePalm

tardy delta
#

imagine not having gh student

#

me over two years 😢

vocal cloud
#

Imagine not realizing that's the org pricing not individual

undone kernel
#

wut

vocal cloud
#

That's the org pricing

tardy delta
#

ok good

undone kernel
#

oh shat i'm dumb af

#

alr this is less bad but still that's alof of money for not alot of features

vocal cloud
#

The db stuff is so important to me lol. I pay for intellij

tardy delta
#

for one year bruh

#

id just get it illegal

vocal cloud
#

Gross

tardy delta
#

im sorry

undone kernel
#

what's even the differences

vocal cloud
#

I pay for the full product pack

undone kernel
#

I've used the trial but seen none

#

other than more plugins that i will never use

tardy delta
#

i get it all for free for three years uwu

vocal cloud
#

You get access to a lot of extra features like integrated db, the profiler, and others

undone kernel
#

database?

tardy delta
#

i love that db stuff

undone kernel
#

if not i have no idea what db is

vocal cloud
#

Database Integration

undone kernel
#

bc when I used my trial i never saw that

vocal cloud
#

It's on the right hand side

#

Insanely useful

undone kernel
#

what can i do

#

with that

vocal cloud
#

The better question is what can't you do

#

It's a full database manager supporting almost every db out there that matters

undone kernel
#

well what can't you do

wary topaz
#

how can I check how many categories are in the "hi" in the config

#

X Y Z being 3

undone kernel
wary topaz
#

without a map or array*

tardy delta
#

section(hi).getKeys(false).size()

undone kernel
#

there u go

wary topaz
#

thanks

sacred hamlet
#

hello to all, after several tries I still can't find the event that verifies the setting up of an item frame

wary topaz
#

if (homeConfig.getStringList("Homes.Players." + p.getUniqueId()).getkeys <----- error) {

tardy delta
#

its a section not a stringlist

wary topaz
#

Oh a section alr

bold gorge
#

can I use a higher java version for lower spigotmc-api versions

tardy delta
#

getSection(homes.players.id.hi).getKeys(false).size()

undone kernel
#

also I have no clue if this works at all

#

but u can try that for yourself

wary topaz
#

Cannot resolve method 'getSection' in 'FileConfiguration'

bold gorge
tardy delta
#

getConfigurationSection

wary topaz
#

Thanks.

sacred hamlet
undone kernel
sacred hamlet
#

nothing more

undone kernel
#

yeah there doesn't seem to be a way in spigot
and if ur gonna switch to paper be ready for alot of redacted things

bold gorge
#

not a lot.

undone kernel
#

like broadcastMessage

#

and and

#

other things

#

@sacred hamlet if you switch to paper
here's a demo of what u can try to do

sacred hamlet
#

sur internet je trouve "Hanging Place Event" mais l'événement ne me propose rien en événement. et ma console ne me répond pas Systeme.out.printer("ok")

tardy delta
#

uh english only

sacred hamlet
#

Rip sorry copy past

#

on the internet I find "Hanging Place Event" but the event does not offer me anything as an event. and my console does not answer me Systeme.out.printer("ok")

undone kernel
bold gorge
#

can I use a higher java version for lower spigotmc-api versions?
for example java 11 for the 1.13.2 spigot api.

undone kernel
#

i have no idea at all

trim creek
#

Afaik 1.13.2 supports Java 11

#

so probably you can...

#

if not, then not

undone kernel
#

but tell me ur version and I'll see if paper has smth for it

sacred hamlet
#

Me : spigot 1.19.2

undone kernel
trim creek
#

so wait there are events that don't even work in Spigot?

undone kernel
trim creek
#

aa

#

that explains

#

definetly won't use paper API

undone kernel
sacred hamlet
#

Packagé io.papermc.paper.event.player ?

undone kernel
#

also it has options

dire salmon
#

what u trying to do?

vocal cloud
undone kernel
sacred hamlet
#

do you have a link to download the io.papermc package?

undone kernel
#

yeah

sacred hamlet
#

I just want to detect when the player places it

undone kernel
#

damn I thought this meant what rotation

undone kernel
#

and have an if statement that detects if it's a itemframe

#

that should be way easier

#

nice

#

purple name

sacred hamlet
#

I launch my plugins but an item frame is an entity, isn't it?

dire salmon
#

yes

sacred hamlet
#

HangingPlaceEvent not responding in 1.19.2

#

you can only do event.get class and if you call your console (to check) it doesn't respond

undone kernel
#

idk bout u but it works

sacred hamlet
#

Non HangingPlaceEvent

undone kernel
#

i made this quick i don't need to do that bruh

river oracle
#

Bad thought process

#

I call mine e cope

#

Event is too long

undone kernel
#

how tf is intellij trash

river oracle
#

vscode>>>

hybrid spoke
#

notepad>>>>>>>>>>>>>>>>>>>

river oracle
#

Two keystrokes vs 1

unique mountain
#

Hello,

Is there a standard way of combining datapacks with plugins? I have a theory about how I can implement custom items using datapacks & resourcepacks and then keep the logic to plugins?

#

btw nodepad sucks

sacred hamlet
#
 @EventHandler
    public void onPosterPlace(HangingPlaceEvent e){
if(e.getEntity instanceof ItemFrame){
    
}
        System.out.println("ok");

    }
}```

Connor resolve symbol 'getEntity'
river oracle
#

Also despite popular belief vscode does have auto complete

undone axleBOT
undone kernel
#

yeah you forgot the things

#

I forgot the name

#

paraentheses

undone kernel
#

or smth

river oracle
#

Good luck 👍🏼

unique mountain
undone kernel
#

he just said that wasn't and u think it's gonna work

river oracle
#

Who knows sounds like a shitty idea bur you can do what you want

unique mountain
#

Why a bad idea?

river oracle
#

Why even bother

hybrid spoke
sacred hamlet
#

Cannot résolve method 'getEntity' in 'HangingPlaceEvent'

undone axleBOT
river oracle
hybrid spoke
wary topaz
#

if (homeConfig.getConfigurationSection("Homes.Players." + p.getUniqueId()).getKeys(false).size() == maxhomes) {

Is seems this is just not running but I do not know why.

hybrid spoke
#

when you could literally either do all via a datapack OR via a plugin

#

not sure why you want to combine them

undone kernel
sacred hamlet
#

???

undone kernel
hybrid spoke
unique mountain
#

No I cant, I want to interract with a database, thereby I have to use java, but I still want custom textures which, from what I know, you cannot do using bukkit?

undone kernel
#

u can't just put getEntity

hybrid spoke
unique mountain
#

Can you send me some links?

sacred hamlet
hybrid spoke
#

?bing

undone axleBOT
hybrid spoke
#

here the best link

wary topaz
#

?opera

#

😛

hybrid spoke
#

still mad that ecosia doesnt work

#

or does it

#

?ecosia

#

sucks

wary topaz
#

?firefox

#

LOL

sacred hamlet
#

if i can post a screenshot...

hybrid spoke
#

?verify

quiet ice
#

Get verified lol

wary topaz
#

?microsoftedge

#

ez

undone kernel
#

right now

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

wary topaz
#

I aint getting any errors its just overlapping and ignoring that line

sacred hamlet
#
 @EventHandler
    public void onPosterPlace(HangingPlaceEvent e){
if(e.getEntity() instanceof ItemFrame){

}
        System.out.println("ok");

    }
} ```
Cannot resolve method 'getEntity'  in 'HangingPlaceEvent'
undone kernel
hazy parrot
wary topaz
#

@undone kernel my monitor is huge

#

@hazy parrot alr

undone kernel
hybrid spoke
#

font size 40

undone kernel
wary topaz
#

how tf do I shrink it

hybrid spoke
#

wtf

#

why is your discord so epileptic

wary topaz
#

cause my phone cam sucks

hybrid spoke
#

or you are using unallowed software youknow

undone kernel
#

so I have no clud what you're doing

wary topaz
#

...

undone kernel
#

clue*

#

How tf does ur camera suck

sacred hamlet
#

maybe it works for you but not me

undone kernel
#

i got a moto g pure

#

this man has a iphone

wary topaz
#

maybe its bc my monitor curves

hybrid spoke
#

moto

#

best phones back in the days

undone kernel
#

first mobile one as well

wary topaz
#

let me print the size and ill be back

#

console log and code in there

undone kernel
#

does anyone want cruchyroll premium

wary topaz
#

whats that

undone kernel
#

idk

#

that's why i'm asking if anyone wants it

wary topaz
undone kernel
wary topaz
#

which one

undone kernel
#

the one that's a gift

tardy delta
#

gimme

undone kernel
wary topaz
#

theres 2 gamepasses

#

oh

hybrid spoke
#

MT622-WX9HF-XPKHT-YTCJW-YFV2Z pc

#

CJ26V-CGCYD-9H2VW-6HJJP-6Q26Z xbox

wary topaz
#

6RDJY-64QDW-6JC92-XV67D-K9C4Z pc

undone kernel
wary topaz
#

6XTJ3-RPQCW-2DMF7-D96MT-F923Z xbox

undone kernel
tardy delta
#

what shit is that lol

undone kernel
#

me not getting ultimate

tardy delta
wary topaz
#

wtf

solemn meteor
#

Hello, lets say I want to make it so that strongholds wont spawn when i create and load the world, how would I be able to do that?

undone kernel
#

1KD6O9IMM9F5QSPA @tardy delta here crunchyroll premium

fringe hemlock
#

1KIJ1NZOZ6DD5C4Q

tardy delta
#

nah thank you

undone kernel
#

u also got the premium itz

fringe hemlock
#

yes

#

i dont want it

tardy delta
#

its already enough that someone was watching anime in the train

wary topaz
tardy delta
#

with the goddamn sound on

tardy delta
#

hello young lady

#

what emoji

undone kernel
tardy delta
#

stfu

undone kernel
undone kernel
wary topaz
#

who actually knows how to use nms

undone kernel
#

not me

wary topaz
#

me neither

#

wish there were docs lol

undone kernel
#

it's minecraft

#

they will copyright somthing on reddit

undone kernel
#

also i have a copy of minecraft browser edition

wary topaz
#

damnnn

#

i have a copy of version 1

#

and I decompiled it

tardy delta
#

damn refactored 80 lines in 30 lines

#

java CharBuffer god

wary topaz
#

LOL

#

Have you every seen a plugin made for version 1.0?

undone kernel
wary topaz
#

wait just want to make sure, thats not a google site ?

wary topaz
#

alr

undone kernel
#

it's a site just not a google one

wary topaz
#

no shit\

opal juniper
#

FYJT2-3FT22-MTYC4-RDDR4-3TCFZ

#

Gamepass ^

undone kernel
tardy delta
#

refactored 20 lines

opal juniper
undone kernel
opal juniper
#

is it open source

undone kernel
#

it was

tardy delta
#

js backend ig

undone kernel
#

before minecraft shut it down

tardy delta
#

smh

opal juniper
#

what was it called

#

i will not try and illegally find a copy

undone kernel
#

why don't u join my server 🙂

opal juniper
#

sure

#

i would like to try it

undone kernel
#

alr i'll dm u

#

also uh you gotta turn video settings all the way down

#

or else u get like 15 fps

old cloud
tardy delta
#

expression parser

#

refactoring the whole damn thing and adding a faster algorithm

old cloud
#

cool 👌

crimson jasper
#

How can I check if a dropped Item from the PlayerDropItemEvent equals Dragon Egg?

tardy delta
#

check if the type equals Material.DRAGON_EGG or smth

tardy delta
#

love how jit optimizes the same method call from 28000µs to 163µs

crimson jasper
#

Well can I check getItemDrop() against Materials?

loud frost
tardy delta
quaint mantle
tardy delta
#

first run

#

jit has to compile code ig

undone kernel
#

lmao

#

i found the smallest ruined portal

tardy delta
#

should run a benchmark to actually see

#

big and chunky bro

quaint mantle
#

Hey sorry but I want that when a player joins my server it gives a message to everyone.... except that I want a custom message for 2 players but it does not work https://paste.md-5.net/nosebuqika.java

#

This seems like a bad idea to hardcode

tardy delta
#

dont compare string by ==, use equals

#

?learnjava

undone axleBOT
tardy delta
#

setting the join message to an empty string will actually still show an empty line to the players chat, use null to disable it

quaint mantle
#

good idea thx

steady rapids
#

hi, is there a way to run a mc server from ide?

vocal cloud
#

Yes, gradle can do it

steady rapids
#

mmhh is there a repo?

tardy delta
#

ok my new version is fucking up