#help-development

1 messages · Page 1525 of 1

wraith rapids
#

reddit is the worst shit ever

#

you'll fit right in

onyx shale
#

i mean half the site is porn

#

what ur expecting

astral burrow
#

okay so I have tried to update the block. I order to connect the chest.

wraith rapids
#

I command thee, CONNECT

proud basin
#

uh

#

that's not good

#

deleting the stats file broke my scoreboard

wraith rapids
#

maybe don't delete random files with the server running

proud basin
#

now I got errors

onyx shale
#

i mean i specifically said its a json file

#

meaning ur supposed to open in

wraith rapids
#

and yes, some scores pull from the stats

onyx shale
#

and edit

proud basin
#

oh

#

woopsy

#

so um

#

how do I fix this?

wraith rapids
#

peak 1.8 server administration

onyx shale
#

like just view it before doing anything

wraith rapids
#

you can delete the server

#

and start over

onyx shale
#

i mean..true

proud basin
#

do I actually need to?

onyx shale
#

i guess the question wasnt answered

wraith rapids
#

it might be the easiest way

onyx shale
#

why 1.8?

proud basin
#

pvp

wraith rapids
#

try deleting your scoreboard.dat

#

that might help

#

with the server offline this time around

proud basin
#

where is that located?

onyx shale
#

wait what scoreboard you even have?

proud basin
#

a custom one

onyx shale
#

is it a plugin one or

#

vanilla one

proud basin
#

plugin

onyx shale
#

well..

#

you can try deleting folder for the plugin

#

and see if it fixes

astral burrow
#

@wraith rapids
i understood you like this:

        Chest chestLeft = (Chest) block1.getBlockData(); 
        chestLeft.update();

is that correct or what did I wrong?

proud basin
#

nope

onyx shale
#

also i forgot to notice this is code help

#

not server help section

proud basin
#

oh wait

onyx shale
#

not blockdata

granite stirrup
#

k i removed the minecart and chest textures XD

proud basin
#

hold up

onyx shale
proud basin
#

haha I think im getting an error because its trying to calculate the kdr

granite stirrup
#

the double chest is fine tho

#

lol

proud basin
#

while there isn't any deaths or kills

astral burrow
#

ah okay thanks I will try

proud basin
#

I lied

#

I think

sage swift
#

of course you did

proud basin
#

wow

onyx shale
wraith rapids
#

have you ever seen a 1.8'er tell the truth

proud basin
#

I'm getting a index out of range 4 so lets see where its telling me

#

ahhh

#

yea

#

fixed it

#

that's not good

#

though

#

this is what was the issue String decimal = decimalValueStr.substring(0, (indexDot + 1) + desiredDigits);

wraith rapids
#

literally what are you even doing

astral burrow
proud basin
onyx shale
astral burrow
onyx shale
#

were at a point when every problem ever,a thread exists for it

wraith rapids
#

every beginner problem anyway

#

more complicated issues have threads too, but they're usually populated by dumb dumbs misundersanding the question and giving nooby answers

proud basin
#

I love Double.NaN

astral burrow
#

Okay, so I have read already about so many threads but havent crossed that one.

onyx shale
#

i just typed on google spigot spawn double chest

#

and i find like 10 threads with a solution

astral burrow
#

Thank you, and sorry again for asking. I just dont want to open another thread.

wraith rapids
astral burrow
#

I spend more than 3 hours on this one. Will go to bed now and take a look at that later.

granite stirrup
#

lol

shadow pulsar
#

How to move a location relative to its rotation?

wraith rapids
#

reorder the vector components and flip the signs

shadow pulsar
#

That doesn't work.

#

You keep saying the same thing

granite stirrup
#

^ ^ ^ ?

wraith rapids
#

it should, though

shadow pulsar
#

But you need to figure out how much of a variable goes into the x, y, and z first

wraith rapids
#

if you rotate at 90 degree intervals, you don't

shadow pulsar
#

Because, for example, moving forward would change the x and the z

#

Yeah, 90 degrees it would work but I also need it to work with other rotations

wraith rapids
#

in that case, you need to get into vector math

shadow pulsar
#

I have searched far and wide and the closest I have found was that one code snippet I sent a while ago

#
   loc.setZ(loc.getZ() + forward * Math.cos(Math.toRadians(yaw)));```
proud basin
#

@wraith rapids You like how I calculate their kdr ```java
double kdr = p.getStatistic(Statistic.PLAYER_KILLS) * 1.0 / p.getStatistic(Statistic.DEATHS);
String decimalValueStr = String.valueOf(kdr);
int indexDot = decimalValueStr.lastIndexOf('.');
int desiredDigits = 2;
String decimal = decimalValueStr.substring(0, (indexDot + 1) + desiredDigits);
kdr = Double.parseDouble(decimal);

astral burrow
#

okay thanks, it works.

cinder timber
#

is that the default minecraft statistic stuff

#

cools

cobalt steppe
#

Does anyone know a good language API?

proven sierra
#

🤔

wraith rapids
#

do you worship satan

