#help-development

1 messages · Page 1770 of 1

paper viper
#

AdoptOpenJDK provides prebuilt OpenJDK binaries from a fully open source set of build scripts and infrastructure. Supported platforms include Linux, macOS, Windows, ARM, Solaris, and AIX.

#

use that

surreal prawn
#

any reason why its giving me jdk11?

paper viper
paper viper
surreal prawn
#

weird

#

thanks

patent horizon
#

hey @worldly ingot the regex you gave me doesnt seem to be allowing anything

#

oops wrong one

quaint mantle
#

what are you trying to do

#

I am pro regex 🙂

patent horizon
#
else if (!PATTERN_ALPHANUMERIC.matcher(chatAnswer.get(player)).matches()) {
                player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&3&lGUILDS &8> &7Guild names can only contain letters and numbers."));
            }```
#

trying to check if a guild name only contains alphanumeral chars

quaint mantle
#

so a-z and 0-9

patent horizon
#

capitals work too

marsh plaza
patent horizon
#

unless regex isnt case sensitive

quaint mantle
patent horizon
#

jeez idek how that makes sense to you lmao

quaint mantle
#

its simple you just gotta learn the syntax

patent horizon
#

ah

quaint mantle
#

^ = start of text
[ = match any of...
A-Z = ABC..Z
a-z = abc..z
0-9 = 0123..9
] = end match

  • = 1 or more
    $ = end of text
ancient plank
#

I just throw stuff into regexr and fiddle around until it works for my use cases

#

well, that is, after I search for it online

grave hound
#

how do I get tool used in PlayerInteractEvent

#

for example get pickaxe when mining a block

sullen marlin
#
getItem()
Returns the item in hand represented by this event
grave hound
#

its giving me Incompatible types. Found: 'org.bukkit.inventory.ItemStack', required: 'org.bukkit.block.Block'

quaint mantle
#

show code

grave hound
#
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
import org.bukkit.event.player.PlayerInteractEvent;

public class PlayerInteract implements Listener{
    @EventHandler
    public void onPlayerInteractEvent(PlayerInteractEvent event){
        Block block = event.getClickedBlock();
        Block tool = event.getItem();
        if(block.getType() == Material.BEDROCK){
            block.setType(Material.AIR);
            ItemStack bedrock = new ItemStack(Material.BEDROCK,1);
            block.getWorld().dropItemNaturally(block.getLocation(), bedrock);
        }
    }
}```
sullen marlin
#

Block tool = event.getItem();

quaint mantle
#

ItemStack tool = event.getItem()

sullen marlin
#

what do you think the problem might be

quaint mantle
#

😂

grave hound
#

this is my first java/plugin project

quaint mantle
#

its fine just change it to ItemStack

grave hound
#

I did

quaint mantle
#

so it should work now

grave hound
#

yes

quaint mantle
#

cool

grave hound
#

I've got some more coding to do though

quaint mantle
#

well we are here if you need help

grave hound
#

where do I go to get info on the different function/events

quaint mantle
#

im so glad you asked

#

no beginners ever ask

#

?jd

quaint mantle
#

the javadocs are the gods

ivory sleet
#

imaginedev

quaint mantle
#

Conclure

#

inb4 python help

ivory sleet
#

Is it possible to have something similar to CompletableFuture in python?

quaint mantle
#

lol

ivory sleet
#

lol ye

quaint mantle
#

1 sec

ivory sleet
#

I know there’s like async await but is that all? :0

quaint mantle
#

im not sure but most of the time you'd just create it yourself

#

i dont see a problem with that

#

python has a lot of modules but the point isnt really to create a jdk-like prebuilt module

ivory sleet
#

Ah alr, can we create new thread as well or is it single threaded?

#

true true

quaint mantle
#

use the threading module

ivory sleet
#

Oo

grave hound
#

which method

quaint mantle
#
from threading import Thread

Thread(target=some_fun).start()

# or for Thread subclasses

class A(Thread):
    def __init__(self) -> None:
        Thread.__init__(self)

    def run(self) -> None:
        pass

A().start()
ivory sleet
#

That’s very pog,, what does target do btw?

quaint mantle
#

it runs a function

#

no async keyword

ivory sleet
#

Ah oh

#

Yeah sorry I’m just a bit unused

#

Thanks a lot

quaint mantle
#

mhm

ivory sleet
#

yuh

quaint mantle
#

im more active than the python disc btw

#

dm if you need help

ivory sleet
#

Oo sure will, is there a python discord btw??? Invite me x)

quaint mantle
#

omg conclure @ivory sleet

#

guess the python discord invite

ivory sleet
#

Hmm python possibly?

quaint mantle
#

Maybe 👀

ivory sleet
#

Ah, nvm then I’ll go ahead and join myself then lol

grave hound
#

what method is canDestroy under hasItemMeta in Itemstack

spare marsh
#

Question, so I am creating an class called Inventories. This class has the task of returning several inventories, depending on the one you want. When you get a certain one, the items in it are set by calling method that would generate them. Every time it generates the items an item to create them are called. For example a displayPane would be java private ItemStack getPane() { ItemStack item = new ItemStack(Material.YELLOW_STAINED_GLASS_PANE); ItemMeta meta = item.getItemMeta(); assert meta != null; meta.setDisplayName(" "); item.setItemMeta(meta); return item; }

Do you think something better would be to initialize these items since they won't change when an instance of the inventories class is created? Create a non static initializer maybe that would save this to avoid creating them again every time this class is accessed?

quaint mantle
#

public static final ItemStack i =

#

then create an itembuilder class

ivory sleet
#

First of all, assert won’t do anything if you don’t have a specific jvm flag enabled, secondly what do you mean by non static initializer? It probably doesn’t matter here, however you probably want to just cache the ItemStack in whatever way, although the creation of ItemStack is quite superficial in terms of memory and speed, it’s more over how it gets processed and converted to nms.

misty current
#

ok so for some reason if you set the damage in an entitydamageevent to 0 and set the health of the victim to 0 and the victim is a player, it dies twice

#

sending the death msg twice and calling a playerdeathevent twice

patent horizon
#

howdy kill

misty current
#

hello

ivory sleet
#

Maybe worth reporting

misty current
#

it's 3 am and my brain is frying because of this stuff

#

uh- i am on uh- 1.8

#

is that a known issue

#

from 1.8

ivory sleet
#

Although it’s basically you that triggers an event which proceeds to make another event recur

#

Idk if it still is an issue, if you’re on 1.8 that is

#

Very possible it has been patched and dealt with then

misty current
#

oh actually i guess it kind of makes sense but still should be a bug

#

well the way i was handling damage was a bit sketch anyways so i should change it

spare marsh
#

Just initialize it when the class is created

misty current
#

basically i'm customizing damage calculation based on armor and weapons and so i need to set the final damage somehow

patent horizon
#

could someone help me with spawning a fishing hook in nms

misty current
#

but since you can't do that i'm setting damage to 0 and then damaging the victim

misty current
patent horizon
#

ik

ivory sleet
#

In that way, it will be dynamically supported in case you wanna cache items during runtime or smtng jpdaniel

patent horizon
#

but ive concluded i absolutely have to have one

spare marsh
#

wdym

