#development

1 messages ยท Page 30 of 1

icy shadow
#

yeah but why would you

dark garnet
#

anyone? sadge

dusky harness
#

thats what i mean

#

but other IDEs dont

dusty frost
#

what other IDEs dont

dark garnet
dusky harness
#

have community versions

pulsar ferry
river solstice
#

Other JB ides

dusty frost
#

oh, other JetBrains ones?

dusky harness
#

yeah

icy shadow
#

and if all your employees are used to using the product then you as a business are heavily compelled to buy licenses

#

also

dusty frost
#

that's because IJ was their first and their best one

icy shadow
#

shoo

dusky harness
#

oh wow

#

so many staff members

dusty frost
#

and that's how they got their insane market share lol

river solstice
#

๐Ÿฅด

pulsar ferry
#

Did you add api-version to the plugin.yml?

icy shadow
#

code is written in 1.11

dark garnet
dusky harness
icy shadow
#

u shouldn't actually need xmaterial for this

dusky harness
#

remove api-version if you're using 1.12 or below api

pulsar ferry
#

What

river solstice
dark garnet
icy shadow
#

spigot specifically has hacky bytecode manip to keep forwards compatibility with materials

pulsar ferry
#

XMaterial requires it to be 1.13 in the plugin.yml

icy shadow
#

remove api and remove xmaterial

#

u dont need either

dusky harness
#

and bm

pulsar ferry
#

Yall give really bad advice

dark garnet
dusky harness
#

yep

pulsar ferry
dusky harness
#

we're saying to not use xmaterial at all

icy shadow
#

the point is that he shouldnt need xmaterial in the first place

dusky harness
#

unless u need it but a lot of the times you don't

river solstice
icy shadow
#
world.spawnFallingBlock(location, new MaterialData(block.getType())

no XMaterial needed

signal grove
#

is there a way to convert my 1.15 plugin into 1.19 easily? like can i just change the spigot maven version in the pom?

#

(all the code will work on both versions)

dusky harness
#

wait i just realized

icy shadow
#

yes but also spigot is forward compatible

#

it should just work

dusky harness
#

why are you turning material -> xmaterial -> material

#

๐Ÿฅฒ

dark garnet
dusky harness
#

error?

dark garnet
#

none

dusky harness
#

debug time

#

:)

dark garnet
icy shadow
#

...

dusky harness
#

oh

icy shadow
#

yeah i wonder why then lmao

dusky harness
#

._.

dark garnet
#

wait

#

WAIT

dusky harness
#

falling air block

dark garnet
#

๐Ÿ˜ญ

icy shadow
#

tfw

dusky harness
#

๐Ÿคฉ

river solstice
icy shadow
signal grove
#

nah it's fine its a small plugin

#

thanks

dusky harness
#

from 1.15 -> 1.19

#

afaik

icy shadow
dark garnet
#

im so happy im a happy little developer so happy happy happy me so happy woohoo i love code yay yipee

river solstice
#

๐Ÿค“

signal grove
#

fraud

dusky harness
#

was the sound update on 1.13

icy shadow
#

yes

#

all enums got changed in 1.13

dusky harness
#

ok then 1.12 and below plugins won't work if it uses sounds

river solstice
#

Oh shit its 2 am, gtg zzzz

icy shadow
#

the so called "flattening"

dusky harness
#

besides that it'll all work if it doesn't use any internal stuff

dusky harness
#

what

#

spigot doesn't add backwards compat to sounds tho

pulsar ferry
#

Can't wait for the new change to break all the enums

dark garnet
#

o while im here, does Block#getLocation() get the corner location of the block or the center of it?

dusky harness
#

what about sounds

icy shadow
dusky harness
#

i thought it was only materials

#

no

icy shadow
#

probably says in docs

dusky harness
#

i remember adding special compat to sounds in bedwars though

icy shadow
#

it does not say in docs

dark garnet
dark garnet
#

omg

dusky harness
#

i remember running into an issue relating to that in bedwars

dark garnet
#

u guys need to have same brain ok?

#

wait

#

what does latter mena

dusky harness
#

second

signal grove
#

second

dark garnet
#

is it corner or center

icy shadow
#

just try it and see

#

idk

signal grove
#

latter ;)

#

jk idk

icy shadow
#

actually yeah it's prolly corner

dusky harness
#

aha

#

i was right

#

it is corner

#

i think

#

?

#

why doesn't spigot use github

dark garnet
#

i think i crashed my server trying to debug it

pulsar ferry
signal grove
#

spighub

icy shadow
#

no legacy sound support

dusky harness
#

it's the struggles i went through in Bedwars

#

๐Ÿ˜”

icy shadow
#

XSeries has sound support lol

dark garnet
#
// Get nearby blocks
final Set<Block> blocks = getNearbyBlocks(player.getLocation(), (int) options.getRadius());
// Remove non-whitelisted blocks
final Set<Material> whitelist = plugin.config.blockWhitelist;
Bukkit.broadcastMessage(whitelist.toString());
blocks.removeIf(block -> {
    Bukkit.broadcastMessage(block.getType().toString());
    return !whitelist.contains(block.getType());
});
Bukkit.broadcastMessage(blocks.stream().map(Block::getType).collect(Collectors.toSet()).toString());```i think there is more version incompatibility stuff: https://maxx-has.no-friends.xyz/java_W15aKgJet2.png *im standing next to a grass block*
#

plugin.config.blockWhitelist comes from a string list of materials in a yml file, converted to materials using Material#valueOf(String)

dark garnet
icy shadow
#

i would guess that blockWhitelist is using the LEGACY_ materials instead

#

how are you loading it?

dark garnet
#

blockBlacklist is the same as blockWhitelist, i just edited it in my previous msg so it made more sense

dusky harness
#

uhhh

#

blacklist and whitelist are different btw

dark garnet
icy shadow
#

just debug the whitelist rq

dark garnet
# dark garnet ```java // Get nearby blocks final Set<Block> blocks = getNearbyBlocks(player.ge...

this is the all the code, but since im only focusing on the whitelist part, i only included it:

        // Get nearby blocks
        final Set<Block> blocks = getNearbyBlocks(player.getLocation(), (int) options.getRadius());

        // Remove blacklisted blocks
        final Set<Material> blacklist = plugin.config.blockBlacklist;
        Bukkit.broadcastMessage(blacklist.toString());
        if (plugin.config.blockBlacklistTreatAsWhitelist) {
            // Whitelist
            if (blacklist.isEmpty()) return;
            blocks.removeIf(block -> {
                Bukkit.broadcastMessage(block.getType().toString());
                return !blacklist.contains(block.getType());
            });
            Bukkit.broadcastMessage(blocks.stream().map(Block::getType).collect(Collectors.toSet()).toString());
        } else if (!blacklist.isEmpty()) {
            // Blacklist
            blocks.removeIf(block -> blacklist.contains(block.getType()));
        }```
icy shadow
#

uh

#
   blocks.removeIf(block -> {
                return !blacklist.contains(block.getType());
            });

๐Ÿค”

#

anyway

#

what is the black/white list containing

dark garnet
dark garnet
# icy shadow what is the black/white list containing
# List of blocks that will/won't be affected by the forcefield (if player has blocks enabled)
block-blacklist:
  # https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
  list:
    - GRASS
    - TALL_GRASS
    - GRASS_BLOCK

  # Whether to treat the blacklist as a whitelist instead
  treat-as-whitelist: true```
icy shadow
#

no i mean

#

in the code

dark garnet
#

what

icy shadow
#

bro just print out the list

#

and tell me what it is