sage swift
#
    public void on(EntityDeathEvent evt) {
        if (evt.getEntityType() != EntityType.WITHER_SKELETON) return;
        if (!(evt.getEntity().getLastDamageCause() instanceof EntityDamageByEntityEvent byEntityEvt)) return;
        if (!(byEntityEvt.getDamager() instanceof Creeper creeper) || !creeper.isPowered()) return;``` this made me commit unsavory acts
subtle kite
#

who doesn't spell out event

#

cringe

sharp bough
#

its 2 less letters

sage swift
#

many times adds up

sharp bough
#

if you type evt instead of event on 1000 events thats 2000 less letters typed

sage swift
#

and if you do Bukkit.shutdown() you save everyone lots of time

maiden shore
#
    public void onEntityDeathEvent(EntityDeathEvent entityDeathEvent) {
        if (entityDeathEvent.getEntityType() != EntityType.WITHER_SKELETON) return;
        if (!(entityDeathEvent.getEntity().getLastDamageCause() instanceof EntityDamageByEntityEvent entityDamageByEntityEvent)) return;
        if (!(entityDamageByEntityEvent.getDamager() instanceof Creeper creeper) || !creeper.isPowered()) return;```
There, I fixed it.
sharp bough
#

entityDeathEvent

maiden shore
#

No ambiguity there!

sage swift
#

i think you mean EntityDamageByEntityEvent entityDamageByEntityEvent

sharp bough
#

how big can the name possible get?

sage swift
#

thank you

subtle kite
#

Anyone know the Material. type for Enchanted golden apple in 1.8

ivory sleet
#

Same as normal golden apple iirc

#

But it has a damage of 1

subtle kite
#

if (event.getItem() != null && event.getItem().getType() == Material.) {

#

so how would I do it like this?

ivory sleet
#

ItemStack item;
boolean isEnchantedGoldenApple = item != null && item.getType() == Material.GOLDEN_APPLE && item.getItemMeta().getDurability() == 1;

#

I think

sage swift
#

dont use 1.8 👍

subtle kite
#

thank you conclure
...
oh man I never thought of that. @sage swift

sage swift
#

edited to ping me

#

nice one

granite stirrup
#

Die frog @sage swift

subtle kite
#

how else would someone know I talking to you

sage swift
#

_ _

granite stirrup
#

Lol

hexed hatch
#

imagine adding an‫ to your text ‫

compact haven
#

old trick

candid galleon
#

(edited)

#

‫test

quaint mantle
#

very‫ interesting ‫

unkempt peak
#

Does anyone have experience with the world edit api? I am trying to paste a schematic from a file and i can't figure out how to get the worldedit world, I get an error if i try to cast bukkit.World to Worldedit.World

#

EditSession editSession = WorldEdit.getInstance().newEditSession(pos.getWorld())

quaint mantle
#

is their a chat bridge plugin that anyone uses?

quaint mantle
fiery inlet
#

Anyone know how to get the nearest player, at a target block on rightclick

#
public static Player getNearestPlayer(Player checkNear) {
        Player nearest = null;
        for (Player p : checkNear.getWorld().getPlayers()) {
            if (nearest == null) nearest = p;
            else if (p.getLocation().distance(checkNear.getLocation()) < nearest.getLocation().distance(checkNear.getLocation())) nearest = p;
        }
        return nearest;
    }
#

tried this but just got, eh

quaint mantle
#

why did you use haskell for the code block highlighting lmao

quaint mantle
fiery inlet
#

idk im used to it

quaint mantle
#

you didn't getName

quaint mantle
unkempt peak
fiery inlet
#

player.playSound(player.getLocation(), Sound.UI_BUTTON_CLICK, 1.0, 1.0);

Cannot resolve method 'playSound(org.bukkit.@org.jetbrains.annotations.NotNull Location, org.bukkit.Sound, double, double)'

#

dahell

rotund pond
#

Your two last parameters are floats

fiery inlet
#

oh

#

ty

rotund pond
#

👍

winter remnant
#

trying to write a datapack for my server but ran into this and cant run it in singleplayer

#

(im asking because sometimes spigot has bugs fixed before minecraft does such as the piglin dupe in 1.16)

quasi flint
#

How can U create a Fake Player entity, which has No Knockback and the players cps as its name?

maiden thicket
#

oh at a target block

fiery inlet
#

like when i rightclick, i need to get the nearest player at the block im looking at

maiden thicket
#

oh if it's a right click maybe try getNearbyEntities

fiery inlet
#

the thing is it returns a list

maiden thicket
#

yeah so filter if it's instance of player

#

then map as cast to player

#

should be maybe

quasi flint
#

Well then use the 1 one outta that list u guess

maiden thicket
#

getNearbyEntities().stream().filter(entity -> entity instanceof Player).map(entity -> (Player) entity).collect(Collectors.toList()) maybe

fiery inlet
#

there is a nearbyPlayers one

ivory sleet
quaint mantle
#

Hi Im have problem with plugin protectionstone or idk how to use it. So after setting plot and making them for sale, normal player can buy plot and lost his money but he won't be owner if person who sell this isn't online. Idk its my mistake or bug

quasi flint
sage swift
#

hahahaaaa

tall ridge
#

nice and timely

sage swift
#

outdated versions are unsupported

quasi flint
#

;7

sage swift
#

¯_(ツ)_/¯

quasi flint
#

(╯°□°)╯︵ ┻━┻

#

well then i guess i have to do some thinking and trying

sage swift
#

and then some switching

#

to a version that's not over half a fucking decade old

tall ridge
#

maybe they have a reason?

sage swift
#

no reason is good enough to use 1.8.

tall ridge
#

idk what reason that would be I'm waiting for 1.18

sage swift
#

pvp? plugin.

quasi flint
#

yes

sage swift
#

there are so many missing features in the 1.8 api

#

PDC

#

custom recipes

#

it has very few features compared to the current versions

quasi flint
#

well but 1.9 killed pvp soooooo ;7

sage swift
#

again, use a plugin.

tall ridge
#

hahaha

quasi flint
#

dafuq?

tall ridge
#

you can change everything in the game..

sage swift
#

lots of options.

hexed hatch
#

1.8 cringe

tall ridge
#

make it basically like 1.8

sage swift
#

viaversion will allow your retarded players to continue connecting on 1.8 if they so choose

#

but don't use 1.8 on the server side.

lapis relic
#

wh

hexed hatch
#

I’ll never get the fixation on old minecraft pvp

#

Not that the new pvp is any fun but like

#

Why is pvp so big for a game with such a terrible combat system

tall ridge
#

Anyway I'll never get it, I'm into terrain generation!

quasi flint
#

well then ima make my plugin seem 1.16 pvp like 1.8

sage swift
#

or use an existing plugin :D

quasi flint
#

nah

#

my server with be coded, not just download

#

no downloaded plugin

sage swift
#

you're not gonna use coreprotect?

tall ridge
#

I like that

sage swift
#

essentials?

#

anything?

tall ridge
#

gecko I do what he does

quasi flint
#

nah

sage swift
#

some stuff is just stupid not to make

tall ridge
#

I coded everything on my server from scratch too

#

just to learn

sage swift
#

PlaceholderAPI?

quasi flint
#

he got it

sage swift
#

viaversion?

tall ridge
#

1 step at a time

sage swift
#

seems like a waste of time

tall ridge
#

Of course there are some things to not bother with

#

but I don't use them all

#

like I said I'm into terrain generation

quasi flint
#

ah viaversion i download

tall ridge
#

good man

quasi flint
#

thats to tedious

tall ridge
#

Yup

quasi flint
#

but the rest. manageable

tall ridge
#

Yes good luck and have fun with your server

quasi flint
#

yep thx

tiny wolf
#

Hey, can someone help me out with Bukkit schedules, I can't seem to figure out how to use them

sage swift
#

Bukkit.getScheduler().runTask(plugin, () -> {/*code here*/});

tiny wolf
#

plugin is just an instance of the plugin ?

sage swift
#

mhm

tiny wolf
#

k, thanks 🙂

summer scroll
#

How can I remove all elements from hashmap. I've tried to do something like this but it gives me concurrent exception.

for(UUID uuid : entityMap.keySet()){
  // Remove the entity
  entityMap.get(uuid).remove();
  // Remove the element from the map
  entityMap.remove(uuid);
}
sage swift
#

use an iterator

quasi flint
#

hashmap.clear?

summer scroll
#

oh true

sage swift
#

he wants to do stuff to em first

summer scroll
#

wtf

quasi flint
#

well that cleans all of it

summer scroll
#

that might be it, i forgot there is Map#clear

#
    public void removeAllEntity(){
        // Loop through all uuids
        for(UUID uuid : this.entityMap.keySet()){
            // Get the entity and then removes it
            this.entityMap.get(uuid).remove();
        }
        // Clear the map
        this.entityMap.clear();
    }
sage swift
#
entityMap.values().forEach(Entity::remove);
entityMap.clear();```
#

:]

summer scroll
#

alright, thank you so much!

quasi flint
#

np

quasi flint
sage swift
#

anyone found the method for changing world height for 1.17? i must be stupid because i see WorldServer#getMinBuildHeight but i can't find the actual method anywhere

quasi flint
#

give me a quikc min

#

only way i know through server.properties

sage swift
#

...

quasi flint
#

although there could be a way i dont know it

tame coral
#

My connection to my database worked fine yeasterday and suddenly today I have a java.lang.NoClassDefFoundError: pro/husk/hikaricp/pool/HikariProxyResultSet error

sage swift
#

it doesn't show up as an existing method, idek anymore

tame coral
#

isn't sea level always 62

#

or 63 i don't remember

sage swift
#

what

#

that's not what i'm asking

tame coral
#

oh ok

rotund pond
sage swift
#

it's nms...

#

World.java

#

just tryna find the method, and from there the number i can change for height

#

i guess i'm looking for getMin and getMaxBuildHeight

#

neither show up as methods, maybe im missing something

quasi flint
#

i will look into that when i am getting home

#

will take 6 hours tho

summer scroll
quasi flint
#

good thing

eternal night
#

you return in the for loop ?

#

that pops the entire method off the stack.

#

including the for loop

#

I am saying, returning inside the for loop means that, after the first iteration, the return statement ends the entire method logic flow

#

e.g.

for(int i = 0; i < 100; i++) {
  System.out.println(i);
  return;
}

will only print a single 0, as after the first print the return statement is reached which signals the end of the current method.

wraith rapids
#

learn java

tame coral
#

yeah

#

return just ends the function

quasi flint
#

ouch

#

visible pain

#

dafuq he wants to do with that loop?

#

uses it 1 time

#

burns it to hell and beyond

eternal oxide
#

?learnjava

undone axleBOT
quasi flint
#

sooo much java xd

quasi flint
#

dont understand i do

wraith rapids
#

you're not modifying item in the loop; it's aways the same

quasi flint
#

lul

quaint mantle
#

how i can storage block data?

#

smth like persistent data container

wraith rapids
#

tile entities have pdcs

#

for regular blocks, you're fucked

quaint mantle
#

that's bad

wraith rapids
#

there are libraries that try to do it

#

but they aren't super reliable

#

because bukkit doesn't really let you listen to everything involved

quaint mantle
#

and that's so shitty

eternal oxide
#

if its just actual BlockData you use getAsString and Server.createBlockData(String)

quaint mantle
wraith rapids
#

blockdata isn't related to storing data on a block

#

blockdata is what bukkit calls minecraft block states

#

that is, the orientation of fences and shit

quasi flint
#

going off now. no more premium tech support from me. bb

quaint mantle
#

because it is

#

BlockData is note, tone, sharp of noteblock

#

block facing

wraith rapids
#

yes

quaint mantle
#

opne/closed fences states

#

waterlogged and etc.

wraith rapids
#

yes, minecraft block states

quaint mantle
#

but this is not suitable for custom blocks

eternal oxide
#

yes, and as I said you use getAsString if you want to store that data elsewhere

wraith rapids
#

it can not contain arbitrary data, no

#

only tile entities can store arbitrary data

quaint mantle
eternal oxide
#

Gravel has BlockData

quaint mantle
#

but what about barrier?

eternal oxide
#

So does Barrier

wraith rapids
#

every block has blockdata, it just doesn't have fields if there is only one state

eternal oxide
#

All block Materials have BlockData

wraith rapids
#

but again, blockdata does not store arbitrary data

#

you can not use it to store random shit

#

only tile entities can do that

eternal oxide
#

It would probably be an idea that you tell us exactly what you are attempting to store

quaint mantle
#

I'll start from the very beginning

#

I need to store any string in them, and also spawn the frame in that block.

eternal oxide
#

frame?

quaint mantle
#

item frame

quasi flint
#

thats why forge or fabric is cool

eternal oxide
#

and what "string"?

quaint mantle
#

String custom_block = "anything";

eternal oxide
#

You can not place an arbitrary String on an item frame

quaint mantle
quaint mantle
#

simply nbt

eternal oxide
#

ok, you can not place an arbritrary String on a Barrier

wraith rapids
#

barrier is not a tile entity

#

it can not persist arbitrary data

#

i feel like i'm repeating myself

quaint mantle
#

it is.

wraith rapids
#

it is not

eternal oxide
#

Non TileEntity Blocks do not support NBT beyond the pre defined tags of the blocks data

wraith rapids
#

that is to say, non-tile entity blocks do not support nbt at all

eternal night
#

^^ which aren't even stored as NBT yea

wraith rapids
#

instead they have a pre-baked list of possible states

quaint mantle
#

I would love to use note blocks for what I intended, but they are have full-block type and I have to use a barrier + item frame

eternal oxide
#

neither barrier nor ItemFrames support NBT tags

eternal night
#

item frames ?

wraith rapids
#

well an itemframe is an entity

#

so it does have a pdc

eternal night
#

they do yea

eternal oxide
#

Not in teh world. As ItemStacks they can

quaint mantle
eternal night
#

in the world they are an entity

quaint mantle
#

item frame is entity

eternal night
#

what

wraith rapids
#

entities implement persistendataholder

quaint mantle
#

entity support nbt

eternal oxide
#

itemfram is an entity?

wraith rapids
#

an item frame is not a block; it is an entity

eternal night
#

yes

#

lol

wraith rapids
#

same with paintings

quaint mantle
#

yes

eternal oxide
#

I didn;t think it was

#

I stand corrected

wraith rapids
#

it needs to be an entity because blocks can't render stuff like that properly

#

for example the flower pot requires a separate block state for each item put in it

#

there are some exceptions like skulls and signs

eternal oxide
#

I wrote a regen plugin for blocks and entites like pictures and item frames, but it was a while ago

quaint mantle
#

a new problem arises

#

if there are too many frames, it can cause server and client laggs

eternal oxide
#

In which case ItemFrames yes you can store data in its PDC

wraith rapids
#

then don't spawn too many item frames

quaint mantle
#

but i should

wraith rapids
#

then you will lag

eternal oxide
#

Tell us what you are trying to achieve and we will almost certainly have a better alternative

wraith rapids
#

custom blocks with textures presumably

#

with the barrier for collisions + item in itemframe for texture style

#

which is viable if you only have a few such blocks placed in the world

eternal oxide
#

You can do custom block textures with a texture pack and damage states

wraith rapids
#

because itemframes are laggy as shit in high numbers

#

the preferred blocks for that are noteblocks and mushroom blocks

#

noteblocks especially so as you can replicate their functionality server-side so you don't necessarily override any vanilla textures

quaint mantle
#

I'm going to make a lot of my custom blocks where some of them are vases. There are 512 variations of them, and that's why I have to use frames and the subject in them to configure CustomModelData. Others, full blocks, are note blocks. All note blocks and barriers currently have metadata, which falls off immediately after a server reboot,
and I have to store all this data somehow.
https://imgur.com/Dfoycul

wraith rapids
#

well

#

store it to disk or a db, I suppose

#

but beyond that, there is no solution to your "itemframes cause lag" problem

#

the best you can do is spawn them via protocol and make them client side

eternal oxide
#

store it in the chunk PDC

wraith rapids
#

that will not lag the server, but will still lag your players to shit

quaint mantle
#

chunk PDC? wtf

eternal night
#

only really viable if the players cannot modify the map

#

if players can use pistons, explosions etc

#

chunk pdc is nearly unmaintainable

wraith rapids
#

does bukkit block metadata account for that?

#

or is it just a dumb blockpos -> shit map

eternal night
#

doubt

eternal oxide
#

its dumb

wraith rapids
#

great

#

to be expected, I suppose

quaint mantle
#

k, now i using the MySQL

wraith rapids
#

supposedly you could implement a specific tile entity and place that in the world, but I don't know how that works persistence wise

quaint mantle
quaint mantle
wraith rapids
#

remember to make network requests to the remote db in the chunk load and unload events

#

that will boost performance by 100x

eternal night
#

:mind_blown:

eternal oxide
#

Bukkit will complain about random TE's on blocks that should not have them. It will also attempt to fix them

wraith rapids
#

myeah

#

i'm not sure if there is any way around that

quaint mantle
#

now i'm using MySQL + HashMaps

#

with server starting

wraith rapids
#

use a octree

quaint mantle
#

all date applies to blocks

quaint mantle
eternal night
#

can also just stick with a map and the long key representing a block

#

paper has a method to calculate those

quaint mantle
#

i'm using paper now

#

but will this card keep data until reboot?

wraith rapids
#

i wonder what paper is going to do with the long block key

#

what with the world height being customizable and shit

eternal night
#

cry

wraith rapids
#

there's only enough bits in the long key for y values up to like 512 or 1024 or something

quaint mantle
#

i'm using this now:
private static final HashMap<Location, Tuple<Integer, Tuple<Blocks, Material>>> storage = new HashMap<>();

wraith rapids
#

christ

#

learn java

eternal night
#

Why not just make a class instead of a bunch of nested tuples

quaint mantle
#

:p

eternal night
#

records are sweet

wraith rapids
#

at least it's not public

quasi flint
#

use another item. not everytime the same one

wraith rapids
#

but that's about the only saving grace here

quasi flint
#

only changing meta is dumb

quaint mantle
eternal night
#

🥳

quaint mantle
#

Do I need to change the "full" world date application to chunk loading

wraith rapids
#

that's because you're working with the same item every time

#

learn java

#

go read a tutorial

#

then re-read your code

quaint mantle
#

use for

runic root
#

Hello I have a problem with the mcduel plugin when I install it on my server everything goes well but when I do /arena it marks me in the arena chat

quaint mantle
#

why

#

what for

runic root
quaint mantle
#

with him

quasi flint
#

u for looping the same item every time

#

u not changing it

runic root
#

okay thanks

quasi flint
#

or i am retarded just noe

opal juniper
#

yes

#

that was memes

summer onyx
#

Emm I just paid a plugin then, It doesn't in my Purchased Resources

chrome beacon
#

Give it time

summer onyx
#

I bought it 6 hours ago🤔

summer scroll
#

Maybe you can try to contact the author.

opal juniper
#

its like a list of 2 things iirc

hardy swan
#

nvm i take that back

#

I didn't see the tuple inside tuple

opal juniper
#

yeah

hardy swan
#

wtf

opal juniper
#

its kinda rough

summer scroll
#

If I update my plugin to 1.17, am I required to update the java on the plugin to 16 too?

hardy swan
#

nope

summer scroll
#

oh thank god

hardy swan
#

in fact can prob even write with java 7, correct me if im wrong

eternal oxide
#

So long as you use no NMS

ivory sleet
#

Yeah you could in theory

summer scroll
#

yeah, Java is backwards compability so..

eternal oxide
#

Well, probably ok with NMS

hardy swan
#

nms not java syntax

#

prob wont matter

summer scroll
#

Can someone explain to me what does remapped-mojang do?

hardy swan
#

so basically mojang's library is obfuscated

#

remapped-mojang remaps it

ivory sleet
#

Tho java 7 didn’t have stuff like lambdas and streams and pseudo function first class objects so some stuff will probably not work like the BukkitScheduler#runTask(plugin,consumer) for instance

hardy swan
#

you wont be able to write those

#

but otherwise should be ok

sullen dome
#

does the InventoryOpenEvent get called too, when switching between 2 menu's with Player#openInventory?

ivory sleet
#

Ye

ivory sleet
sullen dome
#

1.16.5 in my case

hardy swan
#

definitely

sullen dome
#

good. ty

summer scroll
hardy swan
#

it is not required?

#

you mean required as in for the library to be obfuscated?

unreal sandal
#

Hello, how can I do a list with a YML file ?

hardy swan
#

getConfigurableSection(.....).getKeys(false)

ivory sleet
#

Using the Bukkit config thing?

pastel dove
#

best anti cheat to use for a survival server

#

paid

hardy swan
unreal sandal
unreal sandal
#

Like that, I would like to list the chunks

summer scroll
# hardy swan you mean required as in for the library to be obfuscated?

When choosing to use the 'Mojang Mappings', it is absolutely imperative that you are aware of the conditions attached to them as well as the Mojang EULA. These are not restrictions you can simply ignore. In particular you may only 'use the mappings for development purposes'. This means that you must only use the remapped-mojang jar for development and must remap your plugin prior to distribution. For those not using Maven you can download SpecialSource to help you do this here, and we encourage the creation of instructions/tools for other build systems.
This one, I'm kinda confused.

pastel dove
#

i see

hardy swan
#

then you are required to remap it back

#

you must only use it for development

#

IF you use it

#

you cant use it for anything else

ivory sleet
#

aglerr basically you’d use the mappings at compile time and then turn it back to the obfuscation when compiling it (like your nms imports and stuff)

summer scroll
#

is that for nms?

#

oh

hardy swan
#

yea nms

summer scroll
#

i don't use the nms, so i can just use the api right?

hardy swan
#

then nothin to remap, if all you are using is bukkit api

#

i would assume

summer scroll
#

so by remap the mojang library, it'll be easier for developer to use nms?

hardy swan
#

but even if you are writing with nms, you prob wont need the remapped-mojang jar lol, can just deduce from method signature >.>

summer scroll
#

ah i see, thanks

ivory sleet
sullen dome
#

alright, that's probably a dumb question, but idk.
I have a Class named Settings, and then another Class named GameruleSettings
GameruleSettings extends from Settings, and both classes implement Bukkit's Listener.
do i need to register both to the PluginManager, or would it be enough to register the Settings one?

#

probably both tho

opal juniper
#

if GameruleSettings extends Settings then afaik you just need to register the GameruleSettings because it will implement all of its superclasses methods

(i think)

sullen dome
#

yeah that's what i thought of. i'll try it, and see if it works lol

ivory sleet
#

Each individual instance that inherits Listener needs to be registered

sullen dome
#

wait

#
 if (event.getInventory().equals(SETTINGS_MAIN)) {```

this is not working? know a better way of checking which inventory someone is in?
ivory sleet
#

I use InventoryHolder but what is SETTINGS_MAIN btw

opal juniper
#

Im assuming a custom class

sullen dome
#
    public final Inventory SETTINGS_MAIN = Bukkit.createInventory(null, 27, "§bMain-Settings");```
opal juniper
#

nvm

#

that would never be true afaik

sullen dome
#

the inv, where i am clicking

ivory sleet
#

Hmm maybe try == instead

opal juniper
#

use something like the holder (or if you have to) the name

sullen dome
#

well, it's a public gui without a specific holder

ivory sleet
#

Sometimes comparing with == works so give it a shot I guess

sullen dome
#
{
        Player player = (Player) event.getWhoClicked();
        if (event.getInventory() == SETTINGS_MAIN) {
            event.setCancelled(true);
            switch (event.getSlot()) {
                case 1:
                    initGUI(player, SETTINGS_CHALLENGES);
                    player.openInventory(SETTINGS_CHALLENGES);
                    break;
                default:
                    System.out.println("1");
                    break;
            }
        } else {
            System.out.println("2");
        }
    }```

it always gives me 2
ivory sleet
#

Oh well you could try InventoryView although if I personally would advice something, it would be InventoryHolder

opal juniper
#

^^

#

What the man said

sullen dome
#

like i said, it actually has no holder. it's a public gui, not player specific at all

opal juniper
#

Make one 🙃

sullen dome
#

well wait

#

players cannot change the gui name right?

#

like the title

ivory sleet
#

You’d use InventoryHolders to identify inventories. No they can’t

opal juniper
#

no - thats why people sometimes use the title

sullen dome
#

then why dont i just use the title

opal juniper
#

i have done it before

#

its not ideal though

sullen dome
#

well, i'll try it tho

#

well... is there actually a method for getting the inventory title? don't see one

ivory sleet
#

InventoryView

opal juniper
#

Its a method under inventory view

#

yes

wraith rapids
#

md69 in his infinite wisdom has decided that inventories do not have titles

#

inventory views do, however

opal juniper
#

(off topic) anyone able to answer a physics question

ivory sleet
#

Give it a shot

opal juniper
#

Its the worst worded question i have ever seen i think

wraith rapids
#

is that not like a kindergarten grade question

opal juniper
#

myes

#

i just cannot understand what it is asking me to do

#

and i have done about 50 of them so brain is gone

wraith rapids
#

it's asking you what the velocity will be in 2 seconds from being thrown

sullen dome
#

well, what i wanna do is basically smt like java if (event.getView().getTitle().equals(SETTINGS_MAIN.getTitle())) {

isn't possible right?

ivory sleet
#

Yeah

wraith rapids
#

at t0 it is 15m/s

opal juniper
#

yeah

hardy swan
#

and a = -10

wraith rapids
#

and each second it decelerates by 10m/s

#

what happens in 2 seconds

opal juniper
#

-5?

#

wait no

#

wait yeah

hardy swan
#

it is

wraith rapids
#

yeah, but flip the sign, apparently the question calls downwards velocity positive for some reason

opal juniper
#

oh you right

#

thats dumb as hell

wraith rapids
#

so you'd actually start at -15 and add 10 twice

opal juniper
#

yep

wraith rapids
#

seems rather silly but maybe it's some convention I don't know about

hardy swan
#

or just rmb v = v0 + at

opal juniper
#

i was expecting more of a parabolic shape than for it to just start going down

#

immediately

wraith rapids
#

well it is

opal juniper
#

yeah fair enough

wraith rapids
#

the actual position is

hardy swan
wraith rapids
#

but the speed is linear

opal juniper
#

but i thought it meant that they throwed it up like this

#

🙃

wraith rapids
#

they did

opal juniper
#

wait FlushedPoint

wraith rapids
#

as you can see, the location on the y axis is parabolic

#

but the speed is not

opal juniper
#

😑

#

im stoooopid

wraith rapids
#

the speed decreases at a continuous, linear rate

#

it starts at going up by 15

hardy swan
#

huh they ddin't state horizontal velocity

wraith rapids
#

and only ever decreases from that

#

they didn't no but horizontal velocity doesn't matter

opal juniper
#

🤷

ivory sleet
#
class Rivex implements InventoryHolder {
  final Inventory inv = Bukkit.createInventory(this, ...);
  //override getter to return inv
}
class Real implements Listener {
  @EventHandler void onClick(InventoryClickEvent event) {
    var inv = event.getClickedInventory();
    if (inv == null || !(inv.getHolder() instanceof Rivex)) {
      return;
    }
    //inv is your inventory (;
  }
}``` @sullen dome something like this might be worth trying otherwise. Wrote it on mobile so prone to errors
wraith rapids
#

downward acceleration is the same regardless of horizontal or vertical speed

opal juniper
#

oh well im dumb thanks though

hardy swan
#

that's what I meant by they didn't state horizontal velocity

wraith rapids
#

i suppose yes

sullen dome
quaint mantle
sullen dome
#

god

hardy swan
#

?paste

undone axleBOT
wraith rapids
#

don't use the inventory title

#

that is gay

opal juniper
sullen dome
#

obvly it is

wraith rapids
#

just compare the inventory or inventory holder

quaint mantle
#

i have copied that link but not ;D

#

sry

hardy swan
#

comparing inventory should be enuf

ivory sleet
#

It sometimes isn’t

hardy swan
#

wat times

wraith rapids
#

supposedly comparing holders is bad bad because reasons

#

hard refs to plugin classloader something something

#

but everyone does it anyway so it's fine

sullen dome
#

so... comparing holders is bad... comparing titles is gay... comparing inventories directly isn't working

so what would be good lmao

wraith rapids
#

it is working

quaint mantle
#

the mysql.async().execute() doesn't works idk why

wraith rapids
#

if you do it right

#

you just need to not do it wrong

#

if (inventory == myInventory) do shit

sullen dome
#

i thought you meant that tho

#

so my fault

wraith rapids
#

you just need to retain the inventory instance somewhere for later comparison

wraith rapids
#

comparing holders would be if (inventory.getHolder() == myholder) do shit

hardy swan
#

every time someone views the gui, you can recreate it

opal juniper
#

Use the way conclure made

hardy swan
#

using == is gay

ivory sleet
#

Well Bukkit might decide to just create a delegate of your inventory. Let’s suppose you have your inventory instance with the memory address a1. Now once an InventoryClickEvent fires Bukkit might decide to reconstruct or your inventory instance a1 (like a shallow clone sort of) so when you call InventoryClickEvent#getInventory you’d get a copy of your inventory instance (of course any trivial changes will be reflect onto the actual inventory) but this instance has the memory address a2 which also means we can’t use == comparison.

wraith rapids
#

as if inventories could implement equals in some sensible fashion

opal juniper
#

do you compare enums with .equals() then solar? or just in this instance

hardy swan
#

inventory is not an enum ?

#

just in this instance

wraith rapids
#

the thing is that bukkit doesn't decide to create delegates

opal juniper
#

get ya

wraith rapids
#

that's not a thing it does afaik

ivory sleet
#

Hmm weird cuz I did some testing for quite some time ago and from what I experienced it did.

wraith rapids
#

using holders is recommended against because that involves holding references to plugin objects inside bukkit/nms itself

#

which means that on plugin unload they need to either be evacuated, or you risk leaking the entire classloader

weary geyser
#

.equals() == ==

hardy swan
#

.equals should definitely be the way to go about comparisons... unless enum

hardy swan
opal juniper
#

🤨

wraith rapids
#

at least I've never run into bukkit creating delegates or wrappers for inventories

#

or really heard of that happening

#

or, well, maybe for things like chests?

ivory sleet
#

Hmm interesting I will do some tests and see if that was just a random occurrence

wraith rapids
#

but custom inventories that you open yourself, basically never

#

i could see a chest or a vanilla container being created a wrapper for

wraith rapids
#

but that's not a custom inventory at that point

tardy delta
#

is there some code to change the name above the users head?

wraith rapids
#

yes

ivory sleet
wraith rapids
#

inventory does not usually implement equals

weary geyser
wraith rapids
#

nor is there usually a sensible way to implement equals, beyond just ==

hardy swan
weary geyser
#

I was hinting at the base methods

hardy swan
wraith rapids
#

yes, but an itemstack is quite different from an inventory

hardy swan
#

is just targeting that statement

opal juniper
ivory sleet
#

Ngl it would certainly be nice if each Inventory had a persistent UUID.

tardy delta
#

no thats chat

wraith rapids
#

CraftX inventories do not implement equals

#

which means they delegate to Object::equals by inheritance

#

which is ==

hardy swan
#

but it shouldn't matter a class implements equals imo, that's the point of information hiding

#

just a better design practice to use equals() instead, but i get you

wraith rapids
#

i suppose you could use whichever, but in case of bukkit it doesn't really matter

#

it highlights that this inventory need to be this exact inventory

#

not a wrapper or a clone or a similar inventory

#

what if equals was implemented by comparing name and contents?

#

what does it mean for an inventory to be equal to another inventory, to begin with?

ivory sleet
opal juniper
#

implement it

hardy swan
#

ok also depends on implementor's intent

wraith rapids
#

point is that I don't know whether the implementor's intent aligns with mine, therefore I use the stricter comparison as that is what the actual API guarantees

hoary knoll
#

does bukkit.getPlayer return null when the player is not on the server?

opal juniper
#

Fair point

hoary knoll
#

the docs dont mention it

ivory sleet
#

Yeah

wraith rapids
#

if I open an inventory for a player, it is guaranteed that when events or queries happen about that inventory, it will be the same instance

ivory sleet
#

It’s null if the player is absent from the server

hoary knoll
#

ok

opal juniper
#

if you want the player object no matter what

hoary knoll
#

ok

#

thanks

wraith rapids
#

just know that if you query by name, it may make a blocking network request to mojang

#

so you should probably not do that on the main thread very often

hardy swan
#

deprecated

hoary knoll
#

im using uuids

ivory sleet
#

Paper getOfflinePlayerIfCachedfingerguns

wraith rapids
#

yes, but you can still use it even though it is deprecated

hardy swan
#

doesn't deprecated means

ivory sleet
#

It’s not deprecated for removal

wraith rapids
#

it is not subject to removal, it is simply there to act as a note for people who might not know about UUIDs

#

querying offline players by name is still a perfectly valid operation

hardy swan
#

ah ok

wraith rapids
#

bukkit deprecations are hardly ever 'we're going to remove this' deprecations

#

because bukkit never fucking removes anything

ivory sleet
#

Yeah compatibility

digital rain
#

guys is there a bug in 1.16 that keepinventory only affects a single dimension or is it an intentional feature?

wraith rapids
#

the rest is mostly "never use for any reason" deprecations, which you can use in certain cases for certain reasons and your use of them will still be perfectly valid

digital rain
#

so intentional ok i get it

wraith rapids
#

bukkit deprecations aren't really deprecations, they're little warning or reminder messages written on post-it stickers attached to the methods

#

which teaches the many new and aspiring developers learning development in the bukkit ecosystem some really bad lessons

hardy swan
#

then must as well, not deprecate it lmao

#

maybe a note or sth would be good

wraith rapids
#

nobody reads the javadocs

#

people won't give a shit until their compiler issues a deprecation warning

opal juniper
#

im not nobody 😠

opal juniper
#

I must have been dropped on my head as a child cause i dont really mind reading documentation

#

(as long as it is written well)

wraith rapids
#

normal people do read documentation

#

but normal people account for a pretty slim minority of the new and aspiring section of bukkit's developer base

hardy swan
#

i mean, how else would you know how to use the method lol

ivory sleet
#

Lmao

#

I mean Bukkit docs are filled with docs like
/**

  • this returns the team entry
    */
    Entry getTeamEntry();
wraith rapids
#

yeah, reading some classes it feels like they were machine generated

eternal night
#

we are just build different

hardy swan
#

no it is

/*
 * Returns team entry.
 * @return team entry
 */
opal juniper
#

built cool 😎

#

lmao

wraith rapids
#

built to hate

opal juniper
#

what a downer

opal juniper
#

i feel like NNY irl is a very polite person however once online he turns into a reincarnation of hitler

ivory sleet
#

lol

eternal night
#

I mean, there is some javadoc where you really don't need more.

#

Team entry isn't the best example but things like straight forward getters

ivory sleet
#

Yeah

opal juniper
hardy swan
#

LMAO

ivory sleet
#

Nonono

opal juniper
#

😈

hardy swan
#

use maven checkstyle plugin

wraith rapids
#

i am going to build an array of remote controlled mirrors

#

so I can concentrate sunlight on things

#

and set them on fire

opal juniper
wraith rapids
#

how many mirrors do you wager i'd need to set an aeroplane on fire mid flight

opal juniper
#

dafuq

#

well

hardy swan
#

the question should be how big of an area do you think you can get

wraith rapids
#

well yes

lilac dagger
opal juniper
#

assuming that you have the best tracking system and/or the plane is at a constant speed and all the mirrors are pointing at a 1cmx1cm area not very many

wraith rapids
#

i will be the modern day archimedes

wraith rapids
#

i'll declare myself a sovereign nation

waxen plinth
granite stirrup
#

You fucking monster

#

🤬

opal juniper
#

its not my code lmao

#

look @ the gist account

wraith rapids
#

issue with parabolic mirrors is that the focal length is fixed

granite stirrup
#

W h o cares

#

U showed it :)

opal juniper
#

lmao

waxen plinth
#

Right

#

Keep a set of them

wraith rapids
#

i suppose you can adjust it very slightly but doing that accurately is pretty difficult

waxen plinth
#

Some for cruising altitude

#

I feel like lasers will be better all around

wraith rapids
#

yeah I recently looked into some scalable laser designs

#

though it's pretty difficult to find any documentation for anything past the some hundreds of milliwatts range

waxen plinth
#

I have an idea

#

Why build anything on the ground?

hardy swan
#

can you actually repel moon with mirrors

waxen plinth
#

Sunlight is much less... diluted... when you're in space

opal juniper
#

MOON LAZER

waxen plinth
#

Make a satellite that focuses sunlight at planes passing under it

#

Put it in geostationary orbit over your sovereign nation

hot hatch
#
            Location exactLoc = child.getLocation();
            exactLoc.createExplosion(10, false);
            child.setCustomName("Goose");
            if (!exactLoc.add(0, 5, 0).getBlock().isSolid()) {
                child.teleport(exactLoc.add(0, 5, 0));

so this worked used to work 1 week ago same api 1.16.5 and everything but it doesn't work now, when i try to make a package it errors on me

waxen plinth
#

And it can cover your nation and also about half the world

wraith rapids
#

i don't live on the equator sadly

waxen plinth
#

Good luck shooting down that many planes at once though

hot hatch
#

oo you guys are shooting planes?

waxen plinth
opal juniper
#

That is what NASA is doing on the moon - They have a giant fucking lazer and they are cooking our heads

wraith rapids
#

well yes but not 100% of the time

opal juniper
#

Thats why i stay inside all the time NM_PeepoCrySip

wraith rapids
#

it would move north and south quite a bit

#

maybe I could build a big catapult

opal juniper
#

maybe... you should not...

just an idea

waxen plinth
#

Well then just send out a satellite that can use a solar sail or ion propulsion or something it won't run out of that pulls a big asteroid into earth

#

Big enough to wipe out cities but not kill every person, you know?

wraith rapids
#

ion propulson is trash

#

solar sail, maybe

waxen plinth
#

With enough patience

#

Anything can happen

wraith rapids
#

yeah it's only going to take a few million years

#

china will have killed everyone with covid Mk. XI by that point

waxen plinth
#

:+1:

hardy swan
#

tbf if not for this covid, I wont be playing mc

waxen plinth
hardy swan
#

mass extinction already in progress

opal juniper
#

so

#
exactLoc.getWorld().createExplosion(exactLoc, 10)

getBlock().getType().isSolid()
hot hatch
#

:/

opal juniper
#

np

lyric grove
#

how do i fix "Name cannot be null"?

ivory sleet
#

1.7 😮

#

well send entire stacktrace

#

?paste

undone axleBOT
lyric grove
#

this is the code im using

ivory sleet
#

ur world variable is null

#

or it points to null

lyric grove
#

oh sorry im stupid

ivory sleet
#

no worries

sullen dome
#

i'm getting an error on this:

if (!file_en.exists()) file_en.createNewFile();```

```console
java.io.IOException: No such file or directory```

ideas how to fix it? i mean...
granite stirrup
#

Lol

granite stirrup
sullen dome
#

doesn't it do that automatically? lol

#

thanks i guess

granite stirrup
#

No

sullen dome
#

fuck java

#

lol

#

didnt knew you have to mkdir yourself

granite stirrup
#

If u want to make directory's I do makeDirectory I think

#

There's a method to make the directorys but idk what it is

opal juniper
#

yeah mkdir

sullen dome
#

mkdir i guess

#

it's the datafolder tho xd

granite stirrup
#

Ye

opal juniper
#

make directory = mk dir = mkdir

granite stirrup
#

U either make it Ur self or use mkdir method

sullen dome
#
        if (!Challenges.getPlugin().getDataFolder().exists()) Challenges.getPlugin().getDataFolder().mkdir();

        try {
            if (!file_en.exists()) file_en.createNewFile();
            if (!file_de.exists()) file_de.createNewFile();
        } catch (IOException e) {
            e.printStackTrace();
        }

guess this should do it?

unreal quartz
#

you don't need to check if it exists

sullen dome
#

k

unreal quartz
#

the return value of mkdir and createNewFile indicates if it was created or not

sullen dome
#

yeah it works. ty

light terrace
#

How to fill the player.setGameMode(); is it "creative"?

@Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (command.getName().equals("gmc")){
            Player player = (Player) sender;
            player.setGameMode();
        }
fringe oak
#

GameMode.CREATIVE I guess

#

It's called enum

opal juniper
#

Yes, Exactly. Just Choose a GameMode enum

rocky hamlet
#

Hey, I got this code so far, whenever you join the server, your inventory gets filled with boats. Ive got a few problems tho, when you die, I want it to fill again, and when you rejoin it should fill again. Another thing is that when someone steps on a pressure plate or something similar it should reset. Thanks

#

@EventHandler
public void handlePlayerJoin(final PlayerJoinEvent event) {
final PlayerInventory inventory = event.getPlayer().getInventory();
for (int i = 0; i < inventory.getSize(); i++) {
final ItemStack item = inventory.getItem(i);
if (item == null || item.getType().isAir()) {
inventory.setItem(i, new ItemStack(Material.OAK_BOAT));
}
}
}

#

And the last problem is that every single slot fillst, also armor slots, all I want is the inventory without the offhand

opal juniper
#

The way that you are looping solves the last issue

#

but you just need to listen for more events

rocky hamlet
#

Well I know a bit about coding but not much. I had help from someone else, could u tell me what to replace in the plugin

opal juniper
#

Well, you have an event listener

#

and you need to add more events to it

rocky hamlet
#

How?

light terrace
opal juniper
opal juniper
#

maybe some1 else can help

foggy bough
#

I have a class that lets me change skins but how do I add it to a runnable that is in my Main class? ```Bukkit.getScheduler().scheduleSyncRepeatingTask(this,
new Runnable() {

                @Override
                public void run() {
                    
                    
                }}, 0L, 1200L); ```
granite stirrup
#

try BukkitRunnable?

foggy bough
#

can I do this? ```private SkinGrabber sg = new SkinGrabber(this);

Player player;

public void onEnable() {
    System.out.println("YT is enabled...");
    Bukkit.getScheduler().scheduleSyncRepeatingTask(this,
            new Runnable() {

                @SuppressWarnings("static-access")
                @Override
                public void run() {
                    sg.changeSkin(player);
                    
                }}, 0L, 1200L); 
        
    
    
}```
granite stirrup
#

Just make sure there's nothing bukkit in changeSkin

rocky hamlet
#

can anyone help me with my problem above

granite stirrup
foggy bough
#

is that bukkit?

granite stirrup
#

No I mean anything in the method run can't be anything bukkit

foggy bough
#

oh ok

granite stirrup
#

Change skin method doesn't contain bukkit stuff right

foggy bough
#

I have this in change skin ```java
public static void changeSkin(Player player) {
GameProfile profile = ((CraftPlayer)player).getHandle().getProfile();
PlayerConnection connection = ((CraftPlayer)player).getHandle().playerConnection;

    connection.sendPacket(new PacketPlayOutPlayerInfo(
            PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, 
                ((CraftPlayer)player).getHandle()));
    
    profile.getProperties().removeAll("textures");
    profile.getProperties().put("textures", getSkin(player));
    
    
    connection.sendPacket(new PacketPlayOutPlayerInfo(
            PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, 
                ((CraftPlayer)player).getHandle()));
    
    
    
}
granite stirrup
foggy bough
#

ok

granite stirrup
ivory garnet
#

hi, how can i detect Lore one a item

#

example : item.getItemMeta().getLore().equals("my lore") but its a error

granite stirrup
#

U can't just check if it equals a string

#

Or is it a collection idk

ivory garnet
granite stirrup
#

Loop through it and check every line idk

ivory garnet
#

yes but how can i do this ?

granite stirrup
#

Learn java lol

#

Use for loop

ivory sleet
#

?learnjava 🙂

undone axleBOT
ivory garnet
#

thx

#

@granite stirrup so i do that ? if(item.getItemMeta().getLore().get(0) == "my lore")

granite stirrup
#

U could but if u want to check every line you would loop through it

ivory sleet
#

.equals("my lore")

granite stirrup
#

Maybe use .equals also

#

.equals is different to == I don't know how to explain it sometimes .equals is technically more accurate but u can't really say that

eternal night
#

Yea, Object#equals should compare the actual content of an object and return if the content is equal. == only checks if the identify of both objects are the same. aka the object is actually just compared to itself

granite stirrup
ivory sleet
#

yeah

eternal night
#

well on objects yea, tho I don't think that is actually defined. pretty much implementation detail

#

primitives are a different story

granite stirrup
#

Lol

#

So .equals is if u have a string it actually compares whatever text u put and mostly == is memory stuff ?

ivory sleet
#

well you could actually do smtng like
boolean isSame = str1.intern() == st2.intern()

eternal night
#

could dumb it down to that yea. One is content the other identify

#

don't you bring the string cache into this

ivory sleet
#

🥲

granite stirrup
#

Lol

smoky oak
#

Is it possible to simulate a player being 2.5 / 3 blocks tall?

granite stirrup
#

teleporting and Armor stands?

#

to detect collision

#

u teleport when the armor stands collide

#

but u will have to do some math

#

to figure how far to go back and stuff

#

probs not worth it

smoky oak
#

how about a onPlayerMoveEvent?

#

could that work?

granite stirrup
#

maybe

smoky oak
#

probably simpler to code but it would end up unprecise

#

wait

granite stirrup
#

u will still have to do math and stuff

#

and u have to use armor stands still to figure out the collisions

smoky oak
#

i know i can grab the players location and everything but is it possible to find out if a specific point in space is air?

granite stirrup
#

yeah u can get blocks and check if its air

#

it requires a x,y,z cord

smoky oak
#

no i meant coordinates with comma

granite stirrup
#

i think

smoky oak
#

so that i can see if a specific point is air even if the upper half of that block is I.E. a slab

granite stirrup
#
if (player.getLocation().getWorld().getBlockAt(0,0,0).getType() == Material.AIR) {

}```
smoky oak
#

well that works only for full blocks

granite stirrup
#

if you wanted ```java
public Material getTypeOfPoint(World world, int x, int y, int z) {
return world.getBlockAt(x,y,z).getType();
}

World world = player.getLocation().getWorld();
if (getTypeOfPoint(world,0,0,0) == Material.AIR) {

}```

granite stirrup
#

it says Gets the Block at the given coordinates

smoky oak
#

i think you got the idea. I want to target a coordinate given by float values and see if that point in space is , quote, 'air'.
As in if i target a slap block, depending if i target upper or lower half itll tell me 'true' or 'false'.
Also, thanks for linking the method I'll see if it could work

granite stirrup
#

just try it and see if it works if it doesnt idk then

#

also u can get a block at a location lol