#help-archived

1 messages · Page 180 of 1

pastel nacelle
#

% and / are largely computationally the same

wheat mirage
#

But in this case they clearly don't

#

-16 / 16 = -1

#

-16 >> 4

pastel nacelle
#

integer division doesn't give you floor

wheat mirage
#

= -1

pastel nacelle
#

it "rounds" towards zero

frigid ember
#

no

wheat mirage
#

it truncates

#

Aka it floors

#

lol??

pastel nacelle
#

yes? (Math.floor(-1.0D / 10.0D)) != (-1 / 100)

#

floor will give you -1

#

flooring the result

#

integer division will get you 0

wheat mirage
#

@pastel nacelle oh yeah for signed values sure

pastel nacelle
#

yes.

wheat mirage
#

But how come the signed bit isn't an issue in bitwise operations

#

Is it ignored?

pastel nacelle
#

how else are you going to have negatives

#

if it's not a signed value

wheat mirage
#

But how come the signed bit isn't an issue in bitwise operations
Is it ignored?

pastel nacelle
#

what the fuck

wheat mirage
#

thing got stuck

pastel nacelle
#

thought you'd gone insane

wheat mirage
#

but still, what's the answer to that

pastel nacelle
#

huh? answer to what? division and bitshift are 2 different operations

#

if you are asking why the sign doesn't change in rightshifts

#

it's because >> pads the leftmost bit with the sign bit

#

pads it with zero

#

arithmetic vs logical right shift

wheat mirage
#

So in other words it's ignored, thanks.

wheat mirage
#

use getEquipment().getItemInMainHand()

crimson cairn
#

truncating is not the same as floor

#

cast -1.6 to int vs flooring it

#

youll get different values

#

no

lilac flame
chrome lark
#

vanilla bug afaik, basically something goes derp and so you get a nice # of golems

pastel nacelle
#

imagine writing competent mob spawning code

lilac flame
#

I can kill it with /kill, but that's annoying and I don't want to give everybody on this survival server that permission

pastel nacelle
#

remove villagers from your server

lilac flame
#

I'd rather remove golems than villagers

pastel nacelle
#

golems are just big gray villagers

tacit trellis
light geyser
#

Hi, I have a question regarding permissions children (in plugin.yml)

#

my setup is as follows currently: ```yaml
uhcp.:
description: Grants access to all UHCPlus commands
children:
uhcp.preset.
: true
uhcp.preset.*:
description: Grants access to all /uhcp preset <arguments> commands
uhcp.preset.create:
description: Allows the player to create a new preset

#

if I do it like this, will uhcp.preset.create be a child of uhcp.*?

#

if I were to add uhcp.preset.create as child of uhcp.preset.* that is

stuck quartz
#
if (e.getView().getTitle().startsWith(ChatColor.DARK_RED + "[ChestSecurity]")) {
    try {
        switch (e.getCursor().getType()) {
            case WRITTEN_BOOK:
                e.getView().getPlayer().closeInventory();
                break;
        }
    } catch (NullPointerException ex) {
        System.out.println(ex.getCause());
    }
    e.setCancelled(true);
}
``` I'm trying to make it so when a player click the item with the type as `WRITTEN_BOOK` it closes the inventory, but for some reason the item is going back into place when i click it, but its not closing the inventory
light geyser
#

InventoryClickEvent?

stuck quartz
#

yes

light geyser
#

I use event.getWhoClicked().closeInventoty();

#

Syntax might be off, doing it off my head

#

also for getting the clicked item type, use event.getCurrentItem().getType()

stuck quartz
#

ok

chrome lark
#

Don't catch NPEs...

light geyser
#

and catching that NPE is pretty bad imo, it shouldn't be necessary if you: java if(event.getCurrentItem() == null || event.getCurrentItem().getType().equals (Material.AIR)) return;

stuck quartz
#

ok, thanks

wheat summit
#

Do any of you know how to overwrite the default restart command?

naive goblet
#

OwO catching npe lol

#

Make your own command with the name "restart" ?

wheat summit
#

I tried that though Bukkit/Spigots restart command seemed to overwrite it

lone fog
#

CommandPreprocessEvent?

wheat summit
#

Usually that does work though, not sure why it didn't

#

Ok and check the command there?

naive goblet
#

Hmm try unregister the default restart command then?

wheat summit
#

How so?

naive goblet
#

So reflect the commandmap and do that.

lone fog
#

Likely doesn't work because it's a built in spigot command and takes priority

wheat summit
#

Ok

naive goblet
#

Is it?

sinful spire
#

so probably would need to remove it from the server jar

wheat summit
#

How would I reflect the comand map?

#

Ok

naive goblet
#

Though only the default minecraft commands was

lone fog
#

Yeah it's built in to spigot

wheat summit
#

I may just use a PreProcess Command Event then

naive goblet
#

Let me decompile

wheat summit
#

Thanks!

#

I'll be fine

naive goblet
#

Coll last time I checked it's totally possible to do that

lone fog
#
These commands are only found in Spigot

/restart
Description: Will tell the server to attempt to perform a restart (You must have "restart-script-location" filled out correctly for this to work)
Permission: bukkit.command.restart

/timings on
Description: Turns server benchmark timings on (on demand - no restart required)

/timings off
Description: Turns server benchmark timings off (on demand - no restart required)

/timings paste
Description: Sends all server benchmark timings to http://paste.ubuntu.com which can then be viewed viahttp://www.aikar.co/timings.php

/tps
Description: Will show a super accurate Ticks Per Second (TPS) of your servers current status.
Permission: bukkit.command.tps```
stuck quartz
#

@light geyser its closing, but now the player can have the book on its inventory how do i fix that?

light geyser
#

Cancel the event, then they can't click and take it

stuck quartz
#

i did cancel the event

light geyser
#

Cancel inventoryDragEvent too

frigid ember
lone fog
#

Canceling the click even should be enough

#

Are you sure it's getting hit

unkempt vigil
#

How can i remove resources myself?

#

That I own

lone fog
#

Report it and request delete

light geyser
#

First check if the gui which was clicked in is your gui, then cancel it and do your stuff then

unkempt vigil
#

How long does that usally take?

naive goblet
#

Coll hmm it's kinda akward because the RestartCommand doesn't seem to be in the setDefaultCommands() as those are the spigot cmds right?

#

So theoretically it should be possible to override the RestartCommand

unkempt vigil
#

Are you trying to override the restart command with your own?

naive goblet
#

Not me

unkempt vigil
#

Ah okay, I think I know how.

naive goblet
#

Ik how you'd do that

#

But haven't checked rly.

light geyser
#

Speaking of restarts, any way to restart it without a restart script?

naive goblet
#

not rly?

lone fog
#

Reflection would probably be more efficient than PlayerCommandPreProcessEvent

naive goblet
#

^

lone fog
#

If you know reflection

naive goblet
#

It's not hard

gusty comet
#

I am completely lost right now and completely tired and completely stupid what are the values inbetween and how can i calculate them? Can't just do divide by 5 since i want the first character to be 0 and the last one to be 255 Sorry please don't judge im tired and LOST right now

light geyser
#

Please do explain conclure, I'm using cmdPreprocessEvent quite a lot

unkempt vigil
#

You can replace any command with cmdPreprocessEvent

light geyser
#

If reflection is more efficient, I'd love to know

unkempt vigil
#

You give the event EventPriority.HIGHEST

#

And get the first argument, check if it equals restart or spigot:restart or whatever with / and it's ez

naive goblet
#

It might not be "more efficient" but it does the job.

unkempt vigil
#

No, I know.

#

It's an easy fix for beginners tho.

light geyser
#

For cmdPreprocessEvent you need to check the first arg with a /

naive goblet
#

If you really want to learn reflection, search it up and read about it.

#

But overall it's how to obtain fields, constructors and methods and invoke them without actually invoking them kind of.

lone fog
#

I've used the event to replace /help

stuck quartz
#

@light geyser if the player shift click he can get the book and the inventory closes

lone fog
#

Should probably move to reflection

unkempt vigil
#

For cmdPreprocessEvent you need to check the first arg with a /
@light geyser Yes.

#

I'm thinking about releasing my API for replacing commands really. Its just ReplaceAPI.replaceCommand("cmd", with command);

lone fog
#
        if (event.getMessage().equalsIgnoreCase("/help"))
            event.setMessage("/infobook");
    }``` Pretty easy to use
