#help-archived

1 messages · Page 105 of 1

frigid ember
#

from the server?

#

well I'm in same position, just homehosting means you won't have professional equipment to hold against any problems

#

Which problems?

#

DDOS attacks?

#

anything else?

#

technical ones, maybe less stable internet

#

than one in a datacenter

#

What's a really cheap or free hosting

#

I use humbleservers for minecraft servers

#

and 3.5eur mo 2gb ram one from ovh for proxy, fallback and databases

#

I use 2gb one with openj9, so it uses much less memory

#

You're from europe too?

#

yu0

#

yup

#

Me too

#

Ayy

#

one weird thing, there's regular database connection issues between ovh and humbleservers

#

I haven't contacted support about it yet

#

but I'll do soon

#

Why do I need that?

#

just told that so if you're choosing em and get same problem, I won't have false adviced

#

Why do you need a database?

#

it's cool

#

moving data between servers, displaying it in any server

#

making leaderboards out of stuff

#

I don't need that

#

oh

#

Between bungeecord?

#

okok

#

So Do I get a bungeecord proxy and a few more servers if I buy a more expensive package or?

#

up to you

#

but it can turn out to be cheaper to buy many little servers from varying providers than one big

#

homehosting may also just work, you have to take decision carefully

bright forge
frigid ember
#

What's the best server hosting?

#

there's no best, it's really competitive

#

The most known that have great hosting

#

lag free or something

#

are you using viaversion? @bright forge

bright forge
#

i need to get protocol number from the server version

#

not player version

frigid ember
#

oh

bright forge
#

or its not specified on spigot?

naive goblet
#

Idk mb nms

bright forge
#

well thats an easy answer, i had been searching the source code over and over and i still have no clue :/

naive goblet
#

Can you explain more by multi compatibility. Maybe the protocol ver isn’t necessary

bright forge
#

i have to make some kind of comparison to know something like...

if (version > 1.12) {
return a;
} else {
return b;
}

wind dock
#

hi - do minecraft servers get my public or local ip address? and how do i change it?

naive goblet
#

Linsa a plugin?

bright forge
#

yeah

naive goblet
#

Just do some abstraction to support multi versions

#

With nms

bright forge
#

maybe i can just take the first and second value and use that as a integer so it would be...

if (version > 112)...

#

i use reflection

#

the thing is

naive goblet
bright forge
#

in 1.12 is .a() but in 1.13 is b()

#

so it wont work unless i manually check versions

naive goblet
#

Check the source I sent you

#

It might be what you’re looking for

bright forge
#

its not sorry

#

the nms source changed what method is used

#

so its impossible to achieve compatibility unless you manually check versions

frigid ember
#

@wind dock they get your IP address yup

wind dock
#

which 1?

frigid ember
#

anything you connect to gets it

naive goblet
#

Achieving your plugin having compatibility by nms version is very possible

frigid ember
#

public, what else

wind dock
#

which ip address

bright forge
#

dude you dont understand

wind dock
#

public or local

bright forge
#

god

naive goblet
#

Idk why you need protocol versions

bright forge
#

to use > and <

frigid ember
wind dock
#

But if i do /whois GeometryPro in my server, it shows my local ip address

bright forge
#

just in 1.13 a method name changed so i cant use it in 1.13 unless i manually check

frigid ember
#

@wind dock because it's your server

bright forge
#

all the other nms stuff works perfectly

#

just a name of a method changed

wind dock
#

?

frigid ember
#

packetevents handles for yu

#

if it's on your computer, it won't show public

wind dock
#

oh

frigid ember
#

multi version support packet listening

wind dock
#

How do I change my public ip?

frigid ember
#

wrapper classes

bright forge
#

so i wanted to know if there was a way to get protocol and use >< for comparison

naive goblet
#

If it’s 1.13+ just get the Bukkit version and compare?

bright forge
#

no dude

#

check this

frigid ember
#

contacting your internet provider / using VPN / some routers have ip changing capability by restarting them@wind dock

wind dock
#

will doing that thing in cmd work?

#

ipconfig /release

bright forge
#

if (version> 112) {
id = (int) packetDataClass.getDeclaredMethod("g").invoke(packetDataSerializer);
} else {
id = (int) packetDataClass.getDeclaredMethod("e").invoke(packetDataSerializer);
}

wind dock
#

ipconfig /renew?

subtle blade
#

The protocol version does not dictate the remapping of methods

frigid ember
#

i don't know, try?

#

packetevents has a util enum

#

to check versions

subtle blade
#

You should not make decisions based on an ever-changing value

frigid ember
#

copy that

bright forge
#

what should i do then

frigid ember
#

serverversion

wind dock
#

@frigid ember in my essentials userdata folder, it also shows my ip address as my local ip, not public

frigid ember
#

it doesn't make a difference

#

it's your server

#

im telling u linsa uh bye

#

so it won't get Publix one

wind dock
#

oh

bright forge
#

@frigid ember absolutelly nothing to do with my issue thanks anyways

frigid ember
#

k

subtle blade
#

If there is API you require not already present in Bukkit, create a pull request

#

If it's something such as packet listening, use ProtocolLib

bright forge
#

im replacing protocollib

subtle blade
#

lol

#

okay

naive goblet
#

Wth

subtle blade
#

You're not going to succeed in replacing PL

bright forge
#

Im trying to try to add a util to manually decode packets

#

its not my idea

subtle blade
#

It's practically standard

bright forge
#

i just want to make a antiexploit

#

and protocollib doesn't help

subtle blade
#

The best anti exploit is 1.15.2

frigid ember
#

k

subtle blade
#

Keep your software up to date

bright forge
#

yeah and the best performance killer

frigid ember
#

oof hehe

bright forge
#

you cant even run the official spigot server with 0 players at 10 tps

naive goblet
#

Lol pretty sure you can

bright forge
#

(not trying to be rude)

subtle blade
#

Maybe if you're doing something stupid, though I run all my test plugins just fine without any issues

frigid ember
#

bad pc then

bright forge
#

no i mean

#

the spigot server is at 10tps

#

you can join now and do /tps

frigid ember
#

doubt

#

bad pc then

subtle blade
#

I believe you though the best way to diagnose that is to use the in-built timings

bright forge
#

official server from spigotmc

frigid ember
#

you said 0 players 10tps

naive goblet
#

That’s weird because my server has 19.5-20 tps all the time

bright forge
#

im speaking about

subtle blade
#

There is a cause for performance issues of which can be remedied

frigid ember
#

if you type /tps it's 1 player

subtle blade
#

Though I can assure you that running outdated software and writing an "anti exploit" is far from beneficial in any way whatsoever

bright forge
#

im not talking about a server i own

subtle blade
#

If you mean #spigotcraft, it's a test server running on a bleeding-edge snapshot version

bright forge
#

btw theres a bunch of exploits that still work on 1.15, just no one tries to use them there because they are the least played versions

subtle blade
#

LMAO

frigid ember
#

choco ik best anticheats but they are for 1.8

subtle blade
#

alright

bright forge
#

shulkers are a big issue

#

im patching that too

frigid ember
#

1.7-1.8 outdated versions

subtle blade
#

If you think that, it's really not my problem, Linsa. You're on your own

#

I advise heavily against what you're doing

#

but hey, power to you

bright forge
#

i've never asked for help for that

#

i already asked for help trying to get 1.15 without lag but i never got a clear answer

#

so i had to switch back to 1.8

frigid ember
#

use paperspigot 1.8.8