grave hound
#
public class PlayerInteract implements Listener{
    @EventHandler
    public void onPlayerInteractEvent(PlayerInteractEvent event){
        Block block = event.getClickedBlock();
        ItemStack tool = event.getItem();
        if(block.getType() == Material.BEDROCK & tool.hasItemMeta(CanDestroy:["minecraft:bedrock"])){
            block.setType(Material.AIR);
            ItemStack bedrock = new ItemStack(Material.BEDROCK,1);
            block.getWorld().dropItemNaturally(block.getLocation(), bedrock);
        }
    }
}
```whats the correct use of hasItemMeta to accomplish what I'm trying to do here
ivory sleet
#

The set of fields you define in your class is limited to whatever they’re sings they’re known at compile time to a certain extent

#

Having a map would make your cached items changeable at runtime more flexibly

#

As you could easily put and remove new items into the cache

spare marsh
#

well yes but it is a GUI

ivory sleet
#

And the cache is usually something like a HashMap

misty current
spare marsh
#

so the ones I would initialize would be only the bottom items

#

Like the GUI options

#

so those I want to initialize at first but the items on top would be the ones that change

#

For example

ivory sleet
spare marsh
patent horizon
spare marsh
#

Only the bottom ones will never change

ivory sleet
#

Yeah

patent horizon
#

people will be riding pigs, so i need them to be able to cast fishing lines with carrots on sticks instead of rods

misty current
#

can't you send a playoutentityspawn or whatever the name is

ivory sleet
#

Then go with a Map of a fixed size of 9 ?

#

it will allow you to swap items if you want to

#

Etc

patent horizon
misty current
#

wdym

#

no line?

ivory sleet
#

Anyways you do you, guess this isn’t enterprise after all

patent horizon
spare marsh
#

Wait so create a map? To store those bottom items?

ivory sleet
#

I mean just do the way you intended to

spare marsh
#

I wanna go the most efficient way

misty current
#

i'm not sure if you can make it throw a fishing hook as a player casted it from a rod

patent horizon
#

is there a way i can change what item a player is holding client side?

misty current
#

yeah send a player equipment packet

#

not sure if it works for the player itself tho

patent horizon
#

ah so maybe i can instead just have them hold a fishing rod and make it look like a carrot on a stick

#

and ill just have to deal with manually operating the moving pig stuff

misty current
#

did you try to use the EntityFishingHook constructor

patent horizon
#

no

#

oh wait nvmd i know what you mean

#

yeah

spare marsh
patent horizon
#

i even tried making the fishinghook parse as a projectile

ivory sleet
#

Well, to be perfectly clear, if you want to make it enterprisy, usually we separate business requirements (aka the logic) and stuff like gui, storage etc.

Anyways I don’t have a good knowledge regarding your plugin precisely however what I’d do is to encapsulate, in this case, an ItemStack[] (array) with the size nine which maybe represents the nine items at the bottom. Then you have your inventory instance. Whenever you update the array, you’d then go on to update the items inventory as well. Of course this requires you to be disciplined, but yeah, that’d be one way.

Another way would be to completely have the logic of the gui in one class. So essentially you might want to have an ItemStack[] with the size of 56 if that was your inventory size. Then have the class with some useful functions to turn the pages, change items, or whatever you wish to do. Then make sure whatever is done with the functions gets reflected onto the actual gui. Which might be done through another class.

glad badger
#

Anybody know off the top of their head how much gravity affects an entities motion every tick?

misty current
#

¯_(ツ)_/¯

spare marsh
#

am actually saving that.

spare marsh
patent horizon
pseudo mirage
#

does anyone know any good plugins that whenever i place diamond blocks, it makes it so i can stack it and it supports ASkyblock. i dont want my players placing Diamond Blocks everywhere and I want it so they can stack em all while still gaining island value with ASkyblock per diamond block and stuff placed.

tawdry patrol
#

does anyone know the placeholder for displaying player hearts

grave hound
#
public class PlayerInteract implements Listener{
    @EventHandler
    public void onPlayerInteractEvent(PlayerInteractEvent event){
        Block block = event.getClickedBlock();
        ItemStack tool = event.getItem();
        //System.out.println(tool.getItemMeta());
        if(block != null & tool != null & tool.getItemMeta() != null){
            if(block.getType() == Material.BEDROCK ){
                if(tool.getItemMeta() = "internal=H4sIAAAAAAAA/+NiYOBk4HJOzHNJLS4pyq/kYGBgYGQQzM3MS00uSkwrsUpKTSnKT85mAACgSyEVKQAAAA==}"){
                    block.setType(Material.AIR);
                    ItemStack bedrock = new ItemStack(Material.BEDROCK,1);
                    block.getWorld().dropItemNaturally(block.getLocation(), bedrock);
                }
            }
        }
    }
}

Incompatible types. Found: 'java.lang.String', required: 'org.bukkit.inventory.meta.ItemMeta'

#
[18:28:53] [Server thread/INFO]: UNSPECIFIC_META:{meta-type=UNSPECIFIC, internal=H4sIAAAAAAAA/+NiYOBk4HJOzHNJLS4pyq/kYGBgYGQQzM3MS00uSkwrsUpKTSnKT85mAACgSyEVKQAAAA==}
twilit wharf
#

is there anyway I can make it so a armorstand cant trigger a pressure plate, I have the armor stand as a object

#

alright, I will give it a shot

twilit wharf
grave hound
pseudo mirage
#

does anyone know any good plugins that whenever i place diamond blocks, it makes it so i can stack it and it supports ASkyblock. i dont want my players placing Diamond Blocks everywhere and I want it so they can stack em all while still gaining island value with ASkyblock per diamond block and stuff placed.

twilit wharf
#

well, first you create a ItemMeta object, give it the values you are looking for, and do a if (itemMeta1 == itemMeta2) {code goes here}

waxen plinth
#

what

#

literally everything about that is wrong

twilit wharf
#

depends on your item meta, but something like this: ```java
// the item meta you want to find
ItemMeta creative_meta = creative.getItemMeta();
creative_meta.setDisplayName(ChatColor.GREEN + "Creative Mode");
ArrayList<String> creative_lore = new ArrayList<>();
creative_lore.add(ChatColor.LIGHT_PURPLE + "Become Invincible >:)");
creative_meta.setLore(creative_lore);