light geyser
naive goblet
#

I mean reflection is heavily used when it comes to multi compatibility even though multi moduling is little faster.

#

But the main issue would be that many developers doesn't maintain it right.

light geyser
#

I've got a feeling its not really version cross compatible?

naive goblet
#

it is

stuck quartz
#

i cant find a file that can help me in my problem Dutch

light geyser
#

I'm developing for 1.16 only so don't need to check for that much but

#

You should be able to overbloxed,. I've built quite a complicated gui system, I think the easier gui is under .gui.recipes.subgui

naive goblet
#

Well as you can run reflection on runtime makes itself being able to support that.

light geyser
#

Then you've got the main gui class, and the event listener class

tawny gale
#

Hello, je configure vos serveurs Faction pour ceux qui souhaitent venez privé 🙂 (c'est pas gratuit)
For french people

light geyser
#

English please :)

naive goblet
#

^

light geyser
#

We can't help you in French

naive goblet
#

oui oui baguette

light geyser
#

Oui oui, je ne parle pas le baguette xd

wraith thicket
#

Using reflection doesn't guarantee that it'll work for any version. It just works for versions that have the same fields and methods. And given that it's used mostly for NMS, the method/field names are never guaranteed to stay the same across versions

naive goblet
#

^

light geyser
#

Right, so for cross version you might get multiple different codebases for that element

naive goblet
#

Though in minecraft most things doesn't change too much and hopefully you'll have your reflection working just fine.

light geyser
#

Same idea different method names

naive goblet
#

yeah

light geyser
#

Right shouldn't be too much of an issue

#

I tend to dev only for the latest version anyways, since I like to use the latest features, e.g my uhc plugin only does 1.16 because I use netherrite upgrades

naive goblet
#

Not finished yet though.

light geyser
#

Multi modules as in every version has its own module with the correct names for reflection?

naive goblet
#

Reflection and multi moduling is kinda different

#

Reflection is more runtime-based

wraith thicket
#

No - multi version abstraction does not (generally) use reflection

#

That's the entire point

light geyser
#

on mobile so GitHub is a pain lol ¯\_(ツ)_/¯

#

Just guessed

naive goblet
#

If you're going to use reflection, then please cache that reflection :]

wraith thicket
#

That'd be a given, I'd say

naive goblet
#

Get the github app 😮

wraith thicket
#

But obviously not obvious for everyone

light geyser
#

Get the github app 😮
@naive goblet that's a thing? 😮

#

Im getting that now

naive goblet
#

iOS atleast

#

Though it isn't great

light geyser
#

Android too it seems

naive goblet
#

It doesn't skip empty dirs

unique barn
#

hey, I'm new to spigot development but I'd say I'm somewhat experienced in Java, how would you create a plugin that supports multiple versions?

naive goblet
#

:/

wraith thicket
#

Either abstraction + multi module project

naive goblet
#

Xmair reflection or multi moduling

wraith thicket
#

Or reflection

naive goblet
#

Still had that on my clipboard :}

light geyser
#

I built the core of my plugin on 1.15, then switched to 1.16 without having to change a single thing lol

naive goblet
#

yh

#

the api is very nice

light geyser
#

Oh yeah

naive goblet
#

Makes those things possible

wraith thicket
#

It depends on what you're using - there won't be many major changes within the API

unique barn
#

wait so basically multi moduling is writing the same plugin for diff versions again and again?

wraith thicket
#

No

naive goblet
#

Nope

wraith thicket
#

Abstraction + multiple modules

#

You create an interface and implement it for each version

unique barn
#

I see

light geyser
#

O.o conclure I need to spit through your build.gradle, it looks interesting

unique barn
#

Neat

naive goblet
#

You basically have a bunch of abstract methods which you declare for each version then in the main plugin you check the nms version and based on that you get the wanted class.

#

Yeah Dutch I hate multiple build scripts

light geyser
#

I've not used nms yet, I need to look at that tio

naive goblet
#

sry but I am that dude :]

wraith thicket
#

In that sense it doesn't matter whether it's an abstract class that gets extended for each version or an interface that gets implemented for each version

#

But I've found an interface to work for my use cases so far

naive goblet
#

Yeah though I kinda use a generic builder I did have to use an abstract class

wraith thicket
#

I can see how that could/would be useful 🙂

naive goblet
#

Yh though my code is always getting to the spaghetti level

keen compass
#

few ways to go about supporting multiple versions

naive goblet
#

indeed

wraith thicket
#

Knowing your code is spaghetti is better than not knowing 😄

light geyser
#

I thought I was good at plugin dev, now I realized I'm still a noob lmao

keen compass
#

can even go the route of using enum as well if what you are trying to support isn't very large code wise 😛

naive goblet
#

true ford

unique barn
#

I'll give it a try tomorrow

naive goblet
#

Dutch me2

light geyser
#

like my current project is almost 7k lines, so I thought I must be getting decent, but nope apparently XD

wraith thicket
#

lines do not really show much

light geyser
#

True,

keen compass
#

You use Enum to hold the appropriate class for your version, and then can use a class that can choose the appropriate enum based on version, use the enum to load said class 😉

naive goblet
#

Idk but I made a simple core but it took 200kb idk how

light geyser
#

mine is like 350kb noe

naive goblet
#

Frostalf I always do it with the static block

light geyser
#

Including paper lib though

unique barn
#

Are there some specific practices you guys avoid? For example using some specific functions/events as less as you can?

light geyser
#

And apache commons io

keen compass
#

Can use a static block, but enum is static already as well

#

so probably not much different then what you do

naive goblet
#

True true

wraith thicket
#

Not sure what you're asking, Xmair

#

If you need to listen to an event, you have to, well... listen to it

naive goblet
#

Dutch lmfaoo

#

nc one

keen compass
#

@unique barn yes there is certain things that are avoided by some of us developers even though it is in the API. But it really depends on what is being made. Just because it is in the API doesn't mean it is optimal to use.

unique barn
#

Exactly, the last line is basically why I asked the question

wraith thicket
#

I'd certainly try and avoid deprecated methods unless you know and understand why they're deprecated

#

The javadocs is a great start

#

Other than that, as said above, it really depends on what you're doing

keen compass
#

So storing Player objects in lists or hashmaps or some other kind of collection is generally avoided due to how easy it is to not have a correct reference to something involved with it, as well as introducing memory leaks because you forgot to remove it from somewhere when a player left the server

#

that is one of the more popular ones

frigid ember
#

@naive goblet hey my dude

wraith thicket
#

Alongside that, you'd want to refer to players using their UUID not their name (nor the Player object like mentioned above)

unique barn
#

Got it, thanks for the tips

frigid ember
#

I changed the kickme message but now it's default?

light geyser
#

I need to ude some depricated ones, like the getItem in itempickupevent

naive goblet
#

Hi Banana

light geyser
#

Pseudonames there ^^^

wraith thicket
#

I'd also advise against getting offline players by their name unless you're sure they've joined the server because the existing method will freeze the server while doing a network call if no player by the name has ever joined the server

keen compass
#

Here is another one that doesn't seem as obvious. Iterating over chunks can cause some problems. The more optimal way if you really need to iterate a chunk or many chunks, is to grab a copy of said chunk and use a separate thread to get the info you need 😉

#

API has a method for this specific purpose, but I see many people not use it lol

naive goblet
#

Banana hmm let me check the plugin

light geyser
#

Chunks and efficiency...my chunk generator is not thst xd

#

Before I optimised it it would eat 20 gb of ram

#

Now only 500mb :)

wraith thicket
#

Frostalf - when you say "iterating over chunks" you most likely mean iterating over blocks in a chunk 🙂

keen compass
#

Even getting entities

#

