#help-development

1 messages · Page 1858 of 1

hollow bluff
#

What about Material.matchMaterisl()?

sullen marlin
#

your context is just <filter>

#

what part of the pom is it in

#

what is the full filter

echo granite
#

one sec

sullen marlin
#

post the pom

frigid rock
echo granite
#

This is inside the shade plugin:

#

I need an explanation about this entire part, what does it mean?

#

I read maven docs. I did. just didn't understand it at all.

frigid rock
slate pendant
#

Is there an easy way to use extra libraries in a plugin? Do I have to use Maven to add them into jar from dependsies? Or how?

sullen marlin
#

it is preventing those classes from being shaded in

echo granite
#

and what does the *:* mean?

sullen marlin
frigid rock
sullen marlin
#

all group ids, all artifacts

#

groupId:artifactId

slate pendant
#

ok, thank you

echo granite
#

so select all the artifacts in XSeries and from there exclude the following classes?

#

in other words ^^

sullen marlin
#

not just xmaterial, all dependencies

frigid rock
echo granite
#

yeah, my bad

#

but did I understand it correctly?

hollow bluff
#

Try the other one and see?

frigid rock
#

did that too haha

young knoll
#

Material.matchMaterial should be working

frigid rock
slate pendant
#

Can I sak a question about Java here? (not a stupid question, but more related to just java)

dusk flicker
#

yeah

#

just shouldent be something you can find in a quick google search

frigid rock
#

here i made a for loop that loops into all the sections in the config.yml. then it puts the name and the material string variables into a function that creates a block

#

i dont know if i explained it correctly lol

dusk flicker
#

is it not getting the right material?

frigid rock
#

i dont think so

dusk flicker
#

try path.getString("material");

#

instead of config.getString material

frigid rock
#

this is the config file

frigid rock
dusk flicker
#

yep thats why then

hybrid spoke
#

path + ".material"

karmic grove
#

so i want to make spawner work on any light level heres what i got so far the only probelm is the w.getWorld has and unknow symbol ```@EventHandler
public void onSpawnEvent(CreatureSpawnEvent e) { // When a creature (Mob) spawns, this even will run.
if (e.getSpawnReason() == CreatureSpawnEvent.SpawnReason.SPAWNER) { // Checks if the mob spawned because of a spawner.
Location loc = (Location) e.getEntity().getLocation(); // Gets the location of the spawned mob.
World w = (World) e.getEntity().getWorld(); // Finds the World name that the mob spawned at.
String mobType = (String) e.getEntityType().toString(); // Gets the name of the mob spawned as a string.

        e.setCancelled(true); // Cancels the event so the mob doesn't spawn.
        // This will only show the mob for a split second so it shouldn't affect lag, though it may
        // be a visual bug that might get reported lol.

        w.getWorld().spawnEntity(loc, EntityType.valueOf(mobType));

    } else { // Otherwise, does this
        return; // Does nothing. Returns to normal.
    }

}```
dusk flicker
#

Yeah that works too

slate pendant
#

(This problem appears most of all in Windows) I tryed starting some java processes (other minecraft servers) and when I shut down the main one, other close as well (also they start in background). How do I start them independent or maybe even start a normal cmd shell window for it?

karmic grove
#

idk what to do now

frigid rock
dusk flicker
#

Also if it isn't related to development you might want to ask in #help-server

dusk flicker
hybrid spoke
#

also this EntityType.valueOf(mobType) is kinda redundant. just take the EntityType of the event instead making it to a string

slate pendant
#

I tryed many ways. with Runtime class, with ProcessBuilder and other ways

karmic grove
frigid rock
slate pendant
#

oh

#

i mean Process builder

dusk flicker
#

Oh thats why

hybrid spoke
dusk flicker
#

should be getConfig.getString(path + ".material")

frigid rock
#

ohhhh lmao

hybrid spoke
#

that would keep them alive even if the main one dies

frigid rock
slate pendant
#

Even if main java app dies?

dusk flicker
#

Can you show the addItem method

hybrid spoke
karmic grove
#

spawners only work in dark

hybrid spoke
#

yeah currently you are just canceling the spawnevent if the mob comes out of a spawner

hasty prawn
frigid rock
hybrid spoke
#

ah wait, i oversaw the spawn method

frigid rock
#

i think that the error its on the return item

frigid rock
dusk flicker
#

What's the yellow line under Material.matchMaterial say

frigid rock
dusk flicker
#

hmm

frigid rock
#

do you think that this could be helpful?

dusk flicker
#

not really

frigid rock
#

mhm

karmic grove
#

that i can see

hybrid spoke
dusk flicker
#

Try having your materials in your config surrounded by ""s

#

so like material: "GRASS_BLOCK"

frigid rock
#

yep its like that

#

oh wait no

hasty prawn
#

Print what material is

analog surge
#

help

dusk flicker
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

analog surge
#

I find the following error

frigid rock
dusk flicker
#

yeah or a sysout

frigid rock
#

oki

hybrid spoke
analog surge
#

[ERROR] Could not load 'plugins/0.1.4_CA.jar' in folder 'plugins'

org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml

at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:164) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]

at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:292) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]

at org.bukkit.craftbukkit.v1_8_R3.CraftServer.reload(CraftServer.java:739) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]

at org.bukkit.Bukkit.reload(Bukkit.java:535) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]

at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]

at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]

at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]

at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchServerCommand(CraftServer.java:627) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]

at net.minecraft.server.v1_8_R3.DedicatedServer.aO(DedicatedServer.java:412) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]

at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:375) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]

at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]

at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]

at java.lang.Thread.run(Thread.java:823) [?:1.8.0_272]

Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token

found character '\t(TAB)' that cannot start any token. (Do not use \t(TAB) for indentation)

in 'reader', line 8, column 6:

pb:

^

dusk flicker
#

delete that

#

put it in a paste

#

?paste

undone axleBOT
hybrid spoke
#

?patse

#

oh

#

damn

#

patse

hasty prawn
#

You're using tabs in your plugin.yml

#

Don't do that

analog surge
#

My plugin.yml

karmic grove
analog surge
#

main: ledmans.miplugin.MiPlugin
version: '0.1.3.4.55'
name: Paintball
softdepend: [ Vault ]
authors: [ ledmans ]

commands:
pb:

dusk flicker
#

they already gave you the answer

karmic grove
hasty prawn
#

You probably tabbed pb: instead of using spaces

karmic grove
#

i want to summon entity where spawner is

hybrid spoke
karmic grove
#

in any light level

#

so ill just cancel event find location and spawn one there

hybrid spoke
#

it seems to not be that easy.

#

you prolly have to cache the spawner and spawn the entities yourself

#

scheduled

karmic grove
#

oh

#

i have no idea how to do that lol

lost matrix
#

You are lucky that a spawner is actually a TileEntity.
So you can implement your own TileEntity, overwrite the tick() method and let it do whatever you want.
For example build blocks or spawn entities