icy shadow
#

๐Ÿค”

dark garnet
pulsar ferry
#

@river solstice It always cracks me up to see you hate on Kotlin (without knowing it) and then having this on your github pepeLaugh

icy shadow
#

๐Ÿ˜Œ ๐Ÿ˜Œ ๐Ÿ˜Œ ๐Ÿ˜Œ ๐Ÿ˜Œ ๐Ÿ˜Œ

dusky harness
#

๐Ÿฅฒ

dense drift
dark garnet
hoary scarab
dusky harness
#

xmaterial seems fine

#

it's not like the bloat will affect your code

dark garnet
dusky harness
#

most likely not

lyric gyro
#

what

dark garnet
dusky harness
hoary scarab
#

You only really need it if your supporting versions under 1.13

dark garnet
dark garnet
dusky harness
#

you've been on this issue for 2 hours

#

unless u already printed

dark garnet
icy shadow
#

XM is for backwards compatibility, this is forwards compatibility

pulsar ferry
#

Btw why specifically 1.11? Don't think I ever seen anyone target that version, normally it's like 1.8, 1.12, 1.16, or latest

dark garnet
icy shadow
#

Yeah that is odd

#

I couldn't name a single thing added in 1.11

dark garnet
#

cause 1.11 is when they added something to do with chat i dont recall

#

i think it was title times

hoary scarab
#

1.11 was end cities I think.

dusky harness
#

isn't that 1.9

icy shadow
#

Yeah that was 1.9

hoary scarab
#

Ah. Then yeah no clue xD

pulsar ferry
#

It was the mansions, very forgettable

icy shadow
#

Ahh

dark garnet
icy shadow
#

Yeah very forgettable

dark garnet
#

1.11 added Player#sendTitle(String, String, int, int, int)
before it was just Player#sendTitle(String, String)

pulsar ferry
#

With adventure you can use titles all the way to 1.8

dark garnet
pulsar ferry
#

I'm sorry to hear that

dark garnet
hoary scarab
#

Can also use the title command

#

Back on your issue though like dkim said, we need you to output the block type and list.

dusky harness
#

๐Ÿฅฐ

pulsar ferry
#

Good, so there is a cure

dusky harness
#

where did the [] come from

#

is that another debug

pulsar ferry
#

List

hoary scarab
dark garnet
#
        // Get nearby blocks
        final Set<Block> blocks = getNearbyBlocks(player.getLocation(), (int) options.getRadius());

        // Remove blacklisted blocks
        final Set<Material> blacklist = plugin.config.blockBlacklist;
        if (plugin.config.blockBlacklistTreatAsWhitelist) {
            // Whitelist
            if (blacklist.isEmpty()) return;
            blocks.removeIf(block -> {
                Bukkit.broadcastMessage("block: " + block.getType().toString() + ", blacklist: " + blacklist);
                return !blacklist.contains(block.getType());
            });
            Bukkit.broadcastMessage(blocks.stream().map(Block::getType).collect(Collectors.toSet()).toString());
        } else if (!blacklist.isEmpty()) {
            // Blacklist
            blocks.removeIf(block -> blacklist.contains(block.getType()));
        }```
dusky harness
#

wait whats the issue lol

#

i dont remember

#

its been too long

dark garnet
pulsar ferry
#

Material is taking pre 1.13 name, blacklist is post 1.13

hoary scarab
#

Remove the ! from the return blacklist.contains(

dusky harness
dark garnet
#

still

dusky harness
dark garnet
pulsar ferry
#

You don't need the empty check, it'll be false if empty

dark garnet
#

the else is coming from if (plugin.config.blockBlacklistTreatAsWhitelist)

dusky harness
#

lol

dark garnet
#
        // Get nearby blocks
        final Set<Block> blocks = getNearbyBlocks(player.getLocation(), (int) options.getRadius());

        // Remove blacklisted blocks
        final Set<Material> blacklist = plugin.config.blockBlacklist;
        if (plugin.config.blockBlacklistTreatAsWhitelist) {
            // Whitelist
            if (blacklist.isEmpty()) return;
            blocks.removeIf(block -> {
                Bukkit.broadcastMessage("block: " + block.getType().toString() + ", blacklist: " + blacklist + ", REMOVE (doesn't contain): " + !blacklist.contains(block.getType()));
                return !blacklist.contains(block.getType());
            });
            Bukkit.broadcastMessage(blocks.stream().map(Block::getType).collect(Collectors.toSet()).toString());
        } else if (!blacklist.isEmpty()) {
            // Blacklist
            blocks.removeIf(block -> blacklist.contains(block.getType()));
        }```
dusky harness
#

lol

#

ok heres some dirty code incoming:

dark garnet
#

wait, should i try a block that actually changed material names between versions, like melon block?

dark garnet
dusky harness
#
        // Get nearby blocks
        final Set<Block> blocks = getNearbyBlocks(player.getLocation(), (int) options.getRadius());

        // Remove blacklisted blocks
        final Set<Material> blacklist = plugin.config.blockBlacklist;
        final Set<String> blacklistStr = blacklist.stream().map(Material::name).collect(Collectors.toSet());
        if (plugin.config.blockBlacklistTreatAsWhitelist) {
            // Whitelist
            if (blacklist.isEmpty()) return;
            blocks.removeIf(block -> {
                final String type = block.getType().name();
                Bukkit.broadcastMessage("block: " + type + ", blacklist: " + blacklistStr + ", REMOVE (doesn't contain): " + !blacklistStr.contains(type));
                return !blacklistStr.contains(type);
            });
            Bukkit.broadcastMessage(blocks.stream().map(Block::getType).collect(Collectors.toSet()).toString());
        } else if (!blacklist.isEmpty()) {
            // Blacklist
            blocks.removeIf(block -> blacklist.contains(block.getType()));
        }
#

try this

#

๐Ÿฅด

#

๐Ÿ’€

#

๐Ÿ’€

#

๐Ÿชฆ

#

๐Ÿซ 

lyric gyro
#

then use the appropriate material names for the version you're running

dusky harness
#

like the food

dark garnet
lyric gyro
#

it might be both

dark garnet
dusky harness
#

oh

#

its both

#

thats interesting

lyric gyro
#

no it's not both

#

melon_slice

dusky harness
#

you don't have api-version right

#

ohhh

dark garnet
dark garnet
dusky harness
#

it won't work for melon though i think

#

Yeah

#

sucks

#

ig xmaterial is the way to go

dark garnet
#

ugh xmaterial confuses me im going to cry

hoary scarab
#

If your server is 1.19 you need api-version in your plugin.yml

dusky harness
#

no you don't

dark garnet
dusky harness
#

the whole point is that if api-version is different (lower) than the server version, it'll apply compatibility

lyric gyro
#

mmh

dusky harness
#

mmh!

lyric gyro
#

do you use materials directly in code?

#

MAtierla.SOMETHING

#

but properly spelled

dusky harness
#

oh does it not work for like Material.valueOf

#

although ig that makes sense

dark garnet
lyric gyro
#

setting the api version might be a "solution" though something I wouldn't recommend doing

dark garnet
lyric gyro
#

do you use things like MaterialData or the various get/setData that use bytes and such?

#

yeah okay then no

dark garnet
#

@dusky harness so xmaterial it is?

dusky harness
#

yes

#

i approve

dark garnet
#

can i get a stamp pls

dusky harness
#

no I don't approve that much

dark garnet
#

well i dont approve of u using adventure

#

so approval revoked

#

wow that is seriously tierist

dusky harness
#

I'd never

dark garnet
#

u can get canceled for that

