#help-development

1 messages · Page 1665 of 1

grim ice
#

imagine someone using hashmaps

#

and getting confused why it isnt working

#

cuz he doesnt know that his package thingy is broken

#

package e.owo.lol.datemepls

#

when i finish dis ill go continue java dos

#

docs

#

becuz this thing is 100% not enough

burnt sand
#

Hi does anyone know how i can update the version of my plugin and upload a new jar

unreal quartz
#

give up and move to brazil

opal juniper
#

no

#

brazil is bad

#

Kenya is better

manic bison
#

hey, how could i convert from InetSocketAddress to String ? I've been trying String.valueOf() but it shows me things i dont want to see, i just need to see the standard IP adress format like X.X.X.X

kindred valley
#

hello

manic bison
kindred valley
#

if(kelepce.equals(player.getInventory().getItemInMainHand()))

#

why this method is not running

manic bison
#

what the f is kelepce

kindred valley
#

hancluffs

#

mean

manic bison
#

kk

kindred valley
#

and its a custom item

manic bison
#

is it in PlayerInteractEntityEvent

#

and did you put an Event Handler

#

and have you registered it in your Javaplugin extends class?

kindred valley
kindred valley
manic bison
#

try sysout'ing some parts of your code so you can see what is fired and what's not

#

System.out.println("Test1");

kindred valley
#

this part of code is not working

#

if(kelepce.equals(player.getInventory().getItemInMainHand()))

quaint mantle
#

try isSimilar to ignore item amounts

kindred valley
#

not working

kindred valley
#

and i made it .equals

#

and it is not working either

quaint mantle
#

show where you create kelepce item