karmic grove
#

?paste

undone axleBOT
karmic grove
#

for me sorry

analog surge
#

help pls

frigid rock
lost matrix
#

Me and my dog rn

frigid rock
sullen marlin
#

pretty clear

hasty prawn
analog surge
#

ok

frigid rock
#

as you said to do

hasty prawn
#

wait what did you print

frigid rock
# hasty prawn wait what did you print
  hub1:
    x: 11.713679753493269
    y: 71.7776368487581
    z: -126.28430046724496
    material: GRASS_BLOCK
  hub2:
    x: 11.706774598316242
    y: 71.7776368487581
    z: -123.04959035484632
    material: ACACIA_BOAT
#

this.

hasty prawn
#

Oh... Because you're getting warps.hub1.material

#

wait

#

hang on

frigid rock
#

thats what i want to get

hasty prawn
#

That should not be empty

frigid rock
#

haha

hasty prawn
#

OH

frigid rock
#

? lmao

hasty prawn
#

You're getting hub1.material

sullen marlin
#

"warps." + path + ".material" is what you want

hasty prawn
#

^

sullen marlin
#

or save the result of getConfigurationSection to a new variable and get that

hasty prawn
#

I'm a little slow but I got there Pepega

lost matrix
#

You should get the values relative to the retrieved configuration section

frigid rock
#

i think that my idea of making it its totally wrong

#

i want to list all the warps on a gui with blocks, i get the block in the "material" on the config

#

i think that there is an easier way maybe, anyone got any ideas?

hasty prawn
#

`

sterile token
#

Thanks

#

I want to ask if there is a way to make an inline return of a string replaced with hashmap key-value?

#

My brains are being burning btw

lost matrix
# frigid rock ```warps: hub1: x: 11.713679753493269 y: 71.7776368487581 z: -126....

Something like this:

    FileConfiguration configuration = ...;
    ConfigurationSection warpsSection = configuration.getConfigurationSection("warps");
    for (String warpName : warpsSection.getKeys(false)) {
      ConfigurationSection currentWarpSection = warpsSection.getConfigurationSection(warpName);
      double x = currentWarpSection.getDouble("x");
      double y = currentWarpSection.getDouble("y");
      double z = currentWarpSection.getDouble("z");
      Material material = Material.matchMaterial(currentWarpSection.getString("material"));
    }
frigid rock
#

this gets all the infos for each warp right? (coordinates and material type)

sterile token
lost matrix
#

btw Location is ConfigurationSerializable so you should do this probably:

for (String warpName : warpsSection.getKeys(false)) {
      ConfigurationSection currentWarpSection = warpsSection.getConfigurationSection(warpName);
      Location warpLocation = currentWarpSection.getLocation("location");
      Material material = Material.matchMaterial(currentWarpSection.getString("material"));
    }

And also save the warps using ConfigurationSection#set(String, Location)

lost matrix
analog surge
#

I get the following error I am not using any tab
https://paste.md-5.net/gofogidive.sql
MyPlugin.yml
main: ledmans.miplugin.MiPlugin
version: '0.1.3.4.55'
name: Paintball
authors: [ ledmans ]

commands:
pb:

frigid rock
lost matrix
quaint mantle
#

and if you're creating placeholders using special characters you're weird

analog surge
quaint mantle
#

%([A-Za-z_]+)%

young knoll
#

Doesn’t placeholder API use special characters

ivory sleet
#

Yeah well papi doesn’t use regex as it’s kinda slow

young knoll
#

Does it use magic

sterile token
#

Hey people

#

I dont want to do that

#

Because i will add to that map things like %player%, %rank%, and then i want to make a method that will replace all the placeholders, but i want to do it inline

young knoll
#

But why

#

Less code doesn’t mean good code

hybrid spoke
#

just replace the placeholders yourself

sterile token
#

I now but i have that types of loops

#

I prefer lambda

hybrid spoke
#

you will have more expense filtering them out, check what they are and then replace them

young knoll
#

Then use a lamda

frigid rock
sterile token
frigid rock
young knoll
#

.entrySet.forEach

hybrid spoke
hybrid spoke
frigid rock
#

ik how to make that but

sterile token
frigid rock
hybrid spoke
#

?paste

undone axleBOT
hybrid spoke
#

^

sterile token
young knoll
#

Why would it return a string

#

forEach is for a lambda

sterile token
#

Because how i will send the message back to the player?

hybrid spoke
#

?learnjava

undone axleBOT
frigid rock
frigid rock
sterile token
frigid rock
sterile token
hybrid spoke
#

and now you want to react if someone clicks that item?

frigid rock
#

so, in that gui there are 3 items now right?

young knoll
#

Where string is a variable outside the forEach

lost matrix
# sterile token I cannot find one btw

There are several ways to do this but here is a fix brute force:

  public String applyPlaceholders(String input) {
    AtomicReference<String> atomicInput = new AtomicReference<>(input);
    placeholders.forEach((key, value) -> atomicInput.set(atomicInput.get().replaceAll(key, value)));
    return atomicInput.get();
  }
hybrid spoke
young knoll
#

Yes

#

That’s the point

hybrid spoke
#

thought he want to do that for every var?

young knoll
#

Yes?

#

And

frigid rock
sterile token
#

But its a fu**d way to return a replaced string from hashmap values using inline code?

hybrid spoke
#

inside the forEach it will be overriden and just the last one will be "returned"

young knoll
#

No

sterile token
#

I have done one but know i cant find it 😡

frigid rock
young knoll
#

It will replace more each iteration

#

And then you return the final result

hybrid spoke
#

oh well string = string....

#

my bad

#

didnt saw that

sterile token
#

Wait i will try with stream().map()

#

Who was having gui problems?

frigid rock
#

me xD

hybrid spoke
frigid rock
#

like in the lore?

#

wdym

hybrid spoke
#

?pdc

frigid rock
#

oh imma read that

sterile token
# young knoll No

.map(entryToReplace -> s -> s.replace(entryToReplace.getKey(), entryToReplace.getValue())) ?

hybrid spoke
lost matrix
#

I still dont know what you are trying to achieve...

sullen marlin
#

Why is there an atomic reference wtf

tame shoal
#

I have two classes, One called LogsHandler, and one called INFO, I need to be able to get the name and target of the info, and put the string to be displayed in the LogsHandler class

sterile token
lost matrix
#

Because otherwise i get scope issues.
This is the 3 line version:

  public String applyPlaceholders(String input) {
    AtomicReference<String> atomicInput = new AtomicReference<>(input);
    placeholders.forEach((key, value) -> atomicInput.set(atomicInput.get().replaceAll(key, value)));
    return atomicInput.get();
  }
young knoll
#

Ah right doesn’t it have to be final to be used inside a lambda

tame shoal
#

I have two classes, One called LogsHandler, and one called INFO, I need to be able to get the name and target of the info, and put the string to be displayed in the LogsHandler class

