#help-archived

1 messages · Page 210 of 1

sturdy oar
#

We don't have mappings for 1.8 tho

#

At least not official

open cipher
#

Hm

#

still not got my purchase

#

can anyone help?

bold anchor
#

Dm the author.

open cipher
#

Oke 😉

noble aurora
#

im getting so much errors

rare prairie
#

fix it

noble aurora
#

i cant upload the file

#

its just warnings

#

not plugins

rare prairie
#

?paste

worldly heathBOT
noble aurora
chrome lark
#

probably a plugin messing with something like chat

lapis kestrel
#

how are enchantment offers calculated?

sturdy oar
#

it better not be mine 😂

livid spruce
sturdy oar
#

Server version?

distant rapids
#

Hello, I have a few questions :)
How can I publish a paid resource and how to delete one?
Thanks!

dusty topaz
#

delete a resource by reporting it with something like "delete" in the message

#

and paid resource you need to meet the requirements and you just ... make it paid lol

distant rapids
#

Thanks a lot for the info, but to further query, where can I find the requirements

spring arch
#
    craftPlayer.getHandle().setHealth(0.0 F);
    player.spigot().respawn();

we have some serious killer talk here

#

@livid spruce To notify other players about skin changing, you just need to call hidePlayer and showPlayer

#

why everyone are using packets for that

#

you literally just exploited yourself with coordinate leaking

#

because you broadcast these packets to all the players

#

ignoring entity tracker

ancient ridge
distant rapids
#

Aight thanks

#

👍

livid spruce
#

Server version?
@sturdy oar 1.8.8

#
    craftPlayer.getHandle().setHealth(0.0 F);
    player.spigot().respawn();

we have some serious killer talk here
@spring arch So how should I do?

spring arch
#

Are you running spigot?

livid spruce
#

yes

spring arch
#

so not Paper?

livid spruce
#

No

spring arch
#

well

subtle blade
#

That's good because we're on the Spigot Discord

spring arch
#

that's bad because Paper has CraftPlayer#refreshPlayer()

sinful spire
#

refresh?

spring arch
#

Yes.

sinful spire
#

just f5

spring arch
#

funny

livid spruce
#

?

spring arch
#

what is sendPacket method?

livid spruce
#
        for (Player all : Bukkit.getOnlinePlayers())
            (((CraftPlayer)all).getHandle()).playerConnection.sendPacket(packet);
    }```
spring arch
#
    craftPlayer.getHandle().setHealth(0.0 F);
    player.spigot().respawn();
#

You need to respawn the player after you send ADD_PLAYER

#

¯_(ツ)_/¯

livid spruce
#

In the RunTaskLater?

#
        CraftPlayer craftPlayer = (CraftPlayer)player; 
        GameProfile gp = craftPlayer.getProfile();
        try {
            gp = GameProfileBuilder.fetch(UUIDFetcher.getUUID(SkinName));
        } catch (Exception exception) {}
        Collection<Property> props = gp.getProperties().get("textures");
        craftPlayer.getProfile().getProperties().removeAll("textures");
        craftPlayer.getProfile().getProperties().putAll("textures", props);
        PacketPlayOutEntityDestroy destroy = new PacketPlayOutEntityDestroy(player.getEntityId());
        sendPacket(destroy);
        PacketPlayOutPlayerInfo tabInfoRemove = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, craftPlayer.getHandle());
        sendPacket(tabInfoRemove);

        Bukkit.getScheduler().runTaskLater(GrieferGameSystem.getInstance(), () -> {
            PacketPlayOutPlayerInfo tabInfoAdd = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, craftPlayer.getHandle());
            sendPacket(tabInfoAdd);
            PacketPlayOutNamedEntitySpawn spawn = PacketPlayOutNamedEntitySpawn(craftPlayer.getHandle());
            craftPlayer.getHandle().setHealth(0.0F);
            player.spigot().respawn();
            for (Player all : Bukkit.getOnlinePlayers()) {
                if (all != player) {
                    (((CraftPlayer)all).getHandle()).playerConnection.sendPacket(spawn);
                    all.hidePlayer(player);
                }
            }
            Bukkit.getScheduler().runTaskLater(GrieferGameSystem.getInstance(), () -> {
                for (Player all : Bukkit.getOnlinePlayers()) {
                    if (all != player)
                        all.showPlayer(player);
                }
            },  10L);
        },10L);
        
    }```
#

Still not work...

spring arch
#

are you running behind bungeecord?

livid spruce
#

not on my test server

spring arch
#

i can't read this code

livid spruce
spring arch
#

i'm talking about quality

livid spruce
#

Oh...

spring arch
#
    public void changeSkin(Plugin plugin, Player player, String skinName) {
        CraftPlayer craftPlayer = (CraftPlayer)player;
        GameProfile gp = craftPlayer.getProfile();
        try {
            gp = GameProfileBuilder.fetch(UUIDFetcher.getUUID(skinName));
        } catch (Exception exception) {}
        Collection<Property> props = gp.getProperties().get("textures");
        GameProfile profile = craftPlayer.getProfile();
        profile.getProperties().removeAll("textures");
        profile.getProperties().putAll("textures", props);
        for (Player ps : Bukkit.getOnlinePlayers()) {
            ps.hidePlayer(plugin, player);
            ps.showPlayer(plugin, player);
        }
        craftPlayer.refreshPlayer();
    }
livid spruce
#

Im sorry...

spring arch
#

s a d

sinful spire
#

isnt that paper only as mentioned above

spring arch
#

yes

#

well you are writing it on only one version

#

good for you

livid spruce
#

What should I use instead of craftPlayer#refreshPlayer()?

spring arch
#
    public void changeSkin(Plugin plugin, Player player, String skinName) {
        CraftPlayer craftPlayer = (CraftPlayer)player;
        GameProfile gp = craftPlayer.getProfile();
        try {
            gp = GameProfileBuilder.fetch(UUIDFetcher.getUUID(skinName));
        } catch (Exception exception) {}
        Collection<Property> props = gp.getProperties().get("textures");
        GameProfile profile = craftPlayer.getProfile();
        profile.getProperties().removeAll("textures");
        profile.getProperties().putAll("textures", props);
        for (Player ps : Bukkit.getOnlinePlayers()) {
            ps.hidePlayer(plugin, player);
            ps.showPlayer(plugin, player);
        }
        EntityPlayer handle = craftPlayer.getHandle();
        Location loc = craftPlayer.getLocation();
        PlayerConnection connection = handle.playerConnection;
        craftPlayer.unregisterPlayer(handle);
        craftPlayer.registerPlayer(handle);
        connection.sendPacket(new PacketPlayOutRespawn(handle.dimension, handle.world.getDifficulty(), handle.world.getWorldData().getType(), handle.playerInteractManager.getGameMode()));
        handle.updateAbilities();
        connection.sendPacket(new PacketPlayOutPosition(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), new HashSet(), 0));
        MinecraftServer.getServer().getPlayerList().updateClient(handle);
        if (craftPlayer.isOp()) {
            craftPlayer.setOp(false);
            craftPlayer.setOp(true);
        }
    }
#

edited

marsh hawk
#

anyone have a func that translates the short uuid from mojang api to a regular one

spring arch
#

?

#
    private static final Pattern PATTERN = Pattern.compile("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})");
        return UUID.fromString(PATTERN.matcher(uuid).replaceFirst("$1-$2-$3-$4-$5"));
marsh hawk
#

thanks

lofty meadow
#

Why I can't do this? The world can not create and will show error in console. But if I release my code comment, it will

