#development

1 messages · Page 145 of 1

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

glass mason
#

I'm not modifying it from inside

lyric gyro
#

It's hard to tell what's going on with so little context. Is any code running asynchronously/on new threads? Where are things added to/removed from the list?

glass mason
#

just when someone sends a message

#

only usage

#

as I said before ".......but on my computer nothing weird happens.."

#

this should work

lyric gyro
#

Is any code running asynchronously/on new threads?

glass mason
#

nope

#

those are the only usages of this list

lyric gyro
#

can you show more?

glass mason
#

yep

#

this code is so simple and doesn't have much code

#

I still think this is occurring due to replit issue

#

becuase this code run perfectly smooth on my computer

#

and the jar on my computer is the same jar on replit

#

I even recompiled it and repackage it

#

just to be sure

lyric gyro
#

Okay so you are creating new threads (readThread extends Thread (might want to rename the class itself to ReadThread though)), Server.messageHistory (it's a regular ArrayList which is not thread safe) is being modified from the whichever many client connection threads you create
Concurrency is a bitch, anything can happen

glass mason
#

can you suggest a solution that could work?

pure crater
#

You can make your list thread safe by using a concurrent implementation

#

So you won’t run into that issue

glass mason
#

what do you mean by saying concurrent implementation? I'm a begginer in java

winged pebble
#

Thread safe

glass mason
lyric gyro
#

this could be easy to fix without overengineering a solution but it might be a band-aid patch on the long run

lyric gyro
#

eeeck

dusky harness
#

not a concurrent list

#

but it'll work

lyric gyro
#

no it won't

dusky harness
#

oh

#

how come

#

ConcurrentLinkedDeque

#

:)

lyric gyro
#

That only allows single-thread access to each method (adds synchronized to every method), but once you get the iterator you are outside of the sync list itself and you're still gonna modify the list as you iterate it

dusky harness
#

oh

dusky harness
lyric gyro
#

They could use a CopyOnWriteArrayList instead of an ArrayList but that's gonna be funny for memory usage on the long run - or use some sort of (thread safe) queue to offer/pull messages between threads rather than iterating

glass mason
#

so what is the best way?

#

for short term

#

I dont really care much about this java application this is mainly for testing

dusky harness
#

I think

lyric gyro
#

uh i don't think a set is fit for this

dusky harness
#

oh wait which one

lyric gyro
#

any

dusky harness
#

ok edited

#

I was just looking at clients

lyric gyro
#

if I send two messages with the same contents then that's gonna be a no-go lol

dusky harness
#

yep

#

I didn't see messageHistory 🥴

glass mason
#

it's on server class

glass mason
lyric gyro
#

Quickest and dirtiest solution? Use a Collections.synchronizedList(new ArrayList) for messageHistory and use an indexed for loop (for (int i = 0; i < messages.size(); ++i)) with List#get(int index) instead of enhanced for loop (for (String message : messages))

#

But this is smelly lmao

dusky harness
#

although technically you can iterate through it and get the element that way 🥲

#

🥲

dusky harness
#

¯_(ツ)_/¯

glass mason
#

Thanks

lyric gyro
#

Concurrency is nasty, and doing it well isn't easy

lyric gyro
#

yee

glass mason
#

are you sure?

lyric gyro
#

uh, yes? thonk why

pure crater
#

I mean, it’s like the only import option lol

glass mason
#

i have an image to send

#

but i don't have the preivleges to send it'

#

maybe imgur will help

lyric gyro
#

you can use imgur or gyazo or whatever

#

yea

glass mason
lyric gyro
#

mh

pure crater
#

Lol

lyric gyro
#

err could you show the whole line? thonk

glass mason
lyric gyro
#

Also this is the solution to iterating a synchronizedList safely, I never read that lmao
CC @dusky harness

glass mason
#

oh nevermind

lyric gyro
#

so yeah you could do that with a synchronizedList instead of doing the indexed for loop

#

both solutions should work

glass mason
#

and what type of list is synchronizedList?

#

can i set the type?

lyric gyro
#

the actual class is implementation detail, you'd just use a List<String>

#

like List<String> messageHistory = Collections.synchronizedList(new ArrayList<>());

#

and then when iterating

synchronized (messageHistory) {
  for (String message : messageHistory) {
    // ...
  }
}
glass mason
#

Ok it fixed the error and now it doesn't show up in the console

#

but I still getting null in the client

#

please note that on my local machine it works fine

#

but on replit...

#

fine I dont really care about that server on replit, most important is that it actually works on my local machine perfectly fine

#

Another question - can I place the JDK folder or JRE in the project folder and run jdk/bin/javaw.exe -jar asdsd.jar and it will run on any machine?

wintry grove
#

I believe you can

#

thats how minecraft bundles the jre for example

#

now its my time to ask

#

can you spawn fireworks with different angles?

#

like I want to spawn one that goes to the right

#

and another that goes to the left

#

can you do so?

#

and how?

leaden sinew
wintry grove
#

I have seen it on another servers

#

it is

#

let me try

#

that works ty

leaden sinew
#

No problem

untold plinth
#