#

Transfering strings inbetween classes

lost matrix
#

But why are the placeholders a Map<String, String>
Shouldnt it be something like Map<String, Supplier<String>> or Map<String, BiFunction<Player, String, String>> ??

lost matrix
hybrid spoke
#

its a string anyways

young knoll
#

Then how ya gonna replace it

lost matrix
#

and then ill just do
input = input.replaceAll()
on a final variable

sullen marlin
#

You don’t need anatomic ref, reduce should do it

young knoll
#

reduce?

lost matrix
#

Oh jeah

young knoll
#

Is it time to learn something new

lost matrix
#

reduce works too

tame shoal
#

Can someone please help me

hybrid spoke
#

^^

tame shoal
#

I have two classes, One called LogsHandler, and one called INFO, I need to be able to get the name and target from info class, and put the string to be displayed in the LogsHandler class

sterile token
sullen marlin
tame shoal
lost matrix
#

uhm

#

?di

undone axleBOT
young knoll
#

You tried

tame shoal
#

I have already gotten the target (args[0]) but I need to put that name, and the command sender and put it in a different class

#

how would i get that

lost matrix
digital drift
# sterile token OMGGG
public String replace(String text) {
  for (Map.Entry<String, String> entry : this.replaces.entrySet()) {
    text = text.replace(entry.getKey(), entry.getValue());
  }
  return text;
}
#

what happened to standard for loops nowadays

sullen marlin
#

^

digital drift
#

can't we just leave .forEach with javascript

lost matrix
young knoll
#

I mean I kinda like forEach for small stuff

digital drift
#
public String replace(String text) {
  for (Map.Entry<String, String> entry : this.replaces.entrySet()) { text = text.replace(entry.getKey(), entry.getValue()); } return text; 
}
young knoll
#

But I usually stick to loops for anything bigger

digital drift
#

inlined!

#

ye

quaint mantle
young knoll
#

forEach is really nice when you can just use a method refrence

digital drift
# sterile token OMGGG

you never actually return text at the end, remove your return and then on the next line write return text;

hybrid spoke
sterile token
digital drift
#

what's the error message?

#

send a screenshot

sterile token
#

Its saying that i cannot return a void

digital drift
#

send a screenshot of the code

#

you're not returning text

lost matrix
sterile token
#

I cant my eyes burns when i see that horrible loop too long

young knoll
#

And also completely unnecessary

#

And probably slightly slower

digital drift
#

horrible loop that long? it's 4 lines my dude

young knoll
#

All of minecraft is basically 1 big loop :p

sterile token
#

I will decompile some plugins to check if it have what i want

digital drift
#

i mean i can help you

#

you're just not sending a screenshot of your code

sterile token
#

Oh ok

digital drift
#

...

#

right

#

ok

#
public String replace(String text) {
  this.replaces.entrySet().forEach(entry -> text = text.replace(entry.getKey(), entry.getValue()));
  return text;
}
sterile token
#

Oh but i want to skip that return

digital drift
#

you can't

sterile token
#

And just return the complete this...blabla

#

Why?

sullen marlin
#

That code won’t work

digital drift
#

yeah just realised

sullen marlin
#

You need something like reduce

sterile token
#

Ohh ok

sullen marlin
#

But again just use the loop

#

Streams are not always better

digital drift
#

streams are slow

lost matrix
digital drift
#

i'm optimizing this plugin that's entire reason why it's performance is so poor is because it uses streams everywhere

young knoll
#

I think streams are faster these days

sterile token
young knoll
#

Probably still slower than loops though

lost matrix
digital drift
#

idk but .findFirst() is taking like 10% of server perf

#

replacing it with a normal for loop increased performance a lot

#

idk why

sterile token
#

I dm a Java senior developer and told me to use return stream.map(bla bla)

digital drift
#

fire that developer

young knoll
#

Lol

digital drift
#

i refuse to believe a senior dev would encourage trying to shorten a function body to one line at the expense of the codebase and performance

lost matrix
#
  public String applyPlaceholders(String input) {
    return placeholders.entrySet().stream().reduce(input, (in, entry) -> in.replaceAll(entry.getKey(), entry.getValue()), (key, value) -> value);
  }

Im not sure if i use the BinaryOperator "combiner" at the end properly

young knoll
#

And readability

lost matrix
#

probably not

young knoll
#

Why replaceAll

digital drift
lost matrix
digital drift
lost matrix
young knoll
#

But if you don’t use regex it’s not good to use it

digital drift
#

what if it's for a chat plugin

#

and then a player writes some invalid regex

#

server crash

#

(i've done that before)

young knoll
#

I used to think replaceAll was just replace but for all occurrences

#

Weird naming

digital drift
#

ya

sterile token
#

I will continúes searching for a inline string renplace

#

Because its imposible that there isnt a way for doing that

#

Another daught what is best Socket or Websocket for making clienta-server communication?

young knoll
#

Just use messaging channels?

sterile token
#

I need without players

#

That why btw

spiral light
#

welll ... just java.net.Socket ?

young knoll
#

How do you communicate with a client without a player

sterile token
#

Sometime ago I find a truck for without players need with Messaging channel but i m an idiot I cannot figure how i had lost that

sullen marlin
#

Use a message queue, don’t roll your own socket system

sterile token
#

Oh ok

#

Redis right?

young knoll
#

I just use plugin messaging to talk to a forge client

sterile token
#

Yeah but i will use for cache sync btween servers

#

So is there a free host for redis?

spiral light
#

local ?

waxen plinth
#

It iterates over the whole map

#

You could use a prefix tree, or if all your placeholders start and end with %, just find and replace those while appending to a StringBuilder

#

I suppose this would only matter if you have a lot of placeholders

young knoll
#

I wonder how papi does it

#

Efficiently

sturdy heron
#

teleportation packet error

rough basin
#

Good Morning Guys, What is PDC?

young knoll
#

?pdc

rough basin
#

cafebabe knows everything

swift adder
#

that's just the docs

waxen plinth
young knoll
#

Sounds slow to check every single registered placeholder for a string though

woeful crescent
#

Good way or API for fully setting a player invisible (with armor)

slim bough
#

How to make command auto fill

desert loom
#

pretty sure they extract every string surrounded with % and then check that against a map for a replacement. Something like that.

ivory sleet
#

iirc they only check the token before the underscore as the rest is up to the expansion derivative to parse

young knoll
slim bough
#

Oh okay bubs

#

I love you

lost matrix
woeful crescent
#

can i convert a bukkit itemstack to an nms itemstack

young knoll
#

CraftItemStack.asNMSCopy

woeful crescent
#

thx

sweet creek
#

so i have my local server running
but when i try to join localhost in the direct connect panel of mc
it doesn't let me join ):
"Connection refused: no further information"
same thing happens when i try localhost:25565, 0, 127.0.0.1, 127.0.0.1:25565
nothing is logged in the server console

wet breach
#

localhost is just the named piped usually for 127.0.0.1

#

however computers typically have another ip other then the loop back as well

#

so maybe try the ip assigned by the router?

#

also is the server and client on the same system?

sweet creek
#

both are on my pc

sweet creek
wet breach
#

what did you set for the ip address in the configs for the server?

sweet creek
#

let me check, 1 second

#

it's blank

wet breach
#

generally for home hosting, you don't need to set an ip specifically and should instead set it to 0.0.0.0 so that it can listen on all ip's it has

sweet creek
#

ill try that now

#

thank you :)