pulsar ferry
#

Save yourself the trouble, drop old versions PepeLa

dusky harness
#

1.19.3 ftw

lyric gyro
#

actually

#

@dark garnet can you try using Material.matchMaterial/getMaterial instead of valueOf?

dark garnet
dusky harness
lyric gyro
#

without setting api version

dusky harness
#

oh

#

wait what do those methods even do

lyric gyro
#

those methods do special handling for legacy plugins

dusky harness
#

you're right!

lyric gyro
#

valueOf simply cannot

dusky harness
#

although

#

by default it doesn't do legacy handling

#

you have to put in true

dark garnet
dusky harness
#

or else it'll default to false for whatever reason

lyric gyro
#

which method are you talking about exactly

dusky harness
#
    @Nullable
    public static Material getMaterial(@NotNull String name, boolean legacyName) {
        if (legacyName) {
            if (!name.startsWith(LEGACY_PREFIX)) {
                name = LEGACY_PREFIX + name;
            }

            Material match = BY_NAME.get(name);
            return Bukkit.getUnsafe().fromLegacy(match);
        }

        return BY_NAME.get(name);
    }
#

this

#

matchmaterial just calls getmaterial in the end

#

but it defaults to false

dark garnet
pulsar ferry
#

Oh shit I was checking bstats for version data and saw that paper is almost at 60% of servers now PauseChamp

pulsar ferry
#

Spigot at 25% KEKW

dark garnet
lyric gyro
#

okay try getMaterial then

dark garnet
lyric gyro
#

one of the two has special handling for legacy plugins

#

I am certain

dark garnet
#

matchMaterial just uppercases the name and replaces spaces with _ then does the same thing as getMaterial with the new name
getMaterial gets the Material from a Map<String, Material> which is just the material's name and the material itself

dusky harness
lyric gyro
#

I am sure it has some handling for legacy plugins

lyric gyro
#

does it say anything

dusky harness
#

but

#

by default, it doesn't do legacy support

dark garnet
dusky harness
lyric gyro
dark garnet
#

true

lyric gyro
dark garnet
#

but how would i use that method? it has another parameter

lyric gyro
#

you dont

shell moon
#

just wondering, what's the issue xd

lyric gyro
#

just replace valueof

#

with that

dark garnet
dusky harness
shell moon
#

for example? xd

lyric gyro
#

dkim bukkit does shit tons of class file transformations for legacy plugins

#

it might touch that shit

dusky harness
#

tru

#

true

#

i didn't think bukkit would go that far

lyric gyro
#

stop playing guessing games and just try it for fucks sake

dark garnet
dusky harness
#

๐Ÿ’€

#

getMaterial or matchMaterial

lyric gyro
#

oh my god

dusky harness
#

or both

shell moon
#

why is it needed? (forwards material compatibility)

dark garnet
pulsar ferry
#

Tbh probably easier to compile on 1.13 or something like that, will work fine on newer names and for old ones they just need to put old names

dusky harness
lyric gyro
#

I'm starting to lose it

#

I will say slurs

pulsar ferry
#

I've lost it a while ago

dark garnet
#
        // Get nearby blocks
        final Set<Block> blocks = getNearbyBlocks(player.getLocation(), (int) options.getRadius());

        // Remove blacklisted blocks
        final Set<Material> blacklist = plugin.config.blockBlacklist;
        if (plugin.config.blockBlacklistTreatAsWhitelist) {
            // Whitelist
            if (blacklist.isEmpty()) return;
            blocks.removeIf(block -> {
                Bukkit.broadcastMessage("block: " + Material.getMaterial(block.getType().name()) + ", blacklist: " + blacklist + ", REMOVE (doesn't contain): " + !blacklist.contains(block.getType()));
                return !blacklist.contains(Material.getMaterial(block.getType().name()));
            });
            Bukkit.broadcastMessage(blocks.stream().map(Block::getType).collect(Collectors.toSet()).toString());
        } else if (!blacklist.isEmpty()) {
            // Blacklist
            blocks.removeIf(block -> blacklist.contains(block.getType()));
        }```
lyric gyro
#

no oh my god

dark garnet
#

oh?

dusky harness
#

:woozy:

lyric gyro
#

ONLY replace valueOf with getMaterial
dont do that getMaterial( name()) stuff

#

when you get the list from the config

#

just there

dark garnet
#

ok ok

lyric gyro
#

and then contains(block. type)

#

aaaaaaaa

dusky harness
#

block. type

#

are you on mobile emily

lyric gyro
#

yes

dark garnet
dusky harness
#

jeeeez

#

wow

dark garnet
#

LOL

dusky harness
#

you're a fast typer

lyric gyro
#

code?

dark garnet
#
        // Get nearby blocks
        final Set<Block> blocks = getNearbyBlocks(player.getLocation(), (int) options.getRadius());

        // Remove blacklisted blocks
        final Set<Material> blacklist = plugin.config.blockBlacklist;
        if (plugin.config.blockBlacklistTreatAsWhitelist) {
            // Whitelist
            if (blacklist.isEmpty()) return;
            blocks.removeIf(block -> {
                Bukkit.broadcastMessage("block: " + block.getType().toString() + ", blacklist: " + blacklist + ", REMOVE (doesn't contain): " + !blacklist.contains(block.getType()));
                return !blacklist.contains(block.getType());
            });
            Bukkit.broadcastMessage(blocks.stream().map(Block::getType).collect(Collectors.toSet()).toString());
        } else if (!blacklist.isEmpty()) {
            // Blacklist
            blocks.removeIf(block -> blacklist.contains(block.getType()));
        }```
#
        config.blockBlacklist = configFile.getStringList("block-blacklist.list").stream()
                .map(Material::matchMaterial)
                .collect(Collectors.toSet());```
#
# List of blocks that will/won't be affected by the forcefield (if player has blocks enabled)
block-blacklist:
  # https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
  list:
    - GRASS
    - TALL_GRASS
    - GRASS_BLOCK
    - MELON

  # Whether to treat the blacklist as a whitelist instead
  treat-as-whitelist: true```
dusky harness
#

try using lambda

#

idk

#

oh wait

#

nvm

dark garnet
#

...

dusky harness
#

its the same in bytecode i assume

#

just syntax sugar?

lyric gyro
#

uh not exactly but they're equivalent

dark garnet
lyric gyro
#

melon_block tho, that's odd?

#

what version are you running now?

dark garnet
pulsar ferry
lyric gyro
#

same

#

glhf

dark garnet
#

no please

shell moon
#

api-version: 1.13

dark garnet
#

dont leave me

dark garnet
dusky harness
#

xmaterial

#

:)

shell moon
#

and?

#

1.11 wont complain if you have api-version in plugin.yml

#

i dont get the actual issue

#

all my plugins support 1.8+

dark garnet
#

dkim and bm both told me not to put api-version

shell moon
#

but never had a similar issue

dusky harness
shell moon
#

well, 1.8 - 1.12 doesnt mind if you have api-version

calm loom
#

what dis mean

#

at me.notdew.com.roboref.RoboRef.<init>(RoboRef.java:38) ~[?:?]at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]at java.lang.Class.newInstance(Class.java:584) ~[?:?]at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:94) ~[patched_1.16.5.jar:git-Paper-794]at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:153) ~[patched_1.16.5.jar:git-Paper-794]at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:414) ~[patched_1.16.5.jar:git-Paper-794]at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:322) ~[patched_1.16.5.jar:git-Paper-794]at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:393) ~[patched_1.16.5.jar:git-Paper-794]at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:269) ~[patched_1.16.5.jar:git-Paper-794]... 3 more