then compare them
```java
if (tool.getItemMeta == creativeMeta) {
  //code goes here
}
twilit wharf
waxen plinth
#
  1. You don't need to create a new ItemMeta object to compare properties
twilit wharf
#

depends on accuracy

waxen plinth
#
  1. You don't use item equality for objects, it will always return false unless they are the exact same object
twilit wharf
#

shouldnt they be tho?

waxen plinth
#
  1. The property being compared is not the entire ItemMeta, and if any properties deviate then the comparison will fail even if you use .equals
waxen plinth
grave hound
waxen plinth
#

If you create a new object it will not be the exact same object as any other object

#

Because I mean exact same object as in the same instance

twilit wharf
#

in any of the situations I have used that it works for me

#

and I do use the same instance

#

I guess I didnt realise what he was looking for

grave hound
twilit wharf
#

since I obviously dont know how to do this, I dont think I can help. You might be able to search on google comparing item lores tho, maybe someone else had the same issue

waxen plinth
#

What properties are you trying to compare

grave hound
grave hound
waxen plinth
#

Alright let's take a look

grave hound
#

the goal is to make the plugin let players mine bedrock with any tool that has the meta property of can break bedrock

waxen plinth
#

I don't think there's a property for that in ItemMeta

#

Alright, you don't need to actually set the property for that

#

You could add it in the lore and/or store that property in PDC

grave hound
waxen plinth
#

Great, that should be simple enough

#

If you want an item to have that property, you can just add a line of lore like &cBreaks bedrock or something

#

Then you can just check if the lore contains that line

quaint mantle
waxen plinth
#

Why are you bringing this up here/now

#

And how's it gonna be better

quaint mantle
#

its gonna be like a template

waxen plinth
#

What does that mean

quaint mantle
#

idk

grave hound
#
public class PlayerInteract implements Listener{
    @EventHandler
    public void onPlayerInteractEvent(PlayerInteractEvent event){
        Block block = event.getClickedBlock();
        ItemStack tool = event.getItem();
        //System.out.println(tool.getItemMeta());

        // the item meta you want to find

        if(block != null & tool != null & tool.getItemMeta() != null){
            if(block.getType() == Material.BEDROCK ){
                if(tool.getItemMeta().getLore() = "Lore"){
                    block.setType(Material.AIR);
                    ItemStack bedrock = new ItemStack(Material.BEDROCK,1);
                    block.getWorld().dropItemNaturally(block.getLocation(), bedrock);
                }
            }
        }
    }
}
```why is it never this simple 
Incompatible types. Found: 'java.lang.String', required: 'java.util.List<java.lang.String>'
quaint mantle
#

its just gonna be better and easier

waxen plinth
#

That would be checking if the entire list is equal to another string

grave hound
#

wrong error

waxen plinth
#

You can use contains

waxen plinth
#

With RedLex you just write the bnf file, then use that to instantiate the parser and call tokenize

#

And bam, you've got your tokens

grave hound
#

time to test

waxen plinth
#

Yes because it's the method that checks if an element is in a list

#

You have to understand the logical difference between checking if something is equal to a list and checking if the list contains an element

ancient plank
#

i dont wanna

#

sounds like a lot of effort!

quaint mantle
#

Could make a bot reply learnjava to every post in here and it'll be 80% right

quaint mantle
#

can always learn more 🙂

grave hound
#

what does this mean ? Could not pass event PlayerInteractEvent to BedrockMiner v1.0-SNAPSHOT
org.bukkit.event.EventException: null

hasty prawn
#

Send the full error

grave hound
hasty prawn
#

It says what's wrong

grave hound
#

but I have ```
if(block != null & tool != null & tool.getItemMeta() != null & tool.getItemMeta().getLore() != null){

hasty prawn
#

You're using 1 &, which checks every condition. Tool is null, but then it's going to tool.getItemMeta(), but tool is null

#

So... use && instead.

#

You should pretty much always be using &&

grave hound
#

plugin works as intended

near aurora
#

Hey can one of the Staff please DM me I want to raise an issue.

flint carbon
#

import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;

public class BreakBlock implements Listener {
    @EventHandler
    public void onPlayerBreakBlock(BlockBreakEvent event) {
        Block blockBroken = event.getBlock();
        if (blockBroken.getType() == Material.WHITE_GLAZED_TERRACOTTA) {
            event.setCancelled(true);
            ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
            String command = "givetoken %player% 1";
            Bukkit.dispatchCommand(console, command);

        }
    }
}
#

Does anyone know how to make it so the command is not shown in the consoole?

blazing scarab
#

Don't use commands

drowsy helm
#

Use an api

quaint mantle
#

wtf is he even doing...?

waxen plinth
#

Eh

#

Sometimes you really do need to use commands because a plugin doesn't have a good api

#

Or because that's how you're supposed to interact with it

#

You should really be careful when using it in events that are fired that often though

pseudo mirage
#

does anyone know any good plugins that whenever i place diamond blocks, it makes it so i can stack it and it supports ASkyblock. i dont want my players placing Diamond Blocks everywhere and I want it so they can stack em all while still gaining island value with ASkyblock per diamond block and stuff placed.

waxen plinth
#

it is a channel for developers seeking help with code

pseudo mirage
#

;-;

waxen plinth
drowsy helm
#

Plus thats a super super niche plugin

#

Probs need it coded by someone

tacit drift
#

idk, why would you use ASkyblock

pseudo mirage
regal moat
#

How could I make a block

#

not moveable

#

by pistons?

granite burrow
#

how can I save updates to config without removing comments and qoutes?

tacit drift
plain helm
#

why does the player move circularly?

                Player target = plugin.CuffLinker.get(p);

                Location loc;
                Vector vet;
                Vector finalLoc;
                Vector vel;

                loc = new Location(e.getPlayer().getWorld(), e.getTo().getBlockX(), e.getTo().getBlockY(), e.getTo().getBlockZ());
                vet = target.getLocation().toVector();
                finalLoc = loc.toVector();
                vel = finalLoc.subtract(vet);
                target.setVelocity(vel.normalize()); ```
plain helm
quaint mantle
#

hello i have a question about async queries

#

it cannot be accessed

#

if i call the method async, will the query be async ?

#

wtf are you doing...?

#

the b = true is for test

#

oh ok

#

hmmm

#

i might need to access the

#

boolean

#

so i can return it

#

Hey,

I'm wondering what exactly the provides keyword in plugin.yml does?

#

what?

#

are you asking about pom.xml

#

No, about the plugin.yml

I know there's a keyword named provides, but could not find any infos about it

#
    private static boolean isTableEmpty() {

        String query = "SELECT `name` FROM `presents` LIMIT 1";

        try {
            PreparedStatement ps = TrexPresents.INSTANCE.getSql().getConnection().prepareStatement(query);
            ResultSet set = ps.executeQuery();
            return !set.next();

        } catch (SQLException e) {
            e.printStackTrace();
            return false;
        }

    }

how to make this async

tribal sparrow
#

Use a completablefuture

quaint mantle
#

what is it

#

how to use it

#

you have to handle the response async too, which is where completablefuture is used

#

otherwise you lose the whole point of running sql async

#

what is a completablefuture

#

the link above explains that

#

i dont get it

#

completable future also links to future which gives more details. You probably skipped that info

#

can you give an example ?

#

google can

regal moat
#

How could I make an inventory not draggable, only the virtual inventory, but if the player clicks on their inventory, they can drag

tribal sparrow
chrome beacon
regal moat
#

I can't send images

#

djghısjfhds

regal moat
#

I sent you what I want to do in your dm's

#

Since I couldn't send here

quaint mantle
quaint mantle
#

thanks

#

i found it myself

tribal sparrow
#