#

just changed the ip to 0.0.0.0 and restarted the server
now the world files are corrupted?

#

pages upon pages of variations of [21:11:42] [IO-Worker-26/WARN]: Region file ./world/region/r.-1.-1.mca has an invalid sector at index: 73; sector 13893932 is out of bounds

wet breach
#

how did you stop the server?

#

did you run /stop

#

if you hit the X button that isn't an appropriate way to exit the server. But if that isn't the case I couldn't really tell you why other then maybe a bad plugin?

maiden thicket
#

how would i get an entity's datawatcher in spigot 1.18 unobfuscated

#

nvm

woeful crescent
#

what order is EnitityEquipment#getArmorContents arranged in?

wet breach
#

don't think there is an order

#

or at least one that is guaranteed

sweet creek
woeful crescent
#

uh oh

#

lol

sweet creek
#

thank you for trying to help though, i do appreciate it

wet breach
#

you can however get each armor independently however @woeful crescent

young knoll
#

Boots is index 0

#

Helmet is index 3

#

IIRC

woeful crescent
#

wait is there an order or no

maiden thicket
#

trying to understand this, how would i set the value like 0 or 1

#

like set invisible to false, or true in the metadata packet

wet breach
maiden thicket
#
    public WrappedEntity hideFrom(@NotNull Player player)
    {
        final SynchedEntityData data = this.nmsEntity.getEntityData();
        data.set(new EntityDataAccessor<>(0, EntityDataSerializers.BYTE), (byte) 0x20);
        final ClientboundSetEntityDataPacket packet = new ClientboundSetEntityDataPacket(this.nmsEntity.getId(), data, true);
        NMSUtil.sendPacket(player, packet);
        return this;
    }```
#

i have this to make it invisible

#

the 0 i assume is the index

#

0x20 is the bitmask

#

how would i toggle though like between the values to set visible and invisibel

wet breach
#

bitmask doesn't mean that 0x20 is the entire byte either, just that it refers to one thing of the byte as a whole

#

there is 8bits to a byte

#

0x20 could mean or refer to the second bit of the byte

#

not sure if it does or not, just an example of what bitmask means

maiden thicket
#

hmmm okay i'm a little confused here xd

wet breach
#

the wiki discusses the masking somewhere

young knoll
#

You want to set bit 6 to 1

#

And the others to 0

wet breach
#

00000100 is what bit 6 set to 1 looks like. Well maybe not exactly since LEB128. But for practical teaching purchases we can pretend that it does.

maiden thicket
#

im officially lost 😔

#

i understand bits but i dont understand how mc does this stuff xd

wet breach
#

ok, well a byte is 8 bits

#

however MC uses all of the bits and not just the byte as a whole

#

hence bitmasking

#

that is why that list above you are looking at, can have multiple bits set in a single type

maiden thicket
#

ahh i see i believe i understand it now :d

wet breach
#

so you need to figure out, where 0x20 means in the byte

#

MC uses LEB128 or better known as Little Endian Binary 128

#

but if you are using protocollib you most likely won't need to worry about this anyways since it takes care of most of this stuff for you

maiden thicket
#

ahhhh okay

#

do you actually have any idea why my mobeffects packet wasnt working 😔

#

sec

wet breach
#

most likely because of this
data.set(new EntityDataAccessor<>(0, EntityDataSerializers.BYTE), (byte) 0x20);

maiden thicket
#
final ClientboundUpdateMobEffectPacket packet = new ClientboundUpdateMobEffectPacket(this.nmsEntity.getId(), new MobEffectInstance(MobEffects.INVISIBILITY, Integer.MAX_VALUE, Integer.MAX_VALUE, false, true));```
maiden thicket
#

i tried to set entity invisible with an effects packet before but didn't work so i resorted to metadata

wet breach
#

well maybe because of the max values for integer? lmao

maiden thicket
#

moving on......

#

xd

#

i didnt know that would affect it

#

since regular spigot allows it

young knoll
#

Level is a byte

#

Duration is an int

wet breach
#

well max value for an int is different on every system and generally that large of a number isn't expected to be in the packet 😛

young knoll
#

Just set the level to 0

wet breach
#

Integer.MAX_VALUE is just shorthand in code to mean the largest possible number an int can be on the system

maiden thicket
#

what level? 😮

young knoll
#

The potion level?

#

Amplifier if you will

maiden thicket
#

oh amplifier

woeful crescent
#

how do i make a player invisible indefinitely (like the potion effect, not hidePlayer())

maiden thicket
#

and what would you think i should set the duration for to make it indefinite

young knoll
#

Max value should be fine

maiden thicket
#

1000000 is what vanilla mc allows 🤷🏾‍♂️

#

o ok

woeful crescent
wet breach
woeful crescent
#

ok

maiden thicket
#

yeah but with nms, the regular way is player.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_INT, 255, false, false)) is what i do

wet breach
#

you can always have a loop to reset timers too on effects

#

just because you set an effect doesn't mean you can't have something come back to update said effect 😛

maiden thicket
#
    public WrappedEntity hideFrom(@NotNull Player player)
    {
        final ClientboundUpdateMobEffectPacket packet = new ClientboundUpdateMobEffectPacket(this.nmsEntity.getId(), new MobEffectInstance(MobEffects.INVISIBILITY, Integer.MAX_VALUE, 0, false, true));
        NMSUtil.sendPacket(player, packet);
        return this;
    }``` doesn't do anything to the entity 😔
wet breach
#

there might be other packets you might have to update as well not entirely sure

#

part of the reason I don't mess with NMS packets XD

young knoll
#

Apparently this is how I did it

#
private PacketContainer constructPacket(int id, boolean disable) {
        PacketContainer entityMeta = manager.createPacket(PacketType.Play.Server.ENTITY_METADATA);

        entityMeta.getIntegers().write(0, id);

        WrappedDataWatcher dataWatcher = new WrappedDataWatcher(entityMeta.getWatchableCollectionModifier().read(0));

        WrappedDataWatcher.WrappedDataWatcherObject isInvisibleIndex = new WrappedDataWatcher.WrappedDataWatcherObject(
                0, WrappedDataWatcher.Registry.get(Byte.class));
        WrappedDataWatcher.WrappedDataWatcherObject effectIdIndex = new WrappedDataWatcher.WrappedDataWatcherObject(9,
                WrappedDataWatcher.Registry.get(Integer.class));

        dataWatcher.setObject(isInvisibleIndex, disable ? (byte) 0 : (byte) 0x20);
        dataWatcher.setObject(effectIdIndex, disable ? 0 : EFFECT_COLOR);

        entityMeta.getWatchableCollectionModifier().write(0, dataWatcher.getWatchableObjects());
        return entityMeta;
    }
maiden thicket
#

i dont think i can get the invisibility index like that thru regular nms

#
    public WrappedEntity hideFrom(@NotNull Player player)
    {
        final SynchedEntityData data = this.nmsEntity.getEntityData();
        data.set(new EntityDataAccessor<>(0, EntityDataSerializers.BYTE), (byte) 0x20);
        final ClientboundSetEntityDataPacket packet = new ClientboundSetEntityDataPacket(this.nmsEntity.getId(), data, true);
        NMSUtil.sendPacket(player, packet);
        return this;
    }``` is how i did it with the datawatcher