kindred valley
#
    public void onClamp(final PlayerInteractAtEntityEvent e) {


        Player player = e.getPlayer();
        final Entity clickedEntity = e.getRightClicked();

        if (clickedEntity instanceof Player) {



            ItemStack kelepce = new ItemStack(Material.TRIPWIRE);
            ItemMeta meta_kelepce = kelepce.getItemMeta();
            meta_kelepce.setDisplayName(ChatColor.GRAY + "Kelepçeler");
            ArrayList<String> lore = new ArrayList<>();
            lore.add(ChatColor.DARK_BLUE + "Polislere Özgüdür");
            lore.add(ChatColor.DARK_BLUE + "Kişileri Kelepçeleyip Soymaya Yarayabilir.");
            meta_kelepce.setLore(lore);
            meta_kelepce.addEnchant(Enchantment.PROTECTION_FALL, 1, true);
            kelepce.setItemMeta(meta_kelepce);

            if(kelepce.equals(player.getInventory().getItemInMainHand())) {



                player.sendMessage("blabalbla");


            }

        }
    }```
quaint mantle
#

show the item in your hand

kindred valley
#

what

quaint mantle
#

send a ss of the item in your hand

kindred valley
calm whale
#

if anyone can help me about it, it would be awesome thnx

dim bluff
#

How do I differenciate between normal golden apple and enchanted golden apple

#

like what would for example Material egoldenapple = Material.etc be

#

putting Material.GOLDEN_APPLE, 1, (short)1; just puts an error

calm whale
#

Material.ENCHANTED_GOLDEN_APPLE @dim bluff

#

you could simply look at Material list to find it

dim bluff
#

it doesnt seem to make the difference

#
  1. my set of wanted materials doesnt even register ENCHANTED_GOLDEN_APPLE as a material. And in game the gapple and enchanted gapple do the same thing
#

(same cooldown)

calm whale
#

what is your version ?

dim bluff
golden turret
#

ye

#

normal apple

#

durability of 1

dim bluff
#

how do I make the difference, everywhere is telling me to change durability but none of the codes work

#

well

#

Material.GOLDEN_APPLE, 1, (short)1; idk how to do this

golden turret
#

in itemstack constructor

dim bluff
#

do I just change all my materials to itemStacks

golden turret
#

welcom to 1.8

dim bluff
#

bru

#

nah

#

naaaaaa

golden turret
#

it depends to

dim bluff
#

😢

golden turret
#

u can keep using materials if yk the items doesnt have data

dim bluff
#

I need the enchanted golden apple

#

thats it

#

so I guess everything needs to change for 1item

#

lit

calm whale
#

what are you trying to achieve ?

tall dragon
dim bluff
golden turret
#

or wlib

dim bluff
#

everything is done and perfect

#

just the notch apple 🙂

#

might just add an if statement

tall dragon
#

but you'll need to change your Materials to XMaterials

tall dragon
#

well any of the solutions work

#

i have my own class for handling this

quaint mantle
#

can i make a command to verify someone's debit card credentials

opal juniper
#

lmao

quaint mantle
#

LOL

#

no i forgor what i was gonna ask

#

im at a restraunt so i cba

#

something about entity visibility w/o packets

#

i'll ask later when im more available

quaint mantle
lament minnow
#

Not really help, but why does Spigot still use Gson 2.8.0 when 2.8.8 is the latest?

quaint mantle
#

Yea

#

probably doesnt add any features needed/performance

lament minnow
#

i at least know that it deprecated jsonparser objects and replaces them with static methods

#

would that decrease or increase performance

quaint mantle
#

neither

lament minnow
#

Oh.

#

okay that explains it

ivory sleet
#

Moshi (D

vivid lily
#

Why is playerConnection not a thing?

hasty prawn
#

Are you on 1.17 with Mojmaps

#

If so it's just connection

vivid lily
#

im on 1.17.1 but not mojmaps

hasty prawn
#

Then it's obfuscated

#

You'll have to manually look through the mappings to find what it's called.

lament minnow
#

Use the remapped-mojang spigot server for that.

#

Or do that.

#

I know that it is b.

hasty prawn
#

Well there you go KEKW

vivid lily
#

That's what i thought!

#

But thanks for confirming

lament minnow
#

you are welcome

hasty prawn
#

Yeah all the Spigot stuff got obfuscated in 1.17 so if you want normal names you have to use Mojmaps and then remap at compile with SpecialSource

lament minnow
#

i can show exactly how to do it

#

and i recommend it because obfuscations suck ball

hasty prawn
#

Facts

vivid lily
#

i would rather learn the obfuscated stuff

lament minnow
#

ogey

hasty prawn
#

It's definitely a pain to initially setup mojmaps but once you get it Prayge

lament minnow
#

i think that they can change between updates though

hasty prawn
#

I wouldn't be surprised if they did

errant snow
#

Hey, so I'm trying to deserialize ItemStacks from a json file. Serializing them seems to work fine, but for some reason deserializing throws and EOFException. I'm not sure why I'm getting an EOFException because my methods seem to be the same as other methods people wrote for similar uses.

Here is my serialization method:

@Nullable
public static String itemStackToBase64(ItemStack item) {
    try {
        ByteArrayOutputStream io = new ByteArrayOutputStream();
        BukkitObjectOutputStream os = new BukkitObjectOutputStream(io);

        os.writeObject(item);
        os.close();
        byte[] serializedObject = io.toByteArray();
        return Base64.getEncoder().encodeToString(serializedObject);
    } catch (final IOException ex) {
        Bukkit.getLogger().severe("Unable to serialize item: " + item);
        ex.printStackTrace();
        return null;
    }
}

And here is my deserialization method:

@Nullable
public static ItemStack base64ToItemStack(String base64) {
    try {
        byte[] serializedObject = Base64.getDecoder().decode(base64);

        ByteArrayInputStream in = new ByteArrayInputStream(serializedObject);
        BukkitObjectInputStream is = new BukkitObjectInputStream(in);

        ItemStack item = (ItemStack) is.readObject();

        is.close();
        return item;
    } catch (final IOException | ClassNotFoundException ex) {
        Bukkit.getLogger().severe("Unable to deserialize item from string: " + base64);
        ex.printStackTrace();
        return null;
    }
}
#

After adding some print statements, I narrowed it down the the exception being thrown by this line: BukkitObjectInputStream is = new BukkitObjectInputStream(in);

waxen plinth
#

Imagine not going open source

unreal quartz
#

ye it is called licensing it under the GPL and releasing it as free software

waxen plinth
#

GPL??

#

MIT best license

#

Get outta here with that viral license shit

unreal quartz
#

that’s what spigot is

#

I would choose MIT if spigot wasn’t GPL

waxen plinth
#

Choose MIT

unreal quartz
#

but either way it is inconsequential as no one gives a shit anyway and it’s not like I am going to take action against someone violating my license

granite beacon
#

How can I push a minecart at a set speed?
(depending on where the rails are pointing to)

I've been trying by altering the velocity but that just bugs things out due to the different directions

waxen plinth
#

I haven't seen a single case of someone coming after an open source plugin for not being GPL

waxen plinth
#

That's why I go MIT

#

Even if someone did violate the license

#

The worst that really means is they didn't credit me or didn't redistribute the license with the source

#

Of which neither are a big deal

#

And in general I just don't really care what people do with it as long as it's not harming me and I like them to credit me, but if they don't that's not a big deal either

unreal quartz
#

likewise

#

i am a broke uni student, i have other things to be doing rather than caring about how people use plugins i wrote as a way to practice programming

waxen plinth
#

Mhm

unreal quartz
#

doesn’t stop you

#

that is a monumentally stupid decision

#

so.. why are you doing it?

#

in most cases it is malicious

#

why are you hard coding your own discord webhook into software other people use

waxen plinth
#

You can make paid plugins open source

#

PlotSquared did that

#

And they still have buttloads of paid downloads

unreal quartz
#

or.. have people hop into your discord server instead and just tell you

waxen plinth
#

Just put it in config

#

Seriously

#

Wait

#

slfjkgl

unreal quartz
#

how are you going to clarify suggestions if they’re ambiguous

waxen plinth
#

Yeah that's genuinely a really terrible idea

#

Even with obfuscation the string is still in there

#

You could very easily use wireshark to get the url

quaint mantle
#

Why are you guys having a full on conversation

waxen plinth
#

And send a bunch of shit to the webhook

granite beacon
#

you guys are having a 2v1. He asked a question...

waxen plinth
#

Just don't do it

unreal quartz
#

because discord channels are designed to allow people to have conversations

waxen plinth
#

Yeah we're telling him not to do it because it is a monumentally stupid idea

#

Take suggestions in your discord

#

Without a webhook

unreal quartz
waxen plinth
#

The only way is to set up a backend server that the plugin would communicate with

unreal quartz
#

why would players be suggesting things for your plugin?

waxen plinth
#

But even if you do that there's no way to easily filter out junk or spam

unreal quartz
#

they go to the server admins to suggest things

#

they then forward that to you

granite beacon
waxen plinth
#

We promoted open source but we're beyond that

#

We're focusing much more on this as a security hole now

unreal quartz
waxen plinth
#

There just isn't one

#

Unless you use an existing forum

#

Or discord

unreal quartz
#

just have a gigantic banner on your plugin page linking to your discord server

waxen plinth
#

Just have /suggest show the link to a forum where they can make a request

waxen plinth
#

Or a link to your discord

granite beacon
#

Just curios as to how I can solve my problem

waxen plinth
#

I don't know enough about what you're trying to do to help

granite beacon
#

Yeah no worries, appreciate it regardless 😅

unreal quartz
#

if you want to piss off every user of your plugin, go for it

silver shuttle
#

+1

#

OH NO

#

you realize thats 20 times a second for every player moving etc?

#

and much much more

#

oh ok

#

just have a big title and subtitle

#

and play sounds

#

particles

#

maybe tp them into an advertising world

#

what about making it mandatory for them to join ur discord and link their mc account?

#

before they can join

#

just cancel the PrePlayerLoginEvent

silver shuttle
#

and obfuscate your code

#

lol

quaint mantle
#

?kick @silver shuttle unfunny sexism

undone axleBOT
#

Done. That felt good.

quaint mantle
#

Nope

hasty prawn
#

Wow

vivid lily
#

Anybody know what the obfuscated version of ADD_PLAYER is? (Wrong image)

granite beacon
#

How can I push a minecart at a set speed?
(depending on where the rails are pointing to)

I've been trying by altering the velocity but that just bugs things out due to the different directions

unreal quartz
#

set the velocity to the direction the rails are facing then

granite beacon
#

right but as I said, it bugs out when it hits a curve or anything like that because the minecart's direction switches up

unreal quartz
#

velocities are set a one time thing, not as a constant, so when the direction changes then apply a new velocity respecting the new direction

vivid lily
#

figured it out. its a

quaint mantle
#

A what skul

granite beacon
vivid lily
quaint mantle
#

Get it

#

because

#

'a'

quaint mantle
#

what is that

#

what

#

💀

eternal oxide
#

inception

vivid lily
#

@quaint mantleIt was a wrong image

quaint mantle
#

ok but what is

#

why are you doing that

#

(Bukkit.getServer()).getServer()

#

i just don't really know what that is

#

or why?

#

inception

torn oyster
#

how do i make projectiles pass through certain players

unreal quartz
#

make all your players watch the matrix

hexed hatch
#

You'd probably have to create your own Arrow entity

eternal oxide
torn oyster
#

and teleport arrow forwards

#

how do i teleport an arrow forwards

#

in the direction it is going

eternal oxide
#

Just try player.getCollidableExemptions().add(arrow.getUniqueId())

torn oyster
#

sorry for using it

#

how do i tp an arrow forwards

eternal oxide
#

its an entity so entity.teleport

torn oyster
#

how do i make it teleport forwards

#

proj.teleport(proj.getLocation().multiply(0.1));

#

prob wrong lol

hexed hatch
#

I don't think those collidable methods work with projectiles tbh

#

I think projectile collision is some deep nms shit

eternal oxide
#

entity.teleport(entity.getLocation().add(entity.getLocation().getDirection().multiply(2)));

torn oyster
#

how many blocks will that teleport forwards

eternal oxide
#

2, but depend on the speed of the arrow

torn oyster
#

wdym

#

whats the amount

#

that will be right behind a player

eternal oxide
#

if the arrow is traveling faster than 1 block per second

#

actually nm, it shoudl tp it 2 blocks

torn oyster
#

so if i do

eternal oxide
#

remove teh multiply to move it one bloc, or multiply by 1

torn oyster
#

multiply 1

eternal oxide
#

as getDirection() returns a unit vector it will be fine

torn oyster
# eternal oxide as getDirection() returns a unit vector it will be fine
    @EventHandler(priority = EventPriority.HIGH)
    public void onProjectileHitEvent(EntityDamageByEntityEvent e) {
        if (e.getDamager() instanceof Projectile && e.getEntity() instanceof Player) {
            Player damaged = ((Player) e.getEntity());
            Projectile proj = (Projectile) e.getEntity();
            SkyWarsGame m = (SkyWarsGame) MinigameManager.getMinigameManager().getCurrentMinigame();
            
            if (m.getMinigamePlayer(damaged).isGhost()) {
                e.setCancelled(true);
                
                proj.teleport(proj.getLocation().add(proj.getLocation().getDirection().multiply(2)));
            }
        }
    }```
