#help-development
1 messages ยท Page 1928 of 1
Its free, try it lul
It looks like it's only free for 30 days
Well known last words
Don't use free products for the sake of them being free.
its Freeโข๏ธ
Free most of the time means shit
I heard something about it being free forever
So did I
It actually might be I think I read it wrong
Probably a small ammount for free, pay to get something worth using.
eternos ๐
Ask @onyx fjord
just get your own VPN ๐
Like oh you did all this hard work and its too slow? Pay us monthly to actually use it.
Eh, for a maven repo it doesn't need to be that fast since you are going to serve mostly static content
I do want to have somewhere to setup some CI and a Maven repo I just need to get around to doing it
I use Hosturly for my dedis, they do vps's as well iirc
So itd be good to develop on then upgrade/transfer.
gitlab + its runners are quite easy to setup
Well yeah, GitHub's actions are good too
10 players is assuming no plugins I imagine.
and yeah for the repository, definitely go for nexus :3 it's indeed the best
no idea, never used them
Nexus has always been on my mind, ye. Just seems standard
what u want
Need to look more into like... hardware requirements
I'd say that the only limiting factors are I/O speeds
this is basically only running nexus + some tiny other docker applications. so yeah I'd go for at least 4 GB of RAM, but other than that, it's basically just idling
Talking about that free stuff from oracle
Yeah that's not terrible
If I spring for 8 gigs or whatever I could use it as general purpose on top of that
ye whats about it
Idk, how much it does or doesn't suck :p
how do i stop the extra [Name] 16:41:19 INFO]: [WhitelistPlugin] [Discord Control Panel] has loaded!
File explorer
what extra Name?
[WhitelistPlugin]
the first one is your plugin's name, the second one you added yourself
Don't attempt it
can i remve plugin name
now why would you want to remove it in the first place?
colors in the console are not only useless but also annoying for admins
just don't do it
k
Don't
noone wants to see a huge colored banner
Bukkit.getConsoleSender().sendMessage supports color codes
its not a banner its just a ready message but ok
atleast on windows cmd
Shhhh
And using Logger.getLogger("Minecraft") is also a really bad way of doing it since admins cannot disable the logger afterwards
i did it before and now i stopped doing it so maybe yea
so getLogger().info("has loaded!"); isnt good
So if your logger would be spamming unnecessary shit you wouldn't be able to disable it traditionally
clearly the real trick is to set your plugin name to nothing
getLogger() is plugins logger
is there an easy way to get the namespace'd id from ItemStack e.g. modname:some_ore, there's BlockData#getAsString I've not touched Spigot's API in ages and everything I search returns magic values before flattening~ Solved: item.getType().getKey().toString()
So, Logger.getLogger("Minecraft").info("[MyPlugin] Has loaded!") isn't good
k
chaining isnt good either
getType.getKey iirc
it must be [A-Za-z0-9_]+ ๐ฆ
remember kids dont make protected stuff public
But why tho
Why not
lmao Bukkit.getOfflinePlayer(uuid) executes a bunch of code
is there any other way to exit an inventory that inventorycloseevent doesnt cover
NOP probably
thanks, even Micrsoft's AI couldn't have figured that out, guess no one uses it.
crashing the server prob
System.exit(0) probably
doing it in the prelogin so it doesnt block the user from entering the server long
that's what methods are for
uhu i hadnt expected it to do that much
Pfft make them wait
well it doesn't really do much
public OfflinePlayer getOfflinePlayer(UUID id) {
Validate.notNull(id, "UUID cannot be null");
OfflinePlayer result = this.getPlayer(id);
if (result == null) {
result = (OfflinePlayer)this.offlinePlayers.get(id);
if (result == null) {
result = new CraftOfflinePlayer(this, new GameProfile(id, (String)null));
this.offlinePlayers.put(id, result);
}
} else {
this.offlinePlayers.remove(id);
}
return (OfflinePlayer)result;
}
๐
whut?
public Player getPlayer(UUID id) {
ServerPlayer player = this.playerList.getPlayer(id);
return player != null ? player.getBukkitEntity() : null;
}
Lmao
Just wait until he sees the MinecraftServer constructor 
as long as it is only some io it is discardable
That isn't offline
There is far worse stuff
whoa
that's the method that getOfflinePlayer calls
with a string as paramater i think
heh i found the Main class
so would getting an offlineplayer and calling hasPlayedBefore on it be faster than looking for the player in the embedded database?
how to check if an nms method or field exists in all mc versions
or it has a different name or whatever
Doing it the bukkit way is probably going to be faster when there are a lot of plugins around
should i decompile every version i want to support ?
If you use maven you should technically create a module for each version you want to support
Even if the method exists in different versions, they can be obfuscated into different forms
where exactly is that?
I think I once looked it up and couldnt find any web requests
The string version
i also looked for it but couldnt find it
It's deep in there
basically yes lol
the docs dont say anything about web requests
it onyl says that getName returns null if the palyer hadnt joined before
ugh my writing
you can keep the typos
The docs do
Gets the player by the given name, regardless if they are offline or online.
This method may involve a blocking web request to get the UUID for the given name.
This will return an object even if the player does not exist. To this method, all players will exist.
oh wait
you are using getOfflinePlayer(String)
I was talking about getOfflinePlayer(UUID)
typical humans
literally monkeys
pft, recaf also does the trick
oh you don't need 1.16.4, and 1.16.3, 1.16.2 etc
you only have to decompile the versions with a changed NMS package name
e.g. 1.16.5 and 1.16.4 are both R3 so you only need one of those
and you can basically ignore 1.15 - it's only used by 0.7% of people
all you need is basically just 1_18_R1, 1_17_R1 and 1_16_R3
I'm kinda surprised 1.8.8 is so low
are these enough ?
and remember than you can use mojang-remapped for 1.17+ which means - no code changes needed except for tiny things (e.g. in 1.17 it's ServerPlayer.connection and in 1.18 it's ServerPlayer.connection.connection)
I wouldn't worry over 1.14.4 and 1.15.2 at all
its ancient ... and no one knows that its more and more too outdated
as said only 0.7% still use 1.15.2 and basically noone uses 1.14 according to bstats
well im forking someone's plugin
and i want to remove protocollib and do it with full reflections
check this: https://bstats.org/global/bukkit
I just figured it's percentage would still be higher.
1.8 is like 8 years old
still the best pvp version
(1.8 is trash its just for cringe 1.8 pvpers i pvp 1.9)
your opinion.
no discussion about that again pls xD
.
i seriously hate 1.8 pvp
my first public plugin was for 1.13 because that was the update that broke all plugins because somehow developers ignored the @ deprecated annotations for years lmao
Mine was 1.12 for some reason
Yeah I think 1.8 is lower than it seems because there's more 1.18.1 servers, but the 1.8.8 servers are just more popular.
and the performance of 1.8 is way better than 1.12.2
So 1.8.8 servers are more prominent than 1.18.1, Hypixel for example would only add like 1 to 1.8.8 but it's got thousands of people lol
1.16.5 still a beast tho
we are running a bedwars server with 500+ players and still 60% usage
yeah because once again people keep using outdated versions because their plugins didn't get an update with the NMS changes in 1.17
i think i would
1.16.5 is not outdated ๐
everything below 1.18.1 is officially outdated ๐
Whats wrong with 1.18.1
people always keep saying new versions are trash because they like to stay on their oudated versions
both server and client
nothing at all
high system usage both client & server
well if you want to run a server for 100 players and only have 4 GB of RAM, then sure that won't work in modern versions
but instead of saying that 1.18.1 is shit, maybe just upgrade your server
the most up to date version we are using in our server is 1.17.1, survival gamemode, 100+ players and 20.0* tps
you can achieve the same thing in 1.18.1
i dont think 1.17+ is trash... it just that i cant play 1.17+ so i choose my main to be 1.16.5
Why can you not
same
trash laptop
getting 60 fps on 1.17 with arch linux
ARCH LINUX
some random shit ass with the cpu graphic driver
sometimes 40 or 30
FPS is meaningless
60+ is meaningless for 60hz monitors
It's only meaningless after your monitor cap
according to what i've seen, the intel graphic driver that was required is intel gene 3000, while mine is the last in gene 2000
Especially if you stayed with 10 - 25 fps all your childhood
this is about 70 players on 1.18.1. not really causing any lag lol
- cries *
why putty
why not?
wrong reply
@quaint mantle what's wrong with putty
It honestly depends on what your server is doing also tho
Survival vs Minigame servers, one is going to be harder than the other
there are better clients
it's regular survival with default view distance etc
for example?
thats my ssh client, looks cool enough ?
and how is that better than putty?
I just use whatever terminal I have available for ssh, I don't see why anyone would be selective about this
its just a command
exactly
on linux I use openssh, on mac I use openssh, on windows I use putty
same but putty looks ugly for me
are you happy now? ๐
sexy
btw I am crying
why did I install ubuntu 20 on so many VMs
I just remembered that ubuntu is a pain in the ass to do dist-upgrades
I should have sticked to debian 11
Just use fedora
wtf is the background behind the window
ugh
Heh
Stromberg
To be honest, I should really look how fedora works in a server env
I don't think rolling releases are good for servers
but that's just my opinion
I basically only use debian 11 for servers because their upgrades are straigtforward, or ubuntu because of the long LTS times
I recently upgraded a server from debian 8 to debian 11 without any problems
Most of my problem with rolling releases have been associated with audio and graphics, so I don't think it won't have any too grave consequences in a server environment.
Could someone send me the build.gralde for Java 8 and Spigot 1.8.9? I cant find anything on the web about it
upgrading an ubunto system is way better then fucking windows ... i almost have to reinstall windows every year because of those fucking updates
i refuse to update to win 11
imo the style sucks
and from looking at screenshots of for example explorer there are less features on the surface
like you have all this shit in win 10
and then in windows 11
Use linux
what would the arguments of the event be?
id like to but i feel like im going to struggle and i just want to use my pc
also i heard some shit about companies giving linux shitty support
like didnt fucking nvidea refuse to make drivers
i do like the icons of win 11 tho
They refused to open source them
Some distros are difficult to install and use, but some are dead simple
i have this:
What features
idk i thought i heard that it lacked features but that might be wrong
Ok but what features are you talking about
idk i think it was like resolution on multiple monitors
Because I'm not aware of drivers being particularly feature-rich, at least not in a way that users would notice
My friend has 9 monitors and it works perfectly fine for him
ok then im wrong
In NVIDIA drivers you have nvidia shadowplay
And I have obs
you can't do instant replays with it
Thanks to the hard work of volunteers on OBS Studio, it now includes the powerful functionality of scripting. More on that here.
This has enabled a very cool feature: Instant Replays.
This guide will go over how to setup an instant replays It...
lol
also idk why when I play MC 1.8 on linux the mouse is messed up and it doesn't register clicks
Doesn't register some, or doesn't register them at all?
I've never had that issue but there's probably a fix for it
But you know, when you use a version that's 7 years out of date that's no longer supported...
?jd
for meself
Wrong server
big doubt
Resource pack
that looks like bedrock
entity is puffer fish
I assume there is an armor stand in there too
Java 17.0.1 64bit
you just remodel it
dragon is animated
No idea what the pufferfish is for
modelengine or msht
I don't see it
you dont see what--?
on f3 info
why would you see the plugin
you can see armor stand on player head
so i was wondering how you can teleport a player to a location reletive to there coords lke 1 block on the y level where they are
get the players location and add
yes but im having trouble with the types like to add it needs to be double but to teleport it needs to be uh location im trying to cast but yeaa
wtf..
Location#add
location#tovector
Why would you need it as a vector
no clue
hey i was sitting there
50 rubies bad
I am curious how that works
It's an armor stand
Hey, is there any method that's used to get the server seed?
i thought of the wrong thing nvm
?jd
WorldInfo#getSeed
thank you!
World should extend WorldInfo so yeah
It does.
gotcha
Does anyone have any idea as to why this event isn't working? Can events not be in the main class?
Forgot the EventHandler annotation
dispatching the ban command hmmm
made it so it works with whichever ban plugin is installed
seems like it doesn't work at all though haha
does a custom map also has a seed?
i'd think a ban is sufficient if the players openly tries spreading the seed in public, it's for my own server
Yes, but the seed will not generate teh same map
ah right
Oh if it's for your own that's fair
makes sense
But otherwise that'd be way overkill
that's true
what was the best way again to execute multiple sql statements? executeBatch?
If they're same
wha-
Yeah that depends entirely on what statements you're executing
If they're the same statements just with different prepared vars, executeBatch() is what you want
table creation
How can I autocomplete commands?
like different tables, which may been created already
just dropping it here, maybe it's useful for someone https://www.spigotmc.org/threads/arnuhs-armorequipevent.545188/
Worth noting that an EntityChangeArmorEvent is about to be pulled into Bukkit for 1.18
IIRC a PR existed for years already
but it was never merged
Yeah because he hadn't updated it
it would be awesome if it was actually added now
It's up to date now with master ;p
I only forked the existing ArmorEquiopEvent because there was no maven repo for it
that's paper only
L
that would be annoying lol
why?
because you made it
I didnt made it
the code was originally written by someone else
I just decided to maintain it now
because I use it myself and it'd be a shame if it'd die now
How do I get length of args?
Is their a way to fix the KB so players donโt get pulled towards the ground in a Spigot Plugin?(I want the KB to be like vanilla, not a vanilla server I donโt want to change how high a player goes)
I want to make a playsound command, how can I transform the string from the command to a sound?
isnt sound an enum otherwise you could use valueOf
wdym by that
it is an enum
yeah they are enums https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html
declaration: package: org.bukkit, enum: Sound
so you could take whatever your input for the command is and play it
like this, if you do Sound.valueOf(string.toUpperCase()) it can get a sound constant
like if the user enters ambient_cave
probably best way to do that is a tabcompletion
is there a entity move event
make sure to catch any exceptions
PlayerMoveEvent but im not sure for entities itself
cant find it
I think paper has an event for that?
That sounds like a super dangerous event tbh
declaration: package: io.papermc.paper.event.entity, class: EntityMoveEvent
oh I'm blind
54% of minecraft servers moment
question
is it better to have 1 runnable repeating every tick and looping through all entities
or is it better to have all entities have their own runnable
one runnable
server? sure, but using paper for plugins eeeeh
no thx
really?
yes
i thought the loop could cause some problesm
why?
because of looping through all the entities..
Dont loop through players
you'd "loop" through all of them anyway, woludn't you?
there's nothing wrong with looping through all entities every tick unless you do heavy stuff
the server itself does it anyway
You miss player profile api, full component support, pathfinder api, async chunks...
im planning to assign a armorstand holding an item and teleport it to the entity
so not really heavy
how do i delete/reset the JAVA_HOME var of intellij?
iirc idea doesn't set any environment vars itself, does it?
do you just want to change your java version in intellij? Ctrl+Alt+Shift+S
it loops through all tasks and executes them
i think
so it should be no different
Btw can I just save an entity as a variable?
also one task more memory efficient
?
not sure. my JAVA_HOME env var is set to the right JDK version but my intellij still takes java 8 as JAVA_HOME
you mean it ticks when the entity ticks?
the runnable?
okay so uh im just going to explain what im going to do
How do people learn to do module stuff? It's legit so complex
i have a map that has a Entity and an Entity
the first entity would be a redstone silverfish and the second one would be an armorstand holding a redstone block
im planning to teleport that armorstand to the back of the silverfish so it will look like it has a redstone block in its back
ok
How is it complex? If maven then it is even easier than anything in the world beside eating and pooping bruh
nah not too hard
can I just assign the first entity when it spawns and it will update all the way through
it simply breaking down the code into parts
i dont know
maybe by making it a passenger
but i think your best bet is just updating all entities in the map every tick
ig
The lack of experience of doing it is hardest
What are you struggling with about it?
make like a chart of whats going to depend on what like:
api -> core -> bukkit-plugin
``` and then implement it
wdym module stuff
I can't wrap my head around it, I guess once I understand how to do it then i'll understand but it's the build.gradle and gradle.settings is where i'm like "wtf is going on?"
@tender shard
settings.gradle is for the root project and tells it what modules it has
pretty sure thats just your OS's java
build.gradle is per module
and configures the environment and build process for them
like dependencies, compiler options, etc...
but intellij doesnt take that
huh weird innit try restarting your computer?
Am I dumb for finding this hard?
good point
do you really wnat the answer to that?
believe intellij is capable of overriding it
well locally
im sorry
but why would it
and how do i prevent that?
and/or delete it?
i will just switch to notepad
luzifer, do you have intellij?
believe you should be able to change in project structure
and make yourself a computer
so you can make your own IDE work with your own computer and OS
yup
so it will be efficient
tried, but it didn't even get showed there
if you use maven then u might wanna look at this
conclure whats your theme
gradle rn. maven and gradle runner set to 17. still crying for JAVA_HOME
why do you need to change JAVA_HOME?
idk
can you... like.... check it?
material oceanic, lol.
i already did
did u change java home before or after entering intellij?
screens are in this chat
while. then invalidate cache and restart
restart your computer
^
just try iot
if this doesnt work switch tpo notepad
restarting my computer takes 30 mins
you got no better option
this is strange
and shouldn't be necessary
already did, sadly its not mine so it didnt worked
make the person give up on the project
buy a new computer and compile it there
so...
I updated intellij
(famous last words)
anyone know why intellij cant recognize the file type of config.yml every time i make it its so annoying to do override file type every time
it recognizes plugin.yml as a yaml but not config
and what do u use
intellij
trusty notepad
and it is the worst
and if you dont think it is the worst
im sorry
but you're in denial
well what else am i supposed to use?
no clue
the only reason people use intellij is becuase its the only option
hows your packages shiny
shiny?
So I
how do you get all of the player's rendered chunks
So I'm using TextInputDialog to display a dialog in javafx but how can I make it so if the input it wrong it reopens the dialog? I've tried using a if statement but that just doesn't reopen it
but how-
actually nvm
- ya dont
- why
its git ignored files
ohh
i should probably store all my stuff to git before intellij somehow manages to corrupt em
trying to make it so certain blocks are invisible
yeah ik but i need to know which blocks to change
oh wait im retarded it only needs to be like 6 blocks away from the player
...
i dont need all their rendered chunks for what im trying to do
lol
anyways how do u get all the blocks in a certain radius from a player
ig loop through it
input.setHeaderText(null);
input.setContentText("Pick a number from 1-10);
input.setTitle("Please enter a number");
returnValue = Integer.parseInt(input.showAndWait().get());```
Not sure why you are asking here
wait for the input, check it, reopen if wrong
Another Java focused discord can prob help a lot more
Isn't there a more efficient way?
no
you can wait efficient for the input, check it efficient and reopen the dialog very efficient
it's not inefficient
Is there any way to get the tool used to damage from a EntityDamageByEntityEvent?
Get the damagers held item
is there a way of making a block invisible to a player but have it apply normal block physics instead of the little lagback things?
Make it a barrier client side
Oh yes of course, thanks ๐๐ป
Anyone know why console throws me an error when I run a command?
but i dont want them seeing the outline
Uh there is an offhand slot to
So if he used it's sword with that, it wouldn't work
You can't attack with offhand
so how would i make it so the outline is invisible
ig setting it to air works but i dont want to have the weird lagback thing
Oh yes of course, quite stupid of me
lol
Do while loops do anything in javafx programs since the instance only runs once?
anyone know how to get the previously held item in PlayerItemHeldEvent the event.getPreviousSlot() seems to be just spewing random numbers lol
is batter to have one event and then execute code with ifs or to have multiple implementations of the same event
i usually use implementations but it just depends on what ur making
ok, I am making a plugin for everything bassiclly ;)
Using ifs will be slightly faster
anyways anyone know what the hell is going on with this
this is what i get from just scrolling in one direction
not exactly in order
like when i press 5 to go to the 5th slot it sometimes does 8, 3, etc.
thanks for suggestions, I will keep multiple implementations way
Target block or whole view
I donโt think thereโs a method for it
Oh you can just loop around in that case
Like loop all blocks in radius
but i need blocks that have faces shown to the player
and i dont feel like doing raytracing cuz rip server
Mhm true
Then youโd have to deal with caves ye
Iโm unsure if thereโs a server efficient way
?xy
Asking about your attempted solution rather than your actual problem
Vector lineOfSight = player.getEyeLocation().getDirection();
Maybe u can make a for loop with displacements
what if i check for blocks that have air next to them that is on the side closest to the player?
U might need normalize() too
How do I open an inventory to the sender of the cmd?
p.showInventory(Inventory)
lol
Or openInventory
Ok
What's the issue here?
Cast to player
What does the error say lol
In the method
i think thats right params
Or just put null
but the issue is not that
Inv owner is dumb
is when using sender
You can open the inv to anyone then
Just make a Player object
Player p = (Player) sender;
check instanceof Player first tho to make sure it isnt console
if(!(sender instanceof Player)){return true;}*
anyways how tf do i do this
nono
Yea mb
wait
go for BlockFace
wdym
wait RL round started
lol
lol
?
what exactly are you trying to do
Yea
make every block thats not in player view appear as air client side
R u making a client?
Ah
anti baritone
Theyโll just, check for the block behind the air
if the client cant intercept the packets that there are blocks there, then it cant pathfind to stuff like diamonds
so like an ore obfuscator
pretty much
but theyll appear if they are in player view
so someone could still go mining legit and find them
so do orefuscator
isnt that.. legit what antixray/orefuscator is?
Just send fake ore packets
dont waste time doing that, you should go for paper's builtin or orefuscator plugin
baritone moves the head around
So?
what if they were just mining lol
I meant next to the packet ore
kick them for the next 10 days is not the same as banning them 10 days right? right? ๐
Like, if they mine a block next to the packet ore quickly in a row
It means they cheat
i think i should never ban anyone, should just kick them pernamently
you'll have to iterate over the blocks near a player over and over again if a block updates
Check when they mine and loop in radius 1 around mined block
but see what if it was just some random person strip mining
and they happen to go where the packet ores are
i feel like all those iterations could take a lot of time/lag
Thats what im saying, multiple times quickly is suspicious
It can happen sometimes
But not all the time
not really. you don't have to update const.
For legit ppl
the sent packets stay
Yea
you'll just have to update if the player moves
Or pickaxe swing
not really if he's air'ing everything
isnt there a blockbreakevent or smth lol
Yes but pickaxe swing can be used in a diff way
Like, get target block behind
If fake ore
Flag
If flag > 5 kick
Reset flag every x seconds
I prefer the anti-xray that spams ores everywhere and lags out the hackers
xD
mhm
Create solution? โ
Never even start server? โ
Modern problems require modern solutions
dont sent any packets about ore at all
If they do then they won't see any ores
win win?
no more lags
I dont think theyโre distinguishable
How?
This is why you modify the main outgoing packets
There would be way to many false positives
Yea lmfao
sure but you would still see some ores
How about new chunks
Also you're assuming that they send the valid ore locations but they dont
and i bet the world packets are sent before some orefuscator packets
It's a smart way to prevent any workaround
ah
never really looked at stuff like that
i mean its not really complicated
Its funny to get in to tho
my ego wants to find a bypass
Like bullying ppl with fake tnt packets and seeing them fly from another acc outta nowhere is hilarious
use resource pack, replace diamond ores with stone.
The only ores you could really detect are the ones on the walls of caves
force that resource pack, if you're not going to use it = you get kick
The heck is create
Lmfao imagine if the client used an xray texturepack with image recognizing ๐
But that only solves xray
Not baritone
U can put ur own txtpack over the one required
hack prevention prevention seems funny
how can I set the note of a noteblock
going to be a client dev soon
After placing or while in inventory
You can modify the BlockData of the block as a NoteBlock
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/data/type/NoteBlock.html
I don't think you can change it in the inventory, Elmo
after successfully prevent the hack prevention, i prevent the hack prevention prevention
This for while place, else nbt
It's not a tile entity, it doesn't have NBT for that
I think nbt can?
Not sure
Oh
It used to be a tile entity I believe, pre-1.13, so it may have been possible then
is there a way to set a custom note value to a noteblock
But yea theyโre not tile entities
instead of using Note
Texturepacks
With custom sound
no like
im going to use that
but to set the note of a ntoeblock
it says I need a Note.Tone enum
is there anyway to do it without it
Maybe, but why
Yea why would u
because I need to add an extra note
How are you planning on doing that
Ah
You can't add a new block state
Yes
i had hope
wait
okay
can I not add a new state or can I just cant add a note over 24
because if I can make it voer 24 i can just play the sound myself
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
You cannot add a new state
so I can set it over 24?
ugh
What is better practice and less consuming for server preformance
getting player:
ServerPlayer sp = MinecraftServer.getServer().getPlayerList().getPlayer(u);
or ServerPlayer sp = casting Bukkit Player to Craft Player and using getHandel ?
Probably just casting
eh there are like a billion different noteblock states
if i change one so uncommon no one will ever notice
hopefully
Change all of em and reimplement noteblocks yourself
i mean, both really isnt.
casting is bad and get the player by the players list is just iterating
i would go with iterating
still I need to check if player is null
Why is it iterating
going thru all the players until it finds match?
shouldnt be a problem
Map?
is it map?
today i am realizing i might not know how maps work
it is a Map
Maps are not iteration
free lessons for you
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Yeah, so not iteration
how do they get their value then
Hashcode based
hmm
I mean I guess there will be some iteration in the event of a hash collision, but those aren't common
You are casting a class to itself in this case
to rotate fake armorstand
Player is always a CraftPlayer
How do I put a player head with skullowner nbt in an inv
because craftP is the only imple of player
paper api
How do I put an nbt on an item from an inv?
That is built on spigot
technically still bukkit
Paper still uses CraftPlayer
someone :c?
?pdc
yeah
hmm
Hey, is there some event for when shulker gets destroyed by fire/cactus and so on?
Anyone know a fix?
internally it looks like something like HashMap#get is close to the behaviour of iterating through a linked list
"Declare repository providing the artifact"
still iterating
it goes through until it finds the one it needs, like u would do with an array, no?
Wait can I use chests for the extra note?
since chests are a blockentity
A hashmap is divided into buckets at each hashcode mod the number of buckets
Each bucket functions basically as a LinkedList
I should be able to technically retexture it
So it iterates the contents of 1 bucket
It doesnโt iterate the buckets
It computes exactly which bucket the key has to be in
And then checks that bucket
coll?
Can you change the number of buckets
As buckets grow in size, the number of buckets increases and the entries are shuffled around accordingly
Thatโs why a hashmap get is an amortized constant time operation
I was going to say custommodeldata but im pretty sure blockentities dont have that
Correct
What is the compatibility with api versions? Trying to run my plugin and its unsupported api version 1.18 im running 1.16. If i compiled the plugin against an earlier version than 1.16 would it work in that case then
how i can make a knockback effect to all players around the block?
like a explosion effect but not an explosion...
well actually its not that important to use 1.13
but most people do that
ask @tender shard
oh thats weird i thought it was something else cause it worked on 1.18 servers
A plugin with API version 1.18 will not load on any older version
Even if itโs technically compatible
Get all the players around the block and apply a velocity
minecraft is pain
will a plugin on 1.14 api version load on any newer version?
Yes
ok cool
it should load on anything >=1.14
but i want a velocity relative to block face (direction of player)
Thatโs fine?
eg: if north -> velocity effect to north
Use vector math
Compute the vector and apply it
how?
Subtract the players location from the blocks location.toVector
Or the other way around, I never remember
That should do it
Youโll also want to normalize and apply the factor you want in order to get the right power
Then you can normalize and multiply it however you want