frigid rock
#

Guys a quick question can u have 3 persistent data doubles in a block?

#

I want to learn that and i was just wondering if it can be useful for a plugin

young knoll
#

Not in a block

frigid rock
#

Thank ya

hollow bluff
#

How may I better format messages? I got a role that is given and at the end of the game, it lists the players with that role, but it looks like this https://gyazo.com/d53e3fdef6338b70dcdae7c6f30b4220 and I'm unsure on how to make it format better. What I mean is for example if there is one player, it goes in the middle and if there is more than 3 or something, it goes to the next line. Just something that looks better if that even makes any sense

paper viper
#

you can't format it "better"

#

chat is different for everyone

#

it may look good for you, but horrible for everyone else

#

for centering

lost matrix
paper viper
#

🥲

hasty prawn
rough basin
#

If I do the same thing in three places ChunkLoadEvent / WorldLoadEvent / onEnable , wouldn't the task run three times?

woeful crescent
#

Can I set invisiblity duration to Integer.MAX_VALUE

rough basin
#

yeah

umbral spindle
#

How would I go about forcing a map to reload? So that it displays what blocks are there now instead of the original time it was loaded?

woeful crescent
#

what's ambient

young knoll
#

makes particles less obstructive

woeful crescent
#

I can set the ItemStack on PacketPlayOutEntityEquipment to null right

#

to unequip?

young knoll
#

Try it

#

Or try air

woeful crescent
#

this.c = var3 == null ? null : var3.cloneItemStack();
Looks like the packet accounts for null, gonna do that

#

how do i unregister events

rough basin
#

maybe?

woeful crescent
#

i meant unregister the listener

#

yea

#

also can i subscribe to just one event

#

or wait no

#

lol

young knoll
#

Of course you can

woeful crescent
#

11 o clock moment

#

yea it's called making one event handler

#

lol

wet breach
woeful crescent
#

yep

young knoll
#

Yep, there are several methods for it too

muted sand
#

How do I take things logged to console, and send them some place else? (discord webhook etc)
like errors logged by plugins, but "redirect" them

sullen marlin
#

By writing code to post log messages elsewhere

young knoll
#

Don't think you can easily do that for other plugins

#

Good ol log4j

rough basin
#

why .getEquipment not works in this line?

sullen marlin
#

Learn java

#

?learnjava

undone axleBOT
rough basin
thorny python
#

can I get list of ConfigurationSection from config yml?

sullen marlin
#

getKeys(false) will help you on your way

thorny python
#

uh I mean like this

sullen marlin
#

Idk

#

What does get("children") return

thorny python
#

so maybe List<ConfigurationSection>

#

let me check

stone light
#

I keep getting a Jar does not contain plugin.yml when putting my plugin into a server, but the plugin.yml is in my project but it doesn't show up in the jar

sullen marlin
#

Is it in the root folder (no package)

stone light
#

yeah

sullen marlin
#

If maven/gradle probably needs to be in resources folder

stone light
#

okay

thorny python
#

seems like a list

#

I will try to convert it to List<ConfigurationSection> then

stone light
sullen marlin
#

Yes

thorny python
#

ya look like a valid convert, thanks

dark arrow
#

how to toggle pvp ?

mellow gulch
drowsy bramble
#

is 1.8.9 code usable in 1.17+? my guess would be not fully, if at all, but figured id ask

eternal oxide
drowsy bramble
#

ill send u it when i can find it

lethal island
#

how do u import spigot jars with maven?

young knoll
lethal island
#

thank u

viscid wharf
#

How to deal with the problem that &r doesn't clear &l &m or other formats with fromLegacyText?

quaint mantle
#

a lot of it changes and breaks

young knoll
#

Not really

quaint mantle
#

i made the switch after years earlier this year

#

at least for what i was doing

young knoll
#

I think a big one is sounds

#

But most of the API is the same

quaint mantle
#

a lot of stuff changes under the hood so you just need to see what breaks i guess

#

but from my experience i just started again

sullen marlin
#

If it doesn't, write a test and open a bug report

viscid wharf
#

Thought it was my code :o Thanks.

rough basin
#

When using runTaskTimer, Does TaskID not change even if BukkitRunnable is executed again through runTaskTimer?

#

I mean, if I run BukkitRunnable using runTaskTimer() and the TaskID is #3 at the first time,
I wonder if it will stay #3 while runTaskTimer is running.

gentle oriole
#

how do I close a player's inventory

quaint mantle
#

p.kick

gentle oriole
#

kick?

quaint mantle
#

yeah

#

kick that player

#

😎

gentle oriole
#

nope

hasty prawn
#

Player#closeInventory

gentle oriole
#

smh it's in HumanEntity instead of Inventory

#

but i guess it works

#

does each line of code run each tick?

#

like 1 tick = 1 line run?

eternal oxide
#

no

gentle oriole
#

uhh... /give triggers PlayerDropItemEvent. is this intended?

thorny python
#

._. the get() of ConfigurationSection return List<Map<?,?> instead of List<ConfigurationSection>; it passed compile time check but throw runtime exception

#

so how can I work on list of ConfigurationSection

eternal oxide
#

If you just added the sections they are Maps, if you loaded the config they are MemorySections

thorny python
eternal oxide
#

try List<MemorySection>

thorny python
#

but how

#

there are no such method

eternal oxide
#

just .get

thorny python
#

.get return an object

eternal oxide
#

or getList

thorny python
#

and it seems internally it will return List<Map<?,?>>

eternal oxide
#

you can use get and provide the object type

thorny python
#

hm

#

you mean this one?

eternal oxide
thorny python
#

._. well, is it possible to convert Map to ConfigurationSection?

#

maybe a workaround but idk

thorny python
#

xd

#

seems like bukkit just no intend to support ConfigurationSection list I guess

eternal oxide
# sullen marlin That sounds like a bug

This only happens if you add Maps to the config. Creating ConfigurationSections works fine, but add a Map object and its not converted to a MemorySection until you reload the config.