#

it works

#

cuz it passes through player

#

but the person it hits after it passes through (a non-ghost)

#

doesnt take damage

#

also pearls dont work with this either

young knoll
#

Perhaps the server ignores it because it thinks it’s already hit someone

#

You could spawn a new one with the same data I guess

eternal oxide
#

try doing it in the ProjectileHitEvent

torn oyster
eternal oxide
#

of course there is

#

getHitEntity()

young knoll
#

Might not exist in 1.8

eternal oxide
#

tuff then

torn oyster
# young knoll You could spawn a new one with the same data I guess

this doesnt work either

    @EventHandler(priority = EventPriority.HIGH)
    public void onProjectileHitEvent(EntityDamageByEntityEvent e) {
        if (e.getDamager() instanceof Projectile && e.getEntity() instanceof Player) {
            Player damaged = ((Player) e.getEntity());
            Projectile proj = (Projectile) e.getEntity();
            SkyWarsGame m = (SkyWarsGame) MinigameManager.getMinigameManager().getCurrentMinigame();
            
            if (m.getMinigamePlayer(damaged).isGhost()) {
                e.setCancelled(true);
    
                proj.teleport(proj.getLocation().add(proj.getLocation().getDirection().multiply(2)));
                Projectile p = (Projectile) e.getEntity().getWorld().spawnEntity(proj.getLocation(), proj.getType());
                p.setVelocity(proj.getVelocity());
                p.setShooter(proj.getShooter());
                proj.remove();
            }
        }
    }```
gaunt saffron
#

i have a main/bungee server and a node/spigot server

can i using a spigot plugin on the spigot/paper server run bungee comands? i want to send a player back to lobby, using /send player lobby or whatever

summer heart
gaunt saffron
summer heart
#

/send is a default bungee command. If you have 2 servers and a bungee server you can do /send <player> <server>

gaunt saffron
#

how would i do that inside bukkit?

#

i assume if i run /send on a bukkit server it wont work

summer heart
#

yeah then I dont think it would work with bukkit

#

im not too sure on that one

gaunt saffron
young knoll
#

Bungee takes like

young knoll
#

1GB per hundreds of players

gaunt saffron
#

oh then im f-ed

summer heart
#

One of the errors in my IDE is ',' or ')' expected:36. I have no idea where to put it xD

p.setVelocity(new Vector(0,64,0)p.getLocation().getDirection());
gaunt saffron
#

time to buy better vps i guess... welll once i scale

young knoll
#

How many freakin players do you have

cedar laurel
#

Is there an event for when Bungeecord shuts down?

gaunt saffron
#

since bungee is the glue

gaunt saffron
#
java.lang.ClassCastException: class com.thechemicalworkshop.com.disasterscontrol.MyEvents cannot be cast to class org.bukkit.plugin.Plugin (com.thechemicalworkshop.com.disasterscontrol.MyEvents is in unnamed module of loader 'DisastersControl-1.0-SNAPSHOT.jar' @5b07a470; org.bukkit.plugin.Plugin is in unnamed module of loader 'app')
        at com.thechemicalworkshop.com.disasterscontrol.MyEvents.lambda$onPlayerDeath$1(MyEvents.java:75) ~[DisastersControl-1.0-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.17.1.jar:git-Paper-202]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483) ~[patched_1.17.1.jar:git-Paper-202]


            else if ( number_of_players_left <= 1) {
                System.out.println("game ended !");
                Bukkit.broadcastMessage(ChatColor.RED + "" + ChatColor.BOLD + "" + "GAME ENDED - RETURNING TO BUNGEE");

                Bukkit.getScheduler().runTaskLater(this.plugin, () -> {

                    ByteArrayDataOutput out = ByteStreams.newDataOutput();
                    out.writeUTF("connect");
                    out.writeUTF("survival");

                    // If you don't care about the player
                    // Player player = Iterables.getFirst(Bukkit.getOnlinePlayers(), null);
                    // Else, specify them
//                    Player player = Bukkit.getPlayerExact("Example");

                    player.sendPluginMessage((Plugin) this, "BungeeCord", out.toByteArray());
                    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "stop");
                }, 100);
            }

        }, delay);```
failed at the `Bukkit.getScheduler`
part... not sure what tho
#

dont tell me it's the capital C

#

okay it's not, same error

okay i gotta sleep, please @ me

undone axleBOT
quaint mantle
#

That's your reason

gaunt saffron
#

no idea what that means tbh

#

i dont like java errors

quaint mantle
#

And also instead of bukkit.dispatch command ... "Stop", use Bukkit.shutdown();

gaunt saffron
#

well that's another error 😂
tbh i want smth else than /stop as it's too slow

quaint mantle
#

It's just my suggestion

#

Use Bukkit.shutdown()

gaunt saffron
#

but yeah, the bungee stuff? any idea?

quaint mantle
#

Not for me

gaunt saffron
#

like end the process?

#

idc about saving, at all

young knoll
#

I mean

#

Runtime.getRuntime.halt if you really wanted to

#

You could also interface with an external explosive charge connected via USB

waxen plinth
waxen plinth
young knoll
#

System.exit still invoked shutdown hooks

#

Halt does not

rough jay
#

hi, how to set food level more than 20?

sleek turret
rough jay
#