I keep getting "Caused by: java.lang.IllegalArgumentException: Cannot translate null text
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-31.0.1-jre.jar:?]
at org.bukkit.ChatColor.translateAlternateColorCodes(ChatColor.java:354) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at me.darklife12345.nsc.commands.Heal.colorize(Heal.java:117) ~[NSC-1.0-SNAPSHOT.jar:?]
at me.darklife12345.nsc.commands.Heal.onCommand(Heal.java:66) ~[NSC-1.0-SNAPSHOT.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
... 17 more"

neat pierBOT
untold plinth
winged pebble
#

FYI Objects.requireNonNull() does not fix NPE's it just makes them throw immediately instead of waiting till you attempt to access something on that variable

#

Basically the config is failing to get the Value of the key "No-Permission"

#

The yaml file is your config.yml?

warm steppe
#

Try without caps

edgy lintel
edgy lintel
#

i mean from your experience but not from the information of the post

upper jasper
#

1.9 and up supports custom models via durability and 1.14.4+ supports custommodeldata

edgy lintel
#

oh alr thx a lot

#

where can i learn about both spigot and minecraft updates 1.9+
like the most quickest and summarising soures

#

cuz I feel like im lagging behind everyone else

lyric gyro
#

you can't quickly summarise almost 9 years worth of updates

#

for mc itself check each major update's wiki page in the mc fandom
for spigot either the update threads on spigotmc.org or each version's javadoc

edgy lintel
#

alright thx a lot

#

thats gonna take hell lots of time xd

errant kraken
#

(\[?#[a-fA-F0-9]{6}]?)|(&[0-9a-fk-or]) how can I get all matches for this regex? I don't understand how matcher.group() works.. when I try group() it only returns one result every time

dense drift
#

you use a while (matcher.find())

errant kraken
#

I do

dense drift
#

and what's the problem?

#
// &aHey &cThere
while (matcher.find()) {
  matcher.group()
}

// &a
// &c
untold plinth
winged pebble
untold plinth
#

I was stupid

#

I mixed up the comments

#

I put // instead of #

round smelt
#

Hello everyone !
Someone want me to create an add-on of Guilds. (https://www.spigotmc.org/resources/guilds-30-sale.66176/)
I have a problem with the API: GuildsAPI class doesn't exist.

Version I'm using: 3.5.6.4-SNAPSHOT
Error message : Cannot resolve symbol 'GuildsAPI'

Feel free to ask questions !
Thank you 🙂

wise steeple
#
    public DataManager(StartupClass plugin) {
        configFile = new File(plugin.getPlugin().getDataFolder(), "data.json");
        System.out.println("1");
        try {
            fileWriter = new FileWriter(configFile);
            System.out.println("2");
        }catch(IOException e){
            e.printStackTrace();
            System.out.println("err");
        }
        initializeConfig();
    }
    
    /**
     * Should only be used by this class to grab/create the config
     */
    private void initializeConfig() {
        
        try {
            if (!configFile.exists()) {
                gson.toJson(new Data(), fileWriter);
                System.out.println("4");
            }
            config = gson.fromJson(new FileReader(configFile), Data.class);
            System.out.println("5");
        } catch (IOException e) {
            System.out.println("6");
            e.printStackTrace();
        }
    }
    
    /**
     * Gets the Data object the config is held in.
     * @return Returns the config object.
     */
    public Data getConfig() {
        return config;
    }

GetConfig is returning null
1,2,and 5 print

hoary scarab
wise steeple
#

i did a chuck

#

Imma try and make it final

#

Ig making is final fixed it 💀

#

So it must have been changed somewhere

#

i gotta find that

hoary scarab
#

👍

wise steeple
#

IT WORKY!

sudden sand
#
        if (plants.containsKey(world.getName()))
            return;

        PlantTicker plantTicker = new PlantTicker(world);

        plants.put(world.getName(),plantTicker);

        System.out.println(plants.keySet().toString());
    }``` Can someone tell me why it prints an empty array ?
high edge
#

Where are you creating the array

sudden sand
#

it a hashmap

tender thicket
#

Hey folks I have a pretty hefty set of questions for yall

#

I'm trying to create a new api to be used in place of the bukkit scheduler. However, I'm using ProjectReactor, to ensure the scheduled tasks are all reactive and non blocking. My first question is, how would I get the service in question able to be executed on a new thread?
My second question is: how can I make a service execute repeatedly, and how can I delay it?
Third and final question: would the actions in question be considered asynchronous as they're operating on parallel threads and not on the main thread?

hoary scarab
tender thicket
#

I have a bit of what I threw together the other day uploaded to github but it's not anywhere near done

#

Take a look at this

#

This is what I'm using to make the API

sudden sand
round smelt
high edge
edgy lintel
# sudden sand private final Map<String, PlantTicker> plants = new ConcurrentHashMap<>();

sth to do with keyset prolly
See here

||keySet: The view's iterator is a "weakly consistent" iterator that will never throw ConcurrentModificationException, and guarantees to traverse elements as they existed upon construction of the iterator, and may (but is not guaranteed to) reflect any modifications subsequent to construction||

It’s not guaranteed to reflect any modifications made

#

Try doing thread.sleep maybe for even like 3 ms and see if the changes is posted

sterile hinge
#

that won't change anything as

and guarantees to traverse elements as they existed upon construction of the iterator

#

having random sleeps in your code isn't how you solve threading issues, but this isn't a threading issue anyways

edgy lintel
# sterile hinge having random sleeps in your code isn't how you solve threading issues, but this...

Retrieval operations (including get) generally do not block, so may overlap with update operations (including put and remove).

This statement implies that put is non blocking too and is async to be overlapping with another async function

So the get function may have preceded set function

And the other problem may be that all sync operations are done before async operations

So this can be a thread problem

#

And indeed sleep may not solve this issue but at least it will test if this is indeed the issue

sterile hinge
#

no

#

threading issues can only appear if multiple threads are involved

#

and "non blocking" is often confused, because the method actually does not return until it did its work.

edgy lintel
#

Depend on your definition of threading issues

#

The set operations create a new thread apart from the main thread,which is exactly the definition of non blocking

#

So it’s effects have to be delayed after all synchronous operations finish

edgy lintel
#

What do you mean

#

If an operation is non blocking it means that the operation is async

#

I’m talking about the operation not the function

sterile hinge
#

please read the documentation instead of spreading false information

#

CHM does not create any threads at any point

#

retrieval operations don't block, but that still doesn't mean those methods run anything async

merry knoll
edgy lintel
#

My mistakes

merry knoll
#

unless the person is calling from another thread (even then should be no issue as the retrieval and put is on the same thread)

edgy lintel
#

Should be synchronisation issues

#

Or locking sequence or sth

#

But delaying get for a few ms certainly would help

sterile hinge
#

If the code is as shown, there is only one thread involved

merry knoll
#

so that should not cause an issue

sterile hinge
#

Yeah

edgy lintel
#

Yes my mistakes

merry knoll
#

i just tested, putting and pulling from a concurrent hashmap works fine

#

so my bet is there is somehow an issue maybe with the objects that they are putting in

#

but they didnt say anything about npe either so

edgy lintel
#

I mean it can be inherent thread design problem

sterile hinge
#

It’s probably just a weird toString method lol

edgy lintel
#

Like the synchronise or read and write block problem

merry knoll
edgy lintel
#

hmm

#

But at least it would have the pair of []

merry knoll
#

quite sure its safe up to? 16?? operations at the same time

#

depending on the segment

glass bay
#

How can I check if a player used a totem of undying? Is there a event for that?

glass bay
#

I know

#

but i wanna like check if a player used a totem with a custom disaplayname

#

and then do stuff

boreal mortar
#

Hiiiii does anyone know how to make a symbol using photoshop or something im working on a t shirt and need a symbol to put on the sleeve please DM 😊

mystic gull
#

Hello im using commandNPC plugin but when im going too far from my npc and i come back i can see his name on tablist for a second

#

how could i fix it

merry plover
mystic gull
merry plover
#

It will do it as long as it is player NPC, if you make the type like a villager or something, it won't do it anymore

mystic gull
#

oh ok ty, but how could i change the NPC type ?

mystic gull
merry plover
#

Of course it will, as i said, this problem will always occur with player NPC type, you cant do anything about it

nimble vale
#

should i use local sqlite and also mysql at the same time in case of something happen to mysql in another server

#

like a backup plan

#

if there is a way to know that mysql connection closed i can stop server basically thats the best option i believe but idk if it is possible

lyric gyro
#

Then do your stuff

broken elbow
#

no. they mean if the totem they used had a custom display name

lyric gyro
#

O

#

He can get the players inventory though right? Or is it fired after the totem disappears?

broken elbow
#

the event is fired before. but you can't be sure which totem is used. at least idk if you can

lyric gyro
#

Cause I feel like if that doesn’t work he can just use the damage event cleverly enough

lyric gyro
#

;d spigot EntityReserructEvent

#

How did it work again 🤨

dusky harness
#

🥲

#

oh

unique rain
#

кто русский?

dusky harness
unique rain
#

Help, why did PlaceholderAP stop working?

night ice
#

https://www.toptal.com/developers/hastebin/wowunusoxu.md

Anyone know the reason for this error

[17:28:15 WARN]: [io.alenalex.github.codegenerator.shaded.hikaricp.hikari.pool.ProxyConnection] HikariPool-1 - Connection com.mysql.jdbc.JDBC4Connection@3354c77c marked as broken because of SQLSTATE(08S01), ErrorCode(0) com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
zenith trout
#

Hi i use DeluxeMenus and i have setup a gui, with command but i have some problems to get the username in the command, eks /rank (user) (group), what can i use on user to get the user of the gui?

worn jasper
#

Hi, If I put this inside an async task:

Bukkit.getScheduler().scheduleSyncDelayedTask(plugin,() -> {
  for (var block : blocksToRemove) {
    block.setType(Material.AIR);
  }
});```
Why would it still give an error that it's being executed in an async task? The idea is to execute this sync after the async task
dusky harness
upper jasper
#

Why is it a delayed task without any delay specified?

dusky harness
#

line 29 in the hastebin

worn jasper
#

oh ye right

#

sorry

#

didn't notice it

#

thx

upper jasper
lyric gyro
#

I'd use runTask though

#

It's no different, just the naming and the depreciation

edgy hearth
#

my plugin is loading before the dependencies and that's why it's giving an error, what can I do?

pure crater
#

We need more information than that

#

Give us code, some context

high edge
#

Depend/soft depend on your dependencies so spigot forces it to load after them

edgy hearth
#

I tried also to put softbefore but did not solve
"depend: [LuckPerms, HolographicDisplays]" "softbefore: [LuckPerms, HolographicDisplays]"

#

I tried to use depend: as it usually is, and it didn't work so I put the softbefore but it didn't work either, I tried to use both but it didn't work either

#

Luckyperms keeps starting right after my plugin and not before. I tested starting the server after giving /reload the plugin and the plugin worked, but when I start the srv with the plugin it remains the same error

lyric gyro
#

it's softdepend if it's an optional dependency, or just depend for a required dependency

#

also forge + bukkit 💀

warm steppe
#

YamlConfiguration iirc

lyric gyro
#

what now?

edgy hearth
#

MoHitts

edgy hearth
wintry grove
#

ew mohist

#

fricking bugged

#

I dont know how to talk

glass bay
#

How can I detect if a player gets their hit blocked from another players shield?

warm steppe
#

Damage event -> get dealt damage

#

Idk if theres an event for that

edgy lintel
#

Use entitydamagebyentityevent
And check if the damage cause is Entityattack
And also check if getfinaldamage is 0 plus if get Entity is player and is holding shield

mystic gull
#

Hello im using wg api but i cant find a class named BlockVector2D

#

But some methods ask me BlockVector2D as parameters

dense drift
#

I believe it is from worldedit

#

ye com.sk89q.worldedit.BlockVector2D

mystic gull
leaden sinew
worn jasper
#

Hi, could anyone explain me this? a bit confused on the meaning/function of it

dense drift
#

it will remove the entity from the world

icy shadow
#

but it's worded like that because it won't necessarily be removed in that same tick afaik

dense drift
#

no, it is worded like that because md sucks as writing documentation, wdym

worn jasper
#

oh, understood, thanks.

worn jasper
#

Uhm quick question, any way to deserialize a text with MiniMessage and return a string instead of Component?

#

tried toString, but kinda returns this

#

(Trying to set the name of an armorstand btw, which doesn't accept components)

icy shadow
#

you have to serialize the component in some way

#

if you want it in § form then use LegacyComponentSerializer

lyric gyro
worn jasper
#

sooo

#

uh

dense drift
#

ah ah

worn jasper
#

I serialize, the deserialized component?

icy shadow
#

pretty much

worn jasper
#

bruh ok

#

ty

dense drift
#

You can either use what BM suggested, or try to set the name using reflections, that should work

worn jasper
#

k ty

#

uh seems like serializing a deserialized string doesn't rlly work

lyric gyro
worn jasper
#

@lyric gyro

#

setCustomName() method

#

for armostands

worn jasper
#

OOOOH

#

that makes a LOT of sense now

#

thx a lot

#

sometimes forget about paper xD

lyric gyro
#

lol

worn jasper
#

uhm another quick question, anyways to fix this "shadow glitch"?

#

like, since the armorstand is inside the block, it displays the name like it's "suffocated" or well, "inside a block"

lyric gyro
#

setMarker(true)

worn jasper
#

okay, thx

lyric gyro
#

that will get rid of the hitbox altogether so you need to place the armour stand where you actually want it to be

#

i.e. above the thing rather than trickily below

worn jasper
#

oh

#

so the location I give is exactly where it will display the text?

lyric gyro
#

yea

worn jasper
#

k thx

#

Oh also, entities, specifically armorstands, can't be removed async right?

#

Does that also apply to spawn?

lyric gyro
#

it applies to every entity

worn jasper
#

okay thanks.

#

Uhm, any ideas on how I can serialize an armorstand?

dusky harness
#

I don't think you can serialize the entity itself

#

¯_(ツ)_/¯

lyric gyro
#

welll

#

you "can", you just are very very very much not supposed to do it

#

usually you save data that refers to the entity, like the UUID

worn jasper
#

Well, actually, no need to serialize it, found another way, but thanks. Also, any way to prevent like, the armorstand being visible for a mili second?

lyric gyro
#

what millisecond?

#

when?

worn jasper
#

like when I spawn the armorstand

#

I can see it for a millisecond

#

it doesn't go invisible directly

lyric gyro
#

use the spawn method that takes a Consumer, and in that lambda you can "configure" the entity before it's added to the world

lyric gyro
#

.spawn(loc, ArmorStand.class, armorStand -> {...})

#

or whatever the param ordering is

worn jasper
#

ye it's that, thanks.

worn jasper
#

Any ideas why this loc.getNearbyEntitiesByType(ArmorStand.class, 0, 3); could not be detecting the hologram?

#

the yRadius is 3 just to make sure, but it apparently can't find it

#

I turned the collecetion into a List, and tried getting the first item

#

and got an java.lang.IndexOutOfBoundsException: error

#

quite confused, doesn't it detect Armorstands specifically?

dense drift
dense drift
worn jasper
#

but the issue is I don't want the armorstands in the right or left lol

#

maybe 0.2? or something

#

works?

#

will just try it

#

okay, doesn't give the IndexOutOfBounds Exception anymore but...

#

doesn't rlly delete the armorstands lol

#

basically doing this:

var entities = location.getNearbyEntitiesByType(ArmorStand.class, 1, 3);
var list = new ArrayList<>(entities);
(ArmorStand) list.get(0).remove();
dense drift
#

why dont you get the entity by its id or something

dusky harness
#

try printing out the armorstand location and the location location

worn jasper
dense drift
#

getUniqueId

worn jasper
#

ye quite stupid question xD

#

ty

kindred yew
#

Im not done with this but It constantly says its incorrect and does not tab complete, Im new and am following a tutorial and even though I have all the same things it tells me im wrong

#
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.ExpBottleEvent;

public class XpBottleBreakListner Listener {

    @EventHandler
    public void onXpBottleBreak(ExpBottleEvent e){
        Block block = e.getHitBlock();
        block.breakNaturally();
    }
}
dusky harness
#

you have to implement Listener

#

XpBottleBreakListner implements Listener

kindred yew
#

There we go! thank you

#

I keep getting a error in when trying to register the events

#

It says that it expected a ) after plugin:

#

import com.pukinetwork.debuffban.debuffban.listeners.XpBottleBreakListner;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityToggleGlideEvent;
import org.bukkit.plugin.java.JavaPlugin;

public final class DebuffBan extends JavaPlugin {

    @Override
    public void onEnable() {
        // Plugin startup logic

        getServer().getPluginManager().registerEvents(new XpBottleBreakListner(), plugin:this);

    }

}```
dusky harness
#

you might see that if the IDE supports it - it just shows what the parameter is asking for, but it's not part of the actual java code

kindred yew
#

ohh ok

lyric gyro
#

@worn jasper you could try saving the stand's chunk & UUID, and then load the chunk and get the entity by its UUID

#

far more reasonable than aimlessly trying to get it with the location alone lol

worn jasper
#

yup, that's exactly what I did

#

Thanks either way!

#

Only saw the message now.

mystic gull
#
@Override
    public void onLoad() {
        
        preRegion1 = WorldGuardPlugin.inst().getRegionManager(Bukkit.getWorld("lobby")).getRegion("prehistoire").getPoints().get(1);
        preRegion2 = WorldGuardPlugin.inst().getRegionManager(Bukkit.getWorld("lobby")).getRegion("prehistoire").getPoints().get(1);
        double xMiddle = (double) ((preRegion1.getBlockX() + preRegion2.getBlockX()) / 2);
        double zMiddle = (double) (preRegion1.getBlockZ() + preRegion2.getBlockZ()) / 2;
        Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
            @Override
            public void run() {
                System.out.println(Bukkit.getWorld("lobby").getEntities().size());
                if(Bukkit.getWorld("lobby").getEntities().size() < 15){
                    System.out.println("1");
                    double xPos = ThreadLocalRandom.current().nextDouble(xMiddle, xMiddle-preRegion1.getBlockX());
                    double zPos = ThreadLocalRandom.current().nextDouble(zMiddle, zMiddle-preRegion1.getBlockZ());

                    MobManager.spawnMob(xPos, zPos, Bukkit.getWorld("lobby"));
                }
            }
        }, 0L, 120L);
    }
#
[23:27:25 ERROR]: null initializing EvoPlugin v1.0 (Is it up to date?)
java.lang.NullPointerException
at com.sk89q.worldguard.bukkit.WorldConfiguration.getBoolean(WorldConfiguration.java:217) ~[?:?]
at com.sk89q.worldguard.bukkit.WorldConfiguration.loadConfiguration(WorldConfiguration.java:342) ~[?:?]
at com.sk89q.worldguard.bukkit.WorldConfiguration.<init>(WorldConfiguration.java:209) ~[?:?]
at com.sk89q.worldguard.bukkit.ConfigurationManager.get(ConfigurationManager.java:228) ~[?:?]
at com.sk89q.worldguard.bukkit.WorldGuardPlugin.getRegionManager(WorldGuardPlugin.java:972) ~[?:?]
at fr.palmus.plugin.Main.onLoad(Main.java:191) ~[?:?]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:297) [server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.reload(CraftServer.java:739) [server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.Bukkit.reload(Bukkit.java:535) [server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) [server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchServerCommand(CraftServer.java:627) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.aO(DedicatedServer.java:412) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:375) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [server.jar:git-Spigot-db6de12-18fbb24]
#

Hello im using world edit/guard api but i dont understand why i receive a NPE at preRegion1

#

The selected region exists

lyric gyro
#

pretty sure you can't do that in onLoad, needs to be in onEnable

#

well, at least in modern versions lol

leaden sinew
#

I asked in their discord, but I have this issue with the ShopGUI+ API and maybe someone else has had it and knows how to fix it.

I get this error when registering an ItemsProvider with ShopGUIPlus:

13.07 20:36:50 [Server]  [ShopGUIPlus] Task #109 for ShopGUIPlus v1.77.4 generated an exception
13.07 20:36:50 [Server] INFO java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.meta.ItemMeta.setLore(java.util.List)" because "<local2>" is null
13.07 20:36:50 [Server] INFO at net.brcdev.shopgui.util.ItemUtils.loadItemMeta(ItemUtils.java:487) ~[ShopGUIPlus-1.77.4.jar:?]
13.07 20:36:50 [Server] INFO at net.brcdev.shopgui.util.ItemUtils.loadItemStackFromConfig(ItemUtils.java:110) ~[ShopGUIPlus-1.77.4.jar:?]
13.07 20:36:50 [Server] INFO at net.brcdev.shopgui.config.Settings.loadItemStacks(Settings.java:133) ~[ShopGUIPlus-1.77.4.jar:?]
13.07 20:36:50 [Server] INFO at net.brcdev.shopgui.ShopGuiPlugin.loadAfterServerLoaded(ShopGuiPlugin.java:228) ~[ShopGUIPlus-1.77.4.jar:?]
13.07 20:36:50 [Server] INFO at net.brcdev.shopgui.task.LoadShopsTask.run(LoadShopsTask.java:26) ~[ShopGUIPlus-1.77.4.jar:?]
13.07 20:36:50 [Server] INFO at org.bukkit.craftbukkit.v1_18_R2.scheduler.CraftTask.run(CraftTask.java:101) ~[pufferfish-1.18.2.jar:git-Pufferfish-72]
13.07 20:36:50 [Server] INFO at org.bukkit.craftbukkit.v1_18_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483) ~[pufferfish-1.18.2.jar:git-Pufferfish-72]
13.07 20:36:50 [Server] INFO at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1175) ~[pufferfish-1.18.2.jar:git-Pufferfish-72]
13.07 20:36:50 [Server] INFO at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:318) ~[pufferfish-1.18.2.jar:git-Pufferfish-72]
13.07 20:36:50 [Server] INFO at java.lang.Thread.run(Thread.java:831) ~[?:?]

It doesn't happen when the ItemProvider isn't registered

onyx kayak
#

Would the DeluxeMenu developers be interested in changing the EventPriority for its PlayerCommandPreprocessEvent listener (in PlayerListener) from LOWEST to LOW? I maintain a plugin for creating Bedrock Edition Forms and I provide a way of intercepting commands so that server owners can instead show forms to bedrock edition players. The problem is that DM uses the LOWEST priority so I cannot modify the event before DM does its thing. It would be nice if DM also ignored the event if it was cancelled.

The workaround for this is setting the DM menu to register_command: true but that isn't really a solution for users that use DM to intercept commands from other plugins. Or just not using open_command.

spring current
#

{"providers":
[
{"type":"bitmap","file":"custom/admin.png", "ascent":7,"height":7,"chars":["ꈁ"]}

]

}

#

Umh whats wrong here doesn anyone know

leaden sinew
onyx kayak
#

How would that help?

leaden sinew
#

It should make your listener register first

#

Oh wait

onyx kayak
#

if its the same priority?

leaden sinew
#

Other way around

#

I think it might be loadbefore

leaden sinew
onyx kayak
#

Ill try both, thanks so much!

leaden sinew
#

softdepend definitely won't work

#

It will make yours load after

onyx kayak
#

Yeah that would make sense

leaden sinew
onyx kayak
#

and then i'll use event#setMessage to obfuscate it or something awful so that DM doesn't pick up on it 💀

leaden sinew
#

lol

edgy lintel
#

what is 1.8 equivalent of packetplayoutstopsound?

#

do I just play the same sound and set the volume to 0?

#

pls ping if you are available for help, thx

high edge
#

Most likely

edgy lintel
#

nope it does not work

weak bronze
#

hi

#

i have a question

neat pierBOT
#

There is no time to wait! Ask your question @weak bronze!

weak bronze
#

i have create a gui for control the players.

#

and for get the player info, i am using this:

#

String book_gui_lore2 = PlaceholderAPI.setPlaceholders(event.getRightClicked().getName(), book_gui_lore);

#

is an invalid method

weak bronze
#

?????????

high edge
#

First parameter takes in a player instance, not their name

#

And the second one takes in a string

weak bronze
#

ah

#

thanks, work

merry knoll
#

also check out naming conventions of java

edgy lintel
#

this is custom model data in 1.9

{
  "parent": "item/handheld",
  "textures": {
    "layer0": "items/wood_hoe"
  },
  "overrides": [
    {"predicate": {"damaged": 0, "damage": 0.01666666666667}, "model": "item/my_cool_custom_item"}
  ]
}

what does damaged and damage mean respectively?

lyric gyro
#

Don't @ me though I've no idea lol, just a guess

edgy lintel
#

oh alr that makes sense actually
just gonna double check if its true
thx a lot kind man!

dense drift
#

it probably means whether the damage is displayed or not

edgy lintel
#

ohhhhh

#

thx a lot man appreciate it

edgy lintel
#

🙏 🙏 🙏

lyric gyro
leaden maple
#

how can i code when a block is broke set to a other block and give player a amount of money and wait 5 seconds and set to other block

merry knoll
leaden maple
#

so where do i place it here

merry knoll
#

no you cant copy it, it aint code

leaden maple
#

import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.inventory.ItemStack;

public class IronBreakListener implements Listener {
@EventHandler
public void onPlayerBlockBreak(BlockBreakEvent event) {
Block brokenIore = event.getBlock();

    if (brokenIore.getType() == Material.IRON_ORE) {
        event.setCancelled(true);
        brokenIore.setType(Material.BEDROCK);
        ItemStack brokenioreDrop = new ItemStack(Material.IRON_INGOT, 5);
        brokenIore.getWorld().dropItemNaturally(brokenIore.getLocation(), brokenioreDrop);

    }

}

}

leaden maple
#

i am ne

#

new

merry knoll
#

what you want is runtasklater

#

for your 5 seconds delay

#

and for money, you need to hook up with whatever econ plugin you normally use

#

through their api if they got one

leaden maple
past ibex
#

By finding their GitHub and then following the tutorial

merry knoll
leaden maple
past ibex
#

Have you tried looking at java docs or googling?

#

There’s a decade of bukkit tutorials

leaden maple
past ibex
#

Don’t Google so specific things

#

Google how to use bukkit scheduler

#

Google how to detect block break

#

Google how to set block

leaden maple
#

yes i have a block break system

#

but now you get naturaldrop

past ibex
#

Google how to use vault

leaden maple
#

look

#

i am dutch so

#

if you break iron block

#

it becomes a bedrock

past ibex
#

I’m trying to avoid spoonfeeding and make you learn

leaden maple
#

but i want that you get money if you break

leaden maple
merry knoll
#

did you check the links i sent you

#

all the info you need is there

leaden maple
#

but i dont understand

#

so

#

and i dont find it easy to find code that i can put here

#

look this is the code for my event now

#

if you press you see my event

#

and i want that you get money instead of the naturaldrop

#

@support pls help me

leaden maple
#

so BukkitScheduler

past ibex
#

If we answer all your questions directly instead of helping you learn, you will perpetually ask more questions

leaden maple
#

i am gonna watch a tutorial

past ibex
#

You also might want to learn Java before bukkit

leaden maple
dusky harness
leaden maple
#

but now if i break iron the iron becomes bedrock but i dont know how to wait 5 sec and set it back to iron

dusky harness
merry knoll
#

Bukkit.getScheduler().runTaskLater(this, new Runnable() {
@Override
public void run() {
//code here
}
}, ticks);

leaden maple
#

all the code

merry knoll
#

but, you need to learn java

dusky harness
#

well to delay 5 seconds

merry knoll
#

there is no going around it

dusky harness
#

I googled

spigot delay 5 seconds
and that's the first result

dusky harness
merry knoll
leaden maple
#

red

dusky harness
#

Well their plugin structure, etc might not be the exact same as yours, so you can't just copy and paste

#

you have to code it yourself too

#

they're just guiding you

leaden maple
#

ow

past ibex
#

Yeah I’d suggest learning java or paying someone to develop

wintry grove
#

at least help them explaining or something bruh

#

what it does is that it schedules a task that will run 100 ticks later

#

20 ticks = 1 second

#

so 5 seconds

#

the problem with that is that the schedule task is deprecated

#

if you are using paper iirc

#

you can also do:

new BukkitRunnable() {
    @Override
    public void run() {
        //you do your stuff here
    }
}.runTaskLater(pluginInstance, 100)
#

if you want to be able to change the length of the delay

#
new BukkitRunnable() {
    int seconds = 5;
    @Override
    public void run() {
        //you do your stuff here
    }
}.runTaskLater(pluginInstance, seconds * 20L)
lyric gyro
#

uh yeah that's not gonna work

wintry grove
#

that has worked for me

#

ig

lyric gyro
#

that literally does not compile lol

dense drift
#

Emily is talking about seconds being defined inside the runnable

wintry grove
#

I have actually done that

#

lmao

#

and it works

lyric gyro
#

it literally does not compile

icy shadow
#

are you sure?

#

i mean he said it works

lyric gyro
#

I am totally certain

sweet scaffold
#

pretty sure I've used that before

wintry grove
icy shadow
#

maybe check again

wintry grove
#

I have done it

#

it does work

lyric gyro
#

bruh of course that part compiles

sweet scaffold
#

;-;

lyric gyro
#

you can't use count outside tho

wintry grove
#

what

lyric gyro
wintry grove
#

ohhhhhh

#

breh

#

I added that bc of the forum post dkim sent

viral moth
#

that will schedule a sync task and it is not deprecated

lyric gyro
#

schedule*Task has been deprecated since forever lmao

pure crater
#

For some reason, I have been having trouble using SplittableRandom. I first tried RandomGenerator.getDefault(), however, I would get an error saying that No implementation of the random number generator algorithm "L32X64MixRandom" is available. So then I tried RandomGenerator.SplittableGenerator.of("L32X64MixRandom") in order to try to specify the implementation to use. However, I still get the same exact error.

What is weird is that when clicking on the SplittableRandom interface and clicking on View Implementations, I can see the source code for the L32X64MixRandom class. However, when I try to import the class, Intellij cannot identify the class.

#

So after some research it turns out some JDK's don't actually have the implementations?

#

I ended up using a faster random utility class outside the jdk

lyric gyro
#

But Spigot's class loading does some weird bullshit that for whatever reason excludes some of the default jdk modules from being included

#

jdk.random being one of them

#

Actually I believe it's some Paperclip thing

#

Which can be easily solved by using not paperclip, but a bundler jar

pure crater
#

That being said

#

I don't know whatever classloader BS is going on behind there

#

but its causing ServiceLoader to just not work

#

and it fucks up many libs and implementations

lyric gyro
#

mhm

#

some things service loader relies on won't work properly for some weird quirks PluginClassLoader does

pure crater
#

i remember i had to copy a whole library (copy all the classes over) cause it used ServiceLoader

#

it was not fun

delicate atlas
#

Hello @everyone
-I am a computer science student that is struggling financially due to the economic crisis in my country.
-I can give you tutoring, make your projects, help you with your assignments , essays, exams.
-I tutor java , c++ , front end web programming , react js ,vb, microsoft apps(ppt,word,excell...), Math,physics
-My prices are so cheap and affordable, contact me for more details.

high edge
merry knoll
#

gotta love the everyone attempt

edgy lintel
spare quiverBOT
#

The 'everyone' mention is disabled so you can't annoy people.

solemn ocean
#

Guys emojis in minecraft chat are avaiable also on tab list or there arent emojis avaiable there in 1.19?

stuck canopy
#
    public void onPlace(BlockPlaceEvent e) {

        Player player = e.getPlayer();

        if (!e.isCancelled()) {

            if (e.getItemInHand().isSimilar(SnowMinion)) {

                player.getInventory().removeItem(SnowMinion);
                ArmorStand stand = (ArmorStand) e.getBlock().getWorld().spawnEntity(e.getBlock().getLocation(), EntityType.ARMOR_STAND);

                stand.setHelmet(new ItemStack(Material.PLAYER_HEAD));
                stand.setChestplate(SnowMinionChestPlate);
                stand.setLeggings(SnowMinionLeggings);
                stand.setBoots(SnowMinionBoots);
                stand.setItemInHand(new ItemStack(Material.DIAMOND_SHOVEL));
                stand.setArms(true);
                stand.setGravity(false);
                stand.setVisible(true);
                stand.addEquipmentLock(EquipmentSlot.HAND, ArmorStand.LockType.REMOVING_OR_CHANGING);
                stand.addEquipmentLock(EquipmentSlot.HEAD, ArmorStand.LockType.REMOVING_OR_CHANGING);
                stand.addEquipmentLock(EquipmentSlot.CHEST, ArmorStand.LockType.REMOVING_OR_CHANGING);
                stand.addEquipmentLock(EquipmentSlot.LEGS, ArmorStand.LockType.REMOVING_OR_CHANGING);
                stand.addEquipmentLock(EquipmentSlot.FEET, ArmorStand.LockType.REMOVING_OR_CHANGING);
                stand.setInvulnerable(true);
                stand.setSmall(true);
                e.setCancelled(true);
                player.sendMessage("worked");
            }
#

help

#

why does it not show leggings and boots

#

on the armors stand

stuck canopy
#

ohh I think I got the problem

#

its probably coz I forgot to set the itemmeta to the specified meta

worn jasper
#

Hi, so, right now I have this method, which well, as the name says, is supposed to delete a hologram with the specified uuid in the location's chunk:

#

The issue I am having, is that, whenever I unload the chunks, and wait a bit, and load them again, it seems like, this method can't find the hologram??

#

Do the armorstands change the UUID or something?

mental cypress
#

Have you tried using equals() instead of ==?

icy shadow
#

yeah that is definitely not gonna work

#

equals is the way to go

worn jasper
#

oh so that's the issue?

#

lol

mental cypress
#

Possibly!

worn jasper
#

Hmm, will test it then, thanks lol

#

quite a stupid mistake

#

still get sometimes confused when I should use == and when I should use .equals

#

since both can compare objects

icy shadow
#

you almost always want .equals

#

that's pretty much it

high edge
#

== only for numbers

#

(mostly)

dusty frost
#

so if they are not referencing the exact same object, it will not be true

#

.equals() methods are user-defined, which, especially in this case with objects being loaded and unloaded by the garbage collector, is what you want

#

when you're using enums (like you are above) or numbers, you want to use == as you can't use .equals

icy shadow
#

yes you can

#

but it's just the same as ==

dusty frost
#

oh you can on enums, sorry

#

not on numbers

high edge
#

cast to string then use .equals like a true dev

worn jasper
#

Thanks a lot for the explanations guys!

hoary scarab
worn jasper
hoary scarab
#

Also with holograms I know it's a bit more advanced but I recommend looking into nms and using packets. Otherwise your gonna be running things on the main thread which won't be to beneficial in terms of performance.

worn jasper
#

Will look into it! Thanks.

lyric gyro
#

so long you spawn armour stands with ticking disabled it's not a concern whatsoever

shell moon
#

Best way to make the arena restoration system for a minigame? (Maybe an api ready to use? xd)

shell moon
#

Api i guess?

warm steppe
#

wit this you basically scrate a "slime" world and load it when you need

#

players can brak/place stuff and then you can just reload the map

#

meaning it doesn't save map progress

fresh anvil
#

does anyone know of a way to reduce/remove the invulnerability of the player when they have a wither/poison level higher than 3?

shell moon
#

Sounds good but couldnt find the method to save the map (i mean i saw the saveWorld but didnt find what byte[] was required)

viral moth
#

if it's not huge huge then I'd just use FAWE and use a schematic to paste the whole build async

#

otherwise if it's a huge thing then you might be better off unloading the world, changing the region files, and reloading it. that's only if it's stupid big haha

#

at that point just dont save the chunks lol

shell moon
#

Minigame, might be 50x50 or 1000 x1000 or more

#

Depends on the owner and the map he uses i guess

lyric gyro
#

Slime worlds are perfect for minigames

#

Or rather, minigame worlds are perfect for the Slime format

edgy lintel
high edge
#

Why you on 1.9 is the real question, and also yea probably

edgy lintel
#

1.9 is good version

broken elbow
#

why 1.9 tho?

tacit quail
broken elbow
#

what thought train made you choose 1.9? I am really really curious

tacit quail
#

just go back to 1.8.9 aat that point

#

at least u get combat

edgy lintel
#

1.9 for a bit of custom model data

#

kinda wanna fiddle with models and make my own vehicles or sth

broken elbow
#

custom model data was added in 1.14

edgy lintel
#

tried it and it works

broken elbow
#

yes. but that's not custom model data.

edgy lintel
#

thats similar to

high edge
#

Just use latest?

broken elbow
#

why do that when you can use legacy stuff? xD

errant kraken
#

which one would be better performance-wise for checking something every tick, relative to every player: using PlayerMoveEvent or using a repeating scheduler?

dusty frost
#

well it kinda depends on what you're doing

#

are you checking something every time a player moves? because there can be a ton of those every tick

#

or are you checking for like one thing every tick?

errant kraken
dusty frost
#

yeah so that wouldn't really be a very good use case for PlayerMoveEvent, as they would have to move to see the boss bar?

errant kraken
#

well yeah, and if they are no longer looking, the bossbar disappears

dusty frost
#

yeah but they can rotate their camera without PlayerMoveEvent firing

#

I mean either way it's not going to be great for performance, but it doesn't really make sense tying pitch/yaw to x/y/z movement

errant kraken
#

what if they move without rotating their head and a player pops in their view?

dusty frost
#

then the every tick check will get it?

#

what if they rotate their head without moving and a player pops into view?

#

PlayerMoveEvent won't show them a bossbar lmao

errant kraken
#

why not? the x,y,z will change, but not the yaw and pitch, PlayerMoveEvent fires when either of these change

dusty frost
#

PlayerMoveEvent fires on pitch/yaw? I thought it was only x/y/z changes

errant kraken
#

yeah

dusty frost
#

If so, then it doesn't really matter, though depending on how events are handled, it'll probably be better to listen to that event (if it only can happen once per tick per player)

broken elbow
#

every single player move triggers player move

#

event

dusty frost
#

weird

#

i would've thought there'd be separate x/y/z movement and pitch/yaw move events

errant kraken
dusty frost
#

well i doubt that'll really be happening often, but moreso just less players if the events are capped to once per tick per player

#

whereas the scheduler will iterate over every player every tick no matter what

#

though to be fair, players can also move without you moving

#

so if someone walks into your view, the bossbar wouldn't show until you moved

broken elbow
#

yeah. unless you do the double check in the playermoveevent. which seems not that good.

errant kraken
#

if there's not that big of a difference, then I guess a scheduler seems to be the choice

edgy lintel
lyric gyro
#

It's a bad decision to make since versions like that are at this point hella unstable and prone to loads of exploits

#

You can do much, MUCH cooler stuff with the latest version when it comes to resourcepacks, that doesn't have to involve finnicky stuff like item damage

#

Development wise you're also going to be stuck with a really old version of the API that has nowhere near as many improvements/features as the current one

edgy lintel
#

i took processing power into consideration
mmorpg takes a lot of mechanics based calculations so i just fear that 1.19 will be too much of a burden for servers to accomodate large amount of players

and about resourcepacks im too noob at that to make good packs lol

#

do you think i should use 1.13 instead? at least its relatively more stable?

high edge
#

You should use latest, and not use a potato to run the server and it'll be just fine

lyric gyro
high edge
#

Performance keeps getting improved and unless you do stuff horrendously wrong you should have decent enough performance

lyric gyro
#

And you also should write your plugins in an optimal way so that the calculations run quickly

edgy lintel
edgy lintel
dusty frost
#

people can still travel fast in 1.9

#

there's really no reason to run anything besides latest and 1.8

high edge
#

"on my potato pc"

dusty frost
#

and only 1.8 if you're a dumb old pvp user

lyric gyro
#

yeah I was about to say you don't need 1.8 either lol

dusty frost
#

well actually, 1.19 might be worth boycotting due to the whole moderation thing

#

but if you don't care, then meh

lyric gyro
#

OldCombatMechanics got a bunch of updates recently that made the pvp pretty similar to what it was before.

edgy lintel
# high edge "on my potato pc"

i mean with better pc the difference is gonna be smaller but with more players the difference is gonna show up again i guess

dusty frost
#

i mean yeah but you also get a much better game and a much more willing playerbase

#

not many people are going to install a version of minecraft that's like 7 years old just to play on your server

#

and good luck getting support for plugins or security fixes or anything

high edge
#

Startup times don't really matter, you aren't going to be spam restarting the server so that's a bad argument

broken elbow
topaz gust
#

You realise hypixel and other massive servers use modified older jars with just protocol support for higher versions

#

Typically modified 1.7

edgy lintel
#

oh damn

high edge
#

Hypixel uses entirely custom software so no point comparing to it at all

lyric gyro
dusty frost
#

yeah unless you have literally an entire dev team to essentially remake the Notchian server from scratch, don't think like Hypixel

broken elbow
#

yeah lol. they have actual developers getting actual salaries working for them

dusty frost
#

and besides, as a dev, your life will be markedly better getting to use latest Java features!

#

switch expressions 🤤

#

pattern-matching instanceof 🤤

high edge
#

Records

lyric gyro
#

oh yeah you'd be stuck with like java 8

lyric gyro
nimble vale
#

List.of things

#

java 9

edgy lintel
#

oh alr thx for all the info guys really appreciate it

dusty frost
#

and just you wait until Loom and Valhalla 😌

edgy lintel
#

will take yall's advice and make it 1.18-1.19

high edge
#

What's valhalla star

dusty frost
lyric gyro
dusty frost
#

value objects 😌

lyric gyro
dusty frost
#

yeah Java is actually getting kind of cool

edgy lintel
dusty frost
#

this is the other one I was talking about

dusty frost
high edge
#

Money motivated them, money

edgy lintel
#

what makes them earn more money with a custom piece of server software?
it just adds more work instead of making more gamemodes

dusty frost
#

it can run way lighter

high edge
#

Because people play and spend money on the server?

dusty frost
#

turns out that the Notchian server, not the most well optimized lmao

high edge
#

Well no shit sherlock

dusty frost
#

and Hypixel has a very specific niche use case where they can just basically delete a bunch of features

edgy lintel
#

oh alr makes sense

lyric gyro
dusty frost
#

like, you wouldn't want Hypixel's server software for your latest SMP server

#

but it's really good for quick-starting minigame servers

edgy lintel
#

thats informative
and yes certainly wouldnt want to make thousand isntances of smp servers haha

lyric gyro
dusty frost
#

not yet, but soon!

edgy lintel
#

struct lets go!

dusty frost
#

basically deleting boxing lmao

#

and adding reified generics, oh man

dusty frost
#

it's more likely they're using something like Docker and k8s

#

would recommend their dev blogs if you're interested, they go into a lot of detail about some cool stuff, like making a custom world file format for their housing servers

worn jasper
high edge
#

I mean it says the issue

worn jasper
#

I am actually quite stupid

#

ignore me

#

🙂

main cloud
#

How do i get a player's name for this thing?
String command = "gmc playername";

merry knoll
#

its from a command?

#

then get its args

main cloud
#

wdym

#

I am trying to execute a command when a player drinks a Water Bottle and when they drink the water a command will trigger iaplayerstat write %player_name% thirst float 2 but i dont know how to make the %player_name% to work

night nexus
#

hello

main cloud
#

hi

night nexus
#

I have a problem, my spigot account result already linked

#

but I don't have linked anything

main cloud
#

i dont think u should be asking this here

night nexus
#

I don't find command for create a ticker or contact support

high edge
#

parse it using PlaceholderAPI

night nexus
#

./papi parse me %placeholder%

high edge
#

No..

night nexus
#

this is not the solution wait

night nexus
broken elbow
#

I think he already is making a java plugin. He just wants to know how to parse the placeholder using PlaceholderAPI

night nexus
night nexus
broken elbow
main cloud
#

java plugin

#

anyone can help, i didnt understand (i am new to javascript) shocked

merry knoll
#

you probably mean java

main cloud
#

ye

#

java

merry knoll
#

you need to hook to

#

player consume event i think

#

then check if its a water bottle

main cloud
#

public void onPotionDrink(PlayerItemConsumeEvent event) { Player player = event.getPlayer(); player.sendMessage("Consumed item"); ItemStack item = event.getItem(); PotionMeta pMeta = (PotionMeta) item.getItemMeta();

#

like this?

#

` @EventHandler(priority = EventPriority.NORMAL)
public void onPotionDrink(PlayerItemConsumeEvent event) {
Player player = event.getPlayer();
player.sendMessage("Consumed item");
ItemStack item = event.getItem();
PotionMeta pMeta = (PotionMeta) item.getItemMeta();

    if (pMeta.getBasePotionData().getType().equals(PotionType.WATER)) {
        event.setCancelled(true);
        ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
        String command = "iaplayerstat write %player_name% thirst float 2";
        Bukkit.dispatchCommand(console, command);` dis is my script, it checks if its water but idk how to parse my name at String ciommand
icy shadow
#

d;jdk String#replace

uneven lanternBOT
#
public String replace(CharSequence target, CharSequence replacement)```
Description:

Replaces each substring of this string that matches the literal target sequence with the specified literal replacement sequence. The replacement proceeds from the beginning of the string to the end, for example, replacing "aa" with "b" in the string "aaa" will result in "ba" rather than "ab".

Since:

1.5

Returns:

The resulting string

Parameters:

target - The sequence of char values to be replaced
replacement - The replacement sequence of char values

merry knoll
#

"hi" + name + "now name is in between"

#

or you can do string manipulation

merry knoll
brittle thunder
#

The last preview they have seems to be on 14

#

I wonder what state it is ijn

dusty frost
brittle thunder
icy shadow
#

it's set to release alongside papi 3

brittle thunder
dusty frost
#

2030 babyyyyy

edgy lintel
#

papi 4

brittle thunder
#

Nah, we'll have a new dominant species on earth

lyric gyro
#

they're waiting for BM to release his Java tutorial videos

dusty frost
#

dude this whole time I thought Emily was going to say something like super insightful that she knew about Valhalla or something

#

but tbh this is better

brittle thunder
edgy lintel
#

his videos brought me into this whole thing

broken elbow
edgy lintel
# broken elbow googled them once, third suggestion: https://www.spigotmc.org/threads/why-you-sh...

wow this post has been really harsh on him
he was like a god to me back then
i used to watch his videos non stop while chugging cola in mc donalds and i just blindly followed his code after watching his whole video and find joy in manipulating basic events

someone even got into uni and landed a dev job because of him.

The post is mainly about deprecation and bad conventions. Honestly those part about deprecated methods and bad naming conventions did not matter to me at all. I corrected all of them later on when partly seriously about learning java as a whole.
And that part about his lack of knowledge about java. Honestly I have already forgotten about that to this day because i wasnt learning java from him but i was learning how to code in bukkit. Any style did not matter to me at that time and as long as it works and as long as i can learn the proper methods to do stuffs i would be happy.

For me this is way too harsh for my past personal god like honestly he doesnt deserve criticism like that being a pioneer in bukkit tutorials

high edge
#

Everyone deserves criticism, best way to improve, when people aren't allowed to critisize you get shit like the current events happening in the world

edgy lintel
#

honestly constructive criticism yes but all the mockings and sarcasms no
And this post is like peeling off every skin of his just to find his mistakes in response to someone's mockings

broken elbow
#

and what mocking? the comments, sure but the post seems pretty constructive

edgy lintel
#

idk how to put it
it just doesnt feel right to me
Maybe just for me myself

high edge
#

It doesn't need to

edgy lintel
#

i mean hes doing it for free solely out of teaching purpose
Like the people can go a bit less harsh on him

high edge
#

No

edgy lintel
#

yes

merry knoll
#

there isnt much good youtube content to learn spigot/bukkit from regardless i feel like

#

people need to learn java and jump after instead of trying to do both

stuck canopy
#

Is it possible to get a entity from a InventoryClickEvent?

dusty frost
#

should be event#getWhoClicked()

stuck canopy
#

I want the entity player is looking at

#

not the player

dusty frost
#

well you can get the entity and use Player#getTargetEntity()

edgy lintel
#

New to making particle effects and this aura does not feel quite right
In fact its quite disgusting (just the shape not colour that matters
is there any cooler way to make particles

dusty frost
#

yeah I dunno a good way to get that in not-Paper

#

d;paper Player#getTargetTntity

uneven lanternBOT
#
@Nullable
@Nullable Entity getTargetEntity(int maxDistance, boolean ignoreBlocks)```
Description:

Gets information about the entity being targeted

Returns:

entity being targeted, or null if no entity is targeted

Parameters:

maxDistance - this is the maximum distance to scan
ignoreBlocks - true to scan through blocks

dusty frost
#

yeah see there it is

nimble vale
#

but afaik not all of them allows you to use with colors

edgy lintel
#

im just looking to make someting like this

#

but i end up like this
colour is certainly something to change
but the shape and stuffs for now i am resort to using formulas

dense drift
#

particles aren't a good idea for that

#

since you won't see anything lol

edgy lintel
#

maybe i should use something like custom model data and make an effect sticker or sth?

nimble vale
#

yes and also there will be lots of particles and some clients may struggle to show them continuously

edgy lintel
edgy lintel
nimble vale
#

nah just some packets wont damage the server

#

but you may want to think something else than particles

edgy lintel
#

alr thx for all the advice man appreciate it

nimble vale
edgy lintel
#

that would be lit
but on the other hand I actually thought about it but i want people to be able to customize their aura and stuffs so i didnt want to use texture

#

but if textures make it look better then imma go for it
is there such thing in mc tho
like custom model data

nimble vale
#

yeah think about it more before you actually try to implement and also i believe that you can still make auras customizable with custom textures

#

just show different custom model data depends on each players settings

edgy lintel
#

i mean like i want people to customize particle physics or make their own aura shape or sth
but for now its too overwhelming for me

nimble vale
#

maybe you can use sculk charge particles but you can change the color

#

or shriek

edgy lintel
#

yo that looks real nice
i can change the colour using spawnParticle method with that right
that would be super cool thx bro

#

oh i actually cant

nimble vale
#

you can only change the color for redstone dust particle

edgy lintel
#

still pretty nice
gonna try and use that to model super saiyan blue
thx so much

nimble vale
#

no problem

stuck canopy
#

thanks for the info

turbid cove
#

Hi, i'm currently working on Factions fork to support MultiPaper, since i can't use cache, should i use MySQL or MongoDB (or some other alternative ?). Because i don't want the database to affect performance of the plugin

high edge
#

depends what you're storing

turbid cove
#

i need to store everything to make it sync

#

Factions, Players

sharp hemlock
#

Anyone know if i can find some old mappings? Im not sure what this is from 1.16.4 to 1.18.2

tacit quail
#

what does .code do in kotlin

dusty frost
#

in what context

icy shadow
#

are you making things up again

tacit quail
#

shouldnt index be an Int and not a char?

#

what makes it be a char?

dusty frost
#

uh

#

do you know how to program

#

or what an iterator is

#

sorry that was rude

icy shadow
#

you're iterating over a String, which is a collection of Chars

dense galleon
#

How do I create a new branch (through IntelliJ) from an existing repository on github?

tacit quail
#

im using it as a int for indexing

dusty frost
#

has the branch selector

dusty frost
tacit quail
#

it works in C so im a bit confused

dense galleon
icy shadow
#

C and kotlin are very different languages

dense galleon
#

I dont want to merge, completely replace

dusty frost
#

doing in is just syntax sugar for an iterator over the String

grizzled wagon
#

i dont mean to bother anyone but does this plugin have any version that works on 1.7.10

tacit quail
dusty frost
#

which is per characters

icy shadow
#

for (x in iterable) always iterates over the elements, not the indices

dusty frost
icy shadow
#

like for (var x : iterable) in java

tacit quail
#

so index = what im trying to look for anyways?

dense galleon
dusty frost
#

still not sure I understand your question honestly

tacit quail
#

index = the current char of the word?

icy shadow
#

yes

dusty frost
#

yes

tacit quail
#

oh wow thats really nice

dusty frost
#

you don't need the index, since you already have the character

tacit quail
#

thats amazing

icy shadow
#

java has that too lmao

dusty frost
#

most languages do lol

icy shadow
#

C moment

tacit quail
#

not C 😭

dusty frost
#

iterables are a thing in like, basically every language I can think of that is used in the modern day besides C lol

tacit quail
#

this is what i have to do in C to get that

dusty frost
#

oh no not the Allman brackets

tacit quail
#

what kotlin does in one line ;-;

dusty frost
tacit quail
#

Im kind of liking this new kotlin thingy

dusty frost
#

oh no lmao

icy shadow
#

uh you could just do return strlen(text) lmao

#

if you want the length of a string

tacit quail
dusty frost
#

i have a feeling Strings just have a property for length anyways

tacit quail
#

im returning a different variable

icy shadow
dusty frost
#

oh I thought you meant in Kotlin lol

icy shadow
#

the C string type is null terminated rather than storing a length

dusty frost
#

yeah i know

#

i've used C bro

merry knoll
#

strlen or smt in c i think

tacit quail
#

painful

merry knoll
#

its a method though not a property

dusty frost
#

it's a property in Java for some reason lmao

icy shadow
#

old java code is not very consistent

dusty frost
#

it is actually also a property in Kotlin

#

not a function

icy shadow
#

kotlin bad

merry knoll
#

kotlin gud

icy shadow
#

wrong

dusty frost
#

I mean it kinda should be a property

icy shadow
#

it doesnt matter really

merry knoll
#

yeah, i prefer property too

icy shadow
#

purely stylistic

dusty frost
#

Java is just weird because it has special syntax for arrays for some reaosn

icy shadow
#

what

dusty frost
icy shadow
#

what on earth has that got to do with strings

dusty frost
#

oh yeah I was thinking of arrays sorry

icy shadow
#

but im nitpicking here

dusty frost
#

the whole point of OOP is that properties are state and they change

#

if anything it should explicitly not be a function, because that function is just a getter and it does nothing special

icy shadow
#

obviously you know from context

#

but in terms of self-describing code it's not ideal

dusty frost
#

that's why you make it a var???

icy shadow
#

but then it can be set from everywhere

#

in the stdlib it's val anyway

dusty frost
#

that's cause Collection is immutable

#

MutableCollection is the interface for mutability where the size actually can change

icy shadow
#

i know

#

but there's nothing saying that size is actually mutable sometimes

#

you just have to know it from the context

dusty frost
#

I mean it really shouldn't be if it can change

grizzled wagon
icy shadow
#

"it shouldnt be mutable if it can change"

#

?

dusty frost
#

it shouldn't be val if it can change

icy shadow
#

that is entirely my point

dusty frost
#

that is entirely my point

dusty frost
#

Kotlin bad, confirmed

icy shadow
#

kotlin bad yes

dusty frost
#

well no I still don't think a property implies it's a constant

#

unless we have different definitions of "property"