#

I'd class it as an annoying bug, but not the end of the world.

dark arrow
#

how to use bossbar?

#

in commandExecuter

eternal oxide
#

Depends which world

dark arrow
#

?

#

overworld?

gentle oriole
#

is there any way to find out if player is using the correct tool to break the block? isPreferredTool does work but it only returns false when after breaking the block, it will not drop anything

low temple
#

In MySQL does creating a variable in a table with the max VARCHAR allocate more memory automatically? Or will it auto adjust the memory allocation for the size of the string?

low temple
#

Like creating a VARCHAR(65000)

gentle oriole
#

is there something like player#isbreakingblock

#

i dont think BlockDamageEvent#isCancelled() works..

#

i had cancelled breaking the block but the code still runs

eternal oxide
#

isCancelled() does not cancel an event

gentle oriole
#

yes,

eternal oxide
#

of course it doesn;t

#

use setCancelled

gentle oriole
#
        if (!disabled.contains("playerUsedWrongTool")) {
            Material[] logs = {Material.OAK_LOG, Material.DARK_OAK_LOG, Material.ACACIA_LOG, Material.BIRCH_LOG, Material.JUNGLE_LOG, Material.SPRUCE_LOG};
            if (Arrays.asList(logs).contains(e.getBlock().getType())) return;
            scheduler.scheduleSyncDelayedTask(plugin, () -> {
                if (!e.isCancelled() && !e.getBlock().isPreferredTool(e.getItemInHand())) {
                    Killer.kill(player, "used the wrong tool.");
                }
            }, 20L);

        }
lost matrix
#

PS: BlockBreak animations are client side in 1.18

#
  1. Dont call contains on a List
  2. Dont create a new array/list every event that just wastes memory
eternal oxide
#

um, you are testing the cancelled state of an Event 20 ticks after its finished!?

gentle oriole
eternal oxide
#

no you are not

gentle oriole
eternal oxide
#

An Event is a fire and done process. Once your code exists teh event is finished

gentle oriole
eternal oxide
#

There is no method to test to see if a player continues breakign a block

#

you can detect the damage, and the break is all

quaint mantle
#

dunno

#

dont mind about that

#

sorry ping

gentle oriole
#

yeah no, doesnt work

lost matrix
#
  @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
  public void onDamage(BlockDamageEvent event) {
    Block block = event.getBlock();
    Material blockMaterial = block.getType();
    ItemStack tool = event.getItemInHand();
    if (!Tag.LOGS.isTagged(blockMaterial)) {
      return;
    }
    if (!block.isPreferredTool(tool)) {
      // Handle wrong tool usage for logs here
    }
  }
gentle oriole
#

!Tag.LOGS.isTagged(blockMaterial) tag?

lost matrix
#
  private static final Set<Material> CHECKED_MATERIALS = EnumSet.of(
      Material.OAK_LOG,
      Material.BIRCH_LOG,
      Material.SPRUCE_LOG
  );

  @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
  public void onDamage(BlockDamageEvent event) {
    Block block = event.getBlock();
    Material blockMaterial = block.getType();
    ItemStack tool = event.getItemInHand();
    if (!CHECKED_MATERIALS.contains(blockMaterial)) {
      return;
    }
    if (block.isPreferredTool(tool)) {
      // Handle wrong tool usage for block contained by CHECKED_MATERIALS here
    }
  }
quaint mantle
#

dont spoonfeed

quaint mantle
#

🥄

lost matrix
#

Dont tell me what to do 😄

quaint mantle
#

🙁

lost matrix
#

its more of a best practice template

#

but u r right

gentle oriole
#

well, i dont know tags exists until now...

lost matrix
#

Tags are an exception for this specific case

wet breach
#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

quaint mantle
#

?feed

#

no?

#

sad

deep solstice
#

hey so i am trying to use the worldguard API, and I am getting this error when I compile. any thoughts as to why?

#

cannot access com.sk89q.worldguard.protection.flags.Flags

lost matrix
#

Do you use dependency manager?

#

maven/gradle

deep solstice
#

yes I do

#

ill send the pom.xml

lost matrix
#

how do you build the project?

deep solstice
#

intellij maven build - clean then compile

#