dark garnet
#

ur gonna need to send the entire stacktrace ๐Ÿ’€
mainly the top bit

dusky harness
#

ohhh boy its roboref again

shell moon
dark garnet
calm loom
#

[03:07:43 ERROR]: RoboRef is enabling!(B
at me.notdew.com.roboref.RoboRef.<init>(RoboRef.java:38) ~[?:?]at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]at java.lang.Class.newInstance(Class.java:584) ~[?:?]at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:94) ~[patched_1.16.5.jar:git-Paper-794]at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:153) ~[patched_1.16.5.jar:git-Paper-794]at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:414) ~[patched_1.16.5.jar:git-Paper-794]at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:322) ~[patched_1.16.5.jar:git-Paper-794]at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:393) ~[patched_1.16.5.jar:git-Paper-794]at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:269) ~[patched_1.16.5.jar:git-Paper-794]... 3 more
[03:07:43 INFO]: [RoboRef] Disabling RoboRef v${1}

#

this is all it has

shell moon
#

lol

dusky harness
#

?startuplog

neat pierBOT
#
FAQ Answer:

Startup Log Location
Your latest startup log can be found in the logs folder of your
server directory, labeled as latest.log.
Please copy the contents and paste them to a paste service.
Type ?paste for more information.

dusky harness
#

wait no

#

ignore that

#

@calm loom send main class

#

that's not the entire exception but oh well

calm loom
dusky harness
#

?startuplog

neat pierBOT
#
FAQ Answer:

Startup Log Location
Your latest startup log can be found in the logs folder of your
server directory, labeled as latest.log.
Please copy the contents and paste them to a paste service.
Type ?paste for more information.

dusky harness
#

send that ^

#

it's referencing an import statement so I assume the lines are messed up

calm loom
#

k

#

lemme ask the owner for the log

#

uno momento

#

is the problem that there is a space

#

like a line gap

dusky harness
#

ohh

#

d;jdk string#trim

uneven lanternBOT
#
public String trim()```
Description:

Returns a string whose value is this string, with all leading and trailing space removed, where space is defined as any character whose codepoint is less than or equal to 'U+0020' (the space character).

If this String object represents an empty character sequence, or the first and last characters of character sequence represented by this String object both have codes that are not space (as defined above), then a reference to this String object is returned.

Otherwise, if all characters in this string are space (as defined above), then a String object representing an empty string is returned.

Otherwise, let k be the index of the first character in the string whose code is not a space (as defined above) and let m be the index of the last character in the string whose code is not a space (as defined above). A String object is returned, representing the substring of this string that begins with the character at index k...

This description has been shortened as it was too long.

Returns:

a string whose value is this string, with all leading and trailing space removed, or this string if it has no leading or trailing space.

dusky harness
#

try that

#

@calm loom try doing token.trim()

calm loom
#

what why are we still talking about tokens

#

im so confused

dusky harness
#

oh did u fix that

#

nice

#

ig wait for log

calm loom
#

while we wait for log is it possible that the space that is inbetween 36 and 38 is the problem?

dusky harness
#

no, empty lines don't affect it

calm loom
#

now we play the waiting game

dark garnet
#

i think my velocity calculation is incorrect:

final Location blockLocation = block.getLocation();
blockLocation.setY(blockLocation.getX() + 0.5);
blockLocation.setY(blockLocation.getY() + 0.5);
blockLocation.setZ(blockLocation.getZ() + 0.5);
final Vector vector = blockLocation.subtract(playerLocation).toVector();
if (vector.getX() == 0 && vector.getY() == 0 && vector.getZ() == 0) return;

final Entity fallingBlock = world.spawnEntity(blockLocation, EntityType.COW);
fallingBlock.setVelocity(vector.normalize().multiply(strength));```or something is wrong with how im summoning entity. cause it just dont exist ๐Ÿ’€
dusky harness
#

btw dont add .5 to the y

dark garnet
dusky harness
#

so you want the entity to spawn .5 blocks on top of the block

dusky harness
#

๐Ÿฅด

dark garnet
calm loom
#

so u can velociticaly abuse cows?

dark garnet
dark garnet
#

omg i just realized my issue

dusky harness
#

so you want the entity directly in the center of the block

#

thats what i meant

dark garnet
#

blockLocation.setY(blockLocation.getX() + 0.5); ๐Ÿ˜ญ

dusky harness
#

๐Ÿ’€

#

๐Ÿ’€

#

remove that line entirely

#

it's not needed

dark garnet
#

it issss

dusky harness
#

oh wait

dark garnet
#

yeah...

dusky harness
#

im confused now

#

if it works

#

it works

#

ยฏ_(ใƒ„)_/ยฏ

dark garnet
#

it wasnt working

#

it changed to:

blockLocation.setX(blockLocation.getX() + 0.5);
blockLocation.setY(blockLocation.getY() + 0.5);
blockLocation.setZ(blockLocation.getZ() + 0.5);```
dark garnet
dusky harness
#

unless u edited it

dark garnet
#

specifically the 2nd line

dusky harness
#

I am blind

#

oh

#

i am not blind!

#

I see

dark garnet
#

ok what the cow still is just gone in obvlivion

#

shoot i just added "obvlivion" to my discord dictionary

#

how do i remove it ๐Ÿ˜ญ

calm loom
#

oblivion

dusky harness
#

๐Ÿคฃ

#

๐Ÿ’€

dark garnet
#

i even made a bedrock box to encase it

#

but it still finds a way to basically not exist

#
// Get blockLocation and Vector
final Location blockLocation = block.getLocation();
blockLocation.setX(blockLocation.getX() + 0.5);
blockLocation.setY(blockLocation.getY() + 0.5);
blockLocation.setZ(blockLocation.getZ() + 0.5);
final Vector vector = blockLocation.subtract(playerLocation).toVector();
if (vector.getX() == 0 && vector.getY() == 0 && vector.getZ() == 0) return;

// Spawn falling block
//final FallingBlock fallingBlock = world.spawnFallingBlock(blockLocation, new MaterialData(block.getType()));
//fallingBlock.setDropItem(false);
//fallingBlock.setHurtEntities(false);
final Entity fallingBlock = world.spawnEntity(blockLocation, EntityType.COW);
fallingBlock.setVelocity(vector.normalize().multiply(strength));```
#

what is wrong with it sadge

#

omg i fixed it somehow idek how

dark garnet
# dark garnet ```java // Get blockLocation and Vector final Location blockLocation = block.get...

i just changed this, to this:

// Get blockLocation and Vector
final Location blockLocation = block.getLocation();
blockLocation.setX(blockLocation.getX() + 0.5);
blockLocation.setY(blockLocation.getY() + 0.5);
blockLocation.setZ(blockLocation.getZ() + 0.5);
if (playerLocation.getX() == blockLocation.getX() && playerLocation.getY() == blockLocation.getY() && playerLocation.getZ() == blockLocation.getZ()) return;

// Spawn falling block
//final FallingBlock fallingBlock = world.spawnFallingBlock(blockLocation, new MaterialData(block.getType()));
//fallingBlock.setDropItem(false);
//fallingBlock.setHurtEntities(false);
final Entity fallingBlock = world.spawnEntity(blockLocation, EntityType.COW);
fallingBlock.setVelocity(blockLocation.subtract(playerLocation).toVector().normalize().multiply(strength));```
dark garnet
#
fallingBlock.setVelocity(playerLocation.subtract(blockLocation).toVector().normalize().multiply(strength));```
signal grove
#

Bro wtf is this plugin