@quaint mantle

        isTableEmpty(new Callback<Boolean>() {
            @Override
            public void execute(Boolean response) {
                //do stuff here
            }
        });
    }

    private void isTableEmpty(Callback<Boolean> callback) {

        String query = "SELECT `name` FROM `presents` LIMIT 1";
        Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
            try {
                PreparedStatement ps = TrexPresents.INSTANCE.getSql().getConnection().prepareStatement(query);
                ResultSet set = ps.executeQuery();
                callback.execute(!set.next());
                return;
            } catch (SQLException e) {
                e.printStackTrace();
            }
            callback.execute(null);
        });
    }


    public interface Callback<R> {
        public void execute(R response);
    }```
quaint mantle
#

tf

#

i dont get it

#

nevermind about it

#

it is the same thing

tardy delta
#

throwable = true?

#

ah my bad

#

just woke up

#

🌝

quaint mantle
regal moat
#

How can I detect if a new item has been put in an inventory

quaint mantle
regal moat
#

No, it doesnt

#

there is InventoryMoveItemEvent

#

though

restive mantle
#

Is there a specific way or best practice to make a plugin have a exposed api for other plugins to use (I just need to expose a tiny api)

quaint mantle
#

Can use the service API or don't and let people access it from grabbing the plugin directly

#

Could also use a static api class that people can grab certain things from

tardy delta
#

?paste

undone axleBOT
restive mantle
#

Ok, I'll use a static api class then, since bungee doesn't have the Service Manager

quaint mantle
#

You can use static method as entry point of api or manually getting plugin from PluginManager aswell

regal moat
#

So I am trying to make a GUI for my custom block

regal moat
#

ElementsMain:26 is Bukkit.getPluginManager().registerEvents(new MergingTable(this), this);

quaint mantle
#

i wonder if the error is on spigot side?

#

lemme check

#

what is your version

chrome beacon
quaint mantle
#

1.17 or what?

quaint mantle
#

oh i forgot about that lol

regal moat
regal moat
quaint mantle
#

blockevent just a class contains everything for event about blocks
you need to listen to the block you want

regal moat
#

whaa

quaint mantle
#

the blockevent itself isnt intended to be an event i think

#

what block are you trying to listen to?

regal moat
#

A crafting table

quaint mantle
#

wait

#

you provided wrong class

regal moat
#

Huh??

quaint mantle
#

i dont see any blockevent listen + the name in the error is ElementsMain not MergingTable

chrome beacon
#

Send the class

regal moat
#

i did...

chrome beacon
#

Are you sure that code is the same as the one youre running

regal moat
#

Yes..?

quaint mantle
#

this is the source code of the latest commit for 1.16.5 for the blockevent

chrome beacon
# regal moat Yes..?

Because the error would suggest that youre listening to the BlockEvent rather than one of the clases that extends it

chrome beacon
quaint mantle
#

and other events extends this class

quaint mantle
regal moat
quaint mantle
#

if i remember it correctly

regal moat
#

Alright then?

quaint mantle
#

yeah nothing

regal moat
#

Whats the problem?

quaint mantle
regal moat
# chrome beacon You're not using Paper

Umm- ```xml
<dependency>
<groupId>com.destroystokyo.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

#

It's literally Paper??

chrome beacon
quaint mantle
#

you must find the BlockEvent word in every class that implements listeners and try to replace it with other thing?

regal moat
#

Yeah, but the plugin is paper

quaint mantle
chrome beacon
quaint mantle
#

but still i dont think there are any differences

regal moat
#

So the problem is with Purpur?

quaint mantle
#

it is his fault lol

#

your fault.

regal moat
#

Oh ok

chrome beacon
regal moat
#

I think BlockEvent is suppossed to be an event, because BlockPlace and Destory events extend BlockEvent

regal moat
#

And since BlockEvent extend Event

regal moat
#

public abstract class BlockEvent extends Event

quaint mantle
#

but if you dont believe me then that is the spigot statsh

regal moat
#

extends Event

chrome beacon
quaint mantle
chrome beacon
#

^

regal moat
#

Then how is it my fault?

quaint mantle
#

so the blockevent itself isnt intended to be a real event

regal moat
#

Dude

quaint mantle
#

🍭

regal moat
#

public class BlockPlaceEvent extends BlockEvent

#

How?

chrome beacon
quaint mantle
#

You... go click on the link hello?

#

this is the blockevent file

#

it doesnt have a handler

regal moat
#

Stop posting the link

#

I can read

#

I just 👏 don't understand whats the problem!

chrome beacon
#

RPGAccount could you just chill a bit. I can handle this

chrome beacon
regal moat
chrome beacon
quaint mantle
#

bukkit required every event to have a handler
the blockevent doesnt have handler = dev didnt intend it as a normal event
the reason for that is it is just a template for other block-related events, as it is an abstract.

regal moat
#

Okay, starting the server

regal moat
quaint mantle
#

oh you're asking me why i say it is your fault?

#

then lol it is a joke then 🍭

regal moat
quaint mantle
#

hmmmm looks sus

regal moat
#

what

quaint mantle
#

as the class you provided dont have the block event listen

regal moat
#

YES

#

I know

quaint mantle
#

check other class then

regal moat
#

The only thing I did

#

Was changing BlockPistonExtendEvent to BlockPistonEvent

chrome beacon
#

Oh..

#

That's abstract too isn't it

regal moat
#

Oh-

#

Well, thanks for your help everyone!

quaint mantle
#

LOL

regal moat
quaint mantle
#

it really is an abstract

quaint mantle
regal moat
#

Ah yes, my reaction was bad wasn't it? Thanking everyone for their help was a bad thing. It was idiotic of me to do this anyways! Thank you for the comment!

quaint mantle
#

wtf...?

chrome beacon
#

Just ignore him

quaint mantle
#

welp

#

ok

visual tide
#

this isnt kindergarten

#

but ngl i could tell

regal moat
#

^^^^^

visual tide
regal moat
#

lmfao

quaint mantle
#

🍭

#

🍭

regal moat
#

God, please stop.

quaint mantle
#

meh idk i dont think that is true

regal moat
#

Why am I here

unreal quartz
#

I thought discord had a minimum age of 13

regal moat
#

lmfao

unreal quartz
#

apparently not

visual tide
quaint mantle
#

🪕

#

🧦

#

sock

#

🍪

regal moat
#

Can we change the topic? This is not the chatting or acting like a kid channel.

quaint mantle
#

wait this isnt general?

#

oh lol

#

i thought this was general 😂

dark osprey
tardy delta
#

hehe

pastel carbon
#

Does Bukkit.getOfflinePlayers() also include online players? As the doc says Gets every player that has ever played on this server.

drowsy helm
#

yes

#

it's every single player

pastel carbon
#

ok thanks

near shoal
#

so ive made a bot (nms) and im able to make it move but im also able to move it through blocks. if i want to make it have collision, do i have to do that myself

chrome beacon
#

Depends on how you made the bot

near shoal
#

its an artificial player so i have to send packets for it do anything

chrome beacon
#

Yeah sounds like you need your own collision then

#

Or try to find where vanilla calculates it and see if you can use it somehow

near shoal
#

is there another way i could have made the bot to not need to implement my own collision

chrome beacon
#

Simply don't use packets and register it like a normal player would be

#

Or you could have a bunch of JS bots with Mineflayer

#

Depends on what you're trying to do

#

Personally I'd just use the Citizens plugin api

#

Since they handle all of it for you

near shoal
#

alright ill look into them

tardy delta
#

i hope this also works in java

drowsy helm
#

well youcan left shift so i don't see why not

quaint mantle
chrome beacon
#

^

tardy delta
#

aaaaaaaaaaaah...

chrome beacon
#

So Color#getRGB returns ARGB my sanity has been lost after troubleshooting that

hoary pawn
#

@chrome beacon i tried to look at some stuff but i still can figure out how da hell to shade it

opal juniper
#

special colorblind glasses

chrome beacon
hoary pawn
#

ahh thats probably the dev idea plugin thats doing that

chrome beacon
#

Add scope provided on to the gson dependency

hoary pawn
#

ahh

#

that worked, thx

mortal hare
#