(will delete that afterward so it doesn't flood)

lost matrix
#

looks good

deep solstice
#

yeah this works on a different plugin that is 1.16.5, I don't know why this doesn't work for a 1.8.8 spigot plugin

lost matrix
#

aaaand im out

deep solstice
#

dam lmao

quaint mantle
deep solstice
#

yes but i thought worldguard worked with 1.8?

wet breach
#

that isn't your entire pom

lost matrix
#

version 7.0.6 is for 1.17 and 1.18 only

deep solstice
wet breach
#

?paste

undone axleBOT
lost matrix
#

for 1.8 - 1.11 you would need to use version 6.2
But i advise against using 1.8 at all

quaint mantle
#

¡

deep solstice
lost matrix
#

probably. This version is very very old and might have completely different approaches which you will probably not find any documentation for anywhere

frigid rock
#

Okay, so i'm stuck again with my plugin haha. Its just so trippy. How do you put 3 values (x,y,z) in a block that i can later get easily?

lost matrix
frigid rock
#

Bruh

#

So how can i make it?

#

Do you have any ideas for the click event?

#

Idk if you remember yesterday

lost matrix
#

What are you trying to do?

frigid rock
#

Oh okay u dont lol lemme explain

#

So i have a config with some warps, each with a name, x,y,z and a material

#

I made a for loop to get al the warps and for each one make an item that i put into a gui

#

Idk if i explained that correctly

lost matrix
#

makes sense

frigid rock
#

Now i need a click event for those blocks, so that when i click i teleport to the coords

lost matrix
#

You didnt mention any blocks so i have no idea what "those blocks" is refering to

#

So you want to have certain Blocks that teleport to certain warps when right clicked?

frigid rock
#

No wait lemme start my pc a sec

lost matrix
#

Ah i see. Was a bit confused with the whole clicking on blocks thing

wet breach
#

seems they want the items in said GUI to probably teleport them to different servers XD

#

or warp them somewhere in the same map/server

wet breach
frigid rock
#

yeah ik that

#
  hub1:
    x: 74.65848167798883
    y: 105.89627683692098
    z: -262.68832976440643
    material: GRASS_BLOCK
  hub2:
    x: 58.36908896976975
    y: 105.89627683692098
    z: -219.65651838033324
    material: BIRCH_LOG
#

this is my config right?

#
        for (String warpName : warpsSection.getKeys(false)) {
            ConfigurationSection currentWarpSection = warpsSection.getConfigurationSection(warpName);
            double x = currentWarpSection.getDouble("x");
            double y = currentWarpSection.getDouble("y");
            double z = currentWarpSection.getDouble("z");
            Material material = Material.matchMaterial(currentWarpSection.getString("material"));
            warps_menu.addItem(createItem(warpName, material));
        }```
wet breach
#

and its not making the item?

frigid rock
frigid rock
#

but. now i need a click event for each block, but how would i get the infos

wet breach
#

get the slot they clicked?

frigid rock
#

like i need to store the coords into the block idk

lost matrix
#

Use a Map<Integer, Warp> for slot -> warp mapping.
Or if you dont have a Warp class then a simple Map<Integer, String> map should suffice

frigid rock
quaint mantle
#

isnt pdc there?

frigid rock
lost matrix
#

Eh... writing a UI using pdcs... idk about that

wet breach
#

lol

quaint mantle
frigid rock
#

yup

quaint mantle
#

ok then use nbt

wet breach
#

the solution is what 7smile7 said

#

it really isn't all that difficult

quaint mantle
#

or store in the hashmap

wet breach
#

you should have the custom gui as a reference somewhere?

frigid rock
lost matrix
frigid rock
#

lemme search on google for maps lol

quaint mantle
#

nah you dont need to search it

#

?learnjava

undone axleBOT
quaint mantle
#

there

wet breach
frigid rock
#

oh thats actually easier than i thought

frigid rock
lost matrix
#

when you load all the warps you should fill your map with the values. Its probably a good idea to also define the slot number in your config file

frigid rock
#

oh okay imma try that

lost matrix
#

And you should have a single instance of your inventory as its not dynamic meaning there is no harm in everyone having the same inventory open

viscid oasis
#

is there event when turtle hatched from turtle egg?

frigid rock
lost matrix
viscid oasis
frigid rock
#

hey yo! I tried doing this: ```java
ConfigurationSection warpsSection = getConfig().getConfigurationSection("warps");
for (String warpName : warpsSection.getKeys(false)) {
ConfigurationSection currentWarpSection = warpsSection.getConfigurationSection(warpName);
double x = currentWarpSection.getDouble("x");
double y = currentWarpSection.getDouble("y");
double z = currentWarpSection.getDouble("z");
TWCore.coords.put("x", x);
TWCore.coords.put("y", y);
TWCore.coords.put("z", z);
Material material = Material.matchMaterial(currentWarpSection.getString("material"));
warps_menu.addItem(createItem(warpName, material));

    }```
#

this is the event: ```java
@EventHandler
public void onWarpClick(InventoryClickEvent e){
Player p = (Player) e.getWhoClicked();
if(e.getView().getTitle().equalsIgnoreCase(WARPS_MENU)){
if(e.getCurrentItem() != null){
Double x = (Double) TWCore.coords.get("x");
Double y = (Double) TWCore.coords.get("y");
Double z = (Double) TWCore.coords.get("z");
Location loc = new Location(p.getWorld(), x, y, z);
p.teleport(loc);

        }
    }

}```
#

but, it gets just the coords of the last warp set

#

so even if i click on another warp, it will tp me to the last set

frigid rock
sage patio
frigid rock
#

oh thanks for the tip ^^

sage patio
#

👍

grim ice
#
        for(ItemStack itemStack : ((GuiChest) gui).inventorySlots.inventoryItemStacks) {
            for(Slot slot : ((GuiChest) gui).inventorySlots.inventorySlots){
                if(slot.getHasStack()){
                    if(slot.getStack().getIsItemStackEqual(itemStack)){
                        itemSlot.put(itemStack, slot);
                    }
                }
            }
            renderItem(itemStack,0,0);
        }```
#

this isnt spigot but i have a question

#

if i have a loop

#

that has another loop inside

wet breach
#

it does indeed still loop

grim ice
#

will the first loop code stop until the loop inside

#

finishes

#

?

wet breach
#

it goes in succession if that makes sense

eternal oxide
#

Single thread runs in sequence. Outside loop can;t run until inner finishes

grim ice
#

yooooo

#

pog

wet breach
#

so when the inner loops 1 time, all the outer ones will loop 1 time

ionic torrent
#

I'm new to this plugin thing and i ran into a problem because i don't know how to know the gamemode the player is on, can anyone help me?

eternal oxide
#

?jd-s and search gamemode

undone axleBOT
wet breach
#

get the player object and check. Unless you gave them perms to use the game mode command to change their gamemode, typically this will just be survival

eternal oxide
#

a Clue, its under HumanEntity

ionic torrent
#

ok thx 😁

lean gull
#

any way to make blocks colorable with a resource pack and a plugin? maybe like using the grass thing that colors it depending on the biome?

lost matrix
lean gull
#

can i make it with all the colors tho?

#

and also, how would i pick one exact color?

lost matrix
lean gull
#

what's that

#

actually, nvm, i don't even have my custom blocks part done yet so it wouldn't really matter

#

do you know what's the protocollib packet for when a blockstate updates?

#

or like in the render distance or whatever

spiral light
lost matrix
lost matrix
# lean gull what's that

Lets look at mojangs grass_block.json

{   "parent": "block/block",
    "textures": {
        "particle": "block/dirt",
        "bottom": "block/dirt",
        "top": "block/grass_block_top",
        "side": "block/grass_block_side",
        "overlay": "block/grass_block_side_overlay"
    },
    "elements": [
        {   "from": [ 0, 0, 0 ],
            "to": [ 16, 16, 16 ],
            "faces": {
                "down":  { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" },
                "up":    { "uv": [ 0, 0, 16, 16 ], "texture": "#top",    "cullface": "up", "tintindex": 0 },
                "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#side",   "cullface": "north" },
                "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#side",   "cullface": "south" },
                "west":  { "uv": [ 0, 0, 16, 16 ], "texture": "#side",   "cullface": "west" },
                "east":  { "uv": [ 0, 0, 16, 16 ], "texture": "#side",   "cullface": "east" }
            }
        },
        {   "from": [ 0, 0, 0 ],
            "to": [ 16, 16, 16 ],
            "faces": {
                "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "north" },
                "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "south" },
                "west":  { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "west" },
                "east":  { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "east" }
            }
        }
    ]
}

Pretty sure the coloring is handled with the "tintindex" property

lean gull
#

yeah i know

#

my quesiton was on how to make it colorable with every color, and also how to know what color i should use

#

what biome i should use*

lost matrix
#

no idea. Just dig through the json files and see how its done in vanilla 😄

lean gull
#

alr, can you help me with the packet thing doe?

spiral light
sonic osprey
#

Which operating system is the best for hosting minecraft servers?

 Ubuntu 20.04.3 (HWE) LTS minimal
 Ubuntu 20.04.3 LTS minimal
 Ubuntu 21.10 base
quaint mantle
#

windows 10 bro, i gotchu

wet breach
#

Each material has a base color which is multiplied by 135, 180, 220 or 255, and then divided by 255

#

keep that in mind too, so there isn't infinite colors to choose from

spiral light
spiral light
#

its not an alpha mask

indigo sage
pseudo geyser
#