(

quaint mantle
#

@rough jay you can

#

it is very hacky though

#

use PDCs to handle a namespacedkey "ExtraHunger"

#

get what im sayin?

#

🤠

#

lemme know if you have any questions it can be quite confusing

#
public class ExtraHungerManager implements Listener {
    public void setExtraHunger(Player p) { ... }

    @EventHandler
    public void onFoodLevelChange(FoodLevelChangeEvent e) {
        //...
    }
}
young knoll
#

I mean that’s kinda how saturation works

#

Now we have double saturation

quaint mantle
#

except saturation heals you

#

anyways how do i evaluate a linked list

#

mathematical evaluation

#
class Node:
    def __init__(self, root, previous=None, next=None):
        self.root = root
        self.previous = previous
        self.next = next

class LinkedList:
    def __init__(self):
        self.front = None
        self.tail = None
    
    def add(self, token) -> None:
        node = Node(root=token, previous=self.tail)
        
        if self.front == None:
            self.front = node
            
        if self.tail != None:
            self.tail.next = node
            
        self.tail = node
rough jay
#

gonna try

hardy pivot
#

Hi anyone knows why it cant catch the connect pluginmessage?

#
    public static void sendPlayerToServer(Player player, String server) {
        try {
            ByteArrayOutputStream b = new ByteArrayOutputStream();
            DataOutputStream out = new DataOutputStream(b);
            out.writeUTF("Connect");
            out.writeUTF(server);
            player.sendPluginMessage(getInstance(), "BungeeCord", b.toByteArray());
            b.close();
            out.close();
            Gui.msg(player, "§7Enviando a: " + "[§4" + server + "§7]");
        } catch (Exception e) {
            player.sendMessage(ChatColor.RED + "Error when trying to connect to " + server);
        }
        //player.sendPluginMessage(Handler.getInstance(), "BungeeCord", b.toByteArray());
    }
#

I don't get the catch when the server is offline

quaint mantle
#

Because it wont throw an exception If it is offline

quasi flint
#

Can somone tell me whats wron with this line? It just throws an NoSuchElementException

#

Property property = profile.getProperties().get("textures").iterator().next();

#

for those interrested the whole class

gritty urchin
#

Hey, how would I spawn a mob for a later Minecraft Version. E.g. an axolotl to 1.17 clients on a 1.16.5 Server running ViaVersion?

quasi flint
#

that sounds tricky, because i dont think the 1.15 client would understand the axolotl entity

#

not sure thi#

#

tho

gritty urchin
#

For 1.17 client?

opal juniper
#

you cannot spawn newer mobs for older clients

#

they would shit the bed or default to a single mob type

gritty urchin
#

I didnt mention an older client

opal juniper
#

ah ok

#

i miss read

gritty urchin
#

Spawn an axolotl to 1.17 clients on a 1.16.5 Server running ViaVersion.

opal juniper
#

no there is no way to spawn a mob that doesn’t exist as far as i know

gritty urchin
#

Not with 1.17 NMS or is it all server dependent?

opal juniper
#

the fact that you are on a 1.16.5 server is the issue

#

it has no idea what an axolotl

gritty urchin
#

Ah ok

#

But the 1.17 client does, so is there a way to recreate it?

opal juniper
#

with a custom client maybe

#

idk what the spawn entity fields are

#

gimme a sec

#

you could probably fake it tbh

#

you just need to fill in all those fields

gritty urchin
#

Ah ok thanks.

#

But would the 1.16.5 server recognise it as a valid entity. Not in displaying it for a 1.16.5 client but that it exists and can be removed.

opal juniper
#

you will probably have to work that out urself

gritty urchin
#

Alr thanks

quasi flint
#

yes, but that shouldnt happen in my code

#

if i am not mistaken

quasi flint
#

someone here to give me an idea?

grim ice
#

@quasi flint what're you trying to do

quasi flint
#

Changing my NPC's skin

grim ice
#

i hate nms sori

lavish hemlock
#

You should check if the iterator contains anything

#

Also, why use the iterator?

#

Just do .get(0) to get at the first index.

#

You'll need to check that get() doesn't return empty though.

sterile dragon
#

Hello i'm still learning so sorry if thats an obvious question but here is my problem , i'm trying to get the team of a player to display it in a side scoreboard but the scoreboard always display "null" here is the code Score team = objective.getScore(ChatColor.GOLD + "Vous êtes dans l'équipe :" + player.getScoreboard().getEntryTeam(getName()));

crude charm
#

send code

#

?paste

undone axleBOT
sterile dragon
#

like that ?

crude charm
#

the whole class

sterile dragon
crude charm
#

and you're naming stuff horribly

sterile dragon
#

yeaah ik lol

lavish hemlock
#

oh god

crude charm
#

?learnjava

undone axleBOT
lavish hemlock
#

The last one is also just outdated and bad :p

crude charm
#

...

#

The official java docs... bad?

lavish hemlock
#

It is outdated, okay? It's only up to date for Java 8.

#

And:

  • It's confusing for beginners.
  • Hard to read due to the styling of the page.
  • Designed for enterprise developers.
  • And kinda hard to navigate?
crude charm
#

Idk what you're on about bud.

#

Noones problem that beginners cant read it

#

they are beginners

lavish hemlock
#

It's literally a tutorial.

#

If someone trying to learn the language can't read the tutorial.

#

It has missed the point of being a tutorial.

crude charm
#

You need to learn to read a java to be able to understand it

#

It's not supposed to be a tutorial

lavish hemlock
crude charm
#

It's pretty obv that docs aren't a tutorial

#

Doesn't mean you dont learn alot of them

lavish hemlock
#

And it is a tutorial. All signs point to it being designed as one.

crude charm
#

/ should read them

#

/ should check them

#

idk how this is even an argument

lavish hemlock
#

The URL says tutorial, the The Java Tutorials have been written for JDK 8., etc.

#

And it literally fucking says

#

The Java:tm: Tutorials

sterile dragon
#

at the start i was just asking how to replace this player.getScoreboard().getEntryTeam(getName()) because it don't work x)

lavish hemlock
#

at the top

#

But you know, it's a horrible idea to teach someone OOP concepts before teaching them the basics of your language.
You should teach them OOP concepts when they have the ability to process OOP concepts.

#

I've known multiple Java beginners who struggle with OOP because they're pushed into it too early.

crude charm
crude charm
lavish hemlock
#

They're not useless.

#

They're just badly designed.

#

It makes them harder to be used.

crude charm
lavish hemlock
#

And ftr, calling them "Java docs" is incredibly misleading as "Javadocs" exist.

crude charm
#

you just need to know how to read them

lavish hemlock
#

I literally just went over this point, Zoi.

crude charm
#

whatever

#

I give up

lavish hemlock
#

You are terrible at debating.

crude charm
#

Its not a debate

#

like

#

lmfao

#

I really dont care

#

You just look like an idiot

lavish hemlock
#

I guess it could be more accurately described as an "argument"

ivory sleet
#

Guys chill (:

#

OOP sucks end of discussion

grim ice
#

can someone explain Encapsulation, Abstraction, Inheritance, and Polymorphism better? google makes it weird

ivory sleet
#

maowcraft can

#

And ZoiBox (:

lavish hemlock
#

But my point is that the Java tutorials were advertised as tutorials (judging by them being literally called "The Java Tutorials" and being referred to as "The Java Tutorials"), therefore they should be judged as tutorials instead of docs (the JLS is more documentative anyways), and having to learn how to read the tutorials in the first place is just counterproductive as it steers people away from said tutorials and makes those trying to use them struggle more with using them. They're poorly designed due to their outdated nature, bad structure, and unwelcoming visuals (which is part of them being outdated, as they haven't been updated to match modern style standards). If you need to learn how to read Java before you can even understand the concepts in Java, how are they a good set of tutorials? In order to read Java in the first place, you need a tutorial to teach you how to read Java, and considering Oracle made this tutorial, it's the official first source of information, very likely the first source someone may see unless they find Codecademy or other sources first, which means they can't just "learn Java before they can learn Java." You see how illogical that statement is?

crude charm
lavish hemlock
grim ice
#

@lavish hemlock > Zoibox here

ivory sleet
#

Guys just stop ffs

crude charm
#

ikr

#

just give up

lavish hemlock
crude charm
#

I dont care

grim ice
#

like making private variables then making getters for them?

lavish hemlock
#

Yeah, that's a form of encapsulation as you're encapsulating the fields, making it easier to make changes to the code in the future in case that field changes.

grim ice
#

so the class that has actual functionality uses getters instead of direct access?

#

Oh I see

grim ice
#

I don't get polymorphism well though

lavish hemlock
#

Abstraction is then for splitting your code into multiple "abstractions," such as how Java's standard library has List, AbstractList, and then ArrayList. It allows for reducing the amount of code reuse.

grim ice
lavish hemlock
#

For example, List defines what lists should do.
AbstractList implements a lot of common behaviour for those lists.
And then ArrayList implements specific behaviour.

grim ice
#

the relationship between an engine and a car

#

a car would be an abstract class

#

and the engine would extend maybe a Part class

#

that extends a car class

#

right

lavish hemlock
#

Well, you wouldn't want your car parts to extend the car.

#

You'd want your car to contain the car parts.

grim ice
#

o

#

but its containing them like that, and you're also following SRP right?

lavish hemlock
#

Oh I'm sorry actually I gave you bad definitions

#

Okay so Encapsulation is bundling things into single pieces.

#

And Abstraction is hiding the unimportant details.

grim ice
#

How so? for abstraction

lavish hemlock
#

In the way I explained with my previous, wrong definition of Encapsulation.

#

Meanwhile, that Abstraction definition is much closer to Inheritance

#

For Inheritance I think I'll provide a code example

#
public class Car implements Vehicle {
    ...
}

In this situation, Car inherits the properties of Vehicle.
Therefore, a Car is a Vehicle.
This also means Car must "implement" what Vehicle has "defined."

grim ice
#

o

#

Vehicle has to be abstract, right?

lavish hemlock
#

Defining is like creating how something should be interacted with

#

And Implementing is creating what happens when that something is interacted with

lavish hemlock
#

And Polymorphism plays off of Inheritance

#

For example, say you want to give your Person a Vehicle.

#

lemme just write a code example

#
public class Person {
    public void giveVehicle(Vehicle vehicle) {
       // implementation logic isn't important here ...
    }
}
#

Since Car implements Vehicle (it is a subclass of Vehicle), you can pass a Car to the parameters of giveVehicle

#

myPerson.giveVehicle(new Car()); for example

#

and imagine we have a Boat that also implements Vehicle, well, myPerson.giveVehicle(new Boat()); works too

grim ice
#

oh so polymorphism lets a method work for different uses? like a murder method happening with different tools,
like public void murderSomeone(Tool tool){
guy.murder(tool);

lavish hemlock
#

Yeah!

#

And usually

crude charm
#

Is it possible to have a custom X marks the spot location on a map without using nms or should I make a custom map image?

lavish hemlock
#

Since you don't know what tool was passed unless you check (like with instanceof), you'd probably just want to use what methods are already on Tool.

#

a more involved example would be

lucid bane
#

guys i hav a question
i cant use World#getKey() in 1.16.5 spigot and dunno why

lavish hemlock
#
public void murder(Tool tool) {
    // 'tool' can only be used to access what Tool has.
    // Let's check and see if the Tool is a knife.
    if (tool instanceof Knife) {
        Knife knife = (Knife) tool; // Here we cast our 'tool' to a Knife, since we now know it's a Knife.
        // Now 'knife' can access both what Tool has and what Knife has.
        // ... go on to murder some poor fellow if you want ...
    }
}
grim ice
#

o

#

i see thank you

#

now murder is easier i understand oop more now :D

lavish hemlock
#

You're welcome

lucid bane
#

oh it was paper i saw

#

sry

lavish hemlock
#

OOP is pretty weird overall but it does help to know it if you're learning Java since it makes understanding code and library development easier.

summer scroll
#

Is there a way to detect when player tries to teleport with a passenger? Now teleport event isn't being called at all because somehow it's cancelled on the client, idk how to explain it properly.

grim ice
#

what are passengers

lavish hemlock
#

Feel free to message me if you have more questions @grim ice

grim ice
#

o sure

summer scroll
#

basically an entity that rides the player

novel basin
#

guys i'm coding a plugin that when a player run a command all compasses in that world will point toward a player's location but i cant get all compasses in that world to point toward that player can someone help me (sorry for my bad english skill)

lavish hemlock
#

You making a Manhunt plugin or something?

#

I probably can't offer advice but I'm just curious.

novel basin
#

yeah but i dont want to pay 20 bucks

lavish hemlock
#

That's fair.

lost matrix
lavish hemlock
lost matrix
summer scroll
#

Can you somehow detect everytime Player#teleport method is being used?

grim ice
#

@lost matrix do you think liskov thingy is really necessary

#

its confusing on how to follow

tall dragon
#

@summer scroll im pretty sure EntityTeleportEvent will be fired

#

but im not completely sure

lost matrix
# novel basin yeah that's all I need

Ok for that you need to:

  1. Get all players in this world.
  2. Iterate over them and get the inventory of each
  3. Iterate over each item in their inventory
  4. Check if its not null and of type COMPASS
  5. Get the ItemMeta of that ItemStack
  6. Cast it to CompassMeta
  7. Set the lodestone of that compass to a Location
  8. Put the CompassMeta back on the ItemStack
lost matrix
grim ice
#

yes

novel basin
summer scroll
lost matrix
# grim ice yes

I mean... you dont need to understand it in detail. Its something that will evolve logically if you
just program for a bit.

lavish hemlock
grim ice
#

o

lost matrix
lavish hemlock
#

^

novel basin
lavish hemlock
#

And you can get the World from the server, but you probably knew that already.

tall dragon
summer scroll
lost matrix
opal juniper
#
Banner banner = (Banner) block.getState();
List<Pattern> patterns = new ArrayList<>();
patterns.add(new Pattern(DyeColor.BLACK, PatternType.FLOWER));
patterns.add(new Pattern(DyeColor.RED, PatternType.CIRCLE_MIDDLE));
banner.setPatterns(patterns);
``` anyone know why this does nothing?
grim ice
vagrant stratus
#

just so you guys know, we have threads available.
So ya know, use them lol

grim ice
#

I Thought of making multiple abstract interfaces and implement each of the ones they need

opal juniper
#

okee

grim ice
#

and leave the other ones

grim ice
#

but it looks like a dumb idea

vagrant stratus
lavish hemlock
opal juniper
ivory sleet
#

Mainly because of code reusability

vagrant stratus
grim ice
#

wait nvm asbtract interfaces cant provide code

lavish hemlock
ivory sleet
#

They can have concrete implementations

lavish hemlock
#

They can

#

default or static

grim ice
#

o

lost matrix
grim ice
#

default abstract interface?

vagrant stratus
lavish hemlock
#

default states that a method in an interface has an implementation but can still be overridden.
static is just static, you get it.

grim ice
#

static means it can be instaniated once right

#

fuck it my spelling died

ivory sleet
#

I strongly urge anyone here who needs help with their issue to open a thread, now when it’s actually available. With that being said I suggest naming your thread the question you’re asking.

lavish hemlock
#
public interface MyInterface {
    default void concreteMethod() {
        // This method has an implementation on an interface.
        // This means you can still implement it on subclasses but that it's not strictly necessary.
    }

    static void staticMethod() {
        // This method has a static implementation on an interface.
        // This means you access it via the class instead of an instance of the class (which you'd get from a subclass).
        // For example: MyInterface.staticMethod()
    }
}
#

staticMethod also can't be overridden by a class that implements MyInterface, like all static methods.

#

and you can't access staticMethod from a MyInterface subclass.

#

meaning MySubclass implements MyInterface doesn't permit MySubclass.staticMethod()

ivory sleet
#

You can still call it from the subclass but ye

#

Not overridable

lavish hemlock
#

really? I thought that was something they strictly avoided bc it was "too confusing"

#

maybe that was just the overriding of a static method via abstract static or smthn

ivory sleet
#

Yeah hmm

#

You got me unsure also now

lavish hemlock
#

gimme a sec

summer scroll
#

Can you somehow detect when specific method is used?

lavish hemlock
summer scroll
#

From the spigot api, I want to detect everytime Player#teleport method used

lavish hemlock
#

If it belongs to your class, then it's just an easily method call to say "hey, this method was used."
If it belongs to someone else, they'd have to give you an API for that.

summer scroll
#

I cannot think a better way to handle teleportation issues when trying to teleport with passenger.

ivory sleet
#

How to make a random dungeon generator?

summer scroll
lavish hemlock
ivory sleet
#

Oh what the

#

Alright ain’t complaining lol

lavish hemlock
#

Fun fact though:

#

I'm pretty sure you can still call it as fuck() WITHIN the class, you just can't specify the class beforehand.

ivory sleet
#

Yeah

lavish hemlock
#

Since you're allowed to do that with fields.

#

Which I only know because people implement ASM's Opcodes interface

Spoiler: Don't do that.

#

Just statically import all the fields from Opcodes as it's legitimately faster and has the same result.

summer scroll
#

How to teleport entity with passengers?

crude charm
#

Looking for a friend

lavish hemlock
#

Anyway, I'm planning on writing a Java guide someday, already got the basic integration down to generate pages from some Markdown so it shouldn't take too long to get to doing.

#

You can reference threads? That's fuckin' cool.

crude charm
lavish hemlock
ivory sleet
#

ZoiBox stop creating these ones

crude charm
ivory sleet
#

?kick @crude charm

undone axleBOT
#

Done. That felt good.

crude charm
#

WHY

lavish hemlock
crude charm
#

huh

#

naughty

golden turret
#

hello my little friends, how do i add nbtags to entities?

unreal quartz
#

smh, conclure

golden turret
#

tried this but didnt worked

calm whale
#

Does anyone know what mean the args for this function ?

golden turret
#

see the method behavior

calm whale
#

ok but I'm still missing one arg

golden turret
#

which

#

and say to us which class is that

calm whale
#

byte b0 it is the map scale

#

but how can I know wich byte is right ?

#

it is the ItemWorldMap class

unreal quartz
calm whale
#

I only know the spigot one

unreal quartz
#

ah

#

never mind then

lavish hemlock
#

Ah yes, NMS docs.

golden turret
#

it have

calm whale
#

does it exists ?

#

where ?

unreal quartz
#

no

#

it doesn;t

golden turret
#

it is called: try and see

calm whale
#

xD

#

oh well

unreal quartz
#

unless someone who is really bored out of their mind has created unofficial documentation and told nobody

golden turret
#

ye

#

but @calm whale, which arg do you need

calm whale
#

in fact i 'm trying to prerender a map to give it to the player, I have actually a code that should work but the map load only around 0:0

#

see

gaunt saffron
# waxen plinth System.exit(0)

Yeah explosive charge i would do if it was hosted locally haha

Yeah i'll try this... i was thinking to recompile paper but idk how much time will i save?

toxic mesa
#

Does protocollib have the PacketPlayInFlying packet?
If so does anyone have a clue what it's called?

rustic bloom
#

Hello, I just wanted to ask if it is possible to calculate the equal amount of Level from a value of the .getTotalExperience() method, for use with the .setLevel() method

quaint mantle
#

player.getExp

#

/ 100

lost matrix
quasi flint
rustic bloom
quaint mantle
#

?

quasi flint
#

oh ok ;V being dumb

rustic bloom
#

Thank you

torn shuttle
#

this is starting to annoy me and I swear there must be a way to fix it on gradle, how do you avoid conflicts like this?

#

shouldn't shading it in work?

#

or smth

craggy cypress
#

Hi, I got a small problem.
If i use ItemStack[] content = ((List<ItemStack>) Main.getInstance().getKluizenConfig().get("Kluizen." + Locatie + ".items")).toArray(new ItemStack[0]); inv.setContents(content); this, It will open once, But if i try to reopen it i will get the error [Lorg.bukkit.inventory.ItemStack; cannot be cast to java.util.List

lost matrix
#

If you want to apply something to one exact player and make it hard coded then sure. But why? Use config instead.

lost matrix
opal juniper
#

is there an event for when a block gets powered?

torn shuttle
#

seemingly

opal juniper
#

hmm yeah

#

thats annoying

#

ok thanks

torn shuttle
#

tbf these kind of events can quickly lead to big performance issues

opal juniper
#

PlayerMoveEvent? xD

#

but yes

#

ik what you mean

torn shuttle
#

MobMoveEvent

opal juniper
#

i wish there was an EntityMoveEvent

#

but, there is not

torn shuttle
#

I don't, it would take .1 seconds for half the plugins in spigot to suddenly take tps down to 7

#

you're better off scanning the actual thing you want to do directly

#

then you can add your own events upon detection like I did

#

I wonder if there would be interest in submitting a PR for an enter combat and leave combat event for mobs

summer scroll
#

EntityMoveEvent damn, sound so expensive xd.

opal juniper
#

yes

lost matrix
opal juniper
#

but there is like a million times i have need it

#

yesa

#

thats the best way tbh

#

dont work if noones online doe

#

/near it

lost matrix
#

You just need to be careful because the move packet gets sent to several players at once

lost matrix
summer scroll
#

What about checking entity location every x second

opal juniper
#

runnable would work

#

not as accurate tho

quasi flint
#

cant a 1.15 thing pull from the api server anymore or my code completly brocken

tardy delta
#

is there a way to force java to update the value of a variable every time it gets called?

opal juniper
#

what?

summer scroll
tardy delta
#

hmm yea

tardy delta
#

😵‍💫

#

never heard of that

lost matrix
# tardy delta 😵‍💫

Example:

  private final MutableInt number = new MutableInt(0);

  public int getNumberValue() {
    int value = number.intValue();
    number.increment();
    return value;
  }

But this heavily violates several clean code principles. You dont want to have
side effects on a method.

#

A method should do exactly one thing.

summer scroll
#

Can you just make int field but not final and modify it?

#

same thing but yeah

opal juniper
#

how does one go about adding to spigot, do i have to fork bukkit & craftbukkit and then clone them. then commit to them and push them back? then some hacking on the jira to open a pr?

#

lmao

lost matrix
#

?contribute

grim ice
#

are you

#

naming variables like thaat

gaunt saffron
grim ice
#

yes

#

like

#

thats half constant half variable

#

lol

narrow furnace
#

call it playersLeft

quaint mantle
#

@gaunt saffron in java its camelCase

grim ice
#

@narrow furnace btw i finished the rest of mooc

gaunt saffron
narrow furnace
#

thats a 14 week course yk

grim ice
narrow furnace
#

u did all the exercises?

grim ice
#

lmao 14 week for that small shit

#

no

narrow furnace
#

no?

grim ice
#

bro

#

they teach u about importing and packages

#

at part 11

#

???????????????

narrow furnace
#

wym u didnt do the exercises

grim ice
#

actual fuck?

narrow furnace
#

thats the course

#

if u didnt do them u didnt do the course

#

...

grim ice
#

how

narrow furnace
#

its not a book

#

u dont just read it

#

the reading is just a short description

#

of the exercise

grim ice
#

breh

paper viper
#

honestly just use code academy

#

very good user interface

#

interactive, and you can learn with other people

#

choose something and learn it

#

dont give up in the middle

narrow furnace
#

if u read the homework questions and didnt write the answers, u get a 0% no?

ivory sleet
#

Pulse r u joining the code jam?

quaint mantle
#

wish there were courses that know you already have a lot of experience

paper viper
#

cause i wanna

#

lol

ivory sleet
#

HelpChat

#

Very soon

#

It’s team of pairs

quaint mantle
#

what is it?

grim ice
paper viper
#

Yea

ivory sleet
#

So if you do I’d like to be your mate if you’re not taken already

paper viper
#

Oo epic

ivory sleet
#

(:

narrow furnace
#

@grim ice did u do any of the course

chrome beacon
#

👀 code jam

narrow furnace
#

what did u do

grim ice
#

i read the stuff and i already know it

narrow furnace
#

oh good so u wont be asking in here for stuff?

grim ice
#

the stuff there arent what i ask these days i guess

narrow furnace
#

cause i know a lot of the things you ask are for sure in that course

grim ice
#

except generics

#

that i didnt even profit from the website

#

they dont even tell u what that means and this means

#

i had to go google it

paper viper
#

alright lets test your knowledge then

narrow furnace
#

you did 0% of the exercises

paper viper
#

on the important stuff

grim ice
#

ok

narrow furnace
#

you got 0% on the course

#

thats a F-----

paper viper
#

what is a constructor

#

dont search anything up

grim ice
paper viper
#

you shouldnt have to take this long

quaint mantle
#

Lmao

grim ice
#

its a method that runs when u instantiate its in

gaunt saffron
grim ice
quaint mantle
paper viper
#

yea

grim ice
chrome beacon
paper viper
#

2Hex, what is static? And why should you use it sometimes, but sometimes not

#

that might be a bit too complicated but idk

grim ice
paper viper
#

cause it has some design involved

quaint mantle
#

horrible

#

wrong

grim ice
#

lmao

paper viper
torn shuttle
#

oh god running buildtools is miserable with this internet speed

grim ice
#

thats what i heard though

narrow furnace
#

🙂

paper viper
#

Lol

#

Then you should know

narrow furnace
#

which he did

#

apparantly

grim ice
#

what

#

what part??

paper viper
#

lol u didnt do it

chrome beacon
#

Or are you on 1.17?

toxic mesa
#

ye 1.17

grim ice
#

tell me

#

the part

#

its in

narrow furnace
#

how long did the 14 week course take you

quaint mantle
#

static is a modifier to allow access without an instance, it should be used for utilities, constants, or singleton design patterns

chrome beacon
grim ice
narrow furnace
grim ice
narrow furnace
#

because i know what static is

grim ice
#

if you find it ill redo the whole thing from zero

narrow furnace
#

redo?

gaunt saffron
narrow furnace
#

u cant redo if u didnt do in the first place

paper viper
grim ice
#

yes, with the exercices

jade perch
toxic mesa
quaint mantle
#

@paper viper look at hereteres plugins

#

fucking bombarded with annotations

jade perch
#

that's beautiful

#

and if you say otherwise

#

you're just wrong

quaint mantle
#

plugin.yml

paper viper
#
@Plugin(name = "HPWP", version = "VERSION")
@ApiVersion(ApiVersion.Target.v1_13)
@LogPrefix("HPWP")
@Author("Heretere")
@Website("heretere.com")
@LoadOrder(PluginLoadOrder.STARTUP)
@Permission(name = "hpwp.events", desc = "Allows /pwp events", defaultValue = PermissionDefault.OP)
@Permission(name = "hpwp.gui", desc = "Allows use of /pwp gui", defaultValue = PermissionDefault.OP)
@Permission(name = "hpwp.notify", desc = "Receive update notifications", defaultValue = PermissionDefault.OP)
@Permission(
    name = "hpwp.bypass.chat",
    desc = "Send and see all chat tunnels",
    defaultValue = PermissionDefault.FALSE
)
@Permission(
    name = "hpwp.bypass.commands",
    desc = "Execute all commands even for disabled plugins",
    defaultValue = PermissionDefault.FALSE
)
@Permission(
    name = "hpwp.*",
    desc = "Wildcard hpwp permission",
    defaultValue = PermissionDefault.OP,
    children = {
        @ChildPermission(name = "hpwp.events"),
        @ChildPermission(name = "hpwp.gui"),
        @ChildPermission(name = "hpwp.notify") }
)
@Permission(
    name = "hpwp.bypass.*",
    desc = "Wildcard hpwp bypass permission",
    defaultValue = PermissionDefault.FALSE,
    children = {
        @ChildPermission(name = "hpwp.bypass.commands"),
        @ChildPermission(name = "hpwp.bypass.chat")
    }
)
quaint mantle
#

lmao

narrow furnace
chrome beacon
quaint mantle
#

like 20 lines of pure annotation

narrow furnace
grim ice
jade perch
#

Guess who doesn't need need a plugin.yml anymore

#

this guy

toxic mesa
narrow furnace
chrome beacon
grim ice
#

i mean

#

i didnt read every single letter

narrow furnace
#

i did

grim ice
#

it seemed like math bro

chrome beacon
#

Why are you detecting lag?

quaint mantle
#
class Node:
    def __init__(self, root, previous=None, next=None):
        self.root = root
        self.previous = previous
        self.next = next

class LinkedList:
    def __init__(self):
        self.front = None
        self.tail = None
    
    def add(self, token) -> None:
        node = Node(root=token, previous=self.tail)
        
        if self.front == None:
            self.front = node
            
        if self.tail != None:
            self.tail.next = node
            
        self.tail = node

how do I sort and evaluate this list

grim ice
#

THEY PUT THAT THING INSIDE OF A MATH LESSON

#

BRUh

grim ice
#

u cant blame me dude

#

i mean u can

toxic mesa
# chrome beacon Why are you detecting lag?

Cuz I want to detect client side/connection lag, I googled for a bit and found that the PacketPlayInFlying gets send every tick and because of that you can use it to detect the player lagging

quaint mantle
narrow furnace
#

the codecademy one pulsebeat suggested is shorter

#

if u want to do that instead

quaint mantle
#

i could give you a java lesson better than codecamp

chrome beacon
toxic mesa
#

Am aware

narrow furnace
#

codecademy really just teaches a languages syntax

quaint mantle
#

right

narrow furnace
#

ive done their javascript course but im hardly a web dev rn lol

jade perch
toxic mesa
#

does it get send every tick?

paper viper
#

and forces them to do it step by step

grim ice
#

@paper viper ok give me another question if u dont mind

chrome beacon
toxic mesa
#

Alright, tysm

grim ice
#

i cant even blame myself. their whole thing is not organized, they throw important shit inside of useless and common stuff

#

its painful to even read it

paper viper
#

stop complaining

#

suck it up, and learn it

grim ice
#

so many examples and its order is ded

paper viper
#

you are clearly only a beginner

grim ice
paper viper
#

you have the resources and tools to learn

narrow furnace
#

coding is difficult

#

we get it

paper viper
#

dont complain

grim ice
#

ok just another question

paper viper
#

we've all been through this too

jade perch
#

Maybe you'll find it more fun to make up your own projects

#

that's what I did

#

Make em up and research till it's done

paper viper
#

I first learned Processing, and created my own games

#

then I learned java, and coded my first Java project for a friend

#

it was shit, but i learned a lot

#

Then I found out about plugins, and decided to try them

grim ice
#

pulsebeat

grim ice
#

ill use codecademy but just answer that

paper viper
#

answer what question

narrow furnace
#

if u want questions

grim ice
#

pls another questin

narrow furnace
grim ice
#

wait

#

i cant skip in codecademy???

narrow furnace
#

is that what you were going to do

#

to learn

#

skip the learning

#

nice one

grim ice
#

no like

#

i dotn wanna know how to add comments or sout ;-;

narrow furnace
#

you did a 14 week course in a day did you not? surely you can handle this

grim ice
#

i mean at least their stuff are organized

narrow furnace
#

you mean at least it holds your hand and gives you hints..

gaunt saffron
#
[14:18:09 INFO]: Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PAPER)
[14:18:09 ERROR]: Main thread terminated by WatchDog due to hard crash
java.lang.ThreadDeath: null
        at java.lang.Thread.stop(Unknown Source) [?:?]
        at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:947) ~[patched_1.17.1.jar:git-Paper-85]
        at net.minecraft.server.dedicated.DedicatedServer.stopServer(DedicatedServer.java:806) ~[patched_1.17.1.jar:git-Paper-85]
        at net.minecraft.server.MinecraftServer.close(MinecraftServer.java:919) ~[patched_1.17.1.jar:git-Paper-85]
        at org.bukkit.craftbukkit.v1_17_R1.util.ServerShutdownThread.run(ServerShutdownThread.java:28) ~[patched_1.17.1.jar:git-Paper-85]
[14:18:09 INFO]: Stopping server
[14:18:09 INFO]: Unregistering com.sk89q.worldedit.bukkit.BukkitServerInterface from WorldEdit
[14:18:09 INFO]: Saving players
[14:18:09 INFO]: DeadlyChemist lost connection: Server closed
[14:18:09 INFO]: DeadlyChemist left the game
[14:18:09 INFO]: Saving worlds
[14:18:09 INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld
[14:18:10 INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved
[14:18:10 INFO]: ThreadedAnvilChunkStorage: All dimensions are saved
[14:18:10 INFO]: Flushing Chunk IO
[14:18:10 INFO]: Closing Thread Pool
[14:18:10 INFO]: Closing Server
container@pterodactyl~ Server marked as offline...

i tried System.exit(0);
i assume i have todo bukkit.shutdown...
is there a way to stop the server EVEN FASTER?
i don't care about keeping the data, it all all corrupt, just stop asap

paper viper
#

Why?

#

Just why

jade perch
paper viper
#

You gotta be kidding me with System.exit

gaunt saffron
paper viper
#

you're joking right

gaunt saffron
#

no? why?

paper viper
#

System.exit will not save data

#

thats how you get data corruption

#

lol

gaunt saffron
#

yes i want thta

#

close asap

jade perch
#

He said he doesn't care

paper viper
#

Lmfao

gaunt saffron
#

1s saved is goood

narrow furnace
#

why do you want to corrupt your server

gaunt saffron
#

less than idc really

narrow furnace
#

tf

paper viper
#

Have you tried Thread.kill

#

lol

grim ice
#

but wtf

class Conditionals {
  public static void main(String[] args) { 
    boolean breakfastTime = false;
    boolean lunchTime = false;
    boolean dinnerTime = true;
    if (breakfastTime) {
      System.out.println("Let's have waffles!");
    } else if (lunchTime) {
       System.out.println("Let's have sandwiches!");
    } else if (dinnerTime) {
       System.out.println("Let's have pizza!");
    } else {
       System.out.println("It's not time to eat!");
    }
  }
}```
gaunt saffron
grim ice
#

why so many else ifs

chrome beacon
#

You can use the ProccessHandle from Java9+ and kill Java

grim ice
#

is that good or bad

gaunt saffron
paper viper
#

That seems fine

gaunt saffron
#

i want it dead asap

gaunt saffron
narrow furnace
#

👀

#

rm -rf /

gaunt saffron
#

yupp

#

im masively scaling minecraft

gaunt saffron
#

destroyForcibly​()?

chrome beacon
#

Use allProcesses​() and filter it and find your java instance then use destroyForcibly()

paper viper
#

Yes

#

lol

gaunt saffron
#

lemme try

paper viper
#

also use parallel computing

#

to loop through the processes

#

if u want quick

chrome beacon
#

looks like you could try using current()

gaunt saffron
#

oh, current would work?

paper viper
#

In that case ig you could do that