is it safe to access stale player's object world object?

eternal oxide
#

why do you have a stale Player object?

mortal hare
#

im trying to error handle my methods

#

so they dont fail

grand stratus
#

How do I expose an API ?

mortal hare
#

if some dumb argument has been passed

eternal oxide
#

The world shoudl be valid even if the player is stale, as its just a reference and world references do not change

#

It would be safest to get a fresh player though

mortal hare
#

but what about get location method

#

it seems it gets the coords from NMS entity object reference

#

but i don't know if it does something with it before disconnecting

#

ah

#

i wouldnt bet on it

#

i'll just make a if statement

misty current
#

hey, i've noticed that when you set the damage to 0 in an EntityDamageEvent and set the health of the victim to 0, the player dies twice, sending 2 death msgs in chat and also calling EntityDeathEvent twice

#

this doesn't happen for other entities tho

mortal hare
#

sounds like a bug

opal juniper
#

send your code

#

& are there any other plugins

#

or listeners

eternal oxide
#

are you canceling the damage event?

#

if not, you are setting the players health to zero, the player dies. The event continues and applies zero damage and makes teh player die again

misty current
#

oh that makes sense

#

i'm not canceling the event

#

so i should cancel the event if the health of the player will reach 0

eternal oxide
#

if you are managing teh death yourself, yes

#

test with getFinalDamage() to account for armor

misty current
#
    @EventHandler
    public void onEntityDamage(EntityDamageEvent e){
        e.setDamage(0);
        if(e.getEntity() instanceof LivingEntity){
            Bukkit.broadcastMessage("");
            LivingEntity entity = (LivingEntity) e.getEntity();
            double calcDamage;
            if(e instanceof EntityDamageByEntityEvent && ((EntityDamageByEntityEvent) e).getDamager() instanceof LivingEntity) {
                EntityDamageByEntityEvent e1 = (EntityDamageByEntityEvent) e;
                calcDamage = pvpManager.calculateDamage((LivingEntity) e1.getDamager(), entity);
            } else {
                calcDamage = pvpManager.calculateDamage(null, entity);
            }
            Bukkit.broadcastMessage("calculated damage:" + calcDamage);
            //if(entity.getHealth() - calcDamage <= 0.0){
            //}

            entity.setHealth(Math.min(Math.max(entity.getHealth() - calcDamage, 0), entity.getMaxHealth()));
        }
    }
#

this is my code btw

#

a bit messy but i'm doing some testing

eternal oxide
#

you should have deprecated warnings in that code

#

use attributes

misty current
#

i don't, i'm on 1.8

#

else i'd use java 16 and the if with instance checks would not be painful to read

#

basically what this code aims to do is create a custom damage system calculated by pvpManager#calculateDamage()

tardy delta
#

if i'm using an import for a plugin that isnt on the server but i dont use the import, will i get a classnotfound exception or not?

#

or are imports pre-checked or something

misty current
#

sadly you can't check the final damage so this is the only way to change damage blocking normal damage modifiers(strength, armor, and so on)

eternal oxide
tardy delta
#

oki thanks

misty current
#

you should specify in your plugin.yml what plugin dependencies you have

eternal oxide
#

why would you have an import you don;t use? unless you are static importing

misty current
#

else if the classes are not present at runtime, you will get an exception

tardy delta
#

i'm checking if that plugin is present before using its code

eternal oxide
#

thats fine

misty current
misty current
#

i usually have different classes for each service provider and i have a boolean method that says if it is present or not

tardy delta
#

ah i do it in my main class

#

if i do something like this, will that throw an exception?

#

maybe go that plugin's support server?

tardy delta
#

ah lets check for vault then

eternal oxide
#

which is why in my code I use ```java
public static Class<?> getClazz() {

    try {
        return GroupManager.class;
    } catch (NoClassDefFoundError ex) {
        // Ignore the error as it simply means the plug-in is not on the server.
    }
    return null;
}```
tardy delta
#

yea i saw that

#

lets avoid making unnessecary exception objects 🌝

eternal oxide
#

the only way you can avoid that is by getting teh plugin by name

tardy delta
#

yesh

misty current
#

ok so i have a small issue

#

i have damaged a player by the max double value

#

and now it's in kind of a softlock state

eternal oxide
#

exceptions should be avoided if you can, but these days they are not as inefficient as they used to be.

#

a possible exception when testing for a plugin is nothing to worry about

tardy delta
eternal oxide
#

so long as you test for it and catch it

#

that will thrown an exception if LP isn't present.

tardy delta
#

i check with ispluginEnabled

eternal oxide
#

k

misty current
#

is there any other way to do what i'm tryna do

chrome beacon
#

Yeah /kill just deals a lot of damage

misty current
#

i could make my own /kill but this method's a mess

#

isn't there any other way

chrome beacon
#

Check and allow the void damage type?

misty current
#

oh is it void damage?

#

well that works but still this method's kinda sketcy

#

yea that worked

tardy delta
#

for some reason i cant set things to a config file

#

i'm trying this

private final FileConfiguration homesFile = plugin.getConfigManager.getHomes();


homesFile.set("homes." + executor.getUniqueId() + "." + name, null);
            plugin.getConfigManager().saveConfig(ConfigManager.FileType.HOMES);
#

and here is my configmanager class ?paste

#

?paste

undone axleBOT
tardy delta
twilit wharf
#

I am developing a parkour plugin, and I want when a player steps on a pressure plate, it keeps track of their time, until they touch the next pressure plate, I know how to do this, but I dont know what to do when multiple people are doing the parkour at once. how would I handle this?

tardy delta
#

store them in a map or something

glass tangle
#

arraylist

tardy delta
#

Map<Player, Integer> int for the waypoints or something

#

i dunno

twilit wharf
#

yeah I need time as well

glass tangle
#

yes

#

you store time in string or integer/long

tardy delta
#

System.currentTimeMillis

#

i really have to shut my mouth smh

twilit wharf
#

I think I will do a Map<Player, ParkourInstanceThingy> playersInParkour then in the thing I am instancing per player will have a stopwatch, checkpoint variable, and all that logic

tardy delta
#

:/

#

thats a multimap

hybrid spoke
tardy delta
#

Just a list of custom class objects?

glass tangle
#

ah shit

#

my bad

tardy delta
#

i miss structs 🥺

eternal oxide
#

is your ParkourInstance a world?

#

nm, I'm not that interested to bother 😦

ancient plank
#

F

tardy delta
regal moat
#

?oaste

#

?paste

undone axleBOT
regal moat
#

So In theory

#

This should block the usage of the 49th slot of a gui

#

it does not...

eternal night
#

The drag event is rather limited tho

#

The Inventory click event would most likely need to be checked too

regal moat
#

I JUST SWITCHED FROM THE CLICK EVENT-

eternal night
#

Two different events xx

crimson terrace
#

is there a reason why you have to go through the slots with a for loop?

regal moat
#

i have no idea i have lost control of my life

crimson terrace
#

check both and youre on the safe side XD

crimson terrace
#

click event and drag event, then nothing can go wrong can it

regal moat
#

i am too

#

confused

#

on this

#

...

quaint mantle
#

you should take a nap

#

or just drinking music/play some games

regal moat
#

no

#

i cant drink music tonight

quaint mantle
#

OH LOL IM...

regal moat
#

@chrome beacon btw you were offline so i didnt want to bother you