#

And why is it not built into spigot

dark garnet
dark garnet
leaden sinew
#

What do you mean by pull

dark garnet
leaden sinew
#

But it's still a push

dark garnet
#

ig ye

#

from the player's perspective ur "pulling" the blocks tho

#

doesnt matter tbh, i just dont get they all go in the same direction before actually going towards the player

leaden sinew
#

Did you fix that?

dark garnet
#

im going to bed now tho, so ill try fixing in the morning

river solstice
#

What would be the best data structure for storing, in my use case, chunk hoppers? I was thinking HashSet, but I've heard it's slower than ArrayList.
Also, how could I improve the scanning for the chunk-hopper? I don't think iterating through hundreds of blocks for each spawned item is a good idea, but I don't really know any other solutions.
Code in question:
https://paste.helpch.at/qesupawaxi.java

#

I was thinking, once the item appears, it scans the chunk for the hopper, if it does not find one, it stores the chunk in a data structure, so it knows it does not have a chunk hopper.
Once I place a block, it removes the chunk from the data structure, so it can scan again.

lyric gyro
#

Hey there,

I'm a little new to minecraft development, I just wanted to ask about the Essentials plugin.

In messages_en.properties, I am configuring the messages to look a bit unique!

How would I add a line like this

PAY CONFIRMATION

You are willing to pay {0} to {f}.

river solstice
dense drift
#

private final List<Block> hopperCache = new ArrayList<>();
id say you should store only the location

river solstice
#

would it be considered a 'different' block if it has an item inside?

#

or block state is not compared

dense drift
#

probably, idk, but I think that's similar to using the UUID of a player instead of the Player object

river solstice
#

yeah I was thinking that it might be the case.
I suppose it depends on the equal implementation

#

well, I'll test that out, see if it works with block. won't need to get block object from location.

sterile hinge
#

Chunk has a getTileEntities method, you can basically just use that and extract hoppers from it

river solstice
#

oh, right. totally forgot about that one

calm loom
#

im back with logs

#

somone help pls

signal grove
#

is this your plugin

#

or another one

calm loom
#

mine

signal grove
#

you registering event listeners to a separate class?

calm loom
#

wdym

signal grove
#

most likely is you have two of the same plugin in your server files

calm loom
#

there is only 1

signal grove
#

hmm

#

im not sure sorry. i had the same error yesterday but it was because i did something dumb. i made my event handler class extend plugin and registered it. i doubt youve done the same thing

pulsar ferry
#

Send code of your main class and the coin flip command class

pulsar ferry
#

There you have your problem, it's extending JavaPlugin when it shouldn't

#

The command class i mean

calm loom
#

so i delte that line?

#

or what do i do

#

becuase when i delte it everything goes red

pulsar ferry
signal grove
#

implement commandexecutor

icy shadow
#

i would strongly suggest you learn java, and no just remove the extends JavaPlugin part

#

you are not going to have a fun time if you're just struggling through with your current level of experience

calm loom
#

k

signal grove
#

i have a splendid time

icy shadow
#

good for you

calm loom
#

not an error but how would i make 1 command excute a command that sets the block below the player to be a blue carpet

signal grove
#

im assuming youre talking about an in game command

#

you'd do your alias thing i showed yesterday, with the command of /setblock ~ ~ ~ (whatever blue carpet is)

icy shadow
#

๐Ÿ˜ตโ€๐Ÿ’ซ

dark garnet
#

this concerns me

signal grove
#

i dont normally assume that xD

dark garnet
#

i hope they figure out that is โŒ eventualyl

signal grove
#

what is, aliases?

dark garnet
#

r they trying to execute a minecraft command inside of their own command?

signal grove
#

yeah, the goal is just to simplify the command

#

so you can do /carpetbelowme or something instead of /setblock ~ ~ ~ carpet

#

(im assuming)

dark garnet
#

makes me think they're running the cmd from their cmd executor ๐Ÿ’€

signal grove
#

yeah in here it should prob be plugin dev so it confused me for a min too

neat pierBOT
#
Uploading Images

You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload or similar service to upload images/screenshots.

tacit belfry
#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
โ€ข HelpChat Paste - How To Use

tacit belfry
#

I'm getting a NPE saying that my object phaseManager is null, but I can't figure out why.
https://paste.helpch.at/anewezupad.csharp
This is the code for assigning phaseManager and where phaseManager is being called.

signal grove
#

it's not made null in here

#

so bedwars.getPhaseManager() returns null

#

can see that class maybe?

dark garnet
#

@tacit belfry can u send the Bedwars class in a paste pls

signal grove
#

idk

#

im not so good at software design, but if it was my main plugin class i would inject it through the constructor

dark garnet
signal grove
#

thats right, because it returns an instance, and not the instance

#

(maybe)

tacit belfry
#

Phasemanager is set in onenable

#

Something like: โ€˜phaseManager = new PhaseManager();โ€™

#

Nothing crazy

tacit belfry
#

Yes

dark garnet
tacit belfry
#

What should I use?

dark garnet
#

u need to add Bedwars plugin parameter to PregamePhase's constructor

tacit belfry
#

Ok

dark garnet
#
public PregamePhase(@NotNull Bedwars plugin) {
    bedwars = plugin;
    config = bedwars.getSimpleConfig();
    phaseManager = bedwars.getPhaseManager();
}```
tacit belfry
#

That actually raises a question, should I use getInstance for runnables or a DI

dark garnet
dark garnet
tacit belfry
#

At the end, like runTaskTimer(Bedwars.getInstance, 0L, 20L)

dark garnet
#

u need to add plugin parameter to the method thats initializing the runnable

tacit belfry
dark garnet
tacit belfry
#

I've seen many tutorials and things use getInstance

#

but i guess thats bad?

dark garnet
#

yeah

#

i feel ur pain, i used to store my main class in a static variable and then i learned it was a big nono

tacit belfry
#

alr ty

dark garnet
#

np

proud pebble
#

ngl i do still use a static get instance method for getting the mainclass

#

i could switch everything and just use DI but lazy

river solstice
#

Does anyone know the link to the page why to use DI over static getters?
I think its by piggypiglet, if im not mistaken

dark garnet
river solstice
#

hm, I think it was like a wiki page or something. maybe I'm mixing things up

dark garnet
#

nothing on spigot

#

that seems to be the only time piggy talks about DI

river solstice
#

new years resolution:

  • guice
dark garnet
river solstice
#

yeah, I know. I've seen it before

#

still wanna learn to use guice tho

warm spear
#

hello is there a way to directly change nbt tag of player hand item ? or i must get the item change the nbt and giving him the new one at the same slot ?

signal grove
#

hmm

signal grove
warm spear
signal grove
#

yeah its probably the standard way

dark garnet
#

hi, im trying to make an entity "revolve" around a player by setting the entity's velocity, anyone got any ideas how i can do this?

signal grove
#

yeah, set the velocity perpendicular to the distance vector to the player

#

probably want to ignore the y component

dark garnet
lyric gyro
#

rotate around Y by 90 degrees

#

perpendicular = at 90 degrees

#

with respect to the other thing

signal grove
#

you can use a shortcut by swapping the x and z components and making the new x negative

lyric gyro
#

or you can just tell bukkit to do the trig for you and use the method to rotate around Y :d

dark garnet
#

i dont understand either tbh...

#

this is what i have rn:

Location entityLocation = entity.getLocation();
final Location direction = inverse ? playerLocation.subtract(entityLocation) : entityLocation.subtract(playerLocation);
entity.setVelocity(direction.toVector().normalize().multiply(strength));```
signal grove
#

