#help-development

1 messages · Page 1788 of 1

onyx fjord
#

Papermc

west oxide
#

ohh i thought it was someone's discord name

onyx fjord
#

They hate calling it paperspigot

#

xDD

mortal hare
#

they did named it first

#

not as if community named it

west oxide
#

wait so they took spigot , changed it a bit, called it theirs ?

mortal hare
#

it has bunch of optimizations

#

spigot is a bit more conservative

onyx fjord
#

They can't call it fully theirs

mortal hare
#

since some of the optimizations can impact the gameplay

onyx fjord
#

No spigot updates = paper death

west oxide
#

ohh i see

west oxide
#

wait they can just take over it then

#

👀

mortal hare
#

yes, since its open source

onyx fjord
#

Well they would continue spigot but that's more work to do

west oxide
#

yeah true

onyx fjord
#

And MD is a chad

#

He already has to maintain 3 projects

west oxide
#

or

onyx fjord
#

Bukkit and spigot

#

It's all in MD hands

#

He has to update bukkit so spigot can be updated

west oxide
#

damn

mortal hare
#

Fork chain is crazy in minecraft: CraftBukkit -> Spigot -> PaperMC -> Tuinity -> Purpur <-> Airplane?

onyx fjord
#

Purpur = purpur and airplane

#

Airplane has its own purpur branch

#

No fucking sense but it exists

mortal hare
#

well purpur includes airplane patches

#

there's some contraversy behind that

#

but afaik it was solved

onyx fjord
#

Airplane includes purpur patches in a branch

eternal night
#

tunity is no longer maintained

#

well

#

it is archived and moved into paper

onyx fjord
#

It's paper part

west oxide
#

damn

mortal hare
#

honestly Both Purpur and Airplane should be merged into PaperMC

onyx fjord
#

No

#

I much prefer purpur community

eternal night
#

purpur follows a way different goal than paper

mortal hare
#

i hate seeing bunch of forks popping up which do include patches from other forks

onyx fjord
#

Purpur has gameplay changes mostly

west oxide
onyx fjord
#

It replaces tons of plugins

onyx fjord
calm star
#

Why doesnt this work in the set display name?
"&4Condenser Wand\n" + "&a&lRight click &l&4on a chest to condense items inside!\n" + "&a&lRight click &l&4in air to condense your inventory!"

onyx fjord
#

Afk system, mob riding, compass

west oxide
#

:o

eternal night
#

display names do not have multiple lines

onyx fjord
#

Flying squids

mortal hare
west oxide
onyx fjord
#

But it's all disabled by default

#

800 lines of config 🥵

west oxide
#

damn

mortal hare
#

Airplane community is a bit toxic. I've came into their discord only to get told to get fucked

mortal hare
#

well at least that was my experience

west oxide
#

joins the discord

onyx fjord
#

You also need to pay for their profiler

west oxide
#

what's that

onyx fjord
#

Monthly

#

Shows CPU usage of everything

eternal night
#

I mean it is a nice business model

mortal hare
onyx fjord
#

We have that for free

#

Spark

mortal hare
#

yea spark is great

west oxide
#

lol

eternal night
#

spark does not have live updates

onyx fjord
#

Well

west oxide
onyx fjord
#

Who needs that pff

eternal night
#

has its advantages

west oxide
#

i think making plugins is also a good business model

onyx fjord
#

No

west oxide
#

if you wanna make money from** minecraft**

onyx fjord
#

You can't live from it

west oxide
#

yeah but

#

its from minecraft

#

so

west oxide
#

nvm i dont think u can

#

but like having multiple plugins that sell monthly and you only have to update (idk if that's an easy thing) sounds good ?

onyx fjord
#

Maybe

paper viper
#

no its really not

west oxide
#

ok then am wrong

paper viper
#

plugin should only be for enjoyment

onyx fjord
#

But we use GPL license

paper viper
#

never for money

#

you wont earn a lot

#

and also you'd probably have more stable income working for a server anyways

west oxide
paper viper
#

money should only be motivation for plugins

west oxide
#

i only get motivated when i dont get error like this xD

onyx fjord
#

Follow GPL or Richard stallman will come to your house

acoustic pendant
#
public class ClimaticExpansions extends PlaceholderExpansion {
    @Override
    public @NotNull String getIdentifier() {
        return "Climatic";
    }

    @Override
    public @NotNull String getAuthor() {
        return "Fragment./Adri752";
    }

    @Override
    public @NotNull String getVersion() {
        return "1.0";
    }
    @Override
    public boolean canRegister() {
        return true;
    }
    @Override
    public boolean persist() {
        return true;
    }

    @Override
    public String onPlaceholderRequest(Player player, @NotNull String params) {
        if(player == null) {
            return "";
        }
        if (params.equals("heat")) {
            return PlayerHeight.getHeat();
        }
        return null;
    }
}```

Hey! could anyone tell me if am missing something in this papi code?
lost matrix
# onyx fjord You can't live from it

If you are really experienced then you can get positions where you get paid 15$/hr for 40hr/week.
If you really really want to then you can make a living out of it. Add giving java courses and some freelancing to it and you
might even be able to make a half decent living. But at that point you are better off as a software dev
making twice that amount...

ivory sleet
#

lowercase on identifier

onyx fjord
#

Working on a server is totay different thing

mortal hare
#

fuck me

#

my cat fur is stuck inside my mouse sensor

#

and i cant scroll properly anymore

#

and i don't have proper screwdriver

ivory sleet
#

Oof rip

mortal hare
#

My cat is a maine coon

#

so yeah

#

its practically mini lion

stone sinew
#

Just confirming why do the "pre" updates not contain bukkit, and other src for the API? Like the jar is basically only craftbukkit but installs the libraries elsewhere.

sullen marlin
#

because a) that wouldn't be an issue if you used maven, gradle, or any other sensible build system; b) that wouldn't be an issue if you used the API not NMS; c) Because Mojang did it and it's not a terrible idea

sullen marlin
#

then depend on spigot-api not spigot

stone sinew
sullen marlin
#

Spigot-api can be found in Spigot/Spigot-API/target; your local maven repo; or our nexus instance

stone sinew
#

I don't use dependency managers.

sullen marlin
#

silly, but I Just listed 3 locations with the jar for you

stone sinew
sullen marlin
#

?maven

undone axleBOT
paper viper
#

do you hate yourself?

stone sinew
#

So that being said... Does that mean the jars won't contain bukkit instance even in the stable release?

stone sinew
acoustic pendant
#
 if (player.getLocation().getY() <= 50){
            player.sendMessage(warningMessageUp);
            scheduler.runTaskTimer(plugin, () -> {
                setCold(1);
            }, 0, 20 * 10);
        }```
i have this code
but when i get to Y 50 i don't recieve any message
(I have specified the warning message), could anyone help me?
sullen marlin
#

what about when you get to y 49

acoustic pendant
#

nothing

#

going up and down

#

but no message

sullen marlin
#

is that in the move event?

#

did you register the event?

acoustic pendant
#

is not an event

sullen marlin
#

what is it then

acoustic pendant
#

ehm

#

so i have to do an event with that?

paper viper
#

you dont even call the method

sullen marlin
#

well what is calling coldAndHeatSetter

paper viper
#

thats the reason why its grayed out

#

cause you didnt call the method

#

lol

acoustic pendant
#

so this?

#

i think i have to do if 50 only

#

xD

vague oracle
#

that seems inefficient

#

everytime you move, not even on the x, y or z axis but on pitch and yaw it creates a new task.

acoustic pendant
#

oh lol

#

i just realized

ivory sleet
#

Yeah

#

At least you probably want to cancel the tasks at some point

stone sinew
#

Ugggg the spigot-api jar don't contain all the classes I use either.

sullen marlin
#

you can use -shaded to have the api dependencies included

stone sinew
sullen marlin
#

what is missing

acoustic pendant
#

ok, so should i make an arraylist so when a player gets to Y 50 he gets the event only once but when he leave the Y 50 it stop?

stone sinew
# sullen marlin what is missing

WorldServer, JSONObject, IBlockData, NBTTagCompound, GameProfile, CraftMagicNumbers, BlockPostition, CraftBukkit Apache libs
There is probs more but this is what I'm missing in one of my latest version plugins.

sullen marlin
#

that's not api

#

that's nms

#

you just told me youre trying to use the api

#

' because a) that wouldn't be an issue if you used maven, gradle, or any other sensible build system; b) that wouldn't be an issue if you used the API not NMS; c) Because Mojang did it and it's not a terrible idea
'