chrome beacon
#

No worries ping me if you need me

maiden mountain
#

Quick question relating to entering the plugin API version.
My 100% sure my plugin works on prior versions of minecraft. Even tho i'm building it targeting the latest 1.17.1. Which version should I enter inside the plugin.yml?

eternal oxide
#

the lowest API you want to run on

maiden mountain
#

I heard its like 1.13 right?

ancient plank
#

1.13 is lowest api-version

maiden mountain
#

Yeah, i have that right now

eternal oxide
#

if you want 1.13, build against 1.13 too

quaint mantle
#

maybe if you want to support 1.8+ then remove the api-version i think?

ancient plank
#

if you remove it it'll just go "brrt brrt plugin using legacy support!"

maiden mountain
#

So I got it right. Thanks for the response 👍

maiden mountain
misty current
#

is there anything built in the Material enum to get the default display name of a Material? (ex. from IRON_SWORD to Iron Sword)

#

or do i have to make it myself

eternal oxide
#

no method

misty current
#

a

#

welp i can make it myself i guess

#

replace _ with spaces

#

and its good

keen basin
#

why i cant restore hashmap ?

public void saveLife(){
    for (Object key : Setup.life.keySet()) {
        getConfig().set("Life."+key, Setup.life.get(key));
    }
    saveConfig();
}

public void restoreLife(){
    for (String key : getConfig().getConfigurationSection("Life").getKeys(false)) {
        Setup.life.put(key, (Integer) getConfig().get("Life."+key));
    }
}
maiden mountain
#

@misty current This should answer your question (Untested):

  String itemName = new ItemStack(Material.DIAMOND_HELMET).getItemMeta().getDisplayName();
misty current
#

getdisplayname returns null if the item doesn't have a custom name iirc

eternal oxide
#

I guess you could Bukkit.getItemFactory().getItemMeta(material).getDisplayName(); So long as you check the material is a valid item.

maiden mountain
#

I was about to post the same code @eternal oxide ahaha

misty current
#

thanks i'll give it a try

#

with checking if it is valid do you mean checking if it is not null?

maiden mountain
#

Yeah, store the item meta inside variable and null check it

#

Just to be safe

#

Because the getItemMeta method is nullable

misty current
#

oh yea the methods where i use it already check if the item is not null/air

maiden mountain
#

Thats always good 💪

misty current
#

uh it returns null

chrome beacon
#

It will be null unless you change the display name

keen basin
#

Is it correct to save the Arraylist

` public void saveBackpack(){
getConfig().set("Backpack.", me.ag4.blox.backpack.Setup.blocks);
saveConfig();
}

public void restoreBackpack(){
    me.ag4.blox.backpack.Setup.blocks.add((Location) getConfig().getConfigurationSection("Backpack"));
}`
chrome beacon
paper viper
#

that code is 💀

chrome beacon
#

What mc version?

misty current
#

1.8

paper viper
#

Yeah... no

chrome beacon
#

?

#

Anyway yeah NMS if you're on 1.8

misty current
#

how should i get it?

chrome beacon
#

🤷‍♂️ I always use modern versions where things are easy

paper viper
#

Or use Adventure

#

😌

chrome beacon
#

Does it work with 1.8?

paper viper
#

idk if it does, but it isnt my issue if it doesnt lol

misty current
paper viper
#

i think it does cause it supports legacy serialization stuff

misty current
#

meh at this point i'd rather take the raw material name, replace _ with " " and capitalize it

chrome beacon
#

Yeah you can do that

misty current
#

any built in method to make Title Text or do i google one?

keen lily
#

can anyone help me with a scoreboard that score updates everytime a certain block is destroyed?

misty current
#

there are plenty apis well documented

#

for sidebars

keen lily
#

alright

quaint mantle
maiden mountain
misty current
#

return toStrictProperCase(material.toString().replaceAll("_", " ").toLowerCase(Locale.ENGLISH)); works fine

paper viper
#

Uh the spigot api has built in sidebar api

misty current
#

ez

misty current
paper viper
#

unless you want to do per players

misty current
#

especially as you said per player

keen lily
#

im not doing per player

paper viper
#

🙂

#

lol

misty current
#

agreed

#

lol

#

wanted to see how bad it was and i feel like the server i'm making fits better in 1.8

quaint mantle
harsh kayak
#

how do i get a plugin to create a config

tardy delta
#

does FileConfiguration#set("section", object) works if the section key doesnt exist?

misty current
#

lol

tardy delta
#

in some way my config doesnt let me write something down

quaint mantle
#

where are you going to use those? If on title, actionbar chat and booms only just use adventure

tardy delta
#

i save it and nothing is saved

misty current
maiden mountain
#

@tardy delta Are you saving data inside the config file?

tardy delta
#

yes

maiden mountain
#

I personally would not recommend that

tardy delta
#

its just an yml data file

maiden mountain
#

Leave the config file for the configuration only

#

I personally would recommending a json data file for saving data

tardy delta
#

its just for saving some small stuff no need for json

eternal oxide
#

why final?

latent pilot
#

can anyone help me? my plugin's having a hard time finding my main class

maiden mountain
#
 main: com.yourname.myproject.Main
#

If this doesnt work. Show me your Main class code

tardy delta
#

because its in a command class and it s not modified

#

i save the file so i dunno whats the problem

latent pilot
#

still doesnt work, here's the code

package com.servers.AllOfTheThings;


public class Main extends JavaPlugin {

    private static Main instance;
    public static Main getInstance() {
        return instance;
    }

    public DataManager data;

    @Override
    public void onEnable() {

        initialize();
        listeners();
        commands();

        CustomEnchants.register();
        this.data = new DataManager(this);
        World world = (World) Bukkit.getServer().getWorld("world");
        Location serverLocation = new Location((org.bukkit.World) world,
                238.5,
                115,
                2173.5);
        //new Stats(this);
        Bukkit.broadcastMessage(ChatColor.AQUA + "" + ChatColor.BOLD + "Hello World! :D");
    }


    public void onDisable() {
        Bukkit.broadcastMessage(ChatColor.RED + "Reloading the server, a lag spike will occur!");
        getServer().getConsoleSender().sendMessage(ChatColor.RED + "(!) | AllOfTheThings | Disabled | (!)");
    }
}

(got rid of some voids due to char limit)

maiden mountain
#

Does it throw errors inside the console?

latent pilot
tardy delta
#

you talking to me?

maiden mountain
#

@latent pilot Your missing the @Override annotation on the "onDisable"method

#

Maybe that causes the error

true perch
#

**What's the best way to efficiently read/write date to a local file upon onDisable? **
Up to this point I've only used SQL to store data for my server. However I'm interested in writing/reading local data. onDisable I want some data to get instantly written to a file so the data doesn't get lost, and read it when the server reboots to take the correct measures.

latent pilot
#

that didnt fix it. here's my plugin.yml

main: com.servers.AllOfTheThings.Main
name: AllOfTheThings
version: 2.0
description: All moderation and extra items for the server.
api-version: 1.16
opal juniper
#

?main

tardy delta
#

do i need to save my fileconfiguration when creating a new file with file.createNewFile() or something?

maiden mountain
tardy delta
#

it seems like the file is there, because values are read directly from the file but when the server restarts, the things are gone

maiden mountain
#

And when working with big data, make reading and writing async by using the Bukkit scheduler API