something like this

#
        double speed = 1.0;
        Vector directionToEntity = entity.getLocation().subtract(player.getLocation()).toVector().normalize();
        double newX = -1 * directionToEntity.getZ();
        double newY = 0;
        double newZ = directionToEntity.getX();
        Vector rotationVector = new Vector(newX, newY, newZ);
        entity.setVelocity(rotationVector.multiply(speed));
lyric gyro
#

i would say that's quite unneeded when there is a simple single-method solution

signal grove
#

oh youre right, rotateAroundY like you said earlier

#

my bad

dark garnet
lyric gyro
#

do you know what rotation is?

dark garnet
lyric gyro
#

yes

#

in Vector

signal grove
#

vector.

dark garnet
#

im in java 8, 1.11, i dont think it exists sadge

lyric gyro
#

common 1.13.2 W

#

so yeah do what heklo suggested xD

signal grove
#

accidentally getting the solution ๐Ÿ‘

dark garnet
# signal grove ```java double speed = 1.0; Vector directionToEntity = entity.ge...

alright this is what i have now:

final Location direction = inverse ? playerLocation.subtract(entity.getLocation()) : entity.getLocation().subtract(playerLocation);
final Vector vector = direction.toVector().normalize();
if (tornado) {
   vector.setX(-1 * vector.getX());
   vector.setY(0);
   vector.setZ(vector.getX());
}
entity.setVelocity(vector.multiply(strength));```but it isnt working, the mob kinda just moves back and forth on a straight line
lyric gyro
#

setX
setZ(getX)

yeah that's not gonna work

dark garnet
#

o

#

oh

#

lol

signal grove
#

the first line

#

vector.setX(-1 * vector.getZ())

#

should be that instead

dark garnet
#

oops typo too

signal grove
#

the last one is correct how it was though

#

x and z swap

dark garnet
#

cause im setting the X to be the -Z, and then the Z is set to the X (which is now -Z)

signal grove
#

oh i see

#

thats why i moved my variables out

#

then combined them afterwards to make a new vector

dark garnet
#

ok, it seems to work, but new issue. the entity seems to be getting farther away from the player, which causes them to get out of the radius of detection

signal grove
#

slowly? or extremely quickly

dark garnet
#

like a spiral, slowly

signal grove
#

hmm, you may need to make the vector point a bit inwards and not directly perpendicular. though "a bit inwards" sounds unreliable

dark garnet
#

ye it does lol

#

here's my code:

final Location direction = inverse ? playerLocation.subtract(entity.getLocation()) : entity.getLocation().subtract(playerLocation);
Vector vector = direction.toVector().normalize();
if (tornado) vector = new Vector(-1 * vector.getZ(), 0, vector.getX());
entity.setVelocity(vector.multiply(strength));```
signal grove
#

is this supposed to happen at an exact radius?

dark garnet
#

but it should push them to like the outermost of the radius (which its doing rn)

signal grove
#

ok

#

here's a janky solution i would do

#

(doesnt mean its good)

#

track entities caught up in the tornado, and when they get outside the radius, tweak the new vector to add a tiny bit of the old vector

#

itll push them back and theyll oscillate along the radius

dark garnet
#

uhhhhhhhh

#

bit too janky

signal grove
#

xD

signal grove
#

that's the same solution

dark garnet
#

it doesnt involve radius detection

signal grove
#

i guess its a little less specific, but i thought you wanted the entities to be pushed to the radius

signal grove
#

i dont think its too terrible. just when you create the perpendicular vector, add a small multiple of the (inversed) direction vector to it if the entities are outside the radius

#

ooooh

#

or

#

dont track the entities

dark garnet
signal grove
#

ignore that

#

the small multiple of the direction vector

#

can be proportional to the current radius of the entity

#

so if they get too far away, the multiple of the inward direction vector grows

dark garnet
#

dumb it down for me a bit

#

i understand the concept, farther entity goes -> higher inward multiple goes

signal grove
#

yes, so we have a regular perpendicular vector like this

double RADIUS = 10; // whatever many blocks you want your tornado radius to be
double someSmallConstant = 0.2; // this will become clear soon, just guess and check

Vector distVector; // player - entity or whatever  (NOT NORMALIZED)
Vector perpendicular; // your perpendicular vector (NORMALIZED)

Vector inwardPull = distVector.multiply( -someSmallConstant / RADIUS );  // (inversely proportional to radius)
Vector newVelocity = perpendicular.add(inwardPull).multiply(speed);
entity.setVelocity(newVelocity);
#

the inwardPull is determined by how far away the entity is, inversely proportional to the total radius

#

the small constant is there still because i dont know how proportional your pull should be. that's dependent on how fast the entities are pushed away, so just keep changing that until it works nicely. If you overshoot your small constant, itll just make the entities revolve slightly closer than the intended radius, no problem

dark garnet
dark garnet
signal grove
#

true

#

oh my bad

#

let me tweak it real quick to make sense

#

yeah ok

#

now its inversely proportional to radius and speed

dark garnet
signal grove
#

no, you can multiply it by the speed earlier on

#

oh'

dark garnet
#

nvm i think it does matter

signal grove
#

im not sure it matter, but if it does, the multiply should be first

dark garnet
signal grove
#

yeah

#

you can switch the order, but the smallConstant would just change

signal grove
# dark garnet i think it does cause PEMDAS right

actually i switched the order, and removed the inverse relation to speed. this makes more sense to me, so increasing the speed increases the inwardPull. but the old solution might still work for you

dark garnet
#
Vector vector = inverse ? playerLocation.subtract(entity.getLocation()).toVector() : entity.getLocation().subtract(playerLocation).toVector();
if (tornado) vector = new Vector(-vector.getZ(), 0, vector.getX()).add(vector.multiply(-0.2 / radius));
entity.setVelocity(vector.normalize().multiply(strength));```
dark garnet
signal grove
#

hes going too far outside the radius

#

so you should increase the small constant

signal grove
#

maybe is just because discord code blocks dont always looks pretty

signal grove
#

ok i prefer the code blocks xD but did increasing the constant help at all?

dark garnet
# signal grove ok i prefer the code blocks xD but did increasing the constant help at all?

is this better? and yes, i think it works great now, ty :))

Vector vector = inverse ? playerLocation.subtract(entity.getLocation()).toVector() : entity.getLocation().subtract(playerLocation).toVector();
if (tornado) {
    final Vector perpendicular = new Vector(-vector.getZ(), 0, vector.getX());
    final Vector inwardForce = vector.multiply(-0.3 / radius);
    vector = perpendicular.add(inwardForce);
}
entity.setVelocity(vector.normalize().multiply(strength));```
signal grove
#

yeah

#

but ahh

#

i think you only want to set the velocity if tornado yes?

dark garnet
#

there is:
A) push
B) pull (represented as inverse)
C) tornado

signal grove
#

ohh, so it will always pull unless tornado is set. but if inverse is set it will push

#

or the other way around, i understand now.

dark garnet
#

im hoping if i toggle inverse and tornado both on, it'll do tornado but opposite direction

#

yep it does

#

but not great...

signal grove
#

hmm

dark garnet
#

do i have to change perpendicular too?

signal grove
#

it might suck the player in

#

is that right?

#

if you inverse and tornado

dark garnet
#

no?

signal grove
#

oh

dark garnet
#

the player doesnt move at all, just the entity

signal grove
#

thats what i meant, the entity

dark garnet
#

o

signal grove
#

does it get sucked in when inverse tornado

dark garnet
#