eternal night
#

I thought with mojang mappings internals are now api 🙂

sullen marlin
#

' I'm trying to use the API xD
'

eternal night
#

runs

stone sinew
#

NBTTags are api.

eternal night
#

wat

sullen marlin
#

..........................

eternal night
#

they are not

stone sinew
#

The others not so much.

sullen marlin
#

then why arent they in the api

#

what do you even use them for

stone sinew
sullen marlin
#

which part

stone sinew
#

NBTTags

sullen marlin
#

nbt to do what?

eternal night
#

The nbt tags are represented through sensible api contracts

stone sinew
#

Store data on the item.

eternal night
#

e.g. ItemMeta#getDisplayName

#

The pdc is crying

stone sinew
#

Example I store ints in NBTTags for how much health/hunger an item has so when placed I Don't have to have that data stored in a config.

eternal night
#

?pdc

stone sinew
sullen marlin
#

because there's already api for the default tags

#

see: ItemMeta

stone sinew
#

I'm still not understanding why the spigot jar just doesn't contain all this like it has for the passed... 8 years?

sullen marlin
#

' because a) that wouldn't be an issue if you used maven, gradle, or any other sensible build system; b) that wouldn't be an issue if you used the API not NMS; c) Because Mojang did it and it's not a terrible idea

quaint mantle
#

how do i handle backend web authentication

stone sinew
#

because a) that wouldn't be an issue if you used maven, gradle, or any other sensible build system
Would still have these issues lol Like I said already using the shaded jar.

that wouldn't be an issue if you used the API not NMS;
I use NMS for supporting older versions.

Because Mojang did it and it's not a terrible idea
It is though.

sullen marlin
#

a) you wouldn't; b) well this doesn't affect older versions; c) that's like your opinion man

stone sinew
#

What do you mean I wouldn't I just proved to you I am LMFAO

paper viper
#

thats why you use a god damn buildtool

#

jesus

sullen marlin
#

but you're not using maven, gradle, or any other sensible build system

paper viper
#

stop using the manual way

sullen marlin
#

you're using eclipse projects

quaint mantle
paper viper
#

lol

stone sinew
stone sinew
eternal night
#

did you just depend on the actual jar file on the system

#

like, an actual system path

#

hardcoded

paper viper
#

deadass if he did that 💀

eternal night
#

seems like it 😂

stone sinew
eternal night
#

that again is the api

#

you are trying to depend on the implementation are you not

#

in which case you'd depend on spigot instead of spigot-api

sullen marlin
#

and every other library as well

eternal night
#

which is automatically installed by build tools into your local maven repo

sullen marlin
#

this is the downside of not using a dependency manager

stone sinew
eternal night
#

doubt it

paper viper
#

i had this issue before

#

its cause there was a jarinjar loader thing

eternal night
#

the spigot server version installed in your local .m2 contains the expected layout

paper viper
#

and you have to use -remapped to get the stuff in the right place

stone sinew
paper viper
#

yeah try that

#

cause if u run without remapped for me at least

#

its the jarinjar strategy

#

but when you run with remapped

#

it exposes the inner jar stuff

eternal night
#

do you even have to tho ? I just ran a clean install and the not remapped jar looks usable as well

paper viper
eternal night
#

it does not

paper viper
#

then thats why

eternal night
#

what ?

#

yea that is the point

#

we don't want it to look like that

paper viper
#

Yeah, thats without --remapped

west oxide
#

made it so that if you cant create tag twice and cant delete non existing one :D

#

progress

eternal night
#

@paper viper

#

¯_(ツ)_/¯

paper viper
#

for emily it worked

#

but if u go onto spigot forums

#

someone also experienced the same issue

#

and had to run remapped in order to get the proper structure

#

I'm not sure why

paper viper
#

Yeah

sullen marlin
#

it was changed

#

probably they were on an older version

eternal night
#

Ah sweet, yea then you wouldn't even need remapped if you don't want to jump into special source

paper viper
stone sinew
#

java -jar BuildTools-#138.jar --remapped --rev %Input%

paper viper
#

hmm

#

i mean when i ran it i put remapped as the last arg but that shouldnt matter right

stone sinew
#

Shouldnt but ill try

#

Same output

sullen marlin
#

again, the jar copied by buildtools will be the bootstrap jar

#

the raw jars are in the Spigot/Spigot-Server/target folder

paper viper
#

And also check your .m2 folder too

#

and the spigot jar

#

and see if its like that

#

the bootstrap jar is really meant for server owners

stone sinew
#

Yeap its in the .m2/repo

#

Even using that jar I'm still not able to use Bukkit imports.

sullen marlin
#

because that jar only contains craftbukkit

#

you need to depend on spigot-api and spigot separately

#

as well as all their libraries if applicable

#

again, this is why Maven/Gradle exist

proud basin
#

You know I wanna try making an anticheat but I have never played with packets before so this would be interesting

sullen marlin
#

otherwise extract the entire META-INF folder of the bootstrap and depend on every jar there

stone sinew
#

Thats a fucking bitch to do. Even with maven and gradle. I can't just depend on 1 jar anymore.

sullen marlin
#

yes you can with maven/gradle

#

because they manage dependencies for you

stone sinew
#

No I would still have to add all the depends that aren't in the spigot api. JSON etc...

sullen marlin
#

no you wouldnt

#

maven/gradle do that automatically

stone sinew
sullen marlin
#

'otherwise'

#

I think I know more about maven than the guy that uses eclipse projects

#

just sayin

stone sinew
#

I use maven for shading. Thats it. Don't need to waste time building my plugins

proud basin
#

Which one do you guys recommend using protocollib or packetevents by retrooper

stone sinew
#

Also added spigot and spigot api to maven depend.... Still have missing imports.

#

So far 1.18 is a joke and just makes it even harder to support future versions.

mortal hare
#

protocollib is more expansive

#