bright forge
#

^

#

its a mess

frigid ember
#

haha yeah

bright forge
#

The exploit opportunities of that thing are infinite

frigid ember
#

nope

#

pistons are pretty insane too

#

oof

bright forge
#

Oh i was speaking about the fact that you can create items that weight +300k bytes

frigid ember
#

oo

bright forge
#

they used them to crash 2b2t

frigid ember
#

k

#

disable them then

#

dont have them in your world

bright forge
#

Yeah and just frick with all players inventories

#

Stonks

frigid ember
#

or use 1.8.8 paperspigot

bright forge
#

@frigid ember Im trying to develop a public plugin, im not having issues.

frigid ember
#

@subtle blade why was PlayerLoginEvent renamed in some versions

bright forge
#

I was just asking for help to get a way to compare versions with ><

frigid ember
#

what were yall thinking

#

or removed

#

idek

#

why bruh

#

hytale is almost out guys and theyll focus more on combat, just a bit more longer to wait

#

it will be actually good

#

just idk why java tho, they should just do c#

#

for modding

bright forge
#

Anyways i love discussing about new versions changes, and i will always defend the fact that since 1.13 the thing is not stable if you want to run +20 players, even if you disable village/stronghold/etc generation and make a only plains biome world it will lag like hell because of all the new mechanics that keep entities and chunks alive.

#

Since 1.9 they started adding stuff that keep chunks loaded and entities loaded too which made it impossible to host a survival server after months of world use.

frigid ember
#

yeah

#

linsa can u add me

#

and vegdedes

bright forge
#

I don't add people sorry

frigid ember
#

;-;

#

u do me like this

bright forge
#

Anyways thx for the help ill probably do a thing that converts the server version to a int and compare it

frigid ember
#

no wait

#

i made shh for comparing versions

#

u didnt listwn

bright forge
#

something like

1_7_10 -> 17

1_15 -> 115

#

haha, its for programming a plugin not for linux system thing

#

oh

#

lets see

#

nice but what about 1.16 release? i have to update manually

#

i dont wish that

#

i want it to work automatically

#

nice implementation tho :)

frigid ember
#

check if its 1.7

#

wait

#