Hi im new, im having a problem with getting the custom name of a chest. When i create it and set the custom name to DeathChest it sets properly (i corroborate that using playerSendMessage(chest.getCustomName()) ).
But when i go and try to break it (i make another playersendmessage) that says me the custom name of the chest its null, i can send the code if its necessary

spiral light
#

when you break it ... when do you try to send the msg ?

pseudo geyser
#

yeah when i break it

#

the idea is that no one can break the deathchest

spiral light
#

before it was breaked ... as item ... before it broke

pseudo geyser
#

and i think that the only way to set a unic data of the chest is setting a custom name

spiral light
#

PersistentDataContainer ^^

pseudo geyser
spiral light
#

?pdc

valid sorrel
#

not exactly completely related to spigot, but I cannot find a good guide on making a nuvotifier listener plugin (preferably, for bungee)

#

their support seems to have closed down to people asking for setup help

torn shuttle
#

is there a way to get the servers.properties config file without resorting to finding it in a directory?

spiral light
#

what do you want to find from the server.prop ?

torn shuttle
#

I don't want to find, I want to write

spiral light
#

what do you want to write ?
if you change smth in server.prop it only affects the server after a full restart

torn shuttle
#

I know

#

resource-pack-sha1=

pseudo geyser
torn shuttle
#

I'm already handling everything required to parse it up to the point where I just want to write the value

#

just wondering if there's a method to get that config directly or if I have to go do more directory crimes

spiral light
spiral light
torn shuttle
#

uh

spiral light
#

so its in nms

torn shuttle
#

yeah let's not do that

#

guess it's back to directory crimes

spiral light
#

its not that deep in nms ... just CraftServer::getServer::setResourcePack(resourcepack, hash)

torn shuttle
#

any depth would rule it out for me, I don't use any nms

spiral light
#

uiff

#

you can also use player::setResourcepack ^^

torn shuttle
#

eh

#

getting the directory isn't that bad

pseudo geyser
spiral light
#

its not chest.setCustomTag ^^

#

which version btw

pseudo geyser
#

1.18.1

pseudo geyser
spiral light
pseudo geyser
#

thank you, i will try it

manic furnace
#

Does anybody know what the license of spigot is? I asked this question e few days ago, but couldn't find anything

valid sorrel
#

anyone know how to make a bungeecord nuvotifier listener?

#

cuz for spigot, I'm pretty sure I can just use the votifier api

#

but I'm a bit unsure for bungeecord

tardy delta
#

what would be the best way to wait till a chunk is loaded before teleporting a player?

manic furnace
#

Where? I can't find it

undone axleBOT
spiral light
#

did someone ever tested what BlockFaces exist ??? i feel like it should have also the 3x3 cube filled in the middle

pseudo geyser
# spiral light

this are the options that i have when i try to set a PersistentDataContainer:
setMetaData
SetCustomName
setData
setType
setBlockData
setLock
setLootTable
setSeed
Which should i use?

quaint mantle
#

GPL

#

in bukkit it is GPL

manic furnace
#

I know

quaint mantle
#

but in craftbukkit it is LGPL

#

kekw

pseudo geyser
#

here im not able

manic furnace
quaint mantle
#

in the stash bukkit is GPL and craftbukkit is LGPL

#

but i dont see anything in spigot

tardy delta
#

is this something to wait till a chunk is loaded before teleporting a player?

CompletableFuture.completedFuture(location.getChunk().load()).whenComplete((b,t) -> target.teleport(location));
young knoll
#

Chunk loading is sync on spigot

spiral light
#

verified*

wraith hare
#

hello I do rtp command and how to do player tp on ground, I'm tp on the sky

#

(i'm french sorry for misspelling)

wraith hare
#

I do Block.getHighestBlockYAt() ?

young knoll
#

It says world

quaint mantle
#

ping him

#

wtf

manic furnace
#

What is the license for spigot? @sullen marlin Sry for pinging

hard cargo
#

i want to create custom enchantment using spigot, can they be obtained using the normal enchanting table?

young knoll
#

Depends how you do it

spiral light
#

not automaticly

hard cargo
young knoll
#

EnchantItemEvent

spiral light
#

EnchantItemEvent and add some of yours too

hard cargo
#

could you make a little code example?

#

or link the wiki

frosty tinsel
hard cargo
#

thx

young knoll
#

You add your custom enchants to the getEnchantmentsToAdd map

young knoll
#

What is what

hard cargo
#

the getEnchantmentsToAdd thingy

young knoll
#

Have you clicked the link?

frosty tinsel
hard cargo
#

ye

#

im reading the wiki

frosty tinsel
#

or instead of

young knoll
#

Do you not see the method labeled “getEnchantsToAdd”

pseudo geyser
#

@spiral light thanks for your help, i watched a video about PersistentDataContainer and i undertood it

tardy delta
hard cargo
young knoll
frosty tinsel
young knoll
#

Because it’s sync

hard cargo
spiral light
#

?learnjava

undone axleBOT
tardy delta
frosty tinsel
#

Key - Value based

tardy delta
#

it teleports a player which kinda falls in the void

frosty tinsel
#

Key is enchantment level and valuse is the enchantment

spiral light
# tardy delta

well player.teleport will automaticly load the chunk ^^

frosty tinsel
hard cargo
#

okkk

#

btw thx for the help

frosty tinsel
#

How to pre-generate chunk?

tardy delta
#

i'm looking to avoid that

#

so i think i need a delay or something

spiral light
tardy delta
#

possible

quaint mantle
#

is there a way to stop animals following wheat

#

in an event

#

without nms

#

i dont want ppl making mob farms 😂

spiral light
#

kill mobs that have players in range with wheat in hand

tardy delta
#

🥺

spiral light
#

if you block following by wheat - what about leashes ?

young knoll
#

I believe you can block it via the EntityTargetLivingEntityEvent

wraith hare
#

when I write World. I have : Environement, Spigot and class

#

not getHighestBlockYAt()

young knoll
wraith hare
#

so how I write the method ?

frosty tinsel
wraith hare
frosty tinsel
young knoll
#

They probably already have a way to get the world

#

Via player#getWorld or soemthing

wraith hare
lucid bane
#

hi
is it possible to get a empty bucket's ItemStack data when i fill the bucket?

lucid bane
#

i want to run a code if empty bucket has a certain displayname

#

and fill water in it

pseudo geyser
#

any idea why BlockExplodeEvent its not working?
i only code 1 if in the event.
if(event.getBlock().getType() == Material.CHEST){
event.setCancelled(true);
}
and i put tnt next to the chest and it explodes

wraith hare
#

how I get the coo of the player ?

spiral light
#

getLocation

wraith hare
#

in a Location

#

ok okay

pseudo geyser
#

its an example

young knoll
#

Right

#

But chests don’t explode

pseudo geyser
#

what?

young knoll
#

event.getBlock gets the block at the source of the explosion

#

Do you want to make chests not explode

pseudo geyser
young knoll
#

Remove all chests from event.blockList