packetevents afaik uses tinyprotocol

#

which was developed by the comphenix (the same protocollib dev)

sullen marlin
#

you know what makes it easy to support future versions

#

the damn API

hasty prawn
#

who would've guessed

proud basin
#

so they are both good?

mortal hare
#

nvm

#

it doesnt use tinyprotocol

#

use what you want

stone sinew
sullen marlin
#

the API hasnt been changed 1 bit

#

you're not using the API

#

that's the problem

mortal hare
#

PacketEvents seems to be more focused on more NMS injection while protocollib relies more on the reflections for backwards compatibility

proud basin
#

hm

mortal hare
#

ProtocolLib is more abstracted while PacketEvents are more on the raw side of packet handling

stone sinew
mortal hare
#

what do you expect from prerelease builds

eternal night
#

if you depend on the build server implementation you basically have no classes whatsoever.

#

you are depending on a bootstrap jar

#

that later on extracts all libraries and resources inside

sacred mountain
#

is anyone willing to make me a few small plugins? i cant find any with 1.8 support.

hasty prawn
#

?services

undone axleBOT
eternal night
#

the API contracts haven't changed, you are just depending on a boostrap jar

mortal hare
#

its possible to build paper/spigot without spigot api bundled in?!

stone sinew
eternal night
#

then you failed somewhere down the line ¯_(ツ)_/¯

#

I am testing an example setup right now and it works great

mortal hare
#

have you tried reloading your project?

#

Try setuping it on Intellij

stone sinew
stone sinew
#

That will just output more errors

mortal hare
#

IDE doesnt output you more errors if its done correctly

sullen marlin
#

yeah please dont suggest another ide, its not helpful & the issue isnt the choice of ide

hasty prawn
eternal night
#

switch to nano

sacred mountain
#

my spigot account hasnt sent 20 posts yet

#

rip

mortal hare
hasty prawn
#

Smart

mortal hare
#

gn everyone

next plume
#

So for us server owners, what's the deal with this new bundler/bootstrap thing? How does it work and what is its purpose?

paper viper
pearl vessel
#

It shouldn’t really matter (hopefully)

paper viper
#

but the main reason is because of JDK encapsulation with URLClassloader class

sacred mountain
#

in english

paper viper
#

which caused JAR loading to be harder. And a new strategy called jarinjar loading (with a bootstrap class) is the fix to load libraries at runtime

next plume
#

JDK encapsulation with URLClassloader
I don't even know what that means.
Is this necessary because of Java 17?

sullen marlin
#

I don't think it's really necessary at all

#

but overall it's a better system

next plume
#

Seems more complicated to me.

paper viper
#

are you a developer? lol

#

you shouldnt be worrying about this

#

if you arent a dev

sullen marlin
#

yeah but it means that the library jars are actually used as-is rather than modified

#

but also as with everything its a trade-off

#

if we retained the old style spigot jar people would yell and say that was the wrong move too

next plume
#

ha ha

#

So was this change initiated by Mojang or Spigot?

sullen marlin
#

Mojang

next plume
#

OK. Just trying to understand the change.

sullen marlin
#

it basically makes the server jar a launcher like the client has

next plume
wispy fossil
#

ooh

#

big man in town

ivory sleet
#

I have one plugin on SpigotMC used by PulseBeat roo_confuse

sullen marlin
#

👑

paper viper
#

Lol

#

Makes sense

next plume
#

Ooh, he asked a question and I answered.

paper viper
#

Sorry for asking that XD. It's never bad to understand smthing

ivory sleet
#

Btw Pulse

ivory sleet
#

Have you started unit testing?

paper viper
#

Yes

paper viper
ivory sleet
paper viper
#

Yes

west oxide
#

:o

ivory sleet
#

hope you’re not testing every function

paper viper
#

nah

#

lol

ivory sleet
#

Even tho people like bob asserts it’s the right way

kindred valley
#

!print

west oxide
kindred valley
#

!p

paper viper
#

no

ivory sleet
#

Cuz you actually wanna test behavior and not specific classes

paper viper
#

Yeah

kindred valley
#

!paste

ivory sleet
#

?paste

undone axleBOT
paper viper
#

Wrong place

#

lol

next plume
#

Don't test for error conditions you don't know how to handle. 🤓

paper viper
#

assert meta != null

kindred valley
#

can u guys take a look at the 39th period

#

i want to control the situation that the player closed the inventory screen

next plume
sullen marlin
#

imagine testing things

ivory sleet
#

Yeah, was probably just talking about tdd in general, I mean sure unit tests can be good to verify your code does not do the wrong thing. But surrounding every function of every class is a bit excessive, since impl details change and then you’ll end up with a lot of broken tests. shrug

wispy fossil
#

world gen - are 'mountain' biomes in 1.18 renamed to peaks?

sullen marlin
#

windswept

wispy fossil
#

this one I assume?

sullen marlin
wispy fossil
#

is that from the wiki?

sullen marlin
#

ye

wispy fossil
#

ty

sullen marlin
#

spigot supports those renames at runtime

wispy fossil
#

hmm, I am getting a strange error with buildtools?

fatal: invalid branch name: init.defaultBranch =
applyPatches.sh: line 16: cd: /c/Users/admin/Downloads/118Server/Spigot/Spigot-API: No such file or directory
Resetting Spigot-API to Bukkit...
fatal: ambiguous argument 'origin/spigot': unknown revision or path not in the working tree.

...
Resetting Spigot-API to Bukkit...
fatal: ambiguous argument 'origin/spigot': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
  Applying patches to Spigot-API...