latent pilot
#

im using intellij, would that be a problem? i can send you the artifact output layout if needed

maiden mountain
#

I'm using intelliji aswell

#

and i never had that issue before

#

It looks very weird to me

#

Since i'm not seeing any issues with your files

tardy delta
#

my plugin is reading data from an empty file and it works :////

latent pilot
#

do you need to see the artifact output?

ornate heart
tardy delta
#

for some reason when i delete my plugins directory and i stop the server, the files come back, with the exact values as before

#

which wouldnt make sense as those are gathered during onenable

summer scroll
tardy delta
#

i'm executing a method that gets the fileconfiguration (when the server files were not removed) from a field and sets some things in it

#

i guess that objects stays in memory with the original values or something

quaint mantle
#

is there any significant benefit of using CompleteableFuture over bukkit schedulers/runnables?

paper viper
summer scroll
paper viper
#

just use the completablefuture

#

at least thats what i do

tardy delta
#

and why isnt it possible to set things in it then?

quaint mantle
paper viper
#

and also plus a lot of other devs do it anyways cause it has better functionality

#

unless you are working with ticks, you shouldn't have to use the bukkit schedualer

quaint mantle
#

I've always used async delayed schedulers when calling database stuff but if that's better I will switch

paper viper
#

Yeah

paper viper
#

the bukkit sched cannot do that

#

another reason why to use it instead

tardy delta
#

why to null??

quaint mantle
#

yeah that was my other reason for asking, because I think I actually have a use for that now

paper viper
#

and dont know java

#

lol

tardy delta
#

lol

#

hmm i guess reloading or something breaks my whole config files

#

as they are cached

#

and dont belong to the original files anymore or something

twilit wharf
#

When a player enters a specific command, it adds some coordinates to a mongodb database, and then when a player goes to those cords it triggers something, put in the mongodb it is adding 3 to the z coordinate, and I cant find why. Here is the code: https://paste.helpch.at/gulomomupu.cs

#

as a quick fix I might be able to just add 3 to the value it is comparing it to

tardy delta
#

hmm it seems the map from the fileconfiguration is cached

#

and when i reload my plugin, the fileconfig isnt

#

so if i removed my files before reloading

#

it is still writing in the file in memory

#

and when i shutdown the server the original file comes back in some magical way

ancient plank
#

It be like that

maiden briar
#

If I build my plugin with Maven, the classes that I've excluded start now with hidden.classname, but I want them completely removed from the jar

#

I use <relocations> from the shade plugin

quaint mantle
#

When saving a player to a Player variable, does that variable become null once the player has logged off?

lyric grove
#

Would this be best to be executed async?

ivory sleet
#

No

ivory sleet
quaint mantle
#

I assume you'd get a nullpointer when using it though

ivory sleet
#

However, the player instance itself might lose certain data

grand stratus
#

Add a Dependency

ivory sleet
#

That might be if you invoke a method on that instance which does something that yields an NPE

quaint mantle
#

yeah that's what I meant. Guess i'll just stick with Player#isOnline() to make sure

ivory sleet
#

Not sure if that works once a player instance has become invalid

quaint mantle
#

😵‍💫

ivory sleet
#

Null checking Server::getPlayer is probably more solid here

lyric grove
quaint mantle
#

But yeah I guess this is probably a thing you'd execute async

lyric grove
#

im not going to use a bukkitrunnable for every player on join 🤦‍♂️

#

that would just lag the server

ivory sleet
#

Literally wouldn’t lol

quaint mantle
#

Yeah I mean I assume your TaskUtil is going to do the exact same thing anyway

ivory sleet
#

I mean BunkitRunnable::runTaskAsynchronously still submits the task to its cached thread pool thus it would be executed asynchronously the same way BukkitScheduler::runTaskAsynchronously does it.

lyric grove
#

oh ok

loud charm
#

does chunk.load() run asynchronously or not?

#

I don't think it does but with some of the results I am getting, I am starting to think otherwise.

lyric grove
#

I think it does on paper?

eternal night
#

Chunk#load will load on the main thread

#

paper has some async alternatives

#

but chunk.load will live on your thread

loud charm
#

k thx

spare marsh
#

Question. If i create a copy of a map, will it still share the same memory location of the keys and values or it changes?

#
// If i modify test later on, the values on someOtherMap will change too>?
Map<String, String> test = new HashMap<>(someOtherMap);
#

because of I modify test a entry set or something, will it also modify someOtherMap?

keen lily
#

im wondering if anyone can help me on making a player specific variable for a scoreboard, and then displaying the top 5 people with the highest of that variable

vale ember
# spare marsh Question. If i create a copy of a map, will it still share the same memory locat...

depends on way you clone it, see https://www.baeldung.com/java-copy-hashmap. The way you showed WILL NOT clone values and keys, so they will point to the same value. If you want them to not point to the same value use external libraries or write your own implementation (i.e. Apache commons lang: SerializationUtils.clone(originalMap), though every element in map you want to be deep copied must implement Serializable).

Baeldung

Learn various techniques for making shallow and deep copies of Java's HashMap

spare marsh
vale ember
tardy delta
ancient plank
#

Yes

quaint mantle
#

like, Whats point of doing this async? You have billions of npcs? You load npcs from database?