Also, people don't know the difference between using BasePlugin and JavaPlugin either. If your plugin is an API for other plugins, it should extend BasePlugin and not JavaPlugin 😉

wraith thicket
#

Well yeah, but my point is you're not iterating over chunks but the contents of one chunk

keen compass
#

True

unique barn
#

That reminds me, is there any method to load a chunk even though a player isn't near it?

keen compass
#

yes

lone fog
#

Pretty sure getChunk loads it

keen compass
#

There is even some methods that will load a chunk for you without you realizing it too

light geyser
#

I'd recommend using paperlib for loading chunks

wraith thicket
light geyser
#

Way more friendly on ram

wraith thicket
#

Javadocs is a neat place to look for all types of things @unique barn

light geyser
#

In my observation at leasy

lone fog
#

Someone said paper

#

Quick, get em

unique barn
#

Javadocs is a neat place to look for all types of things @unique barn
@wraith thicket alright, I'll look it up next time, thanks

keen compass
#

You are even free to look at the server source too to see how some things are implemented

#

quite handy if you need to know if an event is thrown before an action or after

#

or if whether or not in the event the server accepts your changes without first cancelling it

wraith thicket
#

Yeah, I often end up grep'ing the source for events

light geyser
#

Yup same

unique barn
#

lol that reminds me of my days in VCMP, had to check the source code of a plugin to find function names because there was no wiki at all (and the language didn't have an IDE)

keen compass
#

but yeah, I do wish people would use BasePlugin more often though for their API's

#

extending JavaPlugin most times prevents your API plugin from being able to be shaded

wraith thicket
#

The worst user experience I have is with RealBasic 2011

keen compass
#

lol

wraith thicket
#

I was expecting elaboration as to why that was lol funny

forest sigil
#

Wait, does translateAlternateColorCodes​ work on hex codes? Such as: player.sendMessage(ChatColor.translateAlternateColorCodes​('#', "#FFFFF Test")); ?

naive goblet
#

Yeah

forest sigil
#

dang

naive goblet
#

The bungee one I think

forest sigil
#

ye

naive goblet
#

You'd do something like &x&F&F&F&F&F&F iirc

forest sigil
#

oh

lone fog
#

Yeah because weird format

forest sigil
#

hm ok

#

kinda annoying

naive goblet
#

You could make a function so #XXXXXX would work

keen compass
#

translateAlternateColorCodes only does one thing. It replaces the character that you choose to use with the section symbol for you

#

It can work with Hex but it is more involved since you need to use TextComponents to use Hex

lone fog
#

Point is the format should be &#ffffff

#

Idk if that would have caused issues

naive goblet
#

Maybe default minecraft accepts values like §x§f§f§f§f§f§f

frigid ember
#

I need to get the object that placed a boat

#
        Object cause = event.getCause().getRootCause();```
#

So this was for BlockPlaceEvent

stiff thistle
#

Hi I am Japanese so I use Google Translate. So English may be strange.
I'm sorry then.
So what I would like to ask today is if you know a Placeholder that displays the total number of people in Minecraft Server.

frigid ember
#

but I need it for VehicleCreateEvent

#

%server_online% if im correct @stiff thistle

stiff thistle
#

tenkyou

naive goblet
#

Why are you getting it as an Object

frigid ember
#

the other dev did that with another flag and it was for placed waterbuckets

crimson sandal
#

Man, the api hasn't updated my latest version and it's telling all my users there's an update available 😦 https://api.spigotmc.org/legacy/update.php?resource=71355 I deleted the resource "v2.0 Release" and replaced it with "v2.0-Release" But the api is still showing the old version?! Haven't seen this happen before

forest sigil
#

Thinking of making a colour utility for 1.16 that will allow for hassle free hex code formatting in messages, based on 6bit RGB hex codes.

naive goblet
#

Just cuz someone else does that doesn't mean it's necessarily good

#

Nice

frigid ember
#

than what should be done to check what/who placed a vehicle?

crimson sandal
#

Anyone got any idea why that endpoint is showing the wrong version? 🙂

naive goblet
#

The instance that is retrieved from that method?

#

The type of it

#

Packet I mean it's not hard to just make a quick system for handling that but would be awesome

wraith thicket
#

@crimson sandal The version of the plugin is 2.0-Release - the version you've specified is v2.0-Release

crimson sandal
#

Ah man I'm legitimately blind af lmao. Although how come the hyphen gets removed too?

wraith thicket
#

The API simply doesn't update every minute - I believe it's every 6h

#

So your last version change thus hasn't been taken into account yet

balmy sentinel
#

Any idea why I'm still able to connect? event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, "testing loser"); The event is registered I put println statements before and after and both are printed to the console, but I still connect. I'd rather check on AsyncPlayerPreLoginEvent instead of PlayerJoinEvent

crimson sandal
#

Ahh! So If I reupload now I should beat the 6h refresh hopefully? 😄

naive goblet
#

The bungee chat api isn't included in legacy versions right?

wraith thicket
#

No, james

crimson sandal
#

Oh it legit is just a 6h wait from the upload? I thought it'd just be a cache thats being updated every 6h?

wraith thicket
#

It's updated every 6h. I don't know when those 6h are up exactly, but they do not depend on whether or not you upload a new version

crimson sandal
#

Yeah that's what I'm saying, there must be around 1-2 hours left on the refresh, since it's been 4 hours since I uploaded the last version

wraith thicket
#

Oh, you said "beat the 6h refresh", I thought you said "bypass the 6h refresh"

#

But whether or not you'll beat it, I'm not sure, because your last upload hasn't been taken into account and it was 4h ago, therefore there's less than 2h left

crimson sandal
#

Yeah I just deleted the old version and pushed the new one. It would be quite nice if there was a way to edit version numbers haha

wraith thicket
#

You can edit the version number without uploading a new one

crimson sandal
#

facepalm

light geyser
#

You could make a function so #XXXXXX would work
@naive goblet i used ChatColor.of("#" + sixDigitHex)

crimson sandal
#

How? 😄

light geyser
#

Chatcolor from the bungee apibtw

naive goblet
#

Ik

#

I do something else though

light geyser
#

Then you dont need to worry about odd formatting, and just pass along the hex value

#

Do tell :) i use hex too in my plugin, love to know more options

wraith thicket
#

It was the other way around - you can upload a new version without changing the version number - my bad @crimson sandal

crimson sandal
#

Ahhh I get you 🙂

#

The forum/resources site is all closed source I'm assuming yeh?

lunar swift
#

Sorry for bothering anyone here, but is this the right place to ask for help about spigot.yml? I see a lot of stuff that seems like it's related to development :/

light geyser
#

Nah some plugins are open source

naive goblet
#

The bungee chat api isn't included in legacy versions right? ? ?

light geyser
#

That idk

#

Can you shade it in?

naive goblet
#

It is only shaded in 1.16.1 spigot jar right?

light geyser
#

I believe 1.15 too

wraith thicket
#

It's also included in other versions

light geyser
#

I've only tried it on 15 and 16

wraith thicket
#

Don't know which ones particularly, but I've imported the wrong one many a time

scarlet rover
#

Does anyone know how the BlockBreakEvent handles cascading block breaks? I have this code

public void onBreak(BlockBreakEvent e){
        if(e.isDropItems()  && !e.isCancelled() && e.getPlayer().getGameMode()== GameMode.SURVIVAL){
            Player player = e.getPlayer();
            if(!arrayManager.INSTANCE.autoPickupList.contains(player.getUniqueId())) {
                ItemStack mainhand = Objects.requireNonNull(player.getEquipment()).getItemInMainHand();
                e.getBlock().getDrops(mainhand).forEach(item -> {
                    HashMap<Integer,ItemStack> droppedItems = player.getInventory().addItem(item);
                    if (!droppedItems.isEmpty()) {
                        e.setDropItems(true);
                        MessageBuilder.sendBarToPlayer("your inventory is full!", player);
                    }else{
                        e.setDropItems(false);
                    }
                });
            }
        }
    }```
And it works in giving the player the item form of whatever block they broke, but if there is something like a torch or redstone attached to the block the items just get deleted.
wraith thicket
#

@crimson sandal Should be standard Xenforo as far ass I'm aware

#

@lunar swift You'd be fine asking about that here

naive goblet
#

Hmm well I have no usage for the bungee chat api anyways other than 1.16+

subtle blade
#

or, you know, hover and click events

lunar swift
#

Thank you ford. Basically, my question is probably dumb, but I'm trying to get hoppers to transfer more than 1 block (if that's possible). I thought I set it up right, and hoppers are ACCEPTING stacks at a time, but they are still transferring 1 at a time. Here's my hopper file in spigot.yml https://pastebin.com/gLryLx4s. I'm sorry if this isn't possible with spigot, but my players keep complaining about the slow transfer rate