fatal: could not open '../Bukkit-Patches/*.patch' for reading: No such file or directory
  Something did not apply cleanly to Spigot-API.
  Please review above details and finish the apply then
  save the changes with rebuildPatches.sh```
#

i might be doing something stupid. I am using git bash inside the same folder as the buildtools latest jar

sullen marlin
#

just run buildtools

#

dont try and do stuff manually

wispy fossil
#

i did
ran this cmd: java -jar BuildTools.jar --rev 1.18-pre5

sullen marlin
#

oh you are

#

idk then

wispy fossil
#

maybe I'll try another machine

sullen marlin
#

what is fatal: invalid branch name: init.defaultBranch =

wispy fossil
#

not sure

sullen marlin
#

seems like you mightve broken your .gitconfig?

young knoll
#

(Also you should probably be building pre-8 now)

quaint mantle
#

dam we on 8 now?

wispy fossil
#

look at that

#

time flies

young knoll
#

We are actually on RC1

#

Idk if spigot is though

quaint mantle
#

oh we on RC1.. i just read the new post like 1-2 days ago I thought

young knoll
#

Just checked, not yet

quaint mantle
#

ok i missed 3 pre-releases in 3 days

#

wait I even clicked the spigot post after it got updated to pre-8 when spigot mapping stuff got mentioned in #general

paper viper
#

md became like 20x more active

#

lol

young knoll
#

He got the cloning machine working

paper viper
#

human.clone()

wispy fossil
# sullen marlin seems like you mightve broken your .gitconfig?

yep, that's what it was.
I fixed it by running the command git config --global init.defaultBranch main

I should say I found a few people earlier this year who had the same problem, but never found a solution.
Maybe this should be added to the issue solutions list?

quaint mantle
#

how do i get rid of the top box hanging over

unreal quartz
#

make them the same width? lol

quaint mantle
unreal quartz
#

this is impossible to tell you without seeing the website

quaint mantle
#

cross platform solution

proud basin
quaint mantle
proud basin
#

Quick question is better to make the plugin from latest version and support everything below it or start from below and support upwards?

next plume
#

I think if you put api-version: 1.17 in plugin.yml, servers older than 1.17 won't be able to use it.

sand gull
#

I've been stuck for like 2 hours trying to get something to work now.

Basically I want the tab suggestion for /msg to show all players on a BungeeCord proxy, not just the ones on 1 particular Spigot server. I have been trying to do this using a BungeeCord plugin by just simply creating a command and defining a custom TabExecutor response. The problem is that BungeeCord does not seem to override the tab complete response, but it does override the command's functionality. Is there any workaround to get this to work as I intend?

#

Would appreciate any help!

tranquil viper
#

How would I go about loading a pre-built building

#

Ie: I build a house and when I run a command the house is pasted in (like world edit but prebuilt buildings)

quaint mantle
#
        if (cmd.getName().equalsIgnoreCase("anvil")){

            Inventory Inventory = Bukkit.createInventory(Player, InventoryType.ANVIL);

            Player.openInventory(Inventory);

        }

i'm trying to make a /anvil command. the ui shows up and stuff but you can't actually enchant anything. how would I make it to where you can enchant items?

crude charm
proud basin
#

Would it be smart to cache the players data then to call it through api everytime?

young knoll
#

Depends

#

What does the API do to get them

#

If it's just getting it from collections then it's probably fine

sullen marlin
#

Structure api

young knoll
#

What about it

#

Oh for importing structures

#

I still have to have to a look at that API

proud basin
#

their uuid and player

waxen plinth
#

The anvil logic isn't in the GUI itself sadly

#

Also please please please name your variables in lower camel case, having a variable called Player with a capital P is very bad

young knoll
#

A lot of stuff isn’t in the GUI sadly

#

Crafting tables are though

proud basin
#

Hey so whenever you hover over water with creative its seems to be detected what can I do to fix that? ```java
if (packet.isPosition()) {
final List<Block> blocks = ReflectionUtils.getBoundingBox(profile.getPlayer()).expand(1, 1, 1).getBlocks(
profile.getPlayer().getWorld()
);

        final boolean check = blocks.stream().noneMatch(block -> block.getType() != Material.AIR && !block.getType().toString().contains("WATER"))
                && blocks.stream().anyMatch(block -> block.getType().toString().contains("WATER"));

        if (check) {
            if ((ticks += 2) > 10) {
                final double prediction = data.getLastDeltaXZ() * 0.8F;
                final double difference = Math.abs(data.getLastDeltaXZ() - prediction);

                if (difference > 0.04 ) {
                    if (increaseBuffer() > 15) {
                        fail("diff=" + difference);
                    }
                } else decreaseBufferBy(Double.MAX_VALUE);
            }
        } else {
            ticks -= ticks > 0 ? 1 : 0;
        }
    }
vestal matrix
#

if im using Material mat = Material.valueOf(args[0].toUpperCase()); how can i check if the material is actually a material and not something like "jad8jasjd"

sullen marlin
#

iirc valueOf throws an exception

#

better to use something like .matchMaterial and just check if returns null

vestal matrix
#