no, if inverse and tornado r both true, it should just "spin" the entity the opposite direction (left)

signal grove
#

yes, im wondering if that works as intended or not yet

dark garnet
signal grove
#

hmm

dark garnet
#

so it goes out of the radius

signal grove
#

this is because pull is also inverted

#

you should have separate if statements for each case

dark garnet
signal grove
#

red arrow is what we have now

#

when you invert the direction, it pushes

dark garnet
#

oh

#

but im inverting before we apply the inward force?

signal grove
#

the inwardPull vector is based on the original distance vector

#

which is inverted

dark garnet
#

so to fix it would i just have to remove the - from the inward force?

signal grove
#

hmm maybe

#

it's a lot of unnecessary inversions, you should just store copies of the original vectors with more descriptive names

#

or it will be confusing to debug in the future

dark garnet
#

i changed to this:

// Make Vector push entity
Vector vector = entity.getLocation().subtract(playerLocation).toVector();

// If inverse, make Vector pull entity
if (inverse) vector = playerLocation.subtract(entity.getLocation()).toVector();

// If tornado, make Vector spin entity around player
if (tornado) {
    final Vector perpendicular = new Vector(-vector.getZ(), 0, vector.getX());
    final Vector inwardForce = vector.multiply(-0.3 / radius);
    if (inverse) inwardForce.multiply(-1);
    vector = perpendicular.add(inwardForce);
}

// Set entity velocity
entity.setVelocity(vector.normalize().multiply(strength));```
signal grove
#

yes that will work. or you could just have one single inverse on the perpendicular vector

#

and no inversions on the "vector" vector

dark garnet
#

wdym?

signal grove
#

oh nvm, that wont work when its pull

#

yeah i suppose this will work

dark garnet
#

is this what u mean?

// Make Vector push entity
Vector vector = entity.getLocation().subtract(playerLocation).toVector();

// If tornado, make Vector spin entity around player
if (tornado) {
    final Vector perpendicular = new Vector(-vector.getZ(), 0, vector.getX());
    final Vector inwardForce = vector.multiply(-0.3 / radius);
    vector = perpendicular.add(inwardForce);
}

// If inverse, invert Vector
if (inverse) vector.multiply(-1);

// Set entity velocity
entity.setVelocity(vector.normalize().multiply(strength));```
signal grove
#

no, this will invert the pull too. the way before was correct

dark garnet
#

should i do vector.multiply(-1) for the first if (inverse) instead of reassigning vector?

dark garnet
signal grove
#

declared

dark garnet
#

ok ye then multipy is probs better option

signal grove
#
// Make Vector push entity
Vector vector = entity.getLocation().subtract(playerLocation).toVector();
Vector inwardForce = new Vector(0,0,0);
// If tornado, make Vector spin entity around player
if (tornado) {
    // Make the vector perpendicular
    vector = new Vector(-vector.getZ(), 0, vector.getX()); 
    inwardForce = vector.multiply(-0.3 / radius);
}

// If inverse, invert Vector
if (inverse) vector.multiply(-1);

// Add inward force (0 unless tornado)
vector = vector.add(inwardForce)

// Set entity velocity
entity.setVelocity(vector.normalize().multiply(strength));
#

so now inwardforce is zero, but if tornado then our vector is perpendicular and inward force has value.
Invert the vector if we need, and then add on the inwardForce.

dark garnet
#

no caller id is calling me

#

should i pick up

signal grove
#

xD

#

no

dark garnet
#

good choice

dark garnet
signal grove
#

sure

dark garnet
#

ok now new issue ๐Ÿ™ƒ

signal grove
#

which is xD

dark garnet
#

they fall out of the sky if not on the ground

#

i think its an easy fix, just have to change a Y value somewhere

signal grove
#

right cause we set it to zero, but if theyre in the air then theyll fall

dark garnet
signal grove
#

yes

#

but

dark garnet
#

o should i only be adding the inward force to the X and Z?

signal grove
#

yeah

#

well what is your current code

#

it might already be zero

dark garnet
#
// Make Vector push entity
Vector vector = entity.getLocation().subtract(playerLocation).toVector();

// If inverse, make Vector pull entity
if (inverse) vector.multiply(-1);

// If tornado, make Vector spin entity around player
if (tornado) {
    final Vector perpendicular = new Vector(-vector.getZ(), vector.getY(), vector.getX());
    final Vector inwardForce = vector.multiply(-0.35 / radius);
    if (inverse) inwardForce.multiply(-1);
    vector = perpendicular.add(inwardForce);
}

// Set entity velocity
entity.setVelocity(vector.normalize().multiply(strength));```
signal grove
#

yeah just throw in there, right before you add it, inwardForce.setY(0);

#

by the way, you dont want to set perpendicular's y to vector.getY()

dark garnet
#
// Make Vector push entity
Vector vector = entity.getLocation().subtract(playerLocation).toVector();

// If inverse, make Vector pull entity
if (inverse) vector.multiply(-1);

// If tornado, make Vector spin entity around player
if (tornado) {
    final Vector perpendicular = new Vector(-vector.getZ(), 0, vector.getX());
    final Vector inwardForce = vector.setY(0).multiply(-0.35 / radius);
    if (inverse) inwardForce.multiply(-1);
    vector = perpendicular.add(inwardForce);
}

// Set entity velocity
entity.setVelocity(vector.normalize().multiply(strength));```
#

item still falls to ground sadge

signal grove
#

yeah in this code they should

dark garnet
#

o?

signal grove
#

im a little unsure about how to keep entities afloat accurately. for mobs you could maybe give them a constant y velocity that counters gravity (after normalizing it at the end)

#

but if you want players to get caught up in this tornado, clientside physics + lag will muck it all up

signal grove
#

hmm. im not sure, is a little out of my depth on that.

#

whenever someone lags, theyll default to client physics and fall to the ground. they can also walk out of the tornado like this

#

but i dont think you can do anything about that

dark garnet
#

sucks for them tbh LLLLL

signal grove
#

yeah lol

dark garnet
#

well we rly just need to figure out how to make a vector's Y (velocity) point towards another Y (player)

signal grove
#

towards another player?

dark garnet
leaden sinew
#

Isn't that what you have Vector vector = entity.getLocation().subtract(playerLocation).toVector(); for?

signal grove
#

i thought you wanted the Y level to maintain, so floating mobs would float

#

and grounded mobs would stay grounded

dark garnet
signal grove
#

oh, so if a mob is below the player itll float up

#

and if its above the player itll fall down

dark garnet
#

yee

dark garnet
signal grove
#

there is some complications because you keep changing the vector variable at each step, if you want to keep it like that then store the initial vector.getY() after the first line;

#

i just ended my sentence with a semicolon

dark garnet
signal grove
#

and then you can add it to the final vector.setY() at the end

#

negate it too

dark garnet
#
// Make Vector push entity
Vector vector = entity.getLocation().subtract(playerLocation).toVector();
final double y = vector.getY();

// If inverse, make Vector pull entity
if (inverse) vector.multiply(-1);

// If tornado, make Vector spin entity around player
if (tornado) {
    final Vector perpendicular = new Vector(-vector.getZ(), 0, vector.getX());
    final Vector inwardForce = vector.multiply(-0.35 / radius);
    if (inverse) inwardForce.multiply(-1);
    vector = perpendicular.add(inwardForce).setY(y);
}