naive goblet
#

Well Dutch the way I make my stuff compatible is by having a static Function<String, String> which I initialize at runtime and then a static method obviously applying that function on the string.

#

Works fine for me :]

stuck quartz
#

how do i check if 2 Block variables is representing the same block in the world?

wraith thicket
lunar swift
#

i did read that Ford and i thought i did it right, but it still doesn't seem to work? i'm at a loss aha

wraith thicket
#

@stuck quartz - blocks should only have one instance as far as I know, so you should be able to simply compare the references. Failing that, you could always compare their locations

stuck quartz
#

this boolean below is checking if both values above is the same

#

var1 == var2

wraith thicket
#

@lunar swift - if you want (up to) 64 items being tranfserred every 2 seconds, that's what should do the trick. I don't really know more

lunar swift
#

i guess i'll just keep testing until it works haha. thank you Ford! 🙂

wraith thicket
#

@stuck quartz Are you sure they're in the same world?

stuck quartz
#

yes

spare frost
#

Does PlayerInteractEvent when left clicking a block not work while the player is in GameMode.ADVENTURE?

wraith thicket
#

@stuck quartz When in doubt, you can always check their location equivilance

stuck quartz
#

ok

wraith thicket
#

@spare frost The event is likely fired as cancelled

spare frost
#
    @EventHandler
    public void onBlockHit(PlayerInteractEvent event) {
        Bukkit.broadcastMessage("PLAYER INTERACT");
        if (event.getAction() != Action.LEFT_CLICK_BLOCK) return;
        Bukkit.broadcastMessage("BLOCK LEFT CLICK");
``` I don't get "PLAYER INTERACT" when I left click a block. I only that message when I right click one.
#

Is there a way around that?

wraith thicket
#

Well, the default behaviour is to include cancelled events in event handlers so if it was cancelled, you should still see it

#

So therefore it's possible it's not getting called

bold anchor
#

Might just be iffy

keen compass
#

@balmy sentinel I don't think anyone answered your question. You are limited in what you can do in the pre-login event

spare frost
#

Well what should I do?

keen compass
#

in most cases you don't have the player name or UUID in that event, just their IP address

#

the appropriate event to use is the Login event

balmy sentinel
#

I’ll look it up Frostalf thanks

keen compass
#

for instance, you can't kick during a pre-login event

#

but you can cancel it to stop it though.

wraith thicket
#

Perhaps the BlockDamageEvent? Although that might not get called either @spare frost

balmy sentinel
#

well when I was looking at the docs for AsyncPlayerPreLoginEvent I figured event.disallow would stop the connection but it didn’t I’ll look at PlayerLoginEvent right now

keen compass
#

so You won't be able to send a message to the client in that event, but you can still stop them from connecting. If you want them to get a message they are banned, need to do it in the LoginEvent as that is when the server has the UUID of the player which is what the server uses to lookup who is banned lol

grim halo
#

Isnt there a Result you can set in the AsyncPlayerPreLoginEvent

balmy sentinel
#

yes but it was still allowing the player to connect

#

Thanks Frostalf!

spare frost
#

I think I should use PlayerAnimationEvent :/

balmy sentinel
#

tbh I never actually “banned” the player lmao I just checked if they had an active punishment in my database and if they did I kicked them

stuck quartz
#

@wraith thicket i checked the blocks, i checked the location, i checked the world, and they are exactly the same, yet it doesnt work

keen compass
#

only reliable thing in the pre-login event

#

is the clients IP address

undone narwhal
#

Is it possible to get an argument from the command used to launch the server inside a plugin?

keen compass
#

Yes

#

You need to use RuntimeMXBean

undone narwhal
#

Thanks, going to check that out

stuck quartz
#

im going to try .equals

keen compass
#

It will give you a list of JVM arguments that was used for the currently running JVM application

#

for the arguments after the jar name, you need to grab those from the server unfortunately

#

since those are not JVM arguments usually

undone narwhal
#

Awesome !

#

Thanks ❤️

grim halo
#

If you use -D parameter you can just get them with

eg -Dtest="something"
System.getProperty("test");
keen compass
#

D parameters are not the same as JVM arguments

#

but yes you can do that for D parameters
However if you want to get the parameter -nogui you will have to grab those from the server using reflection however or other option specified. What you can specify in the server.properties can be specified on the command line

spare frost
wraith thicket
#

You're welcome to do that if it'll make your life easier

stuck quartz
#

@wraith thicket i tried var1.getLocation().equals(var2.getLocation())

#

and it worked

grim halo
#

Events are usually used as part of an api. So if you want other plugins to interact with this event or if you fire this event in a library you use for all your plugins its usefull.
Other than that you dont really need to.

keen compass
#

.equals does an object value's check == does a reference check IE if both point to the same memory address @stuck quartz to help know when to choose which one 😉

smoky vigil
#

Anyone know of a plugin which allows you to make anvils unbreakable? I know theres a permission node for CMI, cmi.command.unbreakable.player, would this node also work as cmi.command.unbreakable.anvil, or is there any way to set the player paremetre to global?

spare frost
#

ok

obtuse dagger
#

buildtools not working:(

grim halo
#

elaborate

obtuse dagger
#

i get it

#

i run java -jar BuildTools.jar --rev 1.8.8 and I get a spigot thing

#

but the tutorial says i need to get both bukkit and spigot

grim halo
#

You dont. The Spigot jar is your server jar. Write a bat or sh to run it and you are done

obtuse dagger
#

ok thx

#

also i get 1.15

#

but i want 1.8.8

#

is there a way to get a universal one

#

for making a plugin

wraith thicket
#

lol no

obtuse dagger
#

:(

wraith thicket
#

That's not how these things work.

obtuse dagger
#

but y am i getting 1.15

#

when i do --rev 1.8.8

wraith thicket
#

But --rev 1.8.8 should be produce 1.8.8 jar - if you ran it without, you should now have both

obtuse dagger
#

but i only have 1.15

grim halo
#

I just copy pasted your arguments and got a 1.8.8 jar

obtuse dagger
#

then idk

wraith thicket
#

Are you sure that build tools actually built a jar when you run it with the --rev 1.8.8 option? Because it won't for java version greater than 8

obtuse dagger
#

idk what java version i have

#

how do i check?

wraith thicket
#

Well, you'll see from the output whether or not it ran

grim halo
#

terminal -> java -version

wraith thicket
#

But java -version

obtuse dagger
#

C:\Users\Playe\Downloads\Extreme client>java -version
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)

C:\Users\Playe\Downloads\Extreme client>

#

so i need to downgrade?

wraith thicket
#

No, your version is just fine

#

java -jar BuildTools.jar --rev 1.8.8 will build 1.8.8

#

Just like the good old days half a decade ago

grim halo
#

6 years by now i think

wraith thicket
#

I think 1.7 is 6y, 1.8 still 5

#

Well, 1.8.8 is almost 5 at least

keen compass
#

1.7 is 7 years old

#

1.8 is 6 years old

obtuse dagger
wraith thicket
#

1.7.10 is 6 years old

grim halo
#

1.8 release -> 2. September 2014

keen compass
#

technically 5 years, but we are like 2 months away from then

#

so might as well say 6 😛

wraith thicket
#

Well, 1.8.8 was July 27 2015 - which isn't 5 yet

keen compass
#

1.7.10 was released in December if I recall correctly, becuse 1.7.2 was released in October

grim halo
#

Sure but i like to shame the ppl who run 1.8 so ill stretch a bit

keen compass
#

lol

#

I really don't mind people who want to run 1.8

#

I do mind people who want to run legacy software, but don't want to bother maintaining it themselves

#

or expect there to magically be fixes to bugs they encounter XD

wanton delta
#

frost i uh dont mean to bother but i just wanna make sure lol

#

"old" is what i should be looking out for right

keen compass
#

old is where objects go when they survive a GC like once or twice

wanton delta
#

and yea i dont like it when 1.8 users come here with support and get made i shrug at them

#

so does high old mean potential leak

keen compass
#

your old generation shouldn't be very large

wanton delta
#

👍 it was at like 2/3 the way there before i restarted and looked at the heap

wraith thicket
reef sparrow
#

How do I get the IP Addresse from a player

keen compass
#

your profiling looks good though @wanton delta

#

your old Gen has space for 2.5G but only 560MB is being used there

#

Your GC is doing its job like it is supposed to

#

and not causing drastic pauses

#

And the timings for each look good too

stuck quartz
#

how do i get the title of the inventory in InventoryMoveItemEvent.getSource()?

keen compass
#

getInventory().getTitle(); I think is what it would be

wheat mirage
#

@wraith thicket Do you know if the "Removing entity while ticking" error is meant to be a thing when teleporting players between worlds during an event?

wraith thicket
#

You don't - an inventory doesn't have a title, an inventory view has a title

wheat mirage
#

I get it quite a lot

keen compass
#

Ah right, I was confused Drives_a_ford is correct

#

should listen to them 😛

#

you can't remove entities that the server is doing things with

wraith thicket
#

@wheat mirage just run the teleport on the next tick

wheat mirage
#

Basically is it an API bug or is it just something be dealt with

keen compass
#

it is along the lines of a CME

wheat mirage
#

@wraith thicket that allows players to logout inbetween

#

I did extensive testing

#

I have a workaround but it seems like a pretty big issue

wraith thicket
#

Then check for that at teleport time?

obtuse dagger
#

@wraith thicket thx but mustang is better

wheat mirage
#

@wraith thicket Yes but then they avoid any delayed behaviour

#

or the teleport itself

#

Players can logout inbetween to avoid being tp'd

wraith thicket
#

You can just keep track of them and TP them to the correct location once they join

wheat mirage
#

Would appreciate if there was an officially endorsed way to do it

#

Seems a little hacky to me

wraith thicket
#

The thing is, when you TP a player during some events, the server is busy "dealing with" that entity so when its location changes abruptly there's issues.

wheat mirage
#

Yeah sadly that's the case

#

It never used to be a thing in older versions

#

1.12 I could do this no problem

wraith thicket
#

But if those issues don't really manifest into real problems, you might also get away with just having them in console

wheat mirage
#

Suddenly teleporting between worlds is a huge issue

#

@wraith thicket They manifest into HUGE issues

#

ghost players etvc

#

The player stays in the same dimension, can't send chat

#

They become detached from their playerentity almost

#

it's awful

wraith thicket
#

OK, well then you'll need to deal with it

#

I'm not sure what event you're on exactly

wheat mirage
#

Still, if you think it'd be able to be added or fixed API-side, that would be appreciated for spigot

stuck quartz
#

You don't - an inventory doesn't have a title, an inventory view has a title
@wraith thicket what could i do to check if the inventory that the item is getting moved into is a gui that i created?

wheat mirage
#

@wraith thicket Almost any, most cases, entitydamagebyentityevent

#

the player being teleported is the victim

wraith thicket
#

@wheat mirage Well, then there's your first issue - if you teleport the target, then they would get hit in their original location after being teleported (unless you cancel the event, but still server runs something else after which obviously seems to be an issue)

#

@stuck quartz How would an item be moved into a GUI exactly? It's not in the world

winged sparrow
#
nightvison_worlds:
  - world_nether
  - world
``` So this is my config. I did the whole:
```java
getConfig().options().copyDefaults();
saveDefaultConfig();

However, this bit of code is throwing a NPE at the line that checks if the list contains the current world.

    @EventHandler
    public void joinServer(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        player.removePotionEffect(PotionEffectType.NIGHT_VISION);
        World world = player.getWorld();
        List<String> list = (List<String>) plugin.getConfig().getList("nightvision_worlds");
        if (list.contains(world.getName())) {
            player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 200000000, 0, false, false, false));
        }
    }```
stuck quartz
#

im trying to stop the player from moving something from a chest inventory (that i created) to a player inventory (the inventory from inventory)

winged sparrow
#

Anyone know why?

wraith thicket
#

@wheat mirage There is no general "fix" for things happening in a certain order on the server (which is what you're asking for)

#

@winged sparrow You should probably use #getStringList

wheat mirage
#

@wraith thicket It's cancelled.

#

And it worked in older versions

#

Which is the strange bit

#

But anyway, spigot could still implement a workaround in the #teleport function

wraith thicket
#

@stuck quartz That's not what the InventoryMoveEvent is for - read the javadocs. You need the InventoryClickEvent

wheat mirage
#

As a delay of 0 ticks is sometimes too long.

stuck quartz
#

ok

wraith thicket
#

@wheat mirage There is no general "fix" for things happening in a certain order on the server (which is what you're asking for)
@wraith thicket

wheat mirage
#

@wraith thicket The old entityplayer could be hidden and silently maintained in the dimension it's being removed from until safe to do so.

wraith thicket
#

You're welcome to PR

wheat mirage
#

Just proving the point that it is possible to fix, I may PR for the sake of other users, but I can always hack around it

wraith thicket
#

I can guarantee it's not that simple.

wheat mirage
#

It just seems unintuitive that a teleport inside an event, a perfectly valid use of the API can error in such a way.

#

And of course it isn't simple, but it's not going to be impossible @wraith thicket

#

Especially for a developer of md_5's talents

wraith thicket
#

If you believe the issues you're having to be a bug, you can also try posting a bug report on jira

wheat mirage
#

that's why I'm asking you as a mod if you think it's worthy of one @wraith thicket

wraith thicket
#

(which would also be needed for a PR, really)

wheat mirage
#

I've done some NMS testing and saving the entityplayer for disposal / killing until the next bukkit task tick seems to work well.

winged sparrow
#

@wraith thicket i'm now using getStringList, and now it doesn't throw a NPE but I can't get anything from it

grim halo
#

Is the list empty?

wraith thicket
#

You're not actually copying the defaults, though

winged sparrow
#

The list is not empty.

wraith thicket
#

You need to pass true to #copyDefaults

winged sparrow
#

Wait, where would I pass true?

#

oh

wraith thicket
#

Right now you're simply "querying" whether or not the config copies defaults

winged sparrow
#

Weird, I didn't have to do all this for this functionality in 1.15

grim halo
#

If the list is not empty then i dont understand the "I can't get anything from it" part

wraith thicket
#

The list is empty - that's why he was getting an NPE when using #getList and not one when using #getStringList

#

They're just expecting the list to be not empty

grim halo
#

Thats why i asked

wraith thicket
#

And this is nothing new. You probably had a different situation

#

I.e if you save the default config and it already has a list, you don't have to copy defaults

winged sparrow
#

I tried doing a System.out on everything in the list, and I'm not getting a NPE I'm not just getting anything at all.

wraith thicket
#

But if you add something to the config, you may want to copy the defaults in, which is what passing true will do

#

Yes, the list is empty.

winged sparrow
#

It shouldn't be

#
        List<String> list = plugin.getConfig().getStringList("nightvision_worlds");
        for (String string : list) {
            System.out.println(" - " + string);
        }```
#
nightvison_worlds:
  - world_nether```
#
    @Override
    public void onEnable() {
        getConfig().options().copyDefaults(true);
        saveDefaultConfig();```
wraith thicket
#

Is that the context of config.yml in plugins/<plugin name>/ folder?

winged sparrow
#

Yes.

wraith thicket
#

nightvision_worlds
vs
nightvison_worlds

#

You're missing an i in config.yml

winged sparrow
#

Of course that’s the problem.

#

Thanks.. lol

keen compass
#

Just proving the point that it is possible to fix, I may PR for the sake of other users, but I can always hack around it
@wheat mirage that doesn't prove it is possible to fix and this is going under the assumption it is broken. This means that something changed between the versions that requires you to use a different method.

outer ginkgo
#

If i have my phsycal server, how can i install spigot to my server? Im very new at this (also if here is somebody that speak spanish is better)

keen compass
#

As I stated earlier, the Ticking Entity Exception is basically a CME but not quite the same

#

CME = Concurrent Modification Exception

#

however it isn't a CME because it isn't occurring Concurrently. Therefore, we have ticking entity exception. Basically the server expected an entity and there wasn't one or you are trying to remove an entity the server is currently doing something with.

fleet crane
#

not 100% sure what the context is, but there's a good chance that it was just silently broken in a previous version

#

you're welcome to submit what you think is a fix for review though

wheat mirage
#

@fleet crane When teleporting a player to a different world in an many contexts, the player bugs out horrribly

#

And it throws an error in console about removing an entity during ticking

fleet crane
#

because youre doing it in a teleport event no doubt

wheat mirage
#

It's an entitydamagebyentityevent

#

Actually

#

Where the player is the victim

#

Even more strangely

fleet crane
#

when they're dying?

wheat mirage
#

It happens in a couple other events I notice

#

The event is cancelled

#

So I guess not @fleet crane

fleet crane
#

open a clear bug report or fix it yourself

keen compass
#

basically they are trying to teleport the player during certain events

fleet crane
#

moaning that it used to work and now doesn't won't get anything done

wheat mirage
#

Alright, if you consider it something worth fixing

#

I wasn't moaning, I was noting, thanks.

fleet crane
#

in a damage event where the player is not dead I would consider it a bug (probably)

#

in eg a teleport event I would consider it user error

wheat mirage
#

Alright, I'll file a bug report when I next get chance

keen compass
#

?jira

worldly heathBOT
keen compass
#

relevant link for you

wheat mirage
#

(probably)

sturdy oar
keen compass
#

it makes sense to me though why that exception is being thrown

#

guess it doesn't make sense for some people lol

#

not saying it can't be changed

wheat mirage
#

Yeah it does make sense, but there are ways around it

#

And this seems like something not uncommon in the usage of the API

keen compass
#

well obviously, otherwise there wouldn't be exceptions

wheat mirage
#

If we're looking for forwards compatibility, it atleast is worth a look obviously

keen compass
#

XD

#

not everything can always be forward compatible

wheat mirage
#

True, but that's a big goal of spigot

#

As I'm told by the mods

keen compass
#

there is going to be times where it is unavoidable to change something's behavior

wheat mirage
#

Thanks Captain Obvious, you have saved the village!

keen compass
#

Just saying I know it is spigots goal to maintain consistency

#

just even though that is the goal it doesn't mean it is unavoidable and it should be expected

wheat mirage
#

?paste

worldly heathBOT
grim halo
#

?help

#

Whare can i find all pins?

stuck quartz
#

how can i stop the player moving something from their inventories to the chest they opened?

grim halo
#

InventoryClickEvent and InventoryDragEvent

stuck quartz
#

i want to let them move inventories in their inventories, but stop them from putting these items in the open chest gui

grim halo
#

InventoryClickEvent and InventoryDragEvent
@grim halo

wraith thicket
#

Then you'll need to catch a lot of different things.

grim halo
#

There are a lot of cases you need to consider

wraith thicket
#

I'd personally cancel the drag event in the appropriate inventory

#

And keep in mind, there's plenty of times you want to cancel the event even if the click is in the player's own inventory

#

All in all, this is not trivial. But it's not rocket surgery (™ choco), either

wheat mirage
#

A workaround of delaying a task to teleport by 0 ticks is decent, but it is possible for the player to logout inbetween and avoid the teleport entirely.

stuck quartz
#

whats the max slots amount when creating a chest gui?

#

nvm, its 54

winged sparrow
#
            plugin.getConfig().getStringList("nightvision_worlds").add(args[1]);
            plugin.saveConfig();
            plugin.reloadConfig();
#

Any glaring reason why this would not add a string to a string list?

south talon
#

that adds to the String list

#

but you need to save that string list to the file

winged sparrow
#

I see, how would I do that?

#
            List<String> modifiedList = plugin.getConfig().getStringList("nightvision_worlds");
            modifiedList.add(args[1]);
            plugin.getConfig().set("nightvision_worlds", modifiedList);
#

I assume like this?

south talon
#

yes

#

and then save the config

#

to update the file

winged sparrow
#

Yep, that worked!

#

Thanks

keen compass
#

should pay attention to getters and setters

pastel nacelle
#

or more specificly whether the returned collection is a clone or not

frigid ember
#

whats better for larger projects, reflection or abstraction?

keen compass
#

abstraction

#

reflection is slow

#

so you should only use if it is necessary

frigid ember
#

ok

naive goblet
#

reflection is not that much slower if used right

frigid ember
#

what do you mean "if used right"

naive goblet
#

caching it for instance

frigid ember
#

oh ok

naive goblet
#

I've seen pretty nasty reflection code blocks reflecting same fields and invoking accessible everytime.

frigid ember
#

so basically just get a field and store it somewhere so you're not always getting it and making it accessible?

naive goblet
#

pretty much

#

depends on what you're doing

keen compass
#

not saying you can't use it, just if you don't need to then don't

naive goblet
#

^

frigid ember
#

abstraction seems more efficient but reflection would allow for less copying code

keen compass
#

most people who use reflection, really don't need to. You should really evaluate your reasons for using reflection

naive goblet
#

nah abstraction can be used effectively

#

Well only make yourself override necessary code

keen compass
#

the other downside of using reflection, is it makes debugging that much harder

naive goblet
#

yeah thats true

keen compass
#

you can even introduce memory leaks as well or unintended side affects using reflection

#

but like I said, I am not saying you can't use it. Just you really need to use for the right purposes or reasons and not just because you want to be lazy

naive goblet
#

Yeah I see a lot of people who makes malicous memory leaks with reflection.

marsh hawk
#

Is it possible to automatically get the jar from my CI/CD, put it in my plugins folder and restart the server

keen compass
#

yes

marsh hawk
#

any existing programs for that or have to write itmyself?

keen compass
#

is the server and CI on the same system?

frigid ember
#

well i guess i would rather copy code 3 times than deal with the side effects of reflection, cons seem worse than abstraction

marsh hawk
#

seperate machines, local network though

keen compass
#

you can set in the CI to upload the jar to the second server and the directory it uploads to be the plugins directory

#

then you can set in the CI at the end to use SSH to run a command on the second machine to restart the server

#

I assume you are using Jenkins so this is all relatively easy to set up with that CI

#

you could condense this down to using a custom bash script

#

so that the CI only invokes the bash script instead

naive goblet
#

Skeagle

#

What code to be specific

#

Nms?

marsh hawk
#

Oh awesome I'll look into that

frigid ember
#

npc stuff and pathfinding

marsh hawk
#

thankyou

naive goblet
#

oh yeah that's copy paste sadly

#

doesn't take too long though

frigid ember
#

hmm ok

#

at least i dont plan to support all the way down to 1.8

naive goblet
#

I do it all the time

frigid ember
#

that must be a nightmare for the people who do...

naive goblet
#

Yah

#

Nah

#

Most stuff doesn't change too much

#

And I have a plugin that makes it pretty efficient

winged sparrow
#

Is anyone good at ProtocolLib?

#

I'm trying to disable a specific sound made by the server.

wind dock
#

Anyone know how to create an a record to redirect to an ip that doesn't have the port 25565

frigid ember
#

yeah use srv

#

you can specify the port in that

wind dock
#

Oh ok, do I set it up the same way?

frigid ember
#

as...?

wind dock
#

A records

#

Wait

#

I dont have access to srv :/

frigid ember
#

oh

wind dock
frigid ember
#

oh ok

wind dock
#

I mean i do have a namecheap domain as well, but those don't work well

#

Well it works fine it just doesn't fit with my server:/

frigid ember
#

wdym? i use namecheap with cloudflare

#

works perfectly fine

wind dock
#

What do you use cloudfare for? Ddos attacks for your website?

#

Also its just that the name doesn't fit lmao

frigid ember
#

no i use it for dns records too

wind dock
#

Oh

#

Welp

cyan kraken
#

Buenas noches, alguien que hable español? Necesito ayuda con un pago

pastel condor
#

Yo no hablo much espanol

cyan kraken
#

tengo un problema con un pago que realice

#

Hace 22 horas pague por el plugin BannerBoard y hasta ahora no puedo descargarlo

wind dock
#

@frigid ember since you use namecheap: stupid question and not about spigot, but is there a limit to how much activity you can send through your domain(

frigid ember
#

not sure

wind dock
#

Dang

#

Idk if i want to use my domain since I'm setting up a pretty big minecraft server for someone

pastel condor
#

I would recommend using it

#

it's really good

keen compass
#

@wind dock no

#

that isn't how that works

wind dock
#

There's no limit right

keen compass
#

if there is, then they are a very stupid DNS hoster

pastel condor
#

you're talking about cloudflare right?

winged sparrow
#
    public void initializeProtocolListener() {
        ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
        protocolManager.addPacketListener(
                new PacketAdapter(plugin, ListenerPriority.NORMAL, PacketType.Play.Server.NAMED_SOUND_EFFECT) {
                    @Override
                    public void onPacketSending(PacketEvent event) {
                        if (event.getPacketType() == PacketType.Play.Server.NAMED_SOUND_EFFECT) {
                            Bukkit.broadcastMessage("Sound played");
                            Bukkit.broadcastMessage(event.getPacket().getStrings().toString());
                        }
                    }
                });
    }```
This is what I'm using to listen to sounds playing, but I'm not getting any output. The only time I was getting errors from this was when I was trying to get a field that didn't exist, but otherwise NOTHING is being put out in either broadcast.
wind dock
#

Oh ok

keen compass
#

if you want a cheaper alternative as far as dns hosting goes, can always use afraid.org

#

costs $5 to keep your domain private which is reasonable and you can create any kind of record you want

wind dock
#

Yeah

#

Thing is they take a LONG time to update lmao

keen compass
#

most of the time they don't

#

what you are actually experiencing is dns propagation

pastel condor
#

costs $5 to keep your domain private which is reasonable and you can create any kind of record you want
Thats insane

#

is it a one time fee?

keen compass
#

odds are your ISP DNS isn't fetching like it is suppose to 😛

#

@pastel condor no, its a monthly fee

pastel condor
#

thats over priced

#

😭

keen compass
#

by what metric are you using?

#

o.O

pastel condor
#

by a kid with no money lmao

keen compass
#

lmao

#

you can use their service for free btw

pastel condor
#

but they steal your domian.....

keen compass
#

and just never allow people to use a subdomain off your domain 😛

#

they don't steal it

pastel condor
#

*they steal subdomians

wind dock
#

Oh

cyan kraken
#

@loud kindle Sorry friend, I don't know if you can help me, 22 hours ago I paid for the BannerBoard plugin and I still can't download it.

keen compass
#

they don't steal subdomains either

pastel condor
#

then what do they steal?

keen compass
#

at anytime you can revoke someones use of a subdomain

pastel condor
#

oh fun

wind dock
#

I mean i got my namecheap domain for 1 year

#

For 2 bucks

pastel condor
#

oh nice

#

I had to pay 8 😦

wind dock
#

I mean it was a .host

keen compass
#

You also have no obligation to allow subdomains either

wind dock
#

Which isn't the greatest, but an ok one

pastel condor
#

You also have no obligation to allow subdomains either
Then why pay a $5 fee?

keen compass
#

because there is other services I use

pastel condor
#

ah

keen compass
#

such as more domain hosting space

pastel condor
#

oh I see

keen compass
#

also it keeps my domains out of the public searchable area

#

so I don't have to deal with people wanting subdomains

#

See people can use subdomains from your domain, but its not automatic unless you set it that way

#

they have to ask you

pastel condor
#

what I do for dynamic dns is I use no-ip.com, then I setup a cname record via cloudflare to it

wind dock
#

Whats srv priority

pastel condor
#

they have to ask you
ah okay

keen compass
#

if you have multiple srv records

#

it defines which should come first

wind dock
#

Oh... so higher is more priority?

keen compass
#

the lower the priority number, the higher the priority in serving it

wind dock
#

How about weight

keen compass
#

weight has to do with if you have 2 srv records with the same priority because maybe they are for the same service, but the addresses technically point to two different machines

wind dock
#

Oh

keen compass
#

weight will help determine which of those should be served

wind dock
#

Higher is better?

#

Or lower

cyan kraken
#

@subtle blade Excuse me can you help me please

keen compass
#

lower weight is better

#

generally a weight of 0 is sufficient if you are just creating a single srv record

wind dock
#

Thanks

keen compass
#

and don't intend to have multiple of the same srv records

wind dock
#

Why would I need multiple?

#

Or want

keen compass
#

load balancing purposes

#

if a srv service goes down there is a second specified

wind dock
#

Oh ok

#

Thnz

#

Thnx

keen compass
#

you do know you can specify also multiple IP's for a same A records?

#

this will create what is known as round robin dns

wind dock
#

Yes I know you can do that

#

Wouldn't that just create a tree of a bunch of domains leading to 1 ip?

keen compass
#

its not so much a tree, but essentially it just gives out a different ip everytime that A record is served

wind dock
#

Oh

keen compass
#

so if I query the dns for a particular domain or subdomain and it has 2 ips defined, I will get the first ip, second time I query it I will get the second ip

#

and then if I do it a third time I will get the first ip again

wind dock
#

Ohhh

#

How is the order set?

keen compass
#

which ever was defined first

wind dock
#

Oh

keen compass
#

anyways since round robin load balancing exists in DNS, it extends to almost all the records you can create as well that takes in explicit ip's

#

so that includes srv records 😉

#

which is why priority and weight exists lol

wind dock
#

O

keen compass
#

there is a lot of nifty things you can do with just DNS alone especially if you tack on geoip DNS stuff 😛

wind dock
#

Dang, didn't know there was so much to dns

#

Anyways, tysm for the hel0

#

Help

#

I got it, and hopefully it works lol

keen compass
#

np, and have fun 🙂

wind dock
#

I will :)

stuck quartz
#
case CustomConfig.get().getString("permission_button_name"):
``` why is this showing up 'Constant expression required'
#

how could i fix that

frigid ember
#

Hey is there any plugin that creates kit and save contents of the items inside the shulker

grim halo
#

You cant have a dynamic expression as case.

stuck quartz
#

what could i do

grim halo
#

Depends on what you are doing

stuck quartz
#

if the player click a item with the name as [the variable on the custom config file] then it opens another gui

lone fog
#

if statement?

stuck quartz
#

sure, ill try that

grim halo
#

lol

brisk shell
#

So dumb question

#

I donated to Spigot for the Redstone tier

#

and it said I can change my name and also my theme

#

But I am unable to locate these

#

anyone have an idea how to?

#

(feel free to @ me)

wanton delta
#

how long ago did you

#

has the redstone thingy appeared on your name?

ashen nebula
#
       String colorizedName = ComponentSerializer.toString(new ComponentBuilder(player.getName()).color(color).create());

        PacketContainer packet = pm.createPacket(PacketType.Play.Server.ENTITY_METADATA);
        packet.getIntegers().write(0, player.getEntityId());
        WrappedDataWatcher watcher = new WrappedDataWatcher();
        WrappedDataWatcher.Serializer serializer = WrappedDataWatcher.Registry.getChatComponentSerializer();
        watcher.setEntity(player);
        watcher.setObject(2, serializer, WrappedChatComponent.fromJson(colorizedName).getHandle());
        packet.getWatchableCollectionModifier().write(0, watcher.getWatchableObjects());

        try {
            pm.sendServerPacket(player, packet);
        } catch (InvocationTargetException ex) {
            ex.printStackTrace();
        }```

Trying to send an entity metadata packet but when its sent nothing seems to happen?
bleak rock
#

I don't know how Placeholders work, please, can anyone help me set up luckperms placeholders on a featherboard.

wanton delta
#

@bleak rock if you havent purchased the plugin i wouldnt bother

grim halo
#

Where are you from? What language?

timber berry
#

hi

#

i need help

grim halo
#

With?

#

Also @tranquil edge this a question for #general

timber berry
#

I just bought a plugin and I don't know where to download it

grim halo
#

@timber berry This should occur as soon as you buy the plugin. Sometimes it takes a while.

timber berry
#

nop

#

wait a minute

grim halo
#

Did you wait at least 24h

burnt idol
#

So I just coded a text plugin using eclipse, and I want to know how to get the .jar file from eclipse to my plugins folder (I am using linux)

grim halo
#

Compile it and copy it to your plugin folder...

timber berry
#

I get the proof of purchase and nothing

grim halo
#

No idea then. Spigot has a thread for recruitment

burnt idol
#

how do I compile it?

red zenith
#

@burnt idol is there a target folder in your project directory.

burnt idol
#

yes

red zenith
#

What’s in it?

timber berry
#

??

burnt idol
#

uhh the jar file but it doesn't work

grim halo
#

@burnt idol File -> Export

burnt idol
#

ok

red zenith
#

Do you get an error message?

timber berry
#

nop

grim halo
#

@timber berry Did you wait at least 24h

timber berry
#

fuck

burnt idol
#

just a sec

timber berry
#

oke

#

u

#

ok*

burnt idol
#

I'm seeing what the error message is

timber berry
#

@timber berry Did you wait at least 24h
@grim halo no

red zenith
#

Probably doesn’t have the resource files, like the plugin.yml

burnt idol
#

I have the files

#

main: me.MrEgel.Why.Main
name: Why
version: 1.0
author: MrEgel

Commands:
Why:

grim halo
#

Whats the error?

burnt idol
#

no error

#

just doesn't work

timber berry
#

si no llega al toque me mato

burnt idol
#

well it says it is ignoring plugin.yml

grim halo
#

What doesnt work? You copied the jar in your plugin folder and spigot doesnt load the jar?

red zenith
#

So can you see any messages in the console or logs? You’re going to need to pastebin the log

grim halo
#

?paste paste it here

burnt idol
#

?

#

?paste

grim halo
burnt idol
stuck quartz
#

is there something like PersistentDataType.BOOLEAN

lone fog
#

Don’t think so

#

If you really need a Boolean just set a byte with 0

#

And then check PersistantDataContainer.has

red zenith
#

They’re asking about an unrelated issue, Mr_Egel

burnt idol
#

woops

#

sorry

red zenith
#

Is that all that your log showed?

grim halo
#

@burnt idol This log doesnt show anything

stuck quartz
#

@lone fog ill try that, thanks!

burnt idol
#

uh

#

well i can post all of it

worldly heathBOT
grim halo
#

Lol... now the bot reacts to my paste request...

#

Thx

burnt idol
red zenith
#

The only issue is related to the permissions.yml and I don’t think that’s a problem

stuck quartz
#

@lone fog so byte as 0 would be true and no data would be false?

grim halo
#

The byte value is irrelevant

#

You just check if the key exists

stuck quartz
#

ok

grim halo
#

Is your plugin called Why?

burnt idol
#

yes

red zenith
#

Does your command require any permission to be used?

grim halo
#

Then its enabled and works

burnt idol
#

it requires op

#

but

#

I have op

grim halo
#

Pls paste the command code. The whole class if possible

burnt idol
#

ok

grim halo
#

You need to register the command.

burnt idol
#

how?

grim halo
burnt idol
#

ok

#

thanks

grim halo
#

and instead of "new CommandKit" you just use "this"

burnt idol
#

ok

#

"this"?

grim halo
#

A reference to the instance you are currently in. this
so .setExecutor(this)

lone fog
#

Does spigot have API methods to check if an item is the right tool to break a block or vice versa?

burnt idol
#

syntax error on token "this", invalid name

grim halo
#

paste the code

burnt idol
#

so i pasted .setExecuter(this)

#

I already pasted the whole thing

grim halo
#

Uhm i think something like block.getDrops(ItemStack).isEmpty() not sure if it covers all cases

lone fog
#

Plus that checks if it can break it, I want to check if it’s the ideal tool

#

Ie shovel for dirt

grim halo
#

Ah wait. I made a plugin that needed this for automatic switching. Ill take a look at it

burnt idol
#

this.getCommand("why").setExecutor(this));

#

is this correct?

lone fog
#

Pretty sure it’s just getCommand

#

Actually I don’t think it matters, but you gotta save those bytes

sleek ivy
#

how can I declare any rgb color for chat now? for player.sendMessage I'd normally use ChatColor.RED etc

lone fog
#

ChatColor.of

#

Bungee ChatColor, not bukkit one

sleek ivy
#

I'm not using bungee?

grim halo
#

Ok i made a Map<Material, ToolType>. I also used some NMS stuff in older versions but if you want to use API methods only, you need to populate a fat map per hand.

lone fog
#

Don’t need bungee

#

Might PR an API for it then

#

Would be nice to have

sleek ivy
#

oh nvm I see the namespace

grim halo
#

Do you think it should be part of the Material Enum?
I created a new Enum ToolType with AXE, PICKAXE etc and then mapped Material to ToolType.
But having the ToolType as a constant in the Enum would be nice.

lone fog
#

Would be nice yeah

grim halo
#

Or create a new Tag for the tool materials.
Like Tag.PICKAXES containing all pickaxe materials

lone fog
#

And a material.isProperToolFor(otherMaterial)

grim halo
#

Instead of a new ToolType enum

lone fog
#

So if Tags.PICKAXE.contains(material)?

grim halo
#

Bukkit Tag with IRON_PICKAXE, WOODEN_PICKAXE etc.
Then an entry for the Material containing the Tag as a collection of proper tools

lone fog
#

So like

#

Material.ToolTag

sleek ivy
#

hmm, net.md_5.bungee.api.ChatColor doesn't have an of method for me. using spigot 1.16.1.

grim halo
#

Do you know the Tag class?

lone fog
#

Kind of

grim halo
lone fog
#

So Tag.PICKAXES would essentially be a list of pickaxes

grim halo
#

Yes

#

Do you want to PR this? I have never done one for Spigot and this sounds like a nice first addition i could try.

lone fog
#

How do you check if a material is in it

#

.contains?

#

Also yeah go ahead

grim halo
#

would be false for example

lone fog
#

Ah yeah that’s not bad

#

Although it would be a bit cumbersome to get the tool tag from an item no?

#

You’d have to check each tool tag until you got a match

grim halo
#
    Material itemHandMaterial;
    Material blockMaterial;
    Tag<Material> optimalToolTag = blockMaterial.getOptimalTools();
    if (optimalToolTag.isTagged(itemHandMaterial)) {
      // Item is optimal for breaking Block.
    }
lone fog
#

Ah I see

balmy sentinel
#

why is HIDE_POTION_EFFECTS the thing that hides the banner pattern from the lore 🙃

grim halo
#

idk its just weird

frigid ember
#

anyone know

#

what plugin this is

balmy sentinel
#

I’m just happy I figured it out

frigid ember
#

A Kit GUI with custom head

balmy sentinel
#

KM it’s pretty easy to create if you know how to code. If not idk the plugin

frigid ember
#

😄 ikd how to cde

balmy sentinel
#

all good uhh it’s a very specific plugin so your best option is finding someone to code it for you tbh so it’s made to your liking

frigid ember
#

can u help me removing flower banner pattern lores :3

grim halo
#

Ill write a quick plugin. You will need ProtocolLib tho.

#

Wait. 1.16 i suppose?