if (Material.matchMaterial(args[0].toUpperCase()) == null) { isnt detecting if the material doesnt exist

sullen marlin
#

it should though I dont think the uppercase is necessary

vestal matrix
#

still isnt

quaint mantle
#

so you're saying jad8jasjd returns a valid material?

#

Have you thought to see what it is..

#

cause its just a lookup in a map which is cached from Material.values() so it definitely wont return a valid material

vestal matrix
#

after if (Material.matchMaterial(args[0] == null) { i have it send a message to the console and it doesnt

quaint mantle
#

that code doesn't compile

#

i tested matchMaterial("jad8jasjd") and it returns null

young knoll
#

Yeah you are missing a )

vestal matrix
#

if (Material.matchMaterial(args[0]) == null) { still isnt working for me :/ args[0] = "diIJjxwijd37d"

quaint mantle
#

also null

#

might need to give more info

patent onyx
#

is there an event for when a shovel is used to change grass to a dirt path

vestal matrix
patent onyx
vestal matrix
#

im rly confused...

                    for (Material m : mats) {
                        if (m == mat) {
                            p.getInventory().addItem(new ItemStack(mat, i));
                        }
                    }``` why am i not getting the item? args[0] = "dirt" but when i do something like args[0] = "djajdjsad" i get an internal error but if i do a real material name nothing happens
eternal oxide
#

Material#matchMaterial

vestal matrix
fickle helm
eternal oxide
#

why are you event trying to loop mats?

vestal matrix
eternal oxide
#

is mats a list of permitted materials?

vestal matrix
eternal oxide
#

use a list, then you can .contains(mat)

#

if (mats.contains(mat) {

vestal matrix
# eternal oxide `if (mats.contains(mat) {`

it still isnt detecting if the material isnt real

                    mats.addAll(Arrays.asList(Material.values()));
                    if (mats.contains(mat)) {
                        p.getInventory().addItem(new ItemStack(mat, i));
                    }
                    else {
                        p.sendMessage("material does not exist");
                    }```
eternal oxide
#

You are making a List of ALL materials

young knoll
vestal matrix
eternal oxide
#

thats pointles

#

if you then don;t care what material it is

vestal matrix
#

im detecting if the material exists wdym?

eternal oxide
#
Material mat = Material.matchMaterial(args[0]);
if (mat != null) {```
young knoll
#

^ I have no idea how you were not getting null using that

#

Unless you are using some kind of cursed hybrid server

vestal matrix
#

welp it works now idk why it wasnt before but thanks

fervent sonnet
sullen marlin
#

All java primitives are by value so they will always 'clone'

#

boolean b = a; // clone a

#

Most events are before

young knoll
#

If it’s cancellable it’s before

#

Some non-cancellable ones probably are too

summer scroll
#

So right now I want to create a clan plugin that is working on multiple server instances, and now I know how to use the basic jedis, the question is when should I load and save the clan data?

eternal oxide
#

any time it changes

summer scroll
#

In my mind, I load all clans data and cache it on startup, check If the clan data is already on Redis or not, If it's not on Redis I load it from the MySQL.

quaint mantle
summer scroll
quaint mantle
summer scroll
#

I still don't understand.

#

Why I can't just cache it on redis when server startup?

quaint mantle
#

And redis suck as storage

summer scroll
#

But it's quite simple I would say

public void loadClanStats(){
  try(Jedis... ){
    int balance = Integer.parseInt(jedis.hget("key", "field"));
  }
}

public void saveClanStats(){
  try(Jedis... ){
    jedis.hset("key", "field", "value");
  }
}
swift solar
#

is it possible to edit .schem files by code?

#

its binary so not sure

young knoll
#

Sure

summer scroll
quaint mantle
summer scroll
#

How do you notify the other server?

quaint mantle
#

with redis

#

Thats what message brockers do

summer scroll
#

Can you make an event in redis? just like EventHandler in Bukkit, where If I send a message, the other server can receive the message?

#

I don't know how the other server can receive the message everytime I send a message.

summer scroll
#

Is it the pub/sub?

quaint mantle
#

subscriber and publisher, yes

summer scroll
#

oh okay, that's very useful

cosmic arrow
#

is Maven or Gradle better?

sullen marlin
#

maven

summer scroll
# quaint mantle subscriber and publisher, yes

Okay so, is this correct?
Subscribe to specific channel, and then the publisher will send a message for example the clan uuid and set a data using Jedis#hset, and then the subscriber will listen to the message and get the data using Jedis#hget.

ivory sleet
#

But maven is probably much more stable as it has been around for a longer time of period

#

thus I’d say a lot of plugin devs are also used with it so therefore more supported in the spigot community shrug

young knoll
#

See now I am considering switching back to maven because of specialsource

#

But blah

ivory sleet
#

I believe there’s a gradle plugin which solves it for gradle users also?

young knoll
#

Haven’t seen anything other than some GitHub repos

#

Nothing talking about one directly

sullen marlin
#

tbh its simple enough some sort of exec(..) in gradle could probably do it

quaint mantle
quaint mantle
ivory sleet
summer scroll
#

redisson

ivory sleet
#

Way more sophisticated than Jedis

#

And yes it has a pub sub

summer scroll
#

what's the different with jedis?

ivory sleet
#

Ridiculously more features I’d say and better engineered.

summer scroll
#

okay, i'll check that out

ivory sleet
#

Yeah, well its my personal goto when it comes to redis with java

#

I don’t know I actually haven’t used Jedis since a very long time

#

Let me take a peek

#

Oh yeah

#

JedisPool::getResource
then use Jedis::subscribe

summer scroll
#

yup

#

it seems redisson is way more complicated xd

ivory sleet
#

Not a lot

#

But yeah stick with Jedis if you feel like it.

summer scroll
#

yeah, i think i'm gonna stick with jedis for now

#

i never actually used redis, so i'll get more comfortable first

ivory sleet
#

I’m still surprised a lot of spigot devs use mainly redis as a message queue and message broker

sullen marlin
#

Cause it was simple

#

RedisBungee prolly started it

#

Very early plugin

summer scroll
#

and with data synced every server, i just need to load/save on startup and disable right?

ivory sleet
#

Ah

#

I just feel like when it comes to message queues, there are simply way superior alternatives

last ledge
ivory sleet
#

I’ll review it based on your description

last ledge
ivory sleet
#

?1.18

undone axleBOT
#

There is no ETA. Having an ETA leads to unrealistic deadlines, false hope, and a bad product. It will be ready when it's ready.

summer scroll
#

Okay, when server startup it will load all data from mysql, and cache it on the memory, and then update the local cache from the message that is sent thru redis pub/sub, and on server stop save the clan to mysql.

#

But I found a problem, when the data has not been saved on the mysql yet, the servers will have different data.

ivory sleet
#

Local cache?

#

Is that the redis cache?

summer scroll
#

no

ivory sleet
#

Or just a normal hashmap or smtng?

summer scroll
#

yeah hashmap

ivory sleet
#

Hmm sounds somewhat dangerous

summer scroll
#

the hashmap, or the design?

ivory sleet
#

Design

#

I mean loading the clan data seems fine (in the start)

#

But you might just want to rely on the redis cache

#

As redis has its own "hashmap"

summer scroll
#

store everything on the redis?

ivory sleet
#

So no local hashmap

summer scroll
#

manya says it will be slower

ivory sleet
#

No not everything

#

A little but redis is fast

#

Ridiculously compared to mysql or smtng

summer scroll
#

what should i store?

ivory sleet
#

Because the problem is

#

You can end up with something I refer to as the synchronization problem

#

Let’s say you do in fact use redis pub/sub in combination with a local map instance in every server

summer scroll
#

yeah there will be a synchronization problem, i can see it

#

Server 1 clanA balance = 1
Server2 clanA balance = 3

Server1 clanA balance increased by 1, so 2
Server2 clanA balance will be 2

ivory sleet
#

Now at timestamp 20:00
Server A mutates the clan name and sends the update (with pub sub).

At timestamp 20:01
Server B mutates the clan name and sends the update.

However for some reason server B was able to send its update such that it completely reached server C, A, Proxy and D at timestamp 20:02.

But server A got its update reached out at timestamp 20:03 to C, B, D and Proxy.

#

Now those servers will float around with invalid data

#

one way is to ofc include a timestamp in every message you send with pub sub

#

And handle conflicts as such

summer scroll
#

hmm, so how would i do it?

ivory sleet
#

Another way is to completely rely on ONE cache like redis’s cache

#

Third way is to use a lock service, like hazelcast

#

Well you decide

summer scroll
#

never heard of hazelcast, i think i'm gonna stick with redis

ivory sleet
#

Yeah, try the first way

summer scroll
#

what data should i cache?

#

i can give you access to the repository if you want

ivory sleet
#

In the local per server cache or the redis cache?

#

Uh sure

iron palm
#
                   if (e.getBlockPlaced().getType().equals(Material.WHITE_TERRACOTTA)) {
            player.getInventory().addItem(new ItemStack(Material.WHITE_TERRACOTTA, 1));
            BukkitScheduler blockTimer = Bukkit.getServer().getScheduler();
            int o = blockTimer.scheduleSyncRepeatingTask(this, new Runnable() {
                @Override
                public void run() {
                    Block block = e.getBlockPlaced();
                    e.getBlock().setType(Material.YELLOW_TERRACOTTA);
                    if (block.equals(Material.YELLOW_TERRACOTTA)) {
                        block.setType(Material.ORANGE_TERRACOTTA);
                    } else if (block.equals(Material.ORANGE_TERRACOTTA)) {
                        block.setType(Material.RED_TERRACOTTA);
                    } else if (block.equals(Material.RED_TERRACOTTA)) {
                        e.setCancelled(true);
                    }
                }
            }, 10,5);```
uh whats wrong with this code
It only works fine for transfering WHITE_TERRACOTTA to YELLOW_TERRACOTTA.
summer scroll
#

also you're comparing Block with Material

#

it will never be true

iron palm
#

hmm ok

summer scroll
#

So you would want to get the type Block#getType

summer scroll
ivory sleet
#

Sure thing

summer scroll
#

i have invited you btw

ivory sleet
#

Link me, I’ll accept it through the link 😅

iron palm
summer scroll
summer scroll
#

the updated code

iron palm
#

it can only transfer WHITE_TERRACOTTA to YELLOW_TERRACOTTA.

quaint mantle
#

anyone willing to script a hub for me?

#

price depends on the work.

summer scroll
#

so you want to change the block type every 0.25 second?

iron palm
#

im using a scheduleSyncRepeatingTask

chrome beacon
#

Don't cancel the event in the repeating task like that

iron palm
#

wait.

#

did i cancelled that?

#

what the i removed that lmao

chrome beacon
#

Also make sure to stop the repeating task or your server will die

iron palm
#

all of those e.setcancelled are ```java
e.getBlock().setType(Material.AIR);

young knoll
#

I mean you can cancel the event in the task if you want

#

It just won’t do anything

quaint mantle
summer scroll
iron palm
summer scroll
#

Data Synchronization across servers with Redis

iron palm
#
     BukkitScheduler blockTimer = Bukkit.getServer().getScheduler();
            int o = blockTimer.scheduleSyncRepeatingTask(this, new Runnable() {
                @Override
                public void run() {
                    Block block = e.getBlockPlaced();
                    e.getBlock().setType(Material.YELLOW_TERRACOTTA);
                    if (block.getType() == Material.YELLOW_TERRACOTTA) {
                        block.setType(Material.ORANGE_TERRACOTTA);
                    }  if (block.getType() == Material.ORANGE_TERRACOTTA) {
                        block.setType(Material.RED_TERRACOTTA);
                    }  if (block.getType() == Material.RED_TERRACOTTA) {
                        e.getBlock().setType(Material.AIR);
                    }
                }
            }, 10, 5);```
I tried this but this will remove the block instantly
summer scroll
iron palm
odd thicket
odd thicket
#

You should set the type to yellow before the repeating task and then use if-else or switch in the task

sand gull
#

What exactly are you trying to achieve 🙂

iron palm
sand gull
#

Wait, but WHITE_TERRACOTTA isn't even in there?

iron palm
iron palm
#
    @EventHandler
    public void onBlockPlace(BlockPlaceEvent e) {
        Player player = e.getPlayer();
        if (e.getBlockPlaced().getType() == Material.WHITE_TERRACOTTA) {
            player.getInventory().addItem(new ItemStack(Material.WHITE_TERRACOTTA, 1));
            BukkitScheduler blockTimer = Bukkit.getServer().getScheduler();
            Block block = e.getBlockPlaced();
            int o = blockTimer.scheduleSyncRepeatingTask(this, new Runnable() {
                @Override
                public void run() {
                    block.setType(Material.YELLOW_TERRACOTTA);
                    if (block.getType() == Material.YELLOW_TERRACOTTA) {
                        block.setType(Material.ORANGE_TERRACOTTA);
                    } else if (block.getType() == Material.ORANGE_TERRACOTTA) {
                        block.setType(Material.RED_TERRACOTTA);
                    }  else if (block.getType() == Material.RED_TERRACOTTA) {
                        block.setType(Material.AIR);
                    }
                }
            }, 10L,50);
        }
}
sand gull
#

That makes a lot of sense lol

#

Let me walk you through what's happening atm

#

First the player places WHITE_TERRACOTTA right

iron palm
#

yeah

sand gull
#

Then we go inside the run method of the scheduler

#

It first changes it to YELLOW after 10 ticks

iron palm
#

yes

#

but it changes to ORANGE instantly too

sand gull
#

That makes sense, since the if statement comes right after changing it to YELLOW

crimson terrace
#

well you set the block type to orange terracotta and then instantly check wether it is orange

sand gull
#

so it will always immediately go into that if statement

crimson terrace
#

do it the other way around

#

check for red first, then orange, then yellow

#

that should work

iron palm
#

I think i can use map to save that block so i can create another if out of the scheduler and check if that block is orange and then another scheduler

sand gull
#
                @Override
                public void run() {
                    switch (block.getType()) {
                        case Material.WHITE_TERRACOTTA:
                            block.setType(Material.YELLOW_TERRACOTTA);
                            break;
                        case Material.YELLOW_TERRACOTTA:
                            block.setType(Material.ORANGE_TERRACOTTA);
                            break;
                        case Material.ORANGE_TERRACOTTA:
                            block.setType(Material.RED_TERRACOTTA);
                            break;
                        case Material.RED_TERRACOTTA:
                            block.setType(Material.AIR);
                            cancel(); // We cancel this scheduler, since we're now done
                            break;
                    }
                }. 10L, 50L);
#

This is basically what you want to do

crimson terrace
#

that is also a good solution

iron palm
#

woa right i forgot switch lol thanks

sand gull
#

no worries 🙂

crimson terrace
#

might also wanna add a default to cancel the task

sand gull
#

very good point

crimson terrace
#

in case the block gets broken in between or something

sand gull
#

always smart to do, to prevent weird memory leaks

iron palm
#

cant cancel it

#

weird

#

oh

#

i can do someth else

crimson terrace
#

this.cancel?

iron palm
sand gull
#

Give me a sec, I'll write it out in IntelliJ to make sure it works

iron palm
#

it is a bukkit task

crimson terrace
#

int taskID = Bukkit.getScheduler....
and then cancel with the taskID

#

or does that also not work

ivory sleet
#

Are you trying to cancel inside or outside or both?

crimson terrace
sand gull
#
BukkitRunnable runnable = new BukkitRunnable() {
            @Override
            public void run() {
                switch (block.getType()) {
                    case Material.WHITE_TERRACOTTA:
                        block.setType(Material.YELLOW_TERRACOTTA);
                        break;
                    case Material.YELLOW_TERRACOTTA:
                        block.setType(Material.ORANGE_TERRACOTTA);
                        break;
                    case Material.ORANGE_TERRACOTTA:
                        block.setType(Material.RED_TERRACOTTA);
                        break;
                    case Material.RED_TERRACOTTA:
                        block.setType(Material.AIR);
                        cancel(); // We cancel this scheduler, since we're now done
                        break;
                }
            }
        };
        runnable.runTaskTimer(this, 10L, 50L);
ivory sleet
#

what

sand gull
#

Should use a BukkitRunnable

ivory sleet
#

just store it as a BukkitTask then

sand gull
#

You can just use a BukkitRunnable Gameisntover, the code I sent works

iron palm
sand gull
#

Yeah, that doesn't allow cancelling right from the run method

ivory sleet
#

BukkitTask task = new BukkitRunnable() {
@Override public void run() {
this.cancel();
}
}.runTaskTimer(this,10L,50L);

or

Bukkit.getScheduler().runTaskTimer(this, task -> {
task.cancel();
},10L,50L);

#

?scheduling I wrote this not too long time ago in case of any future references

undone axleBOT
sand gull
#

Asking this question again as it got burried:

How would I go about showing all players on a BungeeCord network in the player tab-complete in things like /msg <player>. I've tried overriding the command using a Bungee plugin, but Bungee plugins only seem to override command functionality for natively existing commands.

One solution I came up with is just sending fake PlayerInfo packets to every single server on the network to simulate them being online in that particular Spigot server, but this seems suboptimal.

ivory sleet
#

you could use plugin message channels maybe?

#

or if you got something better, a redis cache, or even some message broker could do

sand gull
#

I use Redis as my plugin message channel basically, so I could use that, but also seems inefficient to request the full player list from the Proxy on every single tab complete action

last ledge
#

?1.17

undone axleBOT
sand gull
#

I could use the message channel to broadcast to all servers when a player joins the network and then let those individual servers spawn a PlayerInfo packet, but I feel like I'm overthinking this

ivory sleet
#

you'd cache it

#

so only on a server instance startup would you request all existing players on the network

sand gull
#

and then on every player join / leave of the network I send a notification to remove (or add) one player from that cache to all singular servers?

ivory sleet
#

yes

#

idk why you'd use redis as a mq, but Ig it works (would recommend rabbitmq or kafka if you got access to those)

sand gull
#

Which basically either uses Redis or Rabbitmq

#

just cross-server messaging without the hassle of BungeeCord's native system where you need at least 1 player on a server etc.

ivory sleet
#

On Single Server Shutdown -> Send bulk update
On Single Server Bootstrap -> Query update
On Player Join -> Send update

#

yeah

#

well using player connections was a clever yet limiting implementation detail

sand gull
ivory sleet
#

yuh that too lol

#

then idk if you have 1 proxy or multiple proxies and one super proxy

sand gull
#

Just using 1 proxy right now to keep stuff relatively simple

ivory sleet
#

hmm alright, arguably you let the proxy be the only one which sends the leave/join updates

sand gull
#

Yeah that was what I thought you meant haha

ivory sleet
#

oh yeah, just to clarify 😅

sand gull
#

I see, this makes a lot of sense (as I also cache other stuff this way), but I thought there might have been a way to override it using a Bungee command

#

I'll just go with this for now, thanks a lot 🙂

ivory sleet
#

yeah good luck

sand gull
#

tyvm

ivory sleet
misty current
#

is it me or does protocollib actually make things slower to dev? I find it much faster to use NMS for packets

sand gull
sand gull
misty current
#

yeah but even looking at minecraft's protocol wiki

#

i never manage to set the right values to the right fields

sand gull
#

Protocol wrapper ✨

#

:))

ivory sleet
#

Jurre, you might need to send the tab complete event through packets or smtng

quaint mantle
#

?1.18

undone axleBOT
#

There is no ETA. Having an ETA leads to unrealistic deadlines, false hope, and a bad product. It will be ready when it's ready.

misty current
quaint mantle
#

?1.16

ivory sleet
#

guess you figured that out alr tho

misty current
#

oh i've found it

#

says i just copy paste classes and that's it?

sand gull
ivory sleet
#

uh

#

lol

sand gull
#

make sure to check if stuff is up to date tho, I believe some code is a bit old already

misty current
#

i'm on 1.8 so won't be an issue

#

worst case, it might be too up to date

sand gull
#

yeah exactly haha, check for that as well

misty current
#

ok so let's say i want to play a lightning bolt

#

is the wrapper weather something

#

WrapperPlayServerSpawnEntityWeather.java

sand gull
#

Yeah

misty current
#

oh wait that's so useful

#

i can also see how do they work behind the scene

#

and what would i have to set if i didn't do it with wrappers

#

thanks a lot

sand gull
#

np

misty current
#

wait lightning bolts have entity ids?

#

wat

sand gull
#

lol

#

apparently ig

misty current
#

random number i guess

#

also another thing, is there anything there for entity metadata?

#

i need to do some armorstand packet playing

ivory sleet
#

yeah

#

there is def

misty current
#

only class i've found is WrapperPlayServerEntityMetadata but it just takes a metadata object as a parameter

#

so i'd have to make it myself

empty comet
#

PrepareAnvilEvent setResult bug? item in slot 1 is replaced directly

brisk estuary
#

Hi guys. In order to make an explosive arrow what should I do? Should I use the interface AbstractArrow?

quaint mantle
#

is it possible to teleport a player to a location when they are near a certain coords?

sharp hemlock
#

yes

quaint mantle
#

how would i do it using eclipse 1.8

true perch
#

How can you turn ItemMeta into a String and back into an ItemMeta object? Does anyone have an example or explenation?

empty comet
#

hey if you guys have 5 minutes to check my thread i will really appreciate it, since i need it done and working for 1.18 it's a bit time sensitive :c

true perch
true perch
onyx fjord
quaint mantle
misty current
#

how can i spawn an armorstand with metadata using protocollib?

dense geyser
misty current
#

he just said that spigot 1.8 is not supported which is true

noble lantern
#

no need to support a version many years old now

hybrid spoke
#

i mean, we can still help with 1.8, but if something comes up, which needs a hacky solution but is already granted in higher versions, we should just say "update"

maiden mountain
#

How can I get the game profile for a player? it tells me that the "GameProfile" class does not exist

maiden mountain
#

But i use spigot

hybrid spoke
#

and mojang lib

misty current
#

bukkit is built in spigot

maiden mountain
#

How can i access it?

hybrid spoke
#

build tool dependency 🤔

misty current
#

if you use paper there's an easier way but i don't know how to

dense geyser
#
EntityPlayer player = ((CraftBukkit) player).getHandle();
GameProfile gp = player.getProfile();
maiden mountain
#

This is weird since i used the Jetbrains minecraft plugin to generate the project

hybrid spoke
#

mojang isnt included in there

#

you need to add it

dense geyser
maiden mountain
#

So to get those libs i need to use the buildtools?

dense geyser
#

depends what dep you're using, spigot or spigot-api

hybrid spoke
#

you need to use your build tool to add it as a dependency

dense geyser
#

?buildtools

#

hm

hybrid spoke
#
<repositories>
        <repository>
            <id>minecraft-repo</id>
            <url>https://libraries.minecraft.net/</url>
        </repository>
</repositories>
<!------>
<dependencies>
        <dependency>
            <groupId>com.mojang</groupId>
            <artifactId>authlib</artifactId>
            <version>version</version>
            <scope>provided</scope>
        </dependency>
</dependencies>
dense geyser
#

can never remember how you call on buildtools from the bot ;-;

hybrid spoke
#

?commands

#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

maiden mountain
#
   <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.17-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
#

Yeah, i got this

hybrid spoke
#

this is just spigot

misty current
#

how can I put in as a parameter an Entity? I can't just construct one without spawning it

dense geyser
#

yeah thats spigotapi

dense geyser
#

protocol lib or packets?

misty current
#

putting in the parameters of a WrappedDataWatcher

#

from protocollib

#

yea

dense geyser
#

oh rip, I raw it idk

misty current
#

i could use nms but it defeats the point of protocollib

maiden mountain
#

So what i have to do is run the buildtools and then it craftbukkit and the mojang lib to my project?

#

And then it should work

hybrid spoke
#

craftbukkit already has the mojang auth lib

empty comet
maiden mountain
#

Btw your xml didnt work

dense geyser
#

you only need to run btools if you want spigot, mojang and nms in one

maiden mountain
#

Could not find artifact com.mojang:authlib

dense geyser
#

and gson but i think thats in spigotapi too

#

did you add the repo

hybrid spoke
maiden mountain
#

i set it to 1.17

hybrid spoke
#

yeah no

maiden mountain
#

?

hybrid spoke
#
        <dependency>
            <groupId>com.mojang</groupId>
            <artifactId>authlib</artifactId>
            <version>3.2.38</version>
            <scope>compile</scope>
        </dependency>

is what craftbukkit use

maiden mountain
#

So should i make it compile or provided?

hybrid spoke
#

provided

maiden mountain
#

Got it

hybrid spoke
#

but if you want to use craftbukkit anyways, you can just shade craftbukkit in

#

craftbukkit already have it

maiden mountain
#

And what about the CraftPlayer class?

hybrid spoke
#

thats craftbukkit

maiden mountain
#

Could you send me the xml?

hybrid spoke
#

for craftbukkit you need to run the buildtools and put it inside your local repo

maiden mountain
#

Ah so it build generate the craftbukkit jar and i will have to add it as a library?

hybrid spoke
#

yup

maiden mountain
#

Alright, thanks for the help buddy

#

Really appreciate it

hybrid spoke
maiden mountain
#

I'm using Spigot

hybrid spoke
#

you are using the spigot-api

maiden mountain
#

ooh

#

so just remove the api line?

#

or remove the whole dependency?

hybrid spoke
#

just the -api

maiden mountain
#

Alright, thank you mate

hybrid spoke
#

👍

misty current
#

is it a good idea to do armor stand animations with armorstand packets to show them to a single player or should I hide the entity from everyone else than the player?

onyx shale
#

armor stands tend to... lag

#

you should use packets as much as you can working with them

misty current
#

yea packets it is

#

issue is protocol lib is painful

onyx shale
#

cant say the same,never used it always doing my packets thru nms

misty current
#

it would probably be viable in my case, i don't need cross version compatibility

#

i still have to decide which one to use

#

i don't have much experience with neither of them

onyx shale
#

well from 1.17 theyr package tied anyway

#

so it will have compatibility with newer

young knoll
#

What’s painful about protocollib

misty current
#

1.8 😔

misty current
onyx shale
#

not rly

misty current
#

how am i supposed to set the metadata of an entity

onyx shale
#

first by looking at examples

#

last i used protocollib i simply went on vg and checked what the packet had

misty current
#

and also if i want to have my armorstand offset how do i do it? the packet takes integers as parameters

#

for location

onyx shale
#

the spawn packet takes location cords

#

once created you only use its id

misty current
#

wdym

#

i just looked at the protocol wrapper and it uses integer fields

onyx shale
#

there should be one asking for doubles

misty current
#

Caused by: com.comphenix.protocol.reflect.FieldAccessException: No field with type double exists in class PacketPlayOutSpawnEntity.

#

tried that

#

oh probably the packet changed in 1.13 or smthing

#

still strange, how is the client meant to see an offset armorstand if the packet takes int fields🤔

hybrid spoke
misty current
#

in 1.8 it takes an int

#

oh wait tho they use fixed point numbers

crimson terrace
#

how do people have plugins which work in all the versions in the world? any tutorials on that?

vale ember
crimson terrace
#

so if I want to support all versions from 1.13 to 1.17 I just need to develop it in the api that works for 1.13 and it works in all versions above?

vale ember
#

if your are not using NMS it should work fine

crimson terrace
#

seeing as I dont even know what NMS stands for that should be fine. thanks 😄

vale ember
crimson terrace
#

packets?

vale ember
#

yes

crimson terrace
#

alright thanks 😄

vale ember
#

but if you're using protocollib it should work fine without any abstractions or reflection

misty current
vale ember
paper viper
#

Yes you could extract the bukkit version

eternal oxide
#

yes, modules and shading

paper viper
#

and use a switch statement

#

Oh i thought u were talking about something else nvm

#

lol

eternal oxide
#

First use block.getType().name() when working with Material names

#

Second, it detects water because you are over water. What do you expect it to detect?

proud basin
#

well yeah

hasty fog
#

Anyone here know how to access com.mojang.serialization in the 1.18 pre-release? Can't find a jar containing it after running buildtools.

proud basin
#

that’s what its suppose to do

#

but not when your legit

eternal oxide
#

A simpler test for liquid is Block#isLiquid()

#

it will detect lava too

proud basin
#

interesting

eternal oxide
#

This test java final boolean check = blocks.stream().noneMatch(block -> block.getType() != Material.AIR && !block.getType().toString().contains("WATER")) && blocks.stream().anyMatch(block -> block.getType().toString().contains("WATER"));

#

Seems to be checking for not AIR and Not water, but also IS water?

#

so if the current block is NOT water and is NOT Air, but there is water in the list

#

Your test is extremely confusing. I don;t see how it could return true

#

For it to be true, there has to be No AIR, No WATER and WATER.

misty current
#

can you make an entity spawned with packets not despawn when it goes out of render or do I have to resend the packet?

#

like i store the location of all packet entities for a player and when the player walks into the chunk plays the packet again

eternal oxide
#

If you spanned using packets it only exists in yoru code and on the client

#

if teh client delets it you have to respawn it

misty current
#

yea i was asking if you can force the client to not despawn it

eternal oxide
#

no idea, but I doubt it

misty current
#

yeah same

eternal oxide
#

I believe the client deletes everything thats out of range

misty current
#

i can listen for chunk load events, check if there should be a packet entity in that chunk and spawn it

young knoll
#

See how something like holographic displays does it

eternal oxide
#

I would guess they are constantly tracking distance

#

any time a player moved between chunks recheck

misty current
#

kk thanks

#

I don't know why but i love going in NMS classes and finding this sorta stuff lol

this.world.getServer().getLogger().warning(this.getName() + " was caught trying to crash the server with an invalid yaw");
((CraftPlayer)this.getBukkitEntity()).kickPlayer("Infinite yaw (Hacking?)");
proud basin
eternal oxide
#

recomended to use as its accurate

mighty pier
#

it gives me this error but my chest size is set to 27

eternal oxide
#

show code

mighty pier
#

wait

#

i think i fixed it

#

ok it works now

#

not sure why

spare prism
#

Hello! I'm trying to set some NBT tags for my items, but it doesn't set
My methods:

    public ItemStack setNBT(ItemStack itemStack, String key, String value) {
        net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(itemStack);
        NBTTagCompound itemCompound = (nmsItem.hasTag()) ? nmsItem.getTag() : new NBTTagCompound();
        itemCompound.setString(key, value);
        nmsItem.setTag(itemCompound);
        return CraftItemStack.asBukkitCopy(nmsItem);
    }

    public String getNBT(ItemStack itemStack, String key) {
        net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(itemStack);
        NBTTagCompound itemCompound = (nmsItem.hasTag()) ? nmsItem.getTag() : new NBTTagCompound();
        itemCompound.getString(key);
        return itemCompound.getString(key);
    }

    public boolean hasNBT(ItemStack itemStack, String key) {
        return !getNBT(itemStack, key).equals("");
    }
eternal night
#

If you aren't on a horribly outdated version you should use the pdc

spare prism
#

wdym by pdc

eternal night
#

?pdc

eternal night
#

Allows you to store custom data on an itemstack

#

I am guessing that is what you are aiming to do ?

spare prism
eternal night
#

Well ehm. Technically yes but why would you ever prefer using NMS if there is API

spare prism
#

cause I will probably support legacy versions

tender shard
#

bruh md_5 why did you remove apache commons lmao

chrome beacon
#

Then use NMS on versions below 1.14

#

And PDC 1.14 and above

tender shard
#

just drop support for everything below 1.16

spare prism
proud basin
misty current
#

if you wanna do stuff with nbt i would highly suggest using nbtapi, it's very easy to use, works from 1.8 to 1.17 and the developer always replies quickly

#

plus you can shade it

twilit wharf
#

I want to change the text above a players head, tried multiple different apis, even tried scoreboards, nothing worked. Armor stands have a delay when the player moves and it looks really weird, is there a better way I could be doing this?

chrome beacon