patent horizon
#
    @EventHandler
    public void gui(InventoryClickEvent event) {
        Player player = (Player) event.getWhoClicked();
        if (event.getView().getTitle().equals("Start A Game")) {
            event.setCancelled(true);
            if (event.getClick().isLeftClick()) {
                if (event.getSlot() == 12) player.sendMessage("public game");
                else if (event.getSlot() == 14) player.sendMessage("private game");
            }
        }
    }``` so the first time opening this gui, the slots send the messages twice, and every time i reopen the gui, the amount of messages +1
visual tide
#

dont use title

#

players can just rename a chest

#

check the holder instead

chrome stream
#

can someone explain how i use bungee

tranquil viper
#

Hello, I wanted to know if there was a way to run the code inside a scheduled task on a command. For example if I run /endtasks it will end the scheduled tasks but still run the code inside of that task

#

Right now I am using Bukkit.getScheduler().cancelTask(task); but that doesn't actually run the code inside the task

torn shuttle
#

nor should it

#

but how about

tranquil viper
#

Yes I know it shouldn't

torn shuttle
#

you extract the logic inside of the task, put that in a method, then run it AFTER you cancel the task

tranquil viper
#

I don't know exactly what task I am running though, I guess I could track this though

torn shuttle
#

you are referring to the task in some way

#

if you want a systematic approach to this you can also create your own task system with your own cancellation system in it

tranquil viper
#

wym

#

Intellij or eclipse

torn shuttle
#

we're not here to do your homework for you, there's plenty of resources out there that will show you how to compile code step-by-step

tranquil viper
#

dm me

torn shuttle
#

I'm sure the mods will love it

tranquil viper
#

I'm just trying to understand what he is going for lmao

#

I'm not offering to do anything

merry pulsar
#

Hi, I'm making Arena Game and I don't want to spend my money by buying 30 server for each arena, so I want help with making Per World Kill Counter.

#

If you can help, TSYM!
If you can't TSYM for reading ❤️

torn shuttle
#

@quaint mantle do discord helpers have moderation powers in here? I forget

quaint mantle
#

get it legally

#

?kick @quaint mantle asking for leaks, bspigot

undone axleBOT
#

Done. That felt good.

quaint mantle
#

ill use that for now

tranquil viper
#

I don't really understand what he even wanted lmao

stone sinew
#

Wow someone actually got banned for leaks or asking for leaks. Thats a first.

tranquil viper
#

ultraprisoncore is literally $20

torn shuttle
#

he wanted someone to compile illegally obtained source code from a premium plugin because he was too cheap to buy it and still had access to the source

#

well, compile and I assume send it to him as well

tranquil viper
#

What so he had the decompiled code?

#

lmao

quaint mantle
#

was a ban worthy?

tranquil viper
#

If he was trying to pirate illegal content I would say probably, yes

quaint mantle
#

well i mean it is against the rules

stone sinew
#

All leakers or people asking for leaks should be banned.

torn shuttle
#

I'd say yes, hopping on the developer side of chat support to ask people to take money away from the devs takes quite the set of balls

quaint mantle
#

ok yeah there banned

merry pulsar
#

oof

torn shuttle
#

imagine if I showed up on amazon support and started asking them to give me a fake credit card

merry pulsar
#

i can't say "bs"

#

full name

stone sinew
merry pulsar
#

idk why

stone sinew
torn shuttle
#

bonkspigot

merry pulsar
#

i used to be a moderator there, i thought its a normal website, I didn't know what "Leak" meant lol

torn shuttle
#

go to jail

merry pulsar
#

I still have my mod rank oof

stone sinew
#

I paid the dumbass owner to whitelist my plugin and one of his admins sent me a screen shot of him saying they were allowed to leak it still lol

torn shuttle
#

that has a name, I was going to say blackmail but it's more like extortion or smth right

merry pulsar
#

They're dumb, they removed "Staff" Rank but didn't remove "Moderator"

maiden mountain
#

imagine being so beta that you start leaking people's products

merry pulsar
merry pulsar
#

no leak xd

quaint mantle
#

beta male

torn shuttle
#

the true beta move is donating to a leak website

stone sinew
#

The drama group songoda actually paid for hosting for leaksites at one point in time and they doxed the current owner of "black knockoff spigot"

torn shuttle
#

oh god is songoda still going

rough jay
#

I don't get what the issue is, it has never done that to me...

stone sinew
graceful turret
#
                    CREATE TABLE IN NOT EXISTS "PLAYERS" (
                        "ID"    INTEGER UNIQUE,
                        "NAME"    TEXT NOT NULL,
                        "UUID"    BLOB NOT NULL,
                        "IP"    BLOB NOT NULL,
                        "SKIN"  INTEGER NOT NULL,
                        PRIMARY KEY("ID" AUTOINCREMENT)
                    );""";``` can someone check that? SQL error or missing database (near "IN": syntax error)
torn shuttle
#

how tf is songoda even an llc

rough jay
quaint mantle
#

Not in

#

Also please make your column names lowercase and remove quotes

graceful turret
#

ty

torn shuttle
#

god reddit is clueless

stone sinew
torn shuttle
#

I know, maybe it's cheaper elsewhere but here iirc it was something like 50k € to set up

graceful turret
torn shuttle
#

oh wow it's actually way, way cheaper in the us

#

40-500 usd

#

damn

#

I wish

quaint mantle
#

make them lowercase
ID -> id
NAME -> name

graceful turret
#

why

quaint mantle
#

naming conventions. To not mess column name with actual sql syntax

#

you alse dont need text and blob

graceful turret
#

okay that makes sense

torn shuttle
#

yep double checked I am pretty sure the portuguese equivalent of an llc costs 50k€ just to set up

quaint mantle
#

for Name, use VARCHAR(16)
For uuid VARCHAR(36)
For ip VARCHAR(16)

graceful turret
#

varchar?

#

i didnt hear about it

torn shuttle
#

oh wait actually maybe a EIRL is the same but that's still 5k

#

whatever

graceful turret
quaint mantle
#

It should

old cloud
#

?paste

undone axleBOT
old cloud
#

solved

tropic kelp
#

How can I untrack an entity with my plugin? (so its non-ticking)
I already tried to remove the AI and disabled collisions.
And i set activatedTick to Integer.MAX_VALUE

digital rain
#

hey so why am i getting a nullpointerexception

old cloud
digital rain
#

how would i do so?

old cloud
#

assign a value to the variable
for example ArrayList<Player> playerList = new ArrayList<>();

digital rain
#

i meant like where would i do so, outside the events?

old cloud
#

Just where it is

maiden mountain
#

@digital rainYou also got typos in your methods

old cloud
#

that doesnt matter

digital rain
#

optionally it would be actually beneficial to save the list

old cloud
#

yes

quaint mantle
#

never store players

old cloud
#

Yea but I was still right so dont say no

torn shuttle
quaint mantle
#

still List<UUID> playerList = new ArrayList<>();

digital rain
#

ok ill do uuids! :)

torn shuttle
quaint mantle
old cloud
old cloud
#

nah

quaint mantle
#

find me one major java project where they specify arraylist

#

im waiting

torn shuttle
night copper
#

hi whats the problem?

quaint mantle
lavish hemlock
#

And even then, you're supposed to refer to the interface for conventional and OOP reasons.

quaint mantle
#

thanks maow

lavish hemlock
#

e.g. if the implementation is ever changed, you only have to change the new expression as opposed to every single usage of the type in your code base.

opal juniper
#

daily nugget of wisdom

quaint mantle
#

these damn youngins 👴🏿

#

never knowin how to code

digital rain
#

how would i convert uuid to player afterwards

quaint mantle
opal juniper
#

Bukkit.getPlayerExact()

torn shuttle
#

bro do you even have more than... 75 stars on your github projects

quaint mantle
digital rain
#

👍

lavish hemlock
quaint mantle
#

well, those are exposed in public and not deprecated, nothing in docs says you arent supposed to

lavish hemlock
#

well alright then

torn shuttle
#

only 1 star, not even an influencer programmer

#

gaze upon my mighty 76 stars and despair

lavish hemlock
#

my most was like 12 or 18

#

both were on shitty projects I discontinued lmao

opal juniper
#

my most is 10 smh

#

im basically unpopular

quaint mantle
#

ensureCapacity is useful when you wanna avoid unecessary array recreation, if you wanna add multiple elements at once

torn shuttle
#

bet yall aren't even getting sponsorships from gaming linters and rgb IDEs

digital rain
#

Also when im here i might as well ask, whats the best way to save variables and stuff

torn shuttle
#

print them physically, you never know when your computer might get set on fire

lavish hemlock
# old cloud assign a value to the variable for example `ArrayList<Player> playerList = new A...

Anyway to explain why you don't store Player instances in collections like this:
It's incredibly memory inefficient as you are storing a reference to a large object, therefore stopping the GC from claiming it when it is no longer in use (which I imagine Player instances are no longer in-use when they are removed from worlds/servers or whatever, but I'd have to confirm that myself)

torn shuttle
#

also player instances change when they log out and log back in which tends to be a way more pressing issue

lavish hemlock
#

Oh yeah that's also really bad.

torn shuttle
#

one of these breaks the plugin functionality and the other one saves you a few bytes, maybe start with the more important one

lavish hemlock
#

UUIDs are harmless though, so you should pretty much always use that over storing Players.

golden turret
#

do a infinite loop to run the gc