u can do if version.isHigherThan(blabla

bright forge
#

but what if 1.16 releases?

frigid ember
#

all unmust add is v_1_16 not muxh work anyway

#

one more enum xd

bright forge
#

i just dont want to make updates manually

frigid ember
#

for protocolversion u must do same

bright forge
#

because i will get reviews of it not working

frigid ember
#

bruh

bright forge
#

or people have to wait me

frigid ember
#

u can be fast

#

does every api release fast

#

nop

#

for now announce it supports 1.7.10-1.15.2

bright forge
#

people that hates me uses that as an excuse to give negative reviews even if i update fast

frigid ember
#

or whatever versions it does

bright forge
#

i just want to relief myself

frigid ember
#

no

bright forge
#

thanks anyways

frigid ember
#

there is no automatic way

bright forge
#

yes there is lol

frigid ember
#

for protocolversion u must do same
@frigid ember

#

still manual

bright forge
#

1_16_1 -> split -> get 0 and 1 from the array of strings -> convert to integer -> 116

frigid ember
#

why are u asking

#

if yk lmao

bright forge
#

because i just came with that idea

#

after asking

frigid ember
#

idk what you doin is weird

#

but ok

bright forge
#

it works fire rushes into my house

frigid ember
#

u are sayi ng ull get bad reviews

bright forge
#

atleast it will work for the next years

frigid ember
#

cos u update slow or what

bright forge
#

my plugin has like 60k downloads

frigid ember
#

ull need to add spigot 1.16

#

manually

bright forge
#

no haha

#

its done automatically by getting server version

frigid ember
#

protocollib doesnt even support 1.7.10

bright forge
#

server.getVersion()

#

its not the same

#

thats because 1.7.10 doesn't have netty in the server files

frigid ember
#

oh yes

#

just diff import area

bright forge
#

what a mess

frigid ember
#

i made a new injector for 1.7

bright forge
#

i hope someone forks 1.7.10 and fixes that thing

frigid ember
#

to supportnit

bright forge
#

nice

frigid ember
#

no

#

no one has time for that xd

bright forge
#

anyways have to go, thanks

frigid ember
#

bye

bright forge
#

its just refactoring bruh

#

ijust dont know how to compile

frigid ember
#

then u donit

#

bruh

silver pewter
#

Hello, how can I get two corners from worldEdit api when pasted a schematic thanks

frigid ember
#

Can I develop plugins on the latest version of JDK?

#

if by that you mean java 14

#

yes

tiny dagger
#

yes you can develop

#

but you're gonna be you and a few others who actually have jdk installed

frigid ember
#

I thought you need to have JDK in order to develop plugins

soft tusk
#

Please help, I have hicoria hosting.
I have BungeeCord server and...
Spigot servers.
I need startup script on BedWars and UHCRun. After game server is will stop.
Need wait to 0:00. Hicoria in this time restart the server. I need after game startup script.
Uhcrun version: Spigot 1.8.
Bedwars version: spigot 1.10

Sorry for my English, I'm from czechia.

Please help.

upper shoal
#

@frigid ember yes but not everyone remotely uses 14 yet may be a while before that even happens

neat orbit
#

/summon Item ~ ~ ~ {PickupDelay:32767,Age:-32768,Item:{id:diamond_pickaxe,Count:1}} how do i make this command global?

soft tusk
#

Can you help me with startup script?

neat orbit
#

What do you mean?

#

Whats the problem?

soft tusk
#

I have hosting I Don not know how to create startup script

keen compass
ashen stirrup
#

What JDK is most used? 1.8?

upper shoal
#

Afaik ye

ashen stirrup
#

Why’s that ?

tiny dagger
#

the jre

upper shoal
#

Compatibility

frigid ember
#

yo can y'all help me

ashen stirrup
#

With that

frigid ember
#

basically i need someone to delete/remove some files in a plugin's source code

#

the developer added a unnecessarily feature i would like to bre removed

bronze marten
#

Just unzip, delete class, zip

#

Ez

frigid ember
#

does that work?

bronze marten
#

But use the hire section on spigot i guess

frigid ember
#

yeah i already found the classes

#

in the java decompiler

#

i just want 2 delete them

#

but i dont have eclipse installed

bronze marten
#

Mh no dont xd

frigid ember
#

?

bronze marten
#

Dont just straight delete them

upper shoal
#

Deleting a class will break other class calls

#

So ud need to delete all references to them

frigid ember
#

you sure? its just these classes

#

wait couldn't paste image

#

let me dm u

upper shoal
#

Unless its a factory class like v1_15_1 its usually called upon via another class i.e imports and methods

frigid ember
#

could you help me with it then?

upper shoal
#

Not at pc

frigid ember
#

oh

upper shoal
#

But seeing as its a fly command its called within the commandmanager class probably

#

So ull need to open and alter it anyway

frigid ember
#

yeah its messing up a lot of my plugins

upper shoal
#

Or mess with the plugin.yml as a main

#

And hope that solves it xd

grand aurora
#

Anyone know how I can change the item moved in an inventory on a shift click? I want to replace an item with another when someone takes it out of a chest but it doesn't work on shift clicks

#

Using event.setCurrentItem() doesn't work

grand aurora
#

I know I can detect when they shift click, my problem is that I don't know how to change the item stack that gets moved

bronze marten
#

An inefficient solution i can think of rn is like keep a map of what itemstack is where during the event, then a runnable a tick later or sth to check new stacks

#

But InventoryClickEvent#setCurrentItem doesnt work you say?

#

Seems odd, might be a bug?

frigid ember
#

wait yo @bronze marten

#

if you remove a command in the commands section from plugins.yml, does that command not work anymore in the plugin?

bronze marten
#

It would error in the plugin if they try to get the command

frigid ember
#

fly:
description: Allows you to fly!
aliases: [flight, togglefly, toggleflight]

bronze marten
#

If they dont check if it properly is in the plugin.yml

frigid ember
#

Would it be able to work with another plugin then?

#

Since this plugin's /fly command is conflicting with EssentialsX's /fly

#

so I want to disable this plugin's /fly command or something

bronze marten
#

You could use commands.yml to override /fly with essentials fly

#

Just rewrite /fly to /efly i think

#

Or /essentials:fly

frigid ember
#

could you show me an example config?

bronze marten
#

I think this should work

aliases:
    fly:
    - "essentials:fly $1-"
frigid ember
#

so this overrides this plugin's /fly with essentialsx /fly?

bronze marten
#

should be yeah

frigid ember
#

okay there's a option in the plugin's settings that disables /fly, but when I do /fly on essentials, it disables that one also, will this override it?

#

Or couldnt you replace the fly command in the commandMap with your own

bronze marten
#

This will not forward the command to that plugin anymore

#

Like it wont receive the command

#

It will always rewrite /fly -> /essentials:fly

frigid ember
#

oh okay

bronze marten
#

And the $1- is to forward any extra arguments properly

#

Like /fly <name>

frigid ember
#

gotchu

#

appreciate it man, everything works, disabled the fly command in the plugin, and /fly still works now

bronze marten
#

👍

wheat summit
#

Is there a way to make a void generator?

grand aurora
#

Set current stack works when the user normally clicks on it, but when they shift click there never is a current item

frigid ember
#

Does anyone here have knowledge within Redis / Java Redis I'm trying some things out but I'm having difficulty understanding some things.

#

Willing to pay ^

manic raptor
#

Hey guys, is there a way I can get the ID of a BukkitTask, in the implementing Runnable class in an async scenario? For example:

In main...

BukkitTask exampleAsyncTask;

@Override
public void onEnable() {
  this.exampleAsyncTask = Bukkit.getServer.getScheduler().runTaskAsynchronously(this, new ExampleAsyncTaskRunnable);
}

Runnable class:

public class ExampleAsyncTaskRunnable implements Runnable {

  @Override
  public void run() {
    // How can I get the taskID of the BukkitTask running this runnable?
  }

}
bronze marten
#

What do you need the taskid for?

manic raptor
#

It's a little complicated, but this is for a plugin that connects to a Google Cloud, not for SQL but for Pub/Sub functionality. I need the task ID as the Google Cloud code has its own async stuff that isn't shutting down properly, so I need the task ID in the runnable.

bronze marten
#

If you want to cancel the task from inside, i suggest using BukkitRunnable

#

It also has a #getTaskId method

manic raptor
#

Ah, fantastic! Exactly what I need. Thanks 🙂

#

@bronze marten I've read around that Runnable's are generally "preferred" over BukkitRunnables. Is there a particular reason as to why this might be? Is it simply because one implements and the other extends?

bronze marten
#

I dont see any reason to prefer one over another, it might be an unneccessary wrap if you dont need the methods provided

#

but for this case its perfect

manic raptor
#

Fair enough, thanks. 🙂

barren abyss
#

Yooh, who remember that slime split error that I was having

worn temple
#

vaguely

gusty coyote
#

Am i doing something wrong here? I want to see what enchants an item has but when i use Item.getEnchantments or Item.getItemMeta.getEnchants its either null or empty, but i know the item has an enchant and that im checking the correct item

worn temple
#

If its null/empty you aren't checking the right item some how.

Usually you have to do item.hasItemMeta() and then get the item meta and check that.

gusty coyote
#

figured it out, getEnchants doesnt work on enchanted books

worn temple
#

well... yeah. Would have been more helpful if you said the item then lol

frigid ember
#

Hey guys, is this the proper way to check if a string is an integer?

    int i;

    try {
        i = Integer.parseInt(args[0]);
    }
    catch(NumberFormatException e) {
        return;
    }
worn temple
#

It will work, wouldn't really say "proper" tho, you can just use regex to check if its a number.

dusty topaz
#

probably faster than regex

#

though I believe it's convention to name e as ignored

worn temple
#

"123456".matches("\\d+");

#

yeah, if you are ignoring the error, you name it ignored.

But regex in this case would be faster since its a simple check. And is much more readable than a try/catch block

dusty topaz
#

well, i'm assuming he needs to use the integer

#

so probably faster to just parse

worn temple
#

Well, you can still parse it over later, but in this case, its just in a block, and the result is being ignored

#

Anyway, regex is surprisingly fast. I had it run over player chat on huge servers to scan for IPs, links, etc.

velvet halo
#

You can also use NumberUtils.isNumber

dusty topaz
#

then you have to shade in commons (i think it's commons?)

worn temple
#

Yeah, that's commons

velvet halo
#

It is already part of spigot

#

is it not?

dusty topaz
#

it's an internal dependency

#

not supposed to use without shading

#

(it's also out of date)

worn temple
#

Its an internal dep, you have to either shade it in or include it as a dep for your project.

subtle blade
#

It's not. Commons 2.6 is included

#

Bukkit dependency

worn temple
#

ah

subtle blade
#

NumberUtils.toInt() will suffice

#

Can supply a default

worn temple
#

Yeah

dusty topaz
#

i thought you had to shade commons

#

and isn't commons up to like 3.2

subtle blade
#

Yes, which is depended on internally

#

You can shade a newer version if you'd like but if you're working with NumberUtils, it's unnecessary because 2.6 shares the same class and utilities

worn temple
dusty topaz
#

ahh so commons 3 is the internal

#

and commons 2.6 is the bukkit

#

i see

velvet halo
#

Guava is also shaded into bukkit

worn temple
#

eww

#

I mean, it is, but guava is eww

velvet halo
#

Why it is eww?

worn temple
#

Its not modular. So unless you are utilizing a shit ton of it, its just bloat.

#

Its also google, and google APIs and libraries are horrendous.

#

Bad documentation, says one thing, does the other, never consistent, etc

dusty topaz
#

bold statements

subtle blade
#

Guava's non-modularity does kind of blow when writing standalone applications

velvet halo
#

Isn't google search engine based around guava cache?

subtle blade
#

Its utilities are quite nice for plugin development however

worn temple
#

Bold statements backed up by so many years of working with their stuff

dusty topaz
#

Main thing I use is ImmutableMap lol

worn temple
#

Almost 4 years working with their oauth, calendar, and other related APIs and I can safely say google's apis and libraries are the worst things ever.

#

So much bloat too

velvet halo
#

I use it for cache but I am looking at ehcache then again could just use redis

worn temple
#

You don't need an immutable map from guava tho, google.common has one that's even lighter. and its a smaller overall dependency. Google loves to repeat their code

velvet halo
#

I use unmodifiable instead of immutable

dusty topaz
#

but i only really code spigot stuff, and bukkit kindly has guava

velvet halo
#

I am not a fan of bloated libraries also tbh.

worn temple
#

java.util has unmodifiableamp

#

So you don't even need a lib lol.

velvet halo
#

Yeah I use that

dusty topaz
#

I like the builder :p

#

and unmodifiable map I believe isn't a copy

#

so it's not reaaaally unmodifiable

worn temple
#

Also, with some clever writing, you can just make an immutable map without guava anyway.

#

Base java allows it

dusty topaz
#

nah the builder is what's nice

#

because I mainly use it for storing values for something

#

something like

#
  private final static ImmutableBiMap<Integer, ChatColor> COLOR_MAP = ImmutableBiMap.<Integer, ChatColor>builder()
      .put(0, ChatColor.BLACK)
      .put(1, ChatColor.DARK_BLUE)
      .put(2, ChatColor.DARK_GREEN)
      .put(3, ChatColor.DARK_AQUA)
      .put(4, ChatColor.DARK_RED)
      .put(5, ChatColor.DARK_PURPLE)
      .put(6, ChatColor.GOLD)
      .put(7, ChatColor.GRAY)
      .put(8, ChatColor.DARK_GRAY)
      .put(9, ChatColor.BLUE)
      .put(10, ChatColor.GREEN)
      .put(11, ChatColor.AQUA)
      .put(12, ChatColor.RED)
      .put(13, ChatColor.LIGHT_PURPLE)
      .put(14, ChatColor.YELLOW)
      .put(15, ChatColor.WHITE)
      .build();
worn temple
#

simplicity in the short run, bloat in the long run. That's what JS is for.

#

That's what ENUMs are for lol

#

literally what you just did there is a worse performing enum

#

legit

frigid ember
#

@subtle blade so would this be the best way of doing it?

    int i = NumberUtils.stringToInt(args[0], -1);
    
    if (i < 0) {
        msg(p, Lang.MUST_BE_NUMBER);
        return;
    }
dusty topaz
#

it's an example class for an api i made lol ¯_(ツ)_/¯

worn temple
#

Its such bad practice, and that will perform horribly compared to an enum

subtle blade
#

That's how I'd do it, Phaze, yea

velvet halo
#

Also @worn temple I had to make the spell cloneable when using it as a parameter for the enum as it wasn't creating a new instance in the map everytime. It was kinda weird (This is yesterdays issue btw)

subtle blade
#

Though there should be just a toInt() function, no?

subtle blade
#

Ah it's stringToInt() in 2.6

#

Then yea, that's fine

worn temple
#

@velvet halo ah

velvet halo
worn temple
#

neat

dusty topaz
#

are all those conditionals really faster than a #get?

worn temple
#

The switch conditionals? That's just for handling user inputs so no try/catch block is needed. But yes, it is faster then a #get on a map

subtle blade
#

I'd have just used an array lol

velvet halo
#

You could also iterate over the enum values and check for it?

dusty topaz
#

arrary makes the most sense yea

#

good idea lol

subtle blade
#

Access index at value - 1, boom. Check for outlier values

worn temple
#

Its year old code, so could be improved, but overall an enum is better than a map if your values aren't changing like that immutablemap example you showed me

dusty topaz
#

yeah definnitely

#

i wasn't thinking about it too much, i wrote it at 4am last night (morning?) as a quick example for an api i made as a proof of concept for a friend lol

worn temple
#

ImmutableMaps have their place and use, they are useful for sure, just the example you showed was bad.

dusty topaz
#

scratch that, was 5 am :p

worn temple
#

lol

#

I often do dumb things at that time

velvet halo
#

Weird because when I program at 5am my brain switches on

#

at midday it just poops itself

dusty topaz
#

i do best from like 1am-3am

worn temple
#

It depends heavily on when I woke up

velvet halo
#

I am going to put my spells plugin on git if anyone is interested. I am not amazing at programming but it should function

worn temple
#

FOSS is the way to go

velvet halo
worn temple
#

Pro Tip @velvet halo : add .idea/ and *.iml to your gitignore. those are system specific files and don't need/shouldn't be included on the github repo

#

Otherwise, looking good

velvet halo
#

alright!

#

Thanks for the tips

keen compass
#

just fyi, when you do add that to the .gitignore file

#

those directories and files will remain until you remove them from the repo

pastel condor
#

yeah

keen compass
#

best to remove them from the github page and then pull the changes into your local repo

#

but only after you add them to the .gitignore

#

otherwise you might find those things missing in your local repo if you do it before then XD

velvet halo
#

So it is safe to remove Spells.iml from my project?

keen compass
#

in the repo yes, not sure if your IDE uses it

#

if your IDE uses it, add it to .gitignore

#

this way you can keep it, but it never gets pushed to the public repo

#

But as already said your repo looks good aside from those few things

#

🙂

#

I will make one other suggestion and that is creating a README.md and license file that resides in the same place as pom.xml

#

README.md will get displayed on your repo page just below

#

and you can use markup stuff in there to make github display it nicely

velvet halo
#

Wish there was a default gitignore for intelliJ projects

keen compass
#

the license file github can read as well usually if its a common license and in the proper format and lets others know what they can do with the stuff in the repo

#

there is a website for generating that file

#

just add all the common stuff on that toolbar hit create and it will generate most of it for you

#

then its just a matter of adding anything that wasn't covered yourself

velvet halo
#

What license do you normally use?

hot fable
#

Is there any method to cancel the death of a player? For example, before dying, change the gamemode

keen compass
#

@velvet halo depends on the project, but I mostly use MIT

#

if I make something public, I really don't care what people do with it

velvet halo
#

Me neither I mainly want feedback

keen compass
#

its not like I have the resources anyways to go after people, so I just keep the mindset of just not caring. If I didn't want people to use it, I wouldn't have made it public 😛

velvet halo
#

Yeah same lol

keen compass
#

but I slap on a MIT license so those who do care about a license, there is one. and MIT is not very restrictive and pretty much states they can use it for whatever they want as long as the license remains intact 😉

#

also, this allow people who want to use it in a closed source project can as well. Unlike GPL not as easy to do so lol

frigid ember
#

Anyone know how to fix this in Eclipse?

#

The word 'int' is not correctly spelled

velvet halo
#

lol

#

I don't use eclipse sorry

keen compass
#

@frigid ember that isn't what it is telling you I don't think

#

but not sure why you are casting to an int

#

when you want a string anyways

frigid ember
#

Alright, I fixed it

nimble stump
#

@keen compass hes casting the double to an int so he doesn’t get the floating points, just the integer value

#

So it’ll say health is 5/20 not 5.3822/20

barren abyss
#

Hi, i have a problem when I get a project from github that my friend shared to me

#

maven isnt loading and that spigot icon isnt either, nothing seems to work, any idea? :c

#

yo... i'll pay for help

#

x))

nimble stump
#

The spigot icon?

#

What do you mean

barren abyss
#

Can I DM? so I dont fill this chat with my stuff?

#

Oh wait cant dm

#

locked dms ;-;

warped shuttle
#

dont try and dm people for support lol

#

this is what the channel is for

#

you probably haven't added the pom to your project

#

I assume the spigot icon you're talking about is the Intellij Ide plugin

#

which should just show up if you have a main folder

worn temple
#

They are cloning from GitHub over and over rather than using git properly from what I can tell.

warped shuttle
#

probably

#

you just need to right click on the pom.xml

#

and add it

worn temple
#

And sharing the .iml and .idea/ files on the gh as well.

frigid ember
#

Hey guys, is it ok if I put these comments on my enums so I know which ones have placeholders?

    /**
     * Title, %%args%%
     */
    TITLE("title-name", "&4[&fAWSMPLUGIN&4]:"), PLAYER_IS_COOL("player-is-cool", "&f%%args%% is cool."),
burnt pollen
#

Hey guys, is it possible to get negative reviews removed from your spigot resources & profile page? (One's that are purely going against you and not the plugin itself) I've got some guy posting random stuff on my profile page which is all false :/

frigid ember
#

You can delete it yourself on the profile page

worn temple
#

Report the review.

#

And you can delete whatever is on your profile page as phaze said

frigid ember
burnt pollen
#

He said he will just keep posting on my page if I delete it. Not sure if it's true but I imagine he will.

nimble stump
#

I mean if he keeps doing it then report him

burnt pollen
#

How?

worn temple
#

Just report their profile on spigot then. A staff member can help

nimble stump
#

You see the report button?

frigid ember
#

I think you can block them too

burnt pollen
#

I think he's ignored me so I can't go on his page? Says he don't exist yet he's posted on my profile.

worn temple
#

Yeah, you can just block then.

burnt pollen
#

Will that prevent them from going on my page?

worn temple
#

yes

burnt pollen
#

I only see the ignore button.

worn temple
#

@barren abyss @warped shuttle Yeah, they aren't using GH correctly at all.

The file structure is wrong: https://owo.oooooooooooooo.ooo/i/80bb.png

There is no pom included, its basically just source files with nothing saying that anything is actually a project.

warped shuttle
#

lol

#

at least theres not the intellij workspace files

worn temple
#

Yeah, somehow no .iml or .idea/ files included. I don't know how its possible to do it so right but so wrong

barren abyss
#

what should I include in order to use github to work together with the plugin with a coop

warped shuttle
#

learn maven

barren abyss
warped shuttle
#

or gradle

barren abyss
#

Yeah, I probably should

warped shuttle
#

absolutely should

worn temple
#

yeah, you're not using maven correctly in the slightest from what I saw

barren abyss
#

anyhow I fixed the error that I've been having but thanks anyways

warped shuttle
#

I delayed learning it and it was a huge mistake

worn temple
#

Also, learn proper project file structure conventions

#

Should be:

projectFolder:
  src:
    main:
      resources:
        plugin.yml
      java:
        you-package-name:
          PluginName.class*
          package:
            YourClass.class
            YourOtherClass.class
  pom.xml
  .gitignore
  README.md
  • main file, naming it main is just redundant at this point, and is less descriptive. Main.class is less descriptive than PluginName.class. Its just a bad practice introduced to newer devs unfortunately.
burnt pollen
#

Nova, sorry to be a bother. How does one block a user from going on my profile? Ignore simply makes me not see them afaik.

worn temple
#

The ignore button

#

You don't see them, and they can't post messages on your page

burnt pollen
#

I pressed ignore, and I sent my profile to my friend and he could still see all the messages.

#

It only hid them from me.

worn temple
#

Yes, you don't see them, and they can't post messages on your profile/DM you.

burnt pollen
#

So if I delete them, ignore him, they can no longer see my pfp basically your saying?

#

Sounds good.

frigid ember
#
        OfflinePlayer pl = Bukkit.getOfflinePlayer(uuid);
        
        StringBuilder st = new StringBuilder();
        
        st.append(pl.getPlayer().getDisplayName());

If I use getPlayer on an offline player, and that player is not online, will this cause an error?

radiant pollen
#

OfflinePlayer#getPlayer() returns null when the player is offline.

worn temple
#

Yes, also, you have to check OfflinePlayer#hasPlayedBefore() as OfflinePlayer will always return an object, but not always a real player.

barren abyss
#

Is there an easy way to make this? example:

The server <ServerIp> is using <MyPlugin>

(Im using linux shell stuff to take the ip and drag it in a variable)

keen compass
#

o.O

frigid ember
#

I made a plugin where it'll announce to the server that the TPS is below a certain number. This is not working, though.

dark shuttle
#

So i'm trying to create a minigame plugin, but i got stuck on arena management, i want it to duplicate/clone the arena when there is a new game session, whats the best way to do this? i tried to copy and load a world but it seems not really a good way to do this

chrome edge
#

After a lot of try, I've decided get player's latency by packets except KeepAlive is impossible now. I don't know maybe 1.16 and up will have this future but for now not.

frigid ember
#

Change random tick speed method?

obtuse rose
#

@chrome edge well, keepalive was made to ping client.
You can also try something like assign velocity and see how long it take for the client to move.
But whatever you do, keep in mind that there's always a workaround
I've made L4 ping spoofer before and that's exactly the same as legitimate internet lag lol xD

neat orbit
#

/summon Item ~ ~ ~ {PickupDelay:32767,Age:-32768,Item:{id:diamond_pickaxe,Count:1}} how do I make this command global? pls help

chrome edge
#

@obtuse rose You're right. I'd never say impossible word but as I see from my experiences, it cannot be accurate player's latency. So there's no way to get accurate.

#

As I remember there's a method that returns what you said in NMS Block until 1.13.2. Take a look in the class.

neat orbit
#

does anyoone know how i set the pickupdelay for everybody

chrome edge
#

Use setPickupDelay for item entity

#
        a.setPickupDelay();```
neat orbit
#

item entity

#

what is that?

chrome edge
#

Items are entity in world *not in inventory

neat orbit
#

alright

#

ill try wait

#

like do i do it in a command block?

frigid ember
#

Plugin AntiCapsize v1.0 generated an exception while executing task 11
java.lang.IllegalStateException: Asynchronous command dispatch!

#

Can you not run bukkit asynchronously?

chrome edge
#

You shouldn't use bukkit api in any of async thread.

frigid ember
#

Then how would I fix that?

chrome edge
#

make sync thread in async

frigid ember
#

how do I do that

chrome edge
#
           
            //Bukkit API code
            
        });```
frigid ember
#

I'm sort of new to this. I put that in, right - and now "plugin" is giving me an error.

chrome edge
#

Just put the sync in if tps statement and inside of the statement to in sync

frigid ember
#

this is what i did

chrome edge
#

plugin is your plugin instance

neat orbit
#

blackbone, sorry but i dont seem to understand. should i use a command block for the command?

obtuse rose
#

hmmm that code make no sense

bronze marten
#

Dont do that, just do it all in one sync delayed task lol

chrome edge
#

@bees Didn't you ask as a code?

#

I though you're asking for the code lol

bronze marten
#

Its not like that one message will lag your server out / getting the tps

chrome edge
#

I don't know the command block.

neat orbit
#

no a command

#

to set the pickupdelay for everybody

#

like a gamerule

obtuse rose
#

also, "Server is good" will be trigger when server lagging

#

also TPS is not 20.000000 all the time

chrome edge
#

sneak 100

obtuse rose
#

it's usually stay at 19.9X

neat orbit
#

so what should i do

chrome edge
#

@neat orbit Sorry, I don't know the command for pick up delay...

neat orbit
#

ok

#

this is the command /summon Item ~ ~ ~ {PickupDelay:32767,Age:-32768,Item:{id:diamond_pickaxe,Count:1}}

#

i just wanna make it global

chrome edge
#

I think you should use plugin for that.

#

Or make command block system that trigger whenever item is spawned

frigid ember
#
    public void runnable() {
        new BukkitRunnable(){
            @Override
            public void run() {
                if(TPSListener.getTPS() < 20) {
                    Bukkit.broadcastMessage(ChatColor.GREEN + "Server is good");
                    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "gamerule randomtickspeed 3");
                }
                else if(TPSListener.getTPS() < 15) {
                    Bukkit.broadcastMessage(ChatColor.YELLOW + "Server is lagging just a bit");
                    getServer().dispatchCommand(getServer().getConsoleSender(), "gamerule randomtickspeed 2");
                }
                else if(TPSListener.getTPS() < 12) {
                    Bukkit.broadcastMessage(ChatColor.RED + "Server is lagging a lot.");
                    getServer().dispatchCommand(getServer().getConsoleSender(), "gamerule randomtickspeed 1");
                }
                else if(TPSListener.getTPS() < 10) {
                    Bukkit.broadcastMessage(ChatColor.RED + "Server is almost unresponsive.");
                    getServer().dispatchCommand(getServer().getConsoleSender(), "gamerule randomtickspeed 0");
                }
            }
        }.runTaskTimer(this, 0, 20);
#

i added ".runTaskTimer(this, 0, 20);"

neat orbit
#

alright

obtuse rose
#

that will do nothing when TPS is 20 or over 🤔

#

you realize TPS does go up to 20.0X sometimes right

#

It's not super stable

frigid ember
#

what happens

chrome edge
#

if the tps is <12 you won't see those messages lol

bronze marten
#

Just swap your first comparison with >= 19.9

obtuse rose
#

^

frigid ember
#

wdym

bronze marten
#

< 20 -> >= 19.9

frigid ember
#

@bronze marten gotcha

obtuse rose
#

also you put if in wrong order

#

< 12 and < 10 will never get trigger

frigid ember
#

i copied and pasted lol

bronze marten
#

< 15 as well

chrome edge
#

@frigid ember try to debug your fields. If there's an error you can easily see with debug.

#

and try to use it in function not in thread

obtuse rose
#

@bronze marten oh you're right xD

bronze marten
#

Basically every value lower than 15 will go into the first block

frigid ember
#

Then how do I fix it?

bronze marten
#

Swap the order

#

if (tps < 10)
else if (tps < 12)
else if (tps < 15)

#

... etc

chrome edge
#

You're using reflections so it might be empty class or etc.

frigid ember
#

Why doesn't it work backwards?

chrome edge
#

I don't know your version

#

so try to debug the fields that you're using currently

frigid ember
#

or rather, the way I'm doing it

bronze marten
#

Well think about it, where does tps 14 go? And 12? 10?

#

Its smaller than 15 right?

#

So it will go into the < 15 block

obtuse rose
#

No offense, but you should learn Java before making plugin tbh

chrome edge
#

Do you need to use reflection? Will you use with multi versions? @frigid ember

frigid ember
#

@obtuse rose People who say "no offense" literally say offensive things for future reference haha

I'm coming from python and it's a little bit of a learning curve but it's not bad. I'm following two tutorials (TheSourceCode and thenewboston)

bronze marten
#

But in python its the same principle tho

#

You have ez shortcuts there

chrome edge
#
        IChatBaseComponent footerJSON = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', this.bottom) + "\"}");
        PacketPlayOutPlayerListHeaderFooter packet = new PacketPlayOutPlayerListHeaderFooter();
        try {
            Field headerField = packet.getClass().getDeclaredField("a");
            headerField.setAccessible(true);
            headerField.set(packet, headerJSON);
            headerField.setAccessible(!headerField.isAccessible());
            Field footerField = packet.getClass().getDeclaredField("b");
            footerField.setAccessible(true);
            footerField.set(packet, footerJSON);
            footerField.setAccessible(!footerField.isAccessible());
        } catch (Exception localException) {
        }
        ((CraftPlayer) this.player).getHandle().playerConnection.sendPacket(packet);``` @frigid ember
#

Try to use like that

frigid ember
#

I don't think so. What I'm doing now is the same thing I've done in python (obv without minecraft lol)

chrome edge
#

just try this code... if it works there's no problem with using it

frigid ember
#

Or maybe I'm just being a dope

bronze marten
#

But yeah try swapping the blocks haha

#

Java doesnt have sth nice for
if (<=)
else if (<=)
else if (<=)
Unfortunately 😔

obtuse rose
#

don't leave empty catch block!

chrome edge
#

I really hate hackers... I've to control their ping for the timing things and they can spoof it.

bronze marten
#

Mbe ehm, put code in online paste sites if its larger than 5 lines xd

#

Hard for mobile to read xd

chrome edge
#

@frigid ember Are you sure it's final code of yours?

frigid ember
#

I set it to 19.9 and it doesn't print anything anymore lol

chrome edge
#

Do you use notepad or something lol. There are tab miksates

#

don't ask me try it and if doesn't work tell me the error

bronze marten
#

Just use vim

obtuse rose
#

footerField.setAccessible(!footerField.isAccessible());

#

hmmm what the?

bronze marten
hoary parcel
#

Sounds like a you problem

chrome edge
#

@obtuse rose It's from my old library lol. It was work so I post here for just help

#

I hate reflection actually. I just want to loyal on one version at all.

frigid ember
chrome edge
#

@frigid ember I don't like to judge people but as I see you don't know Java at all...

frigid ember
#

This is how I have it set up now, but it just constantly runs the task. It is doing what I want, but I don't know how to set the delay on the messages unless one of the if statements happens.

chrome edge
#

You have only one try statement so use only one catch for the exceptions.

#

I though you're starter for packets and reflections...

#

This is not java help platform. So if you don't get any help, it's normal

bronze marten
#

@frigid ember you want a delay on the messages? Or what do you mean?

#

Because to me it seems rn that this runnable is run every 3 seconds, delaying messages wont help

chrome edge
#

@frigid ember So try with basic to understand the bukkit library.

#

Do not start with reflections lol

#

and try to learn java basics

frigid ember
#

You don't have to tell me how to do it, I'd rather just have a direction on where to start so I can try to learn how to use these tasks and schedulers.
I want the TPS check to occur every 3 seconds. The plugin is doing what I want.

However, the messages also do that and that's not what I want (even though I've made it so). Is there a way that to make it so it'll only send the message once unless it passes one of the thresholds I set (<10, <12, <15, and >=15)?

chrome edge
#

This is great starting for you but not start with reflections please. It may be dangerous for you for now.

#

Just use bukkit library for now to your safety

bronze marten
#

Ah, so you want it to only send a message when the TPS is in a different block?

frigid ember
#

Yes!

chrome edge
#

after learning some of the basics you may want to use

bronze marten
#

You could use a variable which holds the last tps

chrome edge
#

But I don't say stop your self. Go straight for you dreams. I'm saying it's noty good starting for you

bronze marten
#

And check in each if and else if if that variable is also not in the same tps category

#

To eliminate code duplication there, you could make a nice method which returns a boolean based on the current tps, the “comparison tps” and the last tps variable

chrome edge
frigid ember
#

Hm. Alright. I'll try that out. Thank you.

chrome edge
#

Never give up until you've done some process. You'll see what it feels.

#

good luck

frigid ember
#

Maybe I should finish some tutorials before trying that, because I don't know how to do that lol.

chrome edge
#

If you say it's easy use packets but not with java reflections

#

You're lacking java basic knowledge

#

You know some basics of course but not at all

frigid ember
#

@bronze marten is there a good document that would explain that?

bronze marten
#

Eh possibly, hard to find a tutorial for a specific case though, its mbe better to learn from the basics

frigid ember
#

Why is player.getTargetBlock(null, range); deprecated

#

is it removed in future versions

bronze marten
#

Use BlockIterator

frigid ember
#

Any good tutorials you recommend?

bronze marten
#

Maybe a udemy course? Idk

#

Or whatever course which just teaches basics

frigid ember
#

why frank

#

I want something that exists in 1.7.10 ->1.15.2

#

does getTargetBlock() exist in them

#

don't ask why

bronze marten
#

I use BlockIterator in 1.8-1.15.2

frigid ember
#

1.7.10?

bronze marten
#

Idk for 1.7.10, try it lol

#

Yep seems like it already exists in there

frigid ember
#

ok

#

how do i use it

#

i want to find the block the player is looking at with a range

bronze marten
#

Just pass the player & the max range? Lol

#

Then you can construct a for loop over that iterator, check if block is air, continue, else return that not air block

frigid ember
#

what direction will it go

#

the direction the player is looking?

bronze marten
#

Yes

frigid ember
#
BlockIterator it = new BlockIterator(player, 10);```
#

alright

#

ty

barren abyss
#

I have a question, can I move an entity without actually teleporting it?, like... this enderman thing, he don't teleport, he do something like a "dash"... idk if you can see my point

frigid ember
#

not with teleportation

#

@bronze marten question

#

Whats the diff between player.getNearbyEntities(range, range, range); and player.getWorld().getEntities() and looping

#

does getNearByEntity loop

#

or does it store in memory for each entity the nearby entities? (which I'm doubting)

#

to make it faster

radiant pollen
#

@barren abyss You can use velocities to move entities around.

#

That's what I use for my dash abilities.

barren abyss
#

hmmm

#

i'll try it, thanks for the tip

radiant pollen
#

@frigid ember AFAIK, they're the same thing

frigid ember
#

ok

#

what about world.getLivingEntities() and world.getEntities() loop and add the living ones in aloop.
Does the getLivingEntities() method have an arraylist specifically for the living entities making it faster or not.

radiant pollen
#

...

#

One gets all entities and one gets living entities.

bronze marten
#

Whats the diff between player.getNearbyEntities(range, range, range); and player.getWorld().getEntities() and looping
@frigid ember absolutely no difference, CraftEntity#getNearByEntities() does the same as looping over all entities in the world.

frigid ember
#

and second question

bronze marten
#

what q?

#

oh

#

no getLivingEntities also loops over all entities, just filtering out the non living ones

frigid ember
#

bruh

#

ok

radiant pollen
#

"bruh"

bronze marten
#

why bruh xd

frigid ember
#

lol

#

for what i want to do I am forced to use NMS

#

to find an entity with id

#

This would be too slow.

radiant pollen
#

lol what

bronze marten
#

uh

frigid ember
#

find an entity by id

#

Imagine you have hundreds of entities

bronze marten
#

Honestly looping over the entity list isnt that bad? just dont do it very often

frigid ember
#

And you are accessing entities by ids at a quite fast rate

#

I am dealing with packets here.

#

I am forced to use MinecraftServer.getServer().getWorlds().get(worldIndexAsExample).getEntity(ID);

#

i want to support 1.7->1.15.2 sad thing is getEntity method and getting worlds changes in the versions

#

1.8->1.8.8 named getEntity to a

radiant pollen
#

Can't you do Server.getEntity(id)

frigid ember
#

and made a variable list worlds

#

No

#

it takes a UUID

#

Packets provide an ID

bronze marten
#

Mh yeah, go for nms much faster

frigid ember
#

ik but its a lot :c

#

xd

#

im tryna use reflection for it to support multiple versions but it gets so confusing

bronze marten
#

they have a HashMap which stores the entities in a <UUID, Entity> fashion

frigid ember
#

ik

#

xd minecraft server class, method for getting instance, then get worlds in some versions its a list field some its a hashmap

#

then getEntity method which is named a in 1.8 versions

#

🤦

#

doing that all in reflection breaks my brain

#

So I will rewrite it for each version

#

So I keep my brain cells

bronze marten
#

¯_(ツ)_/¯

radiant pollen
#

@frigid ember Where do you send the packet? or am I missing something?

bronze marten
#

Up to you lol, go through the hell of supporting a decade old version or stick to the new ones

radiant pollen
#

It doesn't look like you're sending the packet.

#

Dude, Retrooper stfu

#

Retrooper is saying you shouldn't get the Fields within the timer because they're going to be the same every time you run it.

#

Also, you're never sending the packet to any players.

#

I've said it

#

like 3 times now

#

I told you what you need to do.

bronze marten
#

just calm

radiant pollen
#

Because you explained it and then less than 3 seconds later you ping him and say |
"hello???
???"

#

Just chill.

#

oh

#

my

#

god

#
    
    private boolean titlemanager;
    
    @Override
    public void onEnable(){
        saveDefaultConfig();
        new FlyCommand (this);
        PacketPlayOutPlayerListHeaderFooter packet = new PacketPlayOutPlayerListHeaderFooter();
                    Field a = packet.getClass().getDeclaredField("a");
                    a.setAccessible(true);
                    Field b = packet.getClass().getDeclaredField("b");

        new BukkitRunnable() {

            @Override
            public void run() {
                try {
                    a.setAccessible(true);
                    
                    Object header1 = new ChatComponentText("§b§ltixtiggy");
                    Object header2 = new ChatComponentText("§b§ltixtiggy");
                    
                    Object footer = new ChatComponentText("§atixtkittűű");
                    if (titlemanager) {
                        a.set(packet, header2);
                        titlemanager = false;
                        
                    } else {
                        a.set(packet, header1);
                        titlemanager = true;
                    }
                    b.set(packet, footer);

                    for(Player p : Bukkit.getOnlinePlayers()) {
                        // Send packet
}
                } catch (NoSuchFieldException | IllegalAccessException e) {
                    e.printStackTrace();
                }
            }
        }.runTaskTimer(this, 0, 20);
    }

}```
#

oh well the set accessible should be out of the task as well but

#

there ya go

#

You're never SENDING THE PACKET

#

You'll need to catch it and remove the other catch

undone narwhal
#
((CraftPlayer) player).getHandle().playerConnection.networkManager.getVersion();
knotty karma
#

Is there a more efficient way to set an entire X-Z coordinate to a certain biome than this:

for (int Y = world.getMaxHeight()-1; Y > 0; Y--) biome.setBiome(X, Y, Z, biome);```
#

Just profiled my plugin and that code takes up a fat 7 milliseconds

undone narwhal
#

@frigid ember Do you use a plugin like ProtocolSupport or ViaVersion etc?

#

Paper Spigot offers the method. If you don't use paper just check how they do it
Player#getProtocolVersion

#

Is it how Paper works to do it?

#

Yep so just check how paper do to fetch the protocol version of the player

fleet crane
#

?kick @frigid ember

worldly heathBOT
#

👢 Kicked purplex#8384

radiant pollen
#

Can y'all not...

#

There we go

frigid ember
#

pls dont

#

sorry

fleet crane
#

If you aren't using viaversion etc you can only have one protocol version and it doesn't matter; if you are then you should use them

#

This is an

#

?xy

worldly heathBOT
frigid ember
#

im checking player's protocol version, yes im using viaversion xd

radiant pollen
#

Then just depend on it

frigid ember
#

just i dont want to force users to use viaversion just so i can check it

#

maybe they have sth custom

#

alright ill depend on it

fleet crane
#

But if they don't have viaversion then why does protocol matter

frigid ember
#

nvm ima just depend on it

undone narwhal
#

Just do a check if ViaVersion is installed on the server (check if the plugin is present as softdepend) and if yes, use the Viaversion API

frigid ember
#

btw what was ikicked for

#

for the paper thing i said?

#

just im ngl lmao

#

ok fine spigot is best.

undone narwhal
#

Everything depend on what you need and what you want your server behaviour to react

#

Paper is just Spigot edited (like Spigot edited Bukkit for instance)

#

So paper is spigot

frigid ember
#

so i should edit paper so i can improve nothing to the other 3?

undone narwhal
#

But with more features
@frigid ember Yes some more features (which are not essentials)

frigid ember
#

as it has more features and they are useful too

undone narwhal
#

so i should edit paper so i can improve nothing to the other 3?
@frigid ember Yep

frigid ember
#

what does it make it?

#

worse then?

#

xd

undone narwhal
#

It's not worse

frigid ember
#

ok

#

its not better either

#

so its exactly as good as this spigot

undone narwhal
#

There are pros and cons

frigid ember
#

name a con

undone narwhal
#

pros come with cons

#

Disable some Minecraft native behaviour

frigid ember
#

ok

undone narwhal
#

But it comes with faster performance (You need to sacrifice to improve)

frigid ember
#

what native behaviour is disabled?

#

i honestly dont know

bronze marten
#

just look through the patches

undone narwhal
#

Many behaviour, you could probably learn more by reading their page

frigid ember
#

ok

#

you dont know also?

bronze marten
#

I guess if you come from vanilla you may notice the difference in behaviour, but I doubt the regular player will notice it lol

frigid ember
#

they made stuff easier

#

these are good patches on spigot

#

added getTPS method

#

vers command

#

handshake event!

#

added

#

like cmon

undone narwhal
#

This is something you can make with a plugin

frigid ember
#

i don't see these as a sacrifice

#

yes but its easier if its already in your api you are using

undone narwhal
#

Sacrifice is where they improve the performance

frigid ember
#

imagine for each plugin you had to readd it

undone narwhal
#

getTps doesn't iprove performance

frigid ember
#

its not only performance, also extra good api

#

api patches

#

you really like hanging on to things .-.

#

pebblehost, paper

inland oxide
#

mojang ree

native shore
#

i see it's a nice help channel 😄

kind crow
#

Looking for a plugin that deal damage to players on nether roof. Are there any plugins that can do that?

frigid ember
#

if(y >= bedrockHeight) {
p.damage(10000);
}

kind crow
#

@frigid ember on which event?

frigid ember
#

uhhhhh

light geyser
#

Id say put it in a BukkitRunnable not an event

frigid ember
#

PlayerMoveEvent

light geyser
#

oh right forgot about that one

#

Dont forget to check dimension ^^

frigid ember
#

check if e.getFrom().getY() >= bedrockHeight

#

or p.getlocation().gety()

#

once they move, if their prev position y >= bedrockHeight

#

they will get damaged

#

or you can make a tick async runnable with bukkit scheduler

radiant pollen
#

^

#

Use a runnable

undone narwhal
#

p.damage works async ?

frigid ember
#

force that sync

inland oxide
#

it's possible to get to nether top without teleport?

kind crow
#

Does it have any big performance impact on the server?

light geyser
#

yeah it is klug

frigid ember
#

force that to runTask scheduler

#

so its sync

inland oxide
#

when you exit a minecart or teleport are those events hookable?

kind crow
#

So should I do it sync or async? Async seems to be more resource friendly, doesn't it?

frigid ember
#

id do async

#

loop thru all players

undone narwhal
#

Async will not slow a tick, but I'm not sure you can damage a player async

frigid ember
#

same

inland oxide
#

I mean, it's basically exiting minecart, or enderpearl, or teleport to get to y>128 in nether, so if those can be hooked in any way, better than running a conditional every move

bronze marten
#

you can't

frigid ember
#

so id use a playermoveevent

jagged fulcrum
#

Custom event

frigid ember
#

bruh

#

its not some api

#

is it

kind crow
#

Which is better bukkit scheduler or player move event?

jagged fulcrum
#

Depends

frigid ember
#

player move event, it will only damage once they move

#

so if they afk on it, it wont damage

#

if ur gonna risk for better performance do that

#

i guess

kind crow
#

Better for performance and it should deal damage in 100% cases

inland oxide
#

wonder if you can set a per world max height'

frigid ember
#

rather than a runnable every tick

jagged fulcrum
#

Retrooper, the first message wasn't meant for you...

frigid ember
#

?

inland oxide
#

meaning, generate the nether with a max height of 128

jagged fulcrum
#

Oh wait, sorry it wasn't you who reacted to it xD

undone narwhal
#

World nether = // GET NETHER
nether.getPlayers().forEach(player -> {
if (player.getLocation().getBlockY() < height°
player.damage

kind crow
#

Ok, thanks guys. I think that's what I needed

inland oxide
#

suppose depends if you want to suffocate, instantly kill or discourage with damage

frigid ember
#

why lambda

#

u are sacrificing for worse performance xd

#

lmao

#

yea use tick scheduler

#

then

inland oxide
#

would be more interesting to let them get up to the nether top, but then make their movement so slow, they can't do anything

frigid ember
#

its better to have it time based than based off of their movements

native shore
#

talks about using playermoveevent which has shitty performance because it fires every time a player moves and checks if players y >= netherHeight
complains about performance because this guy wants to use lambda

#

nice

frigid ember
#

ya dont get jokes dont you

#

how do you convert a nms ItemStack to a CraftItemStack

#

I cant cast it

native shore
#

ya dont get jokes dont you
it was really funny

frigid ember
#

#nohomor

native shore
#

yes

#

because that's the wrong place for making jokes

undone narwhal
#

Why do you need a CraftItemStack ?

frigid ember
#

I just figured out

#
CraftItemStack.asBukkitCopy(nmsItemStack)```
undone narwhal
#

This is ItemStack not CraftItemStack

torn robin
#

that's the opposite isnt it

undone narwhal
#

You wanted nmsItemStack to ItemStack

frigid ember
#

craftitemstack can be casted to bukkit itemstack

whole sigil
#

hey guys I was wondering to update to the last build of a plugin do i just need to replace the .jar file in my plugin folder ?

torn robin
#

yes verilou

undone narwhal
#

Yep, but some plugins will need to update the config files too, check it on the page

torn robin
#

you might want to delete the config if it tells you to or if the plugin doesnt seem to work

undone narwhal
#

@frigid ember

whole sigil
#

Ok thx 😄 and do you know how to keep trace of all the new build of evry plugins ?

inland oxide
#

this whole fiasco with dimension identifiers and NBT in login and respawn packets is a PITA.

torn robin
#

I'd recommend using an autoplugin updater... plugin

frigid ember
#

ok

torn robin
#

but probably with higher reviews

#

and more updated

frigid ember
#

who cares, in the end i wanted a bukkit itemstack anyway

jaunty night
#

When I start bungeecord, completely clean install, no plugins I get this error.

09:29:42 [SEVERE] java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to java.util.Collection
09:29:42 [SEVERE]     at net.md_5.bungee.conf.YamlConfig.getListeners(YamlConfig.java:234)
09:29:42 [SEVERE]     at net.md_5.bungee.conf.Configuration.load(Configuration.java:85)
09:29:42 [SEVERE]     at net.md_5.bungee.BungeeCord.start(BungeeCord.java:273)
09:29:42 [SEVERE]     at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62)
09:29:42 [SEVERE]     at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)