// Set entity velocity
entity.setVelocity(vector.normalize().multiply(strength));```
signal grove
#

well do you want the y to change only on tornado

#

or on push/pull too

dark garnet
#

just tornado

signal grove
#

ok

#

make that y negative somewhere

#

one thing though you may want to have the strength of the rotation different from the strength of the vertical movement

#

but we'll see if it works first

dark garnet
#

ye it seems to be working

signal grove
#

nice

signal grove
#

this is a disaster, but yes its beautiful

dark garnet
#

only thing thats a bit annoying is that the blocks/entities will fall if they just get a tiny bit out of radius

#

would this solve that or nah? or should it be radius + 1 instead?
final Vector inwardForce = vector.multiply(-0.35 / (radius - 1));

signal grove
#

maybe increase the radius a little bit and increase the smallConstant too

#

radius +1 and then idk like 0.5 smallConstant

dark garnet
signal grove
#

adding one to the radius will make it so the entities have a larger "maximum radius", you can even add more like 3-5. On the other hand, increasing the small constant shrinks down the "equilibrium radius", so entities further out get a stronger push back

#

So it will essentially keep the same radius but have more wiggle room. The little arrows in the picture represent force.

plucky delta
#

I have small question, is there a way to create custom skulls as in skulls from .png files within the server directory?

spiral prairie
#

You can set base64 textures

plucky delta
signal grove
#

skins arent looked up by the client?

plucky delta
#

nbt contains base64

plucky delta
#

{"textures":{"SKIN":{"url":"http://textures.minecraft.net/texture/e8f9eef5317cf4b85127075850980f30bf1a5805a3885978a08e317cc1802ad2"}}}

spiral prairie
#

I'm pretty sure headdatabase doesn't have tens of thousands of accounta

plucky delta
#

i really dont know how they do it

spiral prairie
plucky delta
#

but thats the minecraft texture

plucky delta
#

meaning i could prolly hook it up to my own cdn

#

but id have to check that

#

but every single skin file gets saved on the minecraft database somehow

spiral prairie
#

Whats that string after texture/

plucky delta
#

wdym

#

thats just a hash i think

#

or something to identify

dusky harness
spiral prairie
#

Hm

plucky delta
#

eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly9pLmltZ3VyLmNvbS9VYlRjQnd5LnBuZyJ9fX0= this would be the base64 of a skin with a different database

spiral prairie
#

Yeah you could launch a webserver

plucky delta
#

i just imgur for that

dusky harness
#

i think there's also an exploit where you can "ban" players by having too many heads in a chunk or smth
probably patched though

plucky delta
#

prolly yea

#

Textures payload contains blocked domain: http://i.imgur.com/UbTcBwy.png

#

it blocks textures if its not from minecraft

spiral prairie
#

Looks like you gotta change your skin a bunch of times

plucky delta
#

Well the thing is I wanna make a ingame head creator.

spiral prairie
#

You can take a look at mc source code

signal grove
#

plugin that changes your skin xD

spiral prairie
#

And if there are any chances you don't have to put a url

plucky delta
#

Or I somehow have to upload a new skin to mojang.

#

retrieve the texture and then do it.

#

then cache it

spiral prairie
#

Oh wait

#

Still

dusky harness
#

no the client blocks it

spiral prairie
#

Yeah well hm

plucky delta
#

although

#

i know it spossible

#

maybe that has a api?

spiral prairie
#

It does

#

Even a java api

plucky delta
#

I guess I could try and use that

#

but I think the ratelimits on that are awful.

spiral prairie
#

I think i still have some random alt accounts somewhere

#

Just buy an account and make your own api

plucky delta
#

the thing is

#

minecraft ratelimits how fast you can change your skin.

#

like once a minute or so

#

Ill try using mineskin.

spiral prairie
#

Yup

plucky delta
#

i wish minecraft would just do the texture in base64

dark garnet
signal grove
#

Haha no problem

#

Paint >>>

dark garnet
#

Cause the y is negligible

signal grove
#

Doesnโ€™t matter

lyric gyro
#

I need developers to my server :(i adding an plugin and when i need move it to plugin folder is dont working and when my freidn tryed is worked ๐Ÿ˜ฆ but hes offline and busy allways ๐Ÿ˜ฆ

signal grove
lyric gyro
dusky harness
#

Just in case anyone was gonna respond

dusk crypt
#

I created a javascript to show the healthbar of players. But when I add it from the name of the player using Tab Plugin, it uses a lot of CPU usage from the Tab Plugin which makes the server lag. I added the refresh rate of 10000 and it fixes the problem. Is there a way ti improve this?

grim oasis
#

Don't use a javascript for it

dusk crypt
# grim oasis Don't use a javascript for it

The problem is, there are player that exceeds 20 health. The javascript that I created is a percent health, meaning if they have 41 hearts, it will still show as 10 hearts for 100%

#

but will look into this expansion. Thank you

grim oasis
#

do you know any java? It has github source

#

good luck ๐Ÿ‘

dusk crypt
# grim oasis do you know any java? It has github source

I'm not familiar but I'm already doing some C# stuff. Been busy with work and family so don't really have time to work with this ๐Ÿ˜„ . The expansion works great! The only problem I have is, if the player has more than 10 hearts, it will still display it as 10 hearts. So a player with 60 hearts will still show as 10 hearts even if you already deal 30 hearts to him/her.

calm loom
sterile hinge
#

make sure the event is registered

calm loom
#

how

#

isnt it already doing that?

sterile hinge
#

?

calm loom
#

isnt it already registering it?

sterile hinge
#

I don't know

calm loom
#

well how do we figure that out?

lyric gyro
#

Ello!

sterile hinge
#

I actually mean the listener, not event obviously lol

calm loom
lyric gyro
calm loom
sterile hinge
lyric gyro
sterile hinge
#

the code where you#re registering listeners

calm loom
sterile hinge
#

no

calm loom
#

what should i be looking for?

sterile hinge
calm loom
sterile hinge
#

?

calm loom
#

can you explain what i should add

#

im confused

sterile hinge
#

did you read

calm loom
#

so i go into my main class and paste that in?

sterile hinge
#

well do what it says

worldly cobalt
#

Hey, my expansion is right registered but it seems like the onRequest method is never called, any idea how to fix?

#

My onRequest method :

@Override
public String onRequest(OfflinePlayer player, String params) {
    System.out.println("onRequest");
}
#

I have this message that my expansion is right registered too : Successfully registered expansion: BlockParty [1.0]

signal grove
#

is persist overridden to return true

#

also

#

you dont return a string there so it shouldnt compile. but im assuming this is just an example code and not actually yours

worldly cobalt
#

Yep

    @Override
    public boolean persist() {
        return true;
    }
dusky harness
#

How are you testing the placeholder

#

/papi parse?

#

Show the class and the papi parse command ig

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
โ€ข HelpChat Paste - How To Use

worldly cobalt
#

Yeah I just figured it out that it only listen for placeholders with my plugin name in front of it, it wasn't said on the doc
Can I listen for placeholder without my plugin name in front ?

dusky harness
#

It's the value returned by getIdentifier (or smth named like that)
Its to prevent duplicate placeholders

#

Tldr no you can't

worldly cobalt
#

... seriously

dusky harness
#

Keep in mind papi has multiple plugins using it

#

Not just your expansion

#

If there was no identifier, how would it know which expansion to use?

lyric gyro
#

you don't "listen" for placeholders

#

they are not events

#

you register your own placeholder under an identifier that is called when requested

signal grove
#

the method names a bit misleading

#

with "on"

dusky harness
#

I'd call them listeners that you register it with

#

Just with a special identifier

#

Since when it says onRequest, that is called when a plugin requests the Placeholders to be parsed

lyric gyro
#

IdentifiedPlaceholderTemplateResolver

worldly cobalt