public class EmptyWorldGenerator extends ChunkGenerator {
    @Override
    public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {
        ChunkData chunkData = createChunkData(world);
        for (int x = 0; x < 16; x++) {
            for (int Y = 0; Y < 256; Y++) {
                for (int z = 0; z < 16; z++) {
                    biome.setBiome(x, Y, z, Biome.PLAINS);
                    /*if (Y == 0 && x == 0 && z == 0) {
                        chunkData.setBlock(x, Y, z, Material.GRASS_BLOCK);
                    } else {*/
                        chunkData.setBlock(x, Y, z, Material.AIR);
                    //}
                }
            }
        }
        return chunkData;
    }
}```
livid spruce
spring arch
#

i don't know how these methods are called on 1.8

#
  public void unregisterPlayer(EntityPlayer other) {
    EntityTracker tracker = ((WorldServer)this.entity.world).tracker;
    EntityTrackerEntry entry = (EntityTrackerEntry)tracker.trackedEntities.get(other.getId());
    if (entry != null) {
      entry.clear(this.getHandle());
    }

    if (other.sentListPacket) {
      this.getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, new EntityPlayer[]{other}));
    }

  }
  public void registerPlayer(EntityPlayer other) {
    EntityTracker tracker = ((WorldServer)this.entity.world).tracker;
    this.getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, new EntityPlayer[]{other}));
    EntityTrackerEntry entry = (EntityTrackerEntry)tracker.trackedEntities.get(other.getId());
    if (entry != null && !entry.trackedPlayers.contains(this.getHandle())) {
      entry.updatePlayer(this.getHandle());
    }

  }
spring arch
#

you did not tell what's the error

lofty meadow
#

I have next question too after that

spring arch
#

?ask

#

bruh

#

whatever

#

just ask

lofty meadow
#

But wait, I will copy the error

livid spruce
spring arch
#

look at the constructor that exist

lofty meadow
livid spruce
#
        CraftPlayer craftPlayer = (CraftPlayer)player;
        GameProfile gp = craftPlayer.getProfile();
        try {
            gp = GameProfileBuilder.fetch(UUIDFetcher.getUUID(skinName));
        } catch (Exception exception) {}
        Collection<Property> props = gp.getProperties().get("textures");
        GameProfile profile = craftPlayer.getProfile();
        profile.getProperties().removeAll("textures");
        profile.getProperties().putAll("textures", props);
        for (Player ps : Bukkit.getOnlinePlayers()) {
            ps.hidePlayer(player);
            ps.showPlayer(player);
        }
        EntityPlayer handle = craftPlayer.getHandle();
        Location loc = craftPlayer.getLocation();
        PlayerConnection connection = handle.playerConnection;
        connection.sendPacket(new PacketPlayOutRespawn(handle.dimension, handle.world.getDifficulty(), handle.world.getWorldData().getType(), handle.playerInteractManager.getGameMode()));
        handle.updateAbilities();
        connection.sendPacket(new PacketPlayOutPosition(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), new HashSet()));
        MinecraftServer.getServer().getPlayerList().updateClient(handle);
        if (craftPlayer.isOp()) {
            craftPlayer.setOp(false);
            craftPlayer.setOp(true);
        }
    }``` Still not work ..
spring arch
#

Then you are doing something wrong

#

¯_(ツ)_/¯

#

GameProfileBuilder?

#

@lofty meadow is that the full error log

#

btw you use Paper

lofty meadow
#

Yes

spring arch
#

you better go to Paper's discord server.

#

for support

lofty meadow
#

The error is not stop

#

Ahh

livid spruce
#

@spring arch

marsh hawk
#

hmm how do i get a player's real uuid from an offline server? Do i have to use mojang api or can it be done through bukkit

strong lantern
#

hey err what is the event type for when a player takes damage

marsh hawk
#

EntityDamageEvent

quick arch
#

You use an outside website API for it

#

No idea if you can do it with internal Java stuff

marsh hawk
#

damn that sucks

quick arch
#

By that, I mean generate a v3 UUID not v4

marsh hawk
#

bungee makes my life so much harder lol

strong lantern
#

if(event.getEntity()==Player){

#

why does it not work?

#
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageEvent;

public class player_Damage_Event implements Listener {
    @EventHandler
    public void onDamageEvent(EntityDamageEvent event){
        if(event.getEntity()==Player){
          // do stuff
        }
    }
}

#

help

#

HELPPP

#

?help

livid spruce
subtle blade
#

because that's not how Java works, Geekazodium, and we expect a basic understanding of how the language works before writing plugins

daring oracle
#

How to stop the ender dragon from going through my barrier blocks?

#

I'm using fork 1.16

sturdy oar
#

Idk man

#

cancel his movement

strong lantern
#

@subtle blade I know that, but what data type does event.getEntity() give?

daring oracle
#

But I want to make a boss fight with him

#

so I can't cancel his movement

dry horizon
#

what should i put in <version> if im using 1.8

strong lantern
#

@subtle blade pls help

#

bruh

#

🤦‍♂️

livid spruce
#

Whats wrong with my skin changer method?

south shoal
#

Oke I need some help I am updating my server to 1.16.1 but It wont start the server

crisp zenith
#

Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path guessing somethings up with a json file

strong lantern
#
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageEvent;

public class player_Damage_Event implements Listener {
    @EventHandler
    public void onDamageEvent(EntityDamageEvent event){
        if (event.getEntity().getType()==Player){//how do I get if the entity was a player?
          //stuff
        }
    }
}
#

help

#

pls help

frigid ember
#

u can compare it to EntityType enum but not Player itself

#

for that u have to use instanceof

crisp zenith
#

^ if (event.getEntity() instance of Player) { }

strong lantern
#

oh I forgot obout instanceof

#

🤦‍♂️ 🤦‍♂️🤦

#

crowd facepalms

south shoal
#

Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path guessing somethings up with a json file
@crisp zenith Were do I need to put this?

frigid ember
#

because entity.getType returns EntityType, not Player. u cant run == between two different class types i dont think

#

plus == compares their memory reference not the objects themselves

#

.equals() would be better (unless ur comparing enum values then either is fine)

crisp zenith
#

@south shoal you should check your json files for errors before you try adding that line

south shoal
#

well all json files are ok so

#

well still crashing

crisp zenith
#

same error?

#

try regenerating the server.properties file

south shoal
#

I have done that

crisp zenith
#

hmm

south shoal
#

and all .json files

#

as webconsole I am using amp is that maybe a isue

crisp zenith
#

if the json and properties files are okay them im not sure how else to fix. i wouldnt know how to implement the lenient mode but it doesnt sound like a clean solution either

distant rapids
#

Could SpigotMC FINALLY remove my post

#

as the website wasn't clear at all that when you put the url to the file, it posts it publicly

#

other services use that link to download the file to the server

#

so SpigotMC just leaked my personal IP address without me knowing about it

#

until a guy commented about it

#

and why tf doesn't the site allow me to remove my resource?

#

also, where is the "maximum" file size as my 27mb jar file didn't even fit.

ancient ridge
#

5MB max

#

27MB is huge

distant rapids
#

only? that's horrible i guess

ancient ridge
#

how did you even manage that

distant rapids
#

It has sql libraries in it

#

and the Discord Java sdk

quaint steppe
#

aww im just curious.... like how do i create 1.8 - 1.16 plugin?

wise flame
#

it depends what's in the plugin

lone fog
#

If it’s just API stuff it can probably work across versions

wise flame
#

some stuff might work fine in both versions

lone fog
#

Though it will complain about legacy stuff past 1.13

quaint steppe
#

like

#

ya

#

but

#

u know

distant rapids
#

I use Api version 1.13

river cradle
#

Hi there, I know how I can get the "texture" value from a player and apply it to an NPC to change its skin, but is there a way to change a PNG-image of a skin to such a texture string?

(Yes, I did google but the posts only explained the general concepts and as I'm fairly new a bit more details would be handy)

wise flame
#

if I write a version of a plugin for 1.8 and a version for 1.16, is there a way to release both versions without making separate resources?

lone fog
#

Yes

distant rapids
#

if I write a version of a plugin for 1.8 and a version for 1.16, is there a way to release both versions without making separate resources?
there are ways to make one plugin work with 1.8 - 1.16

lone fog
#

I’m pretty sure you can download old files on SpigotMC right?

wise flame
#

you can

distant rapids
#

Is any staff actually online

#

as i actually need urgent help...

#

as my resource needs to be removed

#

as it leaks my IP

ancient ridge
#

how does it leak your ip lol

quick arch
#

🤔

ancient ridge
#

nothing on your resource has your ip

quick arch
#

@ancient ridge his... external link is his public IP

lone fog
#

Uhh

#

Why

quick arch
#

I don't know

ancient ridge
#

LOL

quick arch
#

GitHub exists too

fathom coral
#

If there are multiple plugins that require MySQL, do I need a separate database for each one?

chrome lark
#

If the plugins are sane, no

#

But, not that it's not a good idea to seperate them

ancient ridge
#

how do you even manage to make the external link your ip

#

what did he expect when he typed that

quick arch
#

IPs can change after 30 minutes of downtime, he should be fine

#

Kek

ancient ridge
#

😂

chrome lark
#

depends on your ISP

#

One of my older ISPs just basically used DHCP, with a fairly nice lease

solemn wasp
#

Is it possible for one of the spigot staff to delete my spigot account? I made mine when I was like 12 and had a really bad username that revealed my personal name and I made crappy plugins, so I'd like to restart with a new account, but don't want to get banned for creating multiple accounts.

ancient ridge
#

once you delete you can't go back iirc

solemn wasp
#

What do you mean?

ancient ridge
#

once you delete, you're out

#

can't even make another account

solemn wasp
#

Then why isn't there a way to at least change your spigot username

ancient ridge
#

you can donate $10 min. to get that ability

solemn wasp
#

What?!

#

Thats-

patent cape
#

how do i upload a post on spigot? please mention me when you answer me

ancient ridge
#

new thread button

patent cape
#

how do i upload a post on spigot? please mention me when you answer me
?? someone?

lone fog
#

new thread button
@patent cape

subtle blade
#

?howtocreateathread

#

Aww :(( we didn't bring that over?

#

?howtopostathread

subtle blade
#

THERE IT IS

patent cape
#

thx

#

but i dont have this button

#

so how

subtle blade
#

So you're not logged in

patent cape
#

im

#

login

subtle blade
#

Well I can see the button just fine so

quick arch
#

Ah yes "woo!"

#

Best so far

patent cape
#

oh

#

now i see

distant rapids
#

Why
@lone fog because I thought for bigger uploads I need to provide a direct link for the server to download it

#

You know those "from url" things

quick arch
#

GitHub works fine

distant rapids
#

it's closed source

#

well "closed"

quick arch
#

Yeah just make a GitHub and redirect it to the Release tab

distant rapids
#

Isn't the releases blocked if the repo is private and they don't have collab access?

quick arch
#

Make a public repo with nothing in it

#

And then just use the release tab

distant rapids
#

That feels hacky so I'll just make it open source

quick arch
#

A lot of resources do that

distant rapids
#

I know

#

but imo it just feel hacky

subtle blade
#

and it's stupid. Open source your stuff

distant rapids
#

and im a perfectionist xd

#

Choco

#

could you help me

subtle blade
#

There is no excuse not to open source anything ¯_(ツ)_/¯

distant rapids
#

Could you remove my resource?

subtle blade
#

Report your own resource and request deletion

distant rapids
#

I am gonna post it again, as I can't edit download link

#

ok

quick arch
#

Can't you just update it

#

And remove the previous update

distant rapids
#

I don't think so

#

or I just don't understand the site

quick arch
#

I've seen resources do it

distant rapids
#

And I don't personally think I'm dumb (could also be xd)

quick arch
#

😬

lone fog
#

Why would you think your public IP is a good direct download

distant rapids
#

You know the "import from url" thing on a lot of sites

#

I thought for bigger uploads, I would need to specify a url for the backend server to download

#

As there might be a limitation in some browsers / tech stacks

hollow thorn
#

how do you use createExplosion

hollow grail
#

how to disable the function

#

in people after death

#

loot remains

warm stirrup
#

Daniel you can use PlayerDeathEvent then use e.getDrops()

grim halo
fallen escarp
#

Hey, it looks like I've completed all the requirements for posting premium resources but I'm unable to select it as a category. What am I doing wrong ??

grim halo
#

?premium

worldly heathBOT
grim halo
#

Whats your account?

fallen escarp
bold anchor
#

You got 2fa enabled?

fallen escarp
#

Yep

grim halo
fallen escarp
#

Ahh, within 1 hour

grim halo
#

Did you wait and hour after the req.

fallen escarp
#

I did not 😅

#

Thank you 😄

grim halo
#

@fallen escarp Btw if you want to post a premium resource it will get reviewed before approval.
If you want i can read against it and give you some tipps or at least tell you if its worth a try.

fallen escarp
#

Ahh thank you, when it comes down to it that'd be really useful thanks 😄

tidal mica
#

Someone know when (in what class) the PlayerMoveEvent is fired?

quick arch
#

It's fired when you move

tidal mica
#

sorry i fixed the sentence

hollow thorn
#

can you use 0 intead of false

quick arch
#

o

tidal mica
#

so no one know in what class the PlayerMoveEvent is fired?

hollow thorn
#

Event class

#

?

#

how do i use Tipped Arrows

#

as in the item

paper forge
#

Can someone help me update this plugin pls

frigid ember
#

what would have to be done to get the reason of death

grim halo
#

Player#getLastDamageCause() or something

sinful spire
#

event#getDeathMessage

paper forge
#

Can someone help me update this plugin

frigid ember
#

why getdeathmessage?

sinful spire
#

reason of death, so i guess

frigid ember
#

reason

sinful spire
#

oh

#

i know

frigid ember
#

getLastDamageCause

#

thats it yea

sinful spire
#

e.getEntity().getKiller();

frigid ember
#

thanks both

#

thats the killer

grim halo
#

As stated before: Player#getLastDamageCause() -> EntityDamageEvent#getCause()

frigid ember
#

and is it possible to get the time when the player died

sinful spire
#

uh usedRam / maxRam maybe?

#

and that * 100

#

and + "%"

paper forge
#

Can someone help me figure out this bug?

#

Could not pass event PlayerViolationEvent to AACDiscordNotifications v1.0.1
org.bukkit.event.EventException: null
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:319) ~[server.jar:git-Spigot-9639cf7-7c03d25]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[server.jar:git-Spigot-9639cf7-7c03d25]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[server.jar:git-Spigot-9639cf7-7c03d25]
at

sinful spire
#

the plugin doesnt even have 1.14 in the versions

#

why did you expect it to work

paper forge
#

I was going too try and update it but i need help

sinful spire
paper forge
#

Ok

quick arch
#

The author's in here, probably doesn't like getting pinged though

sinful spire
#

right

left walrus
#

how can i upload a custom skyblock map on askyblock plugin

#

?

grim halo
#

@tidal mica Found it.
Its fired in the net.minecraft.server.v1_16_R1.PlayerConnection.class

left walrus
#

hi can you help me?

tidal mica
#

@tidal mica Found it.
Its fired in the net.minecraft.server.v1_16_R1.PlayerConnection.class
@grim halo oh thanks!!

left walrus
#

how can i upload a custom skyblock map on askyblock plugin?

grim halo
#

Did you try asking the author? 😄

frigid ember
#

Does anyone know how long it takes to receive an email back from support?

grim halo
#

@frigid ember Between 2 hours and 1 Week

frigid ember
grim halo
#

Yes. Just make sure that you've read the FAQ first

frigid ember
#

Alright

lone fog
#

Real world time? In game time?

frigid ember
#

game

bold anchor
#

Just get the world time you receive the event

lone fog
#

Get the players world and then get the time

frigid ember
#

smart

#

now im curious what would have to be done to get real world time

#

;p

lone fog
#

DateTime.Now I think it is

bold anchor
#

Instant.now() <- too

frigid ember
#
        LocalDateTime time = LocalDateTime.now(UTC);```
#

?

bold anchor
#

If that's valid code sure.

frigid ember
#

it is

#

and to store UUID with coords, reason, time

#

HashMap<UUID, String>

#

and toString() those or no(multiple hashmaps)?

tiny pebble
#

how can i cancel putting a disc into a jukebox?

#

meaning when you right click the jukebox nothing happens

#

i'd assume PlayerInteractEvent although that isnt working currently so I mean

frigid ember
#

oof

#

was about to say that one

tiny pebble
#
        if (event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().equals(Blocks.JUKEBOX)) {
            event.setCancelled(true);
        }

unless i'm just dumb?

#

maybe i shouldn't cancel it?

frigid ember
#

if (e.getAction() == action.RIGHT_CLICK_BLOCK

#

ohh you have that

tiny pebble
#

😛

#

big brain

#

sometimes

#

Blocks.JUKEBOX is an NMS block so maybe thats it tbh

#

but it doesnt say error or anything so i mean

frigid ember
#

tried Material.JUKEBOX?

tiny pebble
#

aight ill test that out

#

well i never registered the event, but now that i did i tried it with both Blocks.JUKEBOX and Material.JUKEBOX and the CD still plays 🤔

frigid ember
#

print something out when interacting

#

check if it printed

#

make sure the event runs

#

just in the interact event

#

not in a statement

tiny pebble
#

the event itself runs but the if statement does not

lone fog
#

Block.getType == material.JUKEBOX

sinful spire
#

event.getClickedBlock().getType() == material.JUKEBOX then i guess

tiny pebble
#

ay that worked

#

thanks 😛

lone fog
#

and to store UUID with coords, reason, time
Make a custom class that takes the time coords and reason

crisp zenith
#

I've just made my own API and have added it as an external library in my plugin. are there any extra steps i should do? importing a static method works fine when both are in the plugins folder

lone fog
#

And then store that in the map

tiny pebble
#

can i store an object in an nbt tag?

pastel nacelle
#

if you can serialize it, why not

tiny pebble
#

how do

pastel condor
#

You have to implement serializable or something

distant rapids
#

You can convert nbt data to a base64 string

#

and vise versa

subtle blade
#

Or use the persistent data API

#

Implement your own PersistentDataType to serialize to and from a primitive data type

tiny pebble
#

ah i see

#

hmmm

#

i'll see what i can do with that

nocturne crane
#

Is there a way to set another role as the default with luckperms?

wise flame
#

The luckperms discord would probably be a better place to ask that question

sturdy oar
#

There's a documentation

#

Fyi

nocturne crane
#

i had a look on the internet but couldnt find anything :/

sturdy oar
#

An insanely cool website^^^

paper forge
#

does anyone see something wrong with the code in this dev api and the code in the plugin

#

the bottom one is the dev api

subtle blade
#

idk what im looking at

pastel nacelle
#

don't use stout for logging

paper forge
#

im trying too fix a plugin

quick arch
#

uh... 🤔

subtle blade
#

Sure but you've linked to unrelated classes

paper forge
#

but i dont really know how too code lol

subtle blade
#

HookAAC isn't at all referenced in your AACDiscordModifications class

paper forge
#

so i need too add the public class line with hookaac into the plugin?

sturdy oar
#

but i dont really know how too code lol
@paper forge 🤨

paper forge
#

I really need too get this too work so can anyone fix this pls

tiny pebble
#

Can I cast an object to PotionEffectType 🤔

pastel nacelle
#

sure you can

#

depending on whether that object is a PotionEffectType, it might blow up in your face, though

subtle blade
#

lol. You can cast anything to anything if you really want to

tiny pebble
#

lmao okay just wanted to make sure and didnt want it to explode

subtle blade
#

Well if you're certain it's of that type, sure

#

Though if I do (PotionEffectType) "Hello!", runtime will hate me

tiny pebble
#

yeah

paper forge
#

can someone fix this plugin for me since i cant get a program too do it myself :((

lapis plinth
#

i tried Plugin.getDataFolder# before and it didnt work

subtle blade
tiny pebble
#

basically i’m just trying to store PotionEffectType either in an NBT tag or the PersistentDataContainer thing, so I’m trying to basically convert it to a string then unconvert it, which I assume is serialization? is that all possible?

balmy sentinel
#

@lapis plinth did you try removing the “/“ before config.yml?

#

if that doesn’t work I’ll get on my computer and show you what I did

subtle blade
#

I'd opt to store the id instead. I know that sounds stupid but potion effects aren't registerable yet

#

So store the integer id

lapis plinth
#

@balmy sentinel yeah

#

File customYml = new File(this.getDataFolder(), "config.yml");

#

I changed it to this

#

and it stille rrors

tiny pebble
#

@subtle blade wait... PotionEffectType’s got ids? smh i’m challenged

subtle blade
#

Once they become keyed, then I'd say store the namespaced key. Though they're not, so integer would be better

#

Eh, maybe the name would be better so it's at least readable

#

PotionEffectType.getName() and PotionEffectType.getByName()

tiny pebble
#

ahhhh i see

balmy sentinel
tiny pebble
#

thank you! will try that out when i get back home

lapis plinth
#

kk

sturdy oar
#

hey thevipershow
@tranquil edge I don't know you tho

#

Im one of the most active member of this discord

warped ivy
#

i need some help

#

the cloudskywars plugin is not working

#

i do /swe

#

/sw*

#

and it says

#

an error occurced

sturdy oar
#

Contact author

warped ivy
#

alr

pastel nacelle
#

don't use bad plugins

warped ivy
#

bruh

#

im using minehu

#

t

#

its the only skywars plugin

pastel nacelle
#

are you implying whatever that is is not bad

#

sky* plugins are generally pretty horrible

warped ivy
#

.

#

im not spending money for hostings

quick arch
#

There's only around 150 or something plugins on there

pastel nacelle
#

imagine using skript

quick arch
#

mhm

pastel nacelle
#

there are people who sell skripts

#

i probably can't send links here

#

look at this shit

#

found this guy advertising his "skripting services" on the pebblehost discord the other day

quick arch
#

oh that guy, I know him

#

Trent is in their Discord btw

#

and somehow supports it 😐

pastel nacelle
#

helping out the users who were affected by the 12 plugin limit

#

hhh

quick arch
#

He's in a Gaming League too, don't know why he bought it

#

Should've just continued on updating FactionsUUID smh

#

He updated it because it's features was out of date smh

pastel nacelle
#

skmcmmo

#

mfw

winged sparrow
#

Is there a way to check if there is space for x amount more items with item stacking taken into account or do I have to make that myself?

pastel nacelle
#

skWE 🚮

#

there's a skClearlag

quick arch
#

A skript anticheat is getting a Java adaptation

#

but I don't think the guy knows much about anticheats

sturdy oar
#

Bro yeah

#

If speed > 4.17 ban

quick arch
#

yeah, that's the one getting a Java adaptation

winged sparrow
#

gets propelled by tnt explosion

#

banned

quick arch
#

His premium version was a Patreon subscription at one point

#

$3/mo 😐

sturdy oar
#

How to learn java in 5hours

quick arch
#

I don't think he has a Spigot account 🤔

sturdy oar
#

He's probably selling it on mcmarket

quick arch
#

I wonder why the resource isn't removed yet

subtle blade
#

alright finally imported. Was an error in the Git integration for some reason

quick arch
#

oh

#

btw, Better Bubble isn't compatible with Spigot

#

Somehow still not removed yet

#

smh

pastel nacelle
#

what am i looking at

quick arch
#

Bubble Anticheat not supporting Spigot

#

Should've been removed but it's not

sturdy oar
#

MinecraftServer#recentTps[] smh

paper forge
#

can someone fix something for me

neat orbit
#

does anybody kow the permissions for essentials command /blocks?

#

i've looked up and down, left and right and i can't seem to find it

#

n v m it's supposedly condense lol anyways take care spigot

paper forge
bold anchor
#

ok

paper forge
#

i need someone too fix the public class issue in the code here

#

the bottom one is the dev api and the top is the plugin code

rare prairie
#

implement that

crisp zenith
quick arch
#

He found it already

#

"Condense"

#

Don't know why it's not /block

crisp zenith
#

I'm too slow on Mobile

rare prairie
#

whyyouask

pastel nacelle
#

fork it i fucking dare you

crisp zenith
#

Yeah

lapis plinth
#

Whats the method to broadcast a title to a specific player? 1.12 api btw

sturdy oar
#

A title ?

#

Yeah there's API

tiny dagger
#

guys what your structure would look like for mysql statistic stored for different intervals ie monthly weekly all time 🤔

sturdy oar
#

What

#

Just add a column for each time interval

#

idk if I understood

silk isle
#

ive been learning the spigot API for a few days (using my knowledge of c# and just winging it with java honestly) and it seems fairly intuitive, but i tried saving data to a yaml and every tutorial i found on the topic seems unnecessarily complicated, is there any simpler way to save data?

quick arch
#

It's simple

rotund orbit
#

Is there any way to prevent custom items from being used successfully in regular recipes? For instance, I don't want my iron ingot renamed Steel Ingot to be able to be used to create an iron sword.

#

Would I need to use the Prepare Craft Item Event for this?

quick arch
#

Load the file with YamlConfiguration then you can useYamlConfiguration#set(path, value) to set values

#

also, YamlConfiguration#save() will remove comments and spaces

#

watch out for that

silk isle
#

path being the "name" or "key" of the value?

quick arch
#

To fix that, you'll have to use another library online

#

yeah

silk isle
#

okay, i think ive got it

quick arch
#

"test.test", 1

test:
  test: 1
#

etc

#

Is there any way to prevent custom items from being used successfully in regular recipes?
It seems you'll have to listen to the Craft event and check the items

#

😬

blazing burrow
#

hey guys, so i have this plugin where if you do /targets player1 player2 then all compasses will point to player1 and will alternate between the two whenever you right click holding a compass, and every right click will point to the latest position of the player

#

but for some reason the /targets command doesnt show up as an option

#

i made a similar one for one like /target player where the compass only points to one person and it works perfectly

left plover
#

is it in your plugin.yml

blazing burrow
#

yes

left plover
#

weird

blazing burrow
#

should i send a code block of it

left plover
#

sure

blazing burrow
#

name: manhuntMC2P version: 1.0 author: Atin main: me.atin.manh.First2 commands: targets: aliases: [focusons]

left plover
#

looks fine

#

What happens when you /targets

#

Unknown command?

blazing burrow
#

yep

#

i tried reloading it as well

left plover
#

try putting usage: '/targets <user1> <user2>' under it

#

under aliases

sinful spire
#

dont think you need '' in yaml

left plover
#

yeah I couldn't decide lol, try with and without

blazing burrow
#

so like
name: manhuntMC2P version: 1.0 author: Atin main: me.atin.manh.First2 commands: targets: aliases: [focusons] usage: '/targets <user1> <user2>' ?

left plover
#

yeah

blazing burrow
#

ok

left plover
#

well

#

usage on the same indent as aliases

blazing burrow
#

oh okay

silk isle
#

the second line is getting an error, i have no idea what the correct way to use loadConfiguration() is

YamlConfiguration homes = loadConfiguration(homesyml);```
quick arch
silk isle
#

The method loadConfiguration(file) is undefined for the type main

blazing burrow
#

the one with 2 compasses isnt being enabled

left plover
#

oh?

blazing burrow
#

yeah

left plover
#

any errors

blazing burrow
#

nope dpesnt show

#

i checked onEnable()

#

looks okay to me

#

do i have to manually enable it?

left plover
#

wdym

blazing burrow
#

like /enable manhuntMC2P

#

or something

#

idk if thats a thing

tranquil aurora
#

Do spigot take a cut on paid plugins

quick arch
#

No

tranquil aurora
#

oh sweet

lone fog
#

YamlConfiguration.loadConfiguration

#

Not just loadConfiguration

upper hearth
#

Does anyone here know if you can change the output directory of the build task with Gradle?

quick arch
#

yes

#
task copyJar(type: Copy) {
    from shadowJar // copies output of file produced from jar task (if your using shadowjar)
    into '' // insert directory
}

build.finalizedBy copyJar
spring coyote
#

could someone help with this:

sturdy oar
#

Mhh

rustic prism
#

One message removed from a suspended account.

sturdy oar
#

Player reach is 3.00

#

@spring coyote

subtle blade
#

You probably haven't set a restart script

sturdy oar
#

Not 3.2

spring coyote
#

ok but idk i did some testing and i got up to 3.2

sturdy oar
#

I don't think that's possible

spring coyote
#

and i was counting from the center of the player's head so

#

thats why i gotta put 3.2

sturdy oar
#

Maybe if there's lag yeah

tiny pebble
spring coyote
#

@sturdy oar so there is no way to fix the other problems?

sturdy oar
#

One second I'm reading

rustic prism
#

One message removed from a suspended account.

tiny pebble
#

Keep in mind this error doesn't always happen, even after doing the exact same thing to cause it

spring coyote
#

also TheViperShow im hosting this server from my computer, could it just be a lag problem and would hosting it on something like server.pro help?

quick arch
#

if your computer's decent, you shouldn't have much lag

rustic prism
#

One message removed from a suspended account.

#

One message removed from a suspended account.

sturdy oar
tiny pebble
#

Also keep in mind that the method is called at the last line of an event, meaning nothing is after it so it is the thing causing the error

grim halo
#

@tiny pebble If all 9 checkpoints are reached then the assertion error cant be thrown in there.

tiny pebble
#
    @EventHandler
    public void onRightClick(PlayerInteractEvent event) {
        Action action = event.getAction();
        Player player = event.getPlayer();
        if (!(action.equals(Action.RIGHT_CLICK_AIR) || action.equals(Action.RIGHT_CLICK_BLOCK))) return;
        if (!player.getInventory().getItemInMainHand().equals(enchantedSyringe)) return;
        if (player.getActivePotionEffects().size() != 1) return;
        Collection<PotionEffect> effects = player.getActivePotionEffects();
        for (PotionEffect effect : effects) {
            potionEffect = effect;
        }

        fillSyringe(player, potionEffect);
    }

This is the PlayerInteractEvent. fillSyringe is the last line, meaning it's also reached.

#

so...

lone fog
#

Compare action with ==

tiny pebble
#

And when I get back in the server every line of code did pass as I intended it to so

#

Alright

lone fog
#
            potionEffect = effect;
        }

        fillSyringe(player, potionEffect);``` Did you want that in the loop?
#

Because that will only fill it with the last potion effect

grim halo
#

So it looks like some item that is created with a null constructor?

tiny pebble
#

The goal is to have it only work with one potion effect

#

hmm

#

when I load the server back up it does seem to have still given me the item though, which is what confuses me

spring coyote
#

@sturdy oar Does your killaura checker get the delay that the server has when sending packets and estimates what the player sees the hitbox as instead of basing it on the server?

sturdy oar
#

It's not mine btw

#

At least not the kill aura

#

And yes lag is taken into consideration

#

Because packets aren't always sent every 50ms

tiny pebble
#

I feel like that may have been the problem @grim halo , the class file I was calling from had an entirely empty constructor that I was going to use then forgot about. Would that do it 😅

#

(the class holds the method for the item)

grim halo
#

@tiny pebble You should probably not use player.getInventory().remove(player.getInventory().getItemInMainHand())
If you want to delete the item in the players main hand you should probably do: player.getInventory().setItemInMainHand(null);
or player.getInventory().setItemInMainHand(new ItemStack(Material.AIR));

tiny pebble
#

I want it to just subtract one item

#

so if it's a stack of 64 i want it to just take it down 63, as like using a bottle and filling it with water

grim halo
tiny pebble
#

nice

#

welp

grim halo
#

You will remove every itemstack that matches your hand item

tiny pebble
#

how would I just remove one?

grim halo
#
  public void decrementHandItem(final Player player) {
    final PlayerInventory inv = player.getInventory();
    final int handSlot = inv.getHeldItemSlot();
    final ItemStack handItem = inv.getItem(handSlot);
    if (handItem == null || handItem.getType() == Material.AIR) {
      return;
    }
    final int amount = handItem.getAmount();
    if (amount == 1) {
      inv.setItem(handSlot, null);
    } else {
      handItem.setAmount(amount - 1);
    }
  }

@tiny pebble

#

Didnt test but this should do the trick

tiny pebble
#

ah sweet, i'll try it out

#

still trying to solve the main error

#

oddly, i just tested it and it worked fine at first, then i did the same thing and it crashed again

grim halo
#

Weird

tiny pebble
#

i do believe it has to do with the item it's giving me though, maybe i did something wonky there

lone fog
#
      inv.setItem(handSlot, null);
    } else {
      handItem.setAmount(amount - 1);
    }``` You don't need to do the == 1 check in modern versions
grim halo
#

Are we finally there?

lone fog
#

mhm

grim halo
#

noice

#

I remember in 1.13 it still just invalidated the item and led to weird behavior

lone fog
#

Not sure how modern it needs to be

#

1.15 and 16 work though

grim halo
#

good to know

fathom coral
#

I am trying to use Luckperms and MySQL Inventory Bridge. Can I use the same database for both?

sturdy oar
#

Ye a s

#

They will use different tables

fathom coral
#

Okay thanks

tiny pebble
sage summit
#

I am making a mine plugin and I want the server owner to be able to create new mines with the config but I dont know how to make it so It resets every certain amount of time specified by the player, basically I dont know how to have an unspecified amount of mines all with different reset times, they will also all have warnings for when it resets the mine

tiny pebble
#

i think i figured out why 😅

grim halo
#

@sage summit You can do two things: poll or schedule

sage summit
#

how do i check what mine is reseting?

grim halo
#

create a Mine class that has an area and a timestamp.
Then create a MineManager class that manages all mines and polls them periodically to check if they should reset.

mental spade
#

can someone help me with maven spigot?

grim halo
#

?ask

worldly heathBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

grim halo
#

@sage summit So the MineManager holds a data structure like List<Mine>
Then every 20 ticks or so you just call a forEach on that List and check if any mine should reset

sage summit
#

ok ill try that

golden geyser
#

Alright, I added three commands to my plugin all at once and now when I try to use any, I only get what I labeled as their usage (in plugin.yml) in the chat. Help?
Main file:```java
public static Map<String, String> passwords = new HashMap<>();
public static Map<String, String[]> helpingBuild = new HashMap<>();

@Override
public void onEnable() {
    passwords.replaceAll(null);
    SmmCommands smmCommands = new SmmCommands();
    getServer().getPluginManager().registerEvents(new LevelEvents(), this);
    getCommand("hub").setExecutor(smmCommands);
    getCommand("openchest").setExecutor(smmCommands);
    getCommand("unsign").setExecutor(smmCommands);
    getCommand("password").setExecutor(smmCommands);
    getCommand("joinbuild").setExecutor(smmCommands);
    getCommand("leavebuild").setExecutor(smmCommands);
}```Plugin.yml:```yaml

name: RevivePlugin
version: 1.0.0
author: TheGamerAdmin
main: com.thegameradmin.reviveplugin.RevivePlugin
api-version: 1.16
commands:
hub:
description: Teleports you to the hub.
usage: /<command>
aliases: spawn
permission: reviveplugin.hub

grim halo
#

Is this the whole plugin.yml?

golden geyser
#

No, I had to cut it off so I wouldn't exceed the character limit.

#

Need me to send the whole thing?

grim halo
#

?paste

worldly heathBOT
golden geyser
grim halo
#

And also send the SmmCommands class pls.

golden geyser
grim halo
#

Btw it is generally discouraged to have one CommandExecutor for multiple commands.

golden geyser
#

yeah sorry, i just did it because its a private plugin

grim halo
#

Dont check cmd.getName(). Just use the label. Thats what its for,

golden geyser
#

Ah, ok. By the way, it was working before I added the final three commands in the SmmCommands

#

No errors in the console, either.

frigid ember
#

e.getEntity().getLastDamageCause() in PlayerDeathEvent returns org.bukkit.event.entity.EntityDamageByBlockEvent@xxxx

#

is there a way to make it look better

#

like that -> killed himself

golden geyser
#

Wait, do I have to put a return true; at the end of every command?

#

I just realized I forgot one at the bottom command.

grim halo
#

@frigid ember The EntityDamageEvent has a getCause() method

frigid ember
#

what happens?

#

does it just say the command in chat @golden geyser ?

#

than that'll be the fix

#

e.getEntity().getLastDamageCause().getCause()

grim halo
#

@golden geyser The last return is always true. So this shouldnt make any difference.

frigid ember
#

thats better but also looks like shit

#

ENTITY_ATTACK

#

VOID (as in /kill (player)

grim halo
#

@golden geyser use the label to compare.

frigid ember
#

FALL

golden geyser
#

@frigid ember yeah

grim halo
#

@frigid ember Then write a Map<DamageCause, String> and fill it with whatever suits you.

frigid ember
#

cant it get the regular mc death message

grim halo
#

@golden geyser And it will not be fixed if you just add a return true;
Compare the label !!

frigid ember
#

slain by spider

#

wait ima try something

grim halo
#

@frigid ember PlayerDeathEvent#getDeathMessage()

frigid ember
#

yea

#

thats what im trying rn

#

xd

#

but I have to cut a part if possible

grim halo
frigid ember
#

nvm it looks allr

#

thanksss

golden geyser
#

@grim halo i did... still fails and gives me the command name

grim halo
#

Create a debug message before and after your Player instance check and at the end of the command (before the return)

pastel nacelle
#

isn't the label of a command affected by the alias

spring coyote
#

How would I put an item into an entityplayer's hand?

pastel nacelle
#
Parameters:
    sender - Source of the command
    command - Command which was executed
    label - Alias of the command which was used
    args - Passed command arguments
#

don't use label in a switch block or use equalsignorecase on it

#

it's affected by the alias

grim halo
#

You are right. So command.getName() was the better method to compare

pastel nacelle
#

ideally you would have an executor for each

grim halo
#

ideally you wouldnt use spigots command system...

#

But yes i also would create one CommandExecutor per registered command.

quick arch
#

ideally you wouldnt use spigots command system...
ACF >:D

pastel nacelle
#

i keep recommending acf to everyone and they just shoot it down with "that's overkill"

quick arch
#

That was me at first

#

But I used it

#

and it's good

#

now that's no longer me

frigid ember
#
                long timeMillis = System.currentTimeMillis();
                players.compute((Player) e.getEntity(), (key, value) -> new Data(e.getEntity().getLocation(), e.getDeathMessage(), TimeUnit.MILLISECONDS.toSeconds(timeMillis)));```
#

it's not converted to seconds?

keen compass
#

@pastel nacelle depending on what someone is trying to do, it can be overkill to use acf lol

quick arch
#

I'm still using it even for 1 command

pastel nacelle
#

could just divide it by 1000

frigid ember
#

ohh I will do that, thanks

keen compass
#

personal preference which I am not saying you shouldn't use it

#

I am just saying, it can be overkill if what you are doing is relatively simple to begin with lol

grim halo
#

acf saves me SO much time. I can just create a command in 5min with command completion permissions etc.
I think it gets unreplacable if you get used to it.

#

Even in a simple project. I can just copy paste acf in my pom in the same time i would have taken for tinkering with my plugin.yml

frigid ember
#

System.currentTimeMillis()/1000)

#

doesnt work either?

#

dividing is just / right?

lone fog
#

yes

winged sparrow
#

that should work.

frigid ember
#
                players.compute((Player) e.getEntity(), (key, value) -> new Data(e.getEntity().getLocation(), e.getDeathMessage(), System.currentTimeMillis()/1000));```
lone fog
#

System.currentTimeMillis will be very high though

sturdy oar
#

acf saves me SO much time. I can just create a command in 5min with command completion permissions etc.
I think it gets unreplacable if you get used to it.
@grim halo yes although I think it's also important to sometimes also try to experiment and learn how to do it the vanilla way

#

With the TabExecutors etc...

spring coyote
#

How would I spawn an entityplayer holding a diamond sword?

keen compass
#

Well, I am not always a fan of using reflection @grim halo like I said, personal preference you can say 😛

frigid ember
#

still gives me this high amount

lone fog
#

system.currentTimeMills is the milliseconds since January 1st 1970

sturdy oar
#

Yes

lone fog
#

So you have the seconds since January 1st 1970

sturdy oar
#

Use LocalDateTime

frigid ember
#

ohh wtf

#

xd

sturdy oar
#

If you want formatted dates use LocalDateTime

frigid ember
#

very nice

#

yea I just want the time

#

of a time zone

sturdy oar
#

Yeah just look into that

#

It's a pretty big time API

frigid ember
#

sure, thanks

sturdy oar
#

You can also write your own formatter

keen compass
#

it should be noted that is Unix Epoch

grim halo
#

@keen compass You dont need to use reflections urself. And doing some reflections at the start of a program does not matter at all.

pastel nacelle
#

unless the reflective stuff is in a super hot loop it's almost certainly a nonfactor

keen compass
#

Windows uses 1 january 1601 for its start of the time

pastel nacelle
#

sure, a reflective field get and method invocation takes moer than twice as long as a regular get/invocation

keen compass
#

Just fyi if you want to take into account windows is different for time stuff 😛

pastel nacelle
#

but the % of the time the jvm spends on the invocation/get part itself is negligible

sturdy oar
#

Yeah because windows was invented in 1600 and UNIX in 1900

grim halo
#

Ive seen something about JIT and reflections in java 11 recently. I was baffled on how much it improved since Java 8

subtle wedge
#

Java 1.8 should work for 1.15.2, right?

sturdy oar
#

Yes

subtle blade
#

It's required

sturdy oar
#

But use 11 if you can

keen compass
#

java 1.8 is the minimum required

sturdy oar
#

It has faster fps for PvP

sage summit
#

@sage summit You can do two things: poll or schedule
@grim halo wait whats a poll?

subtle wedge
#

Yeah because I'm getting Cannot find main class errors for no reason

grim halo
#

"It has faster fps for PvP" i dont even...

lone fog
#

I mean it probably does run better

sturdy oar
#

It does

lone fog
#

But I would think that applies outside of PvP too

keen compass
#

java 11 runs better then java 8 and java 14 runs better then java 11 😉

sturdy oar
keen compass
#

not always the case that higher versions run better, but those 2 versions specifically optimized some things

lone fog
#

And I'm a nub using a shared host so I can't pick which one :p

subtle blade
#

Yeah because I'm getting Cannot find main class errors for no reason
So either your plugins aren't properly defined or you've somehow gotten a server jar not from BuildTools

grim halo
#

@sage summit polling is something you normally want to avoid.
If you ask a thread "are you done?" -> "are you done?" -> "are you done?" every tick then you are polling.

pastel nacelle
#

most shared hosts let you open a ticket or something to change your java version

lone fog
#

Might want to look into that

sage summit
#

ok thanks

lone fog
#

It lets me choose Java 11 if I upload a custom Jar

#

But I really don't want to deal with that

pastel nacelle
#

and what host, pray tell, might you be using

subtle wedge
#

@subtle blade I'm using the jar from --rev 1.15.2

sturdy oar
#

I should start a shared hosting company

#

Tbh

lone fog
#

Meloncube

#

I wonder if it's really that profitable

sturdy oar
#

Meloncube Is great

lone fog
#

It's a pretty saturated market

sturdy oar
#

I recommend MelonCube to everyone ^^^^

pastel nacelle
#

oh it's definitely profitable if you oversell

opal heron
#

@sturdy oar whats the name of your hosting

pastel nacelle
#

but it's saturated to all fuck and back

sturdy oar
#

@sturdy oar whats the name of your hosting
@opal heron Meloncube

opal heron
#

Ah

#

and you should make an intro

pastel nacelle
#

sounds like they use multicraft

opal heron
#

BEEZ MELONCUBE

sturdy oar
#

They do

pastel nacelle
#

any shared host using multicraft is automatically bad in my books

opal heron
#

tntntntn

#

something like cocomelon

sturdy oar
#

But it's really well configured

#

I tried benchmarks

#

And checked for overselling

#

With my advanced software

opal heron
#

your gonna start a company?

pastel nacelle
#

i don't know but multicraft is cancer

opal heron
#

minehut is a grave

pastel nacelle
#

tired of writing ?i in my timings link every time

sturdy oar
#

I can't start a shared company because I don't have the budget to start one

#

But I'd do it if I had the money

lone fog
#

?I ?

opal heron
#

E

pastel nacelle
#

multicraft removes any ? character and the character that follows the ? character from the console feedback

opal heron
#

that sounds stressful

pastel nacelle
#

so your timings?id=shithere turns into timingsd=shithere

sturdy oar
#

? Since when

pastel nacelle
#

since ever

grim halo
#

Lol just looked at MelonCube... for the price of their 16GB VPS i can get two 32GB dedicated I7 server...

pastel nacelle
#

see it all around

opal heron
#

MultiProblem

#

best hosting

pastel nacelle
#

more like multibad

opal heron
#

MultiShit

#

u got shit here and u got shit there

spring coyote
#

How would I set the item an npc is holding

pastel nacelle
#

are you perchance related to jan tuck

opal heron
#

@spring coyote /npc equip

pastel nacelle
#

he has a paper bag for a head as well

sturdy oar
#

Lol just looked at MelonCube... for the price of their 16GB VPS i can get two 32GB dedicated I7 server...
@grim halo vps are more expensive than dedi

opal heron
#

if youre using citizens

pastel nacelle
#

you are like siblings

sturdy oar
#

That's like that in all hosts

spring coyote
#

Im not using citizens

opal heron
#

then what

spring coyote
#

nms

lone fog
#

Huh it does

pastel nacelle
#

vps is worse than a dedi

lone fog
#

I never use the console for timings links anyway

pastel nacelle
#

no reason to pay more for less

opal heron
#

NMS

grim halo
#

Why should a VPS be more expensive than a dedicated one?

opal heron
#

hm

sturdy oar
#

Why should a VPS be more expensive than a dedicated one?
@grim halo it's always like that

#

Go check on DigitalOcean

#

a 16GB standard vps

#

Is 80$ x month

subtle wedge
#

org.bukkit.plugin.InvalidPluginException: Cannot find main class org.spigotmc.spigotplugins That's not the class I have in main ?

opal heron
#

virtual private server

lone fog
#

check your plugin.yml

#

That is where it is defined

pastel nacelle
#

what's stopping you from setting up a vps on your better dedi that you got for cheaper

#

that just doesn't hold water

sturdy oar
#

No one

subtle wedge
#

Yes but the issue is that that's not what I have in my main in plugin.yml

sturdy oar
#

But it's not meloncube that is overcharging or something

#

Literally everyone has high vps prices

pastel nacelle
#

more like badcube

opal heron
#

cocomelon

frigid ember
#

LocalDateTime.now(ZoneOffset.UTC).toLocalTime()

#

this already removed the data

#

but I also want to remove seconds, nanoseconds

sturdy oar
#

A 16GB vps from OVH in Italy is 45€ per month

#

So it's the same price if not higher

peak marten
#

Okay stupid question incoming, but does anyone know a good practice for defining a one to one relationship?
Should I use the constructor to define the reference on the parent or child object?

frigid ember
#

there is .format()

pastel nacelle
#

not sure what you're looking for here

frigid ember
#

but how would I only choose hours, minutes

pastel nacelle
#

are you talking about a pair of inseparable objects or something? not really sure what this question is looking for

frigid ember
#

@wwho

frigid ember
#

?

pastel nacelle
#

the stupid question guy

sturdy oar
#

Use node

peak marten
#

Well @pastel nacelle , very specific, I got a class named "Postman" and another class named "Delivery" . A delivery will always have a postman, and a postman will always have a delivery

pastel nacelle
#

the tightest possible coupling would be to have delivery be an inner class of postman

#

and postman hold a public final field holding a delivery

#

initialized in the constructor or in the field declaration

winged sparrow
#

Or just throw the postman in a map with the delivery

peak marten
#

Well, the purpose is that I can retrieve the delivery from the postman, and from the postman retrieve the delivery

pastel nacelle
#

alternatively, make the ctor of delivery private, and make both of the classes hold a public final ref to the other, initialized in their respective ctors

keen compass
#

could just use an interface for this o.O

#

extend one interface from the other

lone fog
#

You could have biMap I guess

keen compass
#

have delivery extend postman, implement delivery in a class named package 😉

pastel nacelle
#

there is no need to bind this into a collection if you don't need a collection

keen compass
#

and you will always have both 😛

pastel nacelle
#

if they are so tightly coupled, why aren't they the same class to begin with

#

or can the delivery of a postman change?

peak marten
#

Because it's not the same

keen compass
#

Anyways object inheritance is what is needed here

#

solves the problem and no collections needed

pastel nacelle
#

maybe... i'm still not quite sure what's happening here

peak marten
#

Inheritance would be good, but they are not sharing the same properties

keen compass
#

they are

pastel nacelle
#

can the delivery of a postman change?

grim halo
#

Maybe dont go for hard references?
Have a PostmanManager that manages a Map<UUID, PostMan> and just have
a postmanID field in your Delivery and vise versa

peak marten
#

It's the opposit. Delivery would be the parent of the postman

keen compass
#

o.O

pastel nacelle
#

pepega

keen compass
#

doesn't make sense in doing it that way, but doesn't really matter which comes first I suppose

pastel nacelle
#

doesn't answer the question either lol

peak marten
#

The postman of a delivery will never change

#

I'm starting to think I should indeed merge everything into one class

pastel nacelle
#

I personally would pair the 2 objects with public final fields holding refs if one class isn't a possibility, but i guess inheritance could be used as well

peak marten
#

But it doesn't sound right :/ It's 2 totally different things

keen compass
#

Well you haven't gave us much to work with really, but I do agree you are probably over thinking this as well lol

pastel nacelle
#

well, this is what inner classes are for

peak marten
#

Okay, so the full idea

keen compass
#

@peak marten Inheritance doesn't make them both the same, just that they are linked together

#

with inheritance you should be able to get one from the other

peak marten
#

A delivery is created and at the same time a postman will be created and assigned to the delivery

#

Then

pastel nacelle
#

if the concept and existence of a class depends fundamentally on another class so that there can not be an instance of class A without a class B associated with it, then A should be an inner class of B

#

think map and map.entry

peak marten
#

I believe inner class is the thing I'm looking for here , still not sure though :/

#

And the thing is, I'm far from a beginner, so I'm most likely overthinking ...

pastel nacelle
#

to reinforce the one to one rule, the parent class should also hold a final ref to the "canonical" instance of the inner class, since there can be multiple instances of it

peak marten
#

Okay @pastel nacelle , I believe the nested class is what I need

alpine kiln
#

Is it really recommended to use an inner class? Even if the use case is sound most linters will raise warnings over using them

keen compass
#

obviously there is multiple ways to go about this

peak marten
#

I can initialize a new Delivery instance

#

with a nested Postman

pastel nacelle
#

not really recommended i suppose, leads to spaghetti pretty quick

keen compass
#

but what @pastel nacelle I agree is the best of the multiple ways to do this

pastel nacelle
#

no real need to use one either, beyond just semantics

keen compass
#

Nothing wrong with nested classes

pastel nacelle
#

personally i would just have 2 top level classes linked with final refs but an inner class would be the "right" way of doing it on some level

peak marten
#

@pastel nacelle , could you show an example usage pls? I'm a bit confused

pastel nacelle
#

class A holds a final ref to class B

grim halo
#

You could also just write a wrapper class that holds both instances and manages them.

pastel nacelle
#

class B holds a final ref to class A

peak marten
#

That is what I was thinking of as well

#

but

#

How can i do that? If the constructor requires an instance of each other?

pastel nacelle
#

whichever is the top dog will instantiate the bottom dog in the field declaration and pass this to the ctor of the bottom dog

#

which will then set its final ref in its ctor

grim halo
#

I mean then you can just put them both in one class... this doesnt sound clean to me. Two instances just holding a reference to each other.

keen compass
#

should be careful to not do some kind of weird recursion btw

peak marten
#

@grim halo , the wrapper doesn't sound bad either, but then I would need to think of a name that would combine both xd

pastel nacelle
#
public class TopDog {
    
    public final BottomDog BOTTOM = new BottomDog(this);
    
}
public class BottomDog {

    public final TopDog TOP;

    BottomDog(@NotNull TopDog top) {
        this.TOP = top;
    }

}
peak marten
#

hmm

#

let me see

#

ah yes