#help-development
1 messages · Page 1541 of 1
example?
my.file.ext
true
hmm is there a way to like give a player ghost potion effects
like the potion effect icon shows up but the effect isnt there
I want to make it so that when i click on hoverable text, i can make a new instance of a class
I could also use replaceAll
i can't think of a simple and easy regex off the top of my head that'd handle all situations
you'd need negative lookaheads and shit
how do I use the paste bot to share an error
(.*)(\\.[^.]*)?^ might work
?paste
thanks
although that matches both the filename and the extension
the extension, if present, will be in group 2
the filename will be in group 1
im getting this I think when I set velocity. Also subsequently I get "cannot send chat message" when I execute a command or chat. And also the player that causes this error is invisible to others on the serevr https://paste.md-5.net/zafihuveve.apache
so str.replaceAll("(.*)(\\.[^.]*)?^", "$1") should maybe do the trick
i think its from in here ? https://paste.md-5.net/obevejahil.cpp
cannot send chat message usually means you have chat turned off in multiplayer settings
i can send from other players
yeah i haven't actually looked at anything you've said or sent but that's the usual cause of the message
and prior to running snowball() I can chat
mildly disconcerting
????????????????
I just used \.[^.]*$
yeah does anyone know about this??? where to start lookinghttps://paste.md-5.net/zafihuveve.apache
needs full error
isn't that helpful 28.06 15:00:50 [Server] INFO at net.minecraft.server.v1_16_R3.ChunkMapDistance.b(ChunkMapDistance.java:244) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
?
no
there should be a section after that stack that has a caused by and more stack trace
if not, your server is screwed
How come this isn't returning true even though it does equal the same ```java
if (uuid.equals(playerKiller.getName().replaceAll("\.[^.]*$", ""))) {
🤣 yea true, I need to sleep
thats all im getting
a UUID is NEVER going to match a name
How so?
because UUID isn't a player name
a UUID is a UUID a name is a string
or a name at all, it's an ID
playerKiller.getName returns their uuid
no
why would the killer's name have a file extension
No, it returns their name
are you guys slow
your methods are named like shit
Yep were slow
File playerKiller = new File("plugins/Core/PlayerDatabase", File.separator + uuid + ".yml");
it's the god damn file name
getName obviously returns a planetary orbit formula. How silly of me.
why are you even comparing that
naming convention my dude
hello, how could i get the location from inside an ender portal? i can't get the clickedblock than add numbers to the x, y, z
you are comparing the name of the file you just created based on the uuid to the uuid you based it on after removing the text you appended to the uuid from the filename
literally fucking what
Yea makes sense
just store the uuid?
what are you even trying to do
but idk if counts as storing if its the file name
also don't hardcode the plugins directory
Im trying to check if one of the file names equal to the player uuid
the plugins directory isn't necessarily at /plugins
and don't hardcode / as file separator
works though
on this particular system, in this particular case
even a broken clock is right twice a day
unless its a digital 🙂
I still haven't seen a server that stores their plugins outside of that category, but you're correct
i'm a pretty correct guy
cool
It should be true still
yep thanks i realized that one version was depricated while another wasnt
Can you apply a filter to the console logger on 1.8?
@proud basin can you
come now, nose and chin man
stand up for your fellow plebians
it's your time to shine
1.8 dude
what's up with the chin man today ?
What kind of filtering are you thinking of?
❓ ❓
more at 6
Filtering out certain stuff from the logger, not sure how else to explain it
things of your own plugin or all?
Apperantly you can do getLogger().addFilter on newer versions but apparently it's not a thing in 1.8
see what your server uses for the logging backend and see if it supports filters
All, trying to get rid of ban messages in console
probbaly not, l4j is the current logger
isn't there a console message event?
or slf4j on paper iirc
You could try getting the main logger and attach your own handler. You may be able to filter then
you may need to cast to the underlying implementation
Check this out https://bukkit.org/threads/console-ban-messages.436582/
so Skull head is there another reason why it returns false?
imagine recognizing historical figures
i don't know, print out the replaceall'd string and the uuid you're comparing it to
I did it's the same
also if uuid is not a String, call toString on it
as an UUID will never be equal to a String
oh is it not?
i don't know if it is
you haven't shown your declaration of the uuid variable i don't think
👀
i am the most correct man
needed to call toString
especially in expressing my political beliefs
I disagree with this statement
specifically about minorities
You're welcome
How can I give a command to a player without sending
what do you mean ?
I think he means without them full sending
basically not typing that in the chat ?
I don't know what that means, but I've seen many times on servers that the player will automatically give the player an order
based on a complete lack of communication skills, he's probably a 1.8 user
probably from middle or south america
duuuuuude xD
I've got no clue what that means
E.g. you press a button and your chat opens and it is entered automatically /warp but how?
like
even if you somehow managed to get across whatever it is that you want
it will probably be physically impossible for anyone here to help you achieve it
No, not something I mean like you would click on a text in the chat and a command will be written
use the suggest_command action for clickEvent
But I don't want a ClickEvent. I just liked PlayerPerfomCommand without it being sent
you can't make things clickable without ClickEvent
So what I mean is that if you press a custom gui that something is entered in the chat, e.g. UUid of a player and then could copy it
i think you use a ClickEvent still even then
or is it something else
InventoryClickEvent
for guis
but tbh i dont get what ur saying
There is an event for that, uuuuuh I'm forgetting it's name
Not copying in the clipboard, but clicking in the chat and doing manipulating it
just use ClickEvent :) if its chat ur clicking
Help would be appreciated, i cant run my plugin because of this error.
can't see replies
Log: https://paste.md-5.net/qodikirezi.rb
plugin.yml: https://paste.md-5.net/oyaciyocik.sql
In my plugin.yml I have main set to me.prouddesk.proudmix.main.ProudMix (it is located there) but in the error it tries to find it in the same location (me.prouddesk.proudmix.main.ProudMix) where the class is located.
Your ProudMix is under main under commands by the looks
Why do I get a null here when I do iPlayer.setKills((int) playerData.get("kills.amount"));
nope proudmix.main
its probs playerData.get("kills.amount")
thats not what that screenshot looks like
are you building with ant
What is playerData
It's not because when I print it out its fine
I guess it could be
if so change it to src.main.java.me.prouddesk.proudmix.main.ProudMix
if ur using ant
FileConfiguration playerData = YamlConfiguration.loadConfiguration(playerKiller);
why dont you just get the int instead of casting
I don't think it matters
Yeah but it is just something to change
A "best practice" if you get me
is that better iPlayer.setKills(playerData.getInt("kills.amount"));
Yeah - im not sure what isn't working about it
sorry do you mean decompile or what?
um Caused by: java.lang.ClassNotFoundException: me.prouddesk.proudmix.ProudMix
that sucks
lmao
that has nothing to do with 1.8
yes it does
that is not 1.8 so idrm
How so?
Im literally working with yml
well yeah but its probs different in newer versions
Nope its the same
i dont know just dont use 1.8
they could of done optimisations through newer versions lol
omg 🙄
idrm?
wont let me send the damn screenshot
yeah but he uses 1.8 and im sure he is on 1.8 rn
i dont really mind
I believe I did this is correct ```java
public void setKills(int kills) {
this.kills = kills;
}
1.8 isnt supported lol
Just because you are jealous of people using 1.8 doesn't mean you have to hate on it
same thing that shows up in zip obv, that was easier to send.
not jealous
its just outdated
Ah gotcha
why would i be jealous lol
You tell me
i wouldnt
it looks like you may be including things you shouldn't.
?paste your pom
just keep saying your not 🙂. But we know you are
it is IntelliJ tho?
yeah no
paste your pom
?paste
mr Skull head do you know anything about this
lmao
I'm so confused what's happening now
yeah its clearly a really white person with a Santa hat and sunglasses and a moustache
It's a setter
Oh I see
did you save your config when you set the value :)
i think you have to save it to access it lol
Yeah that is super wierd. It seems to be ignoring the main folder. I guess it could be a protected name you can't nest.
does anybody know the name for the fancy sound which plays when you complete one of those fancy advancements
maybe its reserved
@reef wind rename it to core or something
not the issue
aight
You could also add a provided tag to the annotations depoendency as its not needed in the jar
or compile tag
bruh
I literally printed it out in the if statement and its fine
it has to be something with iPlayer.setKills()
nvm found it UI_TOAST_CHALLENGE_COMPLETE
Yeah sorry i forgot that
TOAST
Ah yes, TOAST.
private int kills;
private int deaths;
public IPlayer() {
this.kills = 0;
this.deaths = 0;
}
public int getKills() {
return kills;
}
public void setKills(int kills) {
this.kills = kills;
}``` I don't see anything wrong with this
mow when i renamed it to core and built it main shows up?
I don't get what could be the issue
whats happening with it @proud basin
its giving me an nullpointer when I do setKills
I is generally prepended to interfaces when you can't think of better names
Player extends APlayer implements IPlayer
you're not "supposed" to do it and it's supposedly a shit naming convention
Player extends ASkullHead implements ISkullHead
but it's pretty common and not without its advantages
Hasn't that become an obsolete these days cause you can see the symbol in your IDE?
maybe in getKills try this.kills?
well yes but the thing is that having multiple classes with the same name is annoying
renamed the file and renamed it back and now it works..
so you don't want to have Player implements some.package.Player
Yes
you need a different name for each
and then you run into the issue of what the fuck to call them
but I'm getting the kills with that so I have to return
SimplePlayer extends AbstractPlayer implements Player
lol
but what if the player impl isn't actually simple
that's not even the issue
at some point you run out of effort and just go fuck it and and call the interface IPlayer and the class Player
nny are you brain dead?
this
i still can't see replies
Why do I get a null here when I do iPlayer.setKills(playerData.getInt("kills.amount"));
well, I would assume that something is null
why isn't java 15+ an option here?
because he's on 1.8
There are spigot forks that support java 15+
probably doesn't even fucking run on anything past java 1.9
The npe?
then iPlayer is null
then pretty much the only option is that iPlayer is null
protip: put each deference on its own line
iplayer
.setkills(playerdata
.getInt("kills.amount"))
with better formatting, obviously
pro-er tip: update
There are three variables that can be null:
- iPlayer
- playerdata
- (int) playerData.getInt("kills.amount")
Beware the implicit int cast
This is my IPlayer class ```java
private int kills;
private int deaths;
public IPlayer() {
this.kills = 0;
this.deaths = 0;
}
public int getKills() {
return kills;
}
public void setKills(int kills) {
this.kills = kills;
}
Omg, the variable itself is null
Where do you instantiate it
Show the rest of this class
use Java 15 ffs or use yourself as a human debugger; NPEs are the easiest things to trace
.
wrong class
As Coll said, where do your instantiate it
as the only thing that can be null is iPlayer
Java 15 will be able to run 1.8 if native transport is disabled, so the unsupported Java argument is not valid
@EventHandler
public void onPlayerStatisticsUpdate(PlayerDeathEvent e) {
try {
String killed = e.getEntity().getName();
String killer = e.getEntity().getKiller().getName();
Player gainkills = Bukkit.getPlayer(killer);
Player gaindeaths = Bukkit.getPlayer(killed);
UUID uuid = gainkills.getUniqueId();
UUID uuid0 = gaindeaths.getUniqueId();
File playerKiller = new File("plugins/Core/PlayerDatabase", File.separator + uuid + ".yml");
if (!playerKiller.exists()) {
playerKiller.createNewFile();
}
FileConfiguration playerData = YamlConfiguration.loadConfiguration(playerKiller);
if (playerData.get("kills.amount") == null) {
playerData.set("kills.amount", 1);
} else {
int kill = playerData.getInt("kills.amount") + 1;
playerData.set("kills.amount", kill);
}
playerData.save(playerKiller);
if (uuid.toString().equals(playerKiller.getName().replaceAll("\\.[^.]*$", ""))) {
System.out.println(playerData.getInt("kills.amount"));
iPlayer.setKills(playerData.getInt("kills.amount"));
}
System.out.println(iPlayer.getKills());
}
}
where is iPlayer declared
above that
That's what we asked to see
show
Also oh no loading files in an event
private IPlayer iPlayer;
That is null
player death event is mildly tolerable as it doesn't fire that super often but yeah don't do file IO in events
you declare a field but never assign anything in it
it has no value
it is null
woopsy
learn 2 java scrub
You should load the file on player login via a async thread. So the IO does not freeze the main thread. Then store it in memory. Then save it on player quit via a async thread.
That way above you are loading and saving on the death event that is going to destory your TPS, and maybe even crash the server.
The only way I could do it is if I did private IPlayer iPlayer = new IPlayer();
is there any tutorials out the to create mysql database without localhost?
So basically no xampp or smthing like that needed
like other plugins do
what does the "without localhost" part mean?
Okay basically my current database wont run without xampp
I mean the plugin wont enable
And I've only followed tutorials where they create a database with localhost
so im kinda lost
I mean you have to host the database somewhere
It's still null
ono
IPlayer iPlayer = Core.getInstance().getPlayerManager().getPlayer(e.getEntity().getUniqueId()); still null
What do you mean with create? Like, setup the database server or just creating the database itself (not the database server)
you see, plugins do both
well, most of the time at least
database eserver
i think what is mostly done
Id just need a database
what runs fine
without no xampp
or some other bs
yeah, that confuses me a bit.
Many plugins use sqlite if that is what you want
MySQL, SQLlite, mongodb, file systems all of them works
Honestly, use flatfile, it has absolutely no setup pain
Ill just use SQLite
The thing is Ill need to change my code
With the connection part
Or I don't idk lol, i found some random tutorial what seems to create a database without xampp so ill see wassup
ty
is there any way to get contents of inventory just like its show on inventory itself
now i get hotbar in the first slots
and content inventory in the back of array
Database = file, which stores some data.
Database server = software, which handles the saving to that file.
XAMPP = Program to easily setup and run a database server.
But XAMPP is only used locally mostly right?
ofc i can switch it away
yes
its for dev purposes only
Mkay
Yeeep
its a suite of servers
which you can use to test your code
its like Java Runtime environment
you cant run the code
But like do I have to change my code alot if i switch to mysql ?
But it's still going to work in the production server like it works in xampp
until you have either the server or the LAMP or XAMPP suite of servers
MySQL and SQLite are fairly similar
With*
To mysql from what?
But there are some differences
MySQL to MariaDB almost no difference in SQL syntax, i prefer mariadb
its faster
Microsoft SQL server is a different case here
I mean MariaDB is basically MySQL
You shouldn't need to change anything, when going from mysql to mariadb
its kinda a fork
mongo
^^
yeah dovidas
there are some differences
but 99% you're fine
for simple queries
Only difference I noticed with mariadb and mysql, is that they hadle users differently
i mean you can make one universal transpiler which supports most of the SQL syntax, but that's way too much work
and its inefficient
Some kind of wrapper
I mean
If you want to publish your plugin
Also, did something change with 1.17 regarding plugins written in Kotlin?
Shouldn't
can i see a weapon's attack dmg from item metas
Kotlin has nothing to do with spigot
about couple months ago i made YAML, SQLITE, JSON, MYSQL, MARIADB wrapper which used node system, just like snakeyaml to save values
but that was not that efficient
compared to hardcoded systems of data storage
Cause now I got this issue where a class loader is my plugin is unable to find a Kotlin class when trying to initialize a BukkitRunnable object, even though Kotlin classes are present in the JAR
Unstructured data like logs
its SQL but stored in json
It’s fast
Oh
I don’t know what ghost potion effect is
And that stuff happens on 1.17
Only ?
Yes
When you set the repository to 1.16 is it ok then?
Tried it on earlier versions of MC, and it was nonexistent
Do u compile to jvm 16 bytecode ?
Also can you send the error
but I only have issues on 1.17
Try on change it on this project specifically
Here is the error
?paste
is there any way to get contents of inventory just like its show on inventory itself
[12:17 AM]
now i get hotbar in the first slots
[12:17 AM]
and content inventory in the back of array
On phone heh
anyone?
isn’t that just a normal Inventory?
i mean
hotbar
is at the top of array
i want to be in the back
now i need to copy the array
:/
Oh
I don't get what are you trying to do
everything is fine but the hotbar isnt
Might have to manually sort
So basically .getContents() returns this:
[HOTBAR],
[INVENTORY],
instead of
[INVENTORY],
[HOTBAR]
and i was thinking is there a way to get it like this without sorting anything, like inventory view or smth idk
Nope I don’t think there is
Maybe you could flatten them out
wdym
Try only using 1 loop
wdym by "flatting them out"
is it possible to check and see if a player is holding a weapon?
What about arrays.copyOfRange
other then putting it in a switch loop
is it hotspot intrinsic
oh theres a prebuilt method?
Idk
player.getEquipment().getItemInMainHand();
lol
and?
it seems it is
it returns the item
🤔
doesnt tell me wether its a weapon or not
what is player.getEquipment?
"weapon" is pretty discutable
That only shallow copies it to a certain length
And you can copy the hotbsr part.
wdym
.getEquipMent dont return weapons only
Yeah you can copy it but that wont help
You can narrow it down using Tag
tag?
Yes
okay thx
btw its not possible to get the attack dmg of an item server-side correct?
since no packet is sent and stuff
listen for a damage event
uhh that is not an option for me unfortunatly
I looked little bit deeper. And it actually won't help.
so when player is under the affect of weakness, they cant dmagae anything with their fist, is there a way to make their fist deal half a heart even under weakness?
Yea
rip
I thought it will have at least SWORDS or something
so I'm working on logic to calculate prices for items based on their recipes but I've stumbled on a bizarre issue where the results of ShapedRecipe's ingredients map can't be passed to Bukkit.getRecipesFor - 1.16.5. I am on paper so maybe it's not spigot but has anyone seen that before https://paste.gg/p/anonymous/dfde59b08a254e0a9781318acf815468
Aren't you happy you can't actually hear you router and modem talk millions of times a second like this?!!! This is originally from: https://youtu.be/h16HA4X...
Lol
So trueeeee
what item is this happening for in particular
it would also probably be better to clone the itemstack rather than just the material, as custom recipes can specify exact ingredients with lore and whatever
xd
hmm is there any other weapon other than swords, axes, shovels, hoes, pickaxes and tridents
also, you probably don't want to sum up all of the ingredient values from all of the recipes
but rather take an average
consider an item that has 5 different recipes
I'm not it's just quick pseudo code
at any rate, the method call works just fine for me; the expected list of items is returned
so for example STICK, when it looks up OAK_PLANKS the recipes list size is 0
is this an issue with a specific item or all items
isnt everything is technically a weapon? cuz u could hit people with fishes and it will do a little bit of damage
does this only happen on the second call of recursion?
what are the exact specifics of the issue
Most items do the same damage as a fist
yeah
?paste
yes the second call but some items work just fine
but isnt that mean its still kinda a weapon
thats true
but they only do half a heart
I just happened to notice STICK never made it through to the output
is there any item that do more than half a heart
hey guys I really need some help on an error. I have no idea where to even start debugging. https://paste.md-5.net/avayisutum.apache
shouldnt
except for swords, axes, shovels, hoes, pickaxes and tridents
it works fine individually for each item i've tested for me
and not ranged
thats the entire thing
including stick and oak planks
ok, I guess it could be a paper issue then
i'm on paper
i wouldn't use splögget, I'm not gay
it could perhaps be something pertaining to the recursive nature of your code
check the stacktrace
try iterating over each material and getting their ingredients, without recursion
ChunkMapDistance.java:244
see if sticks or oak planks or whatever still return no ingredients
sorry im new, how do I do that?
are you using the commented out line?
go to line 244 of chunkMapDistance
yes
its nms
thats not code I wrote
oh it is?
lol
i use it for an automatic workbench machine I implemented in slimefun
none of that is code that I wrote
net.minecraft.server.v1_16_R3.ChunkMapDistance.
what are you working on?
@quartz goblet is this the full error?
works fine, aside from slimefun being trash
in its entirety yes
if you want to mess with nms use protocalLib
is that it
there have to be more
there has to be more yeah
true
yes. And im not using nms, ill show the code im executing when this happns
ill send my console log
whole log pls
?paste
I believe its either of these. Had a similar error with damage event in another case. Its not in the other custom function I call because theres other ways I call that function and it works perfectly. Also in running the createPrison(), it runs in its entirety and I can see it in game
I didnt update it yet
did you make a plugin yourself
yes
it might be VoidGenerator
i dont see the log from the plugin :/
thats the custom plugin?
you might wanna delete that now since there is your ip inside
lol thanks
bot net is starting for the ddos
what code are you running which could cause that npe?
its not like bot net is gonna ddos every single ip
this only happens when my code has https://paste.md-5.net/ayixacelac.java
@wraith rapids ok try https://paste.gg/p/anonymous/ac8daf64f3104e939ba810490530da03
he meant he's running code which is causing that
ill try removing void gen
I can reproduce it with just that code
[15:04:22 INFO]: Seeking recipes for STICK 2
[15:04:22 INFO]: Seeking recipes for OAK_PLANKS 0
[15:04:22 INFO]: Seeking recipes for OAK_PLANKS 0
[15:04:22 INFO]: Seeking recipes for BAMBOO 0
[15:04:22 INFO]: Seeking recipes for BAMBOO 0
@EventHandler
private void killPickup (EntityPickupItemEvent e)
{
Item i = e.getItem();
if ( (prisonItem.containsKey(i) || (i.getItemStack().getItemMeta().getDisplayName() == itemName) ))
{
e.setCancelled(true);
createPrison(e.getEntity());
}
}
@EventHandler
private void hitByIcePrison(EntityDamageByEntityEvent e)
{
if (e.getCause() == DamageCause.PROJECTILE)
{
if (prisonItem.containsKey(e.getDamager()))
{
e.setCancelled(true);
createPrison(e.getEntity());
}
}
}
```
what no
getItemMeta is nullable
its short you can just paste it in
i don't know what we're talking about but check yourself before you shrek yourself
who?
okay
me?
I mean I don’t think you can pick up air
whoever calls methods on a nullable return value
itemmeta can be null and display name could be null too iirc
oh some forum post said to check if the material the player is holding is air
Yes
it shouldn't really ever happen to be null for a pickup event but I've seen weirder things happen
what is your createPrison method doing?
best to check always
same thing happens even after I removed voidGenerator
But this has nothing to do with that the player is holding
ill send the prison thing
do we have a stack trace
[21:55:48] [Server thread/FATAL]: Error executing task on Server
java.lang.NullPointerException: null
at net.minecraft.server.v1_16_R3.ChunkMapDistance.b(ChunkMapDistance.java:244) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
at net.minecraft.server.v1_16_R3.PlayerChunkMap.movePlayer(PlayerChunkMap.java:956) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
at net.minecraft.server.v1_16_R3.ChunkProviderServer.movePlayer(ChunkProviderServer.java:482) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1112) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
at net.minecraft.server.v1_16_R3.PacketPlayInFlying.a(SourceFile:122) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
at net.minecraft.server.v1_16_R3.PacketPlayInFlying$PacketPlayInPositionLook.a(SourceFile:18) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(SourceFile:144) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(SourceFile:118) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:942) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:935) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(SourceFile:127) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:919) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:851) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot_1.16.4.jar:git-Spigot-628435a-72c5e74]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292]
this one
mildly disconcerting
{
Location l = ent.getLocation();
prisonItem.remove(ent);
ent.remove();
int level = 1;
int rad = 6;
//x^2 + y^2 + z^2 = rad^2
World world = l.getWorld();
int x = l.getBlockX();
int y = l.getBlockY() + 1; //start 1 block above contact point
int z = l.getBlockZ();
for (int i = x - rad; i <= x + rad; i ++)
{
for (int j = y - rad; j <= y + rad; j ++)
{
for (int k = z - rad; k <= z + rad; k ++)
{
int a = (i-x) * (i-x);
int b = (j-y) * (j-y);
int c = (k-z) * (k-z);
if ( ((a + b + c) <= (rad*rad)) && ( (a + b + c) >= ((rad-1)*(rad-1)) ) )
{
Location blockLoc = new Location(world, i, j, k);
if (blockLoc.getBlock().getType() == Material.AIR)
{
blockLoc.getBlock().setType(Material.ICE);
long minimumTime = 5000 * level; //minimum ice prison block time in ms
long random = (long) (Math.random() * 500); //added random time to each block
long expireTime = System.currentTimeMillis() + minimumTime + random;
prisonData.put(blockLoc, expireTime);
}
}
}
}
}
}``` this can execute when I have a isonground check for the entity and it works that way without error
lines don't match with my paper source
make sure the world u using exists and its loaded
it is since the entity is in there
yeah literally all of that code has been changed in paper
and I don't have spigot sources
maybe you shouldnt worry about it
i mean it isnt effecting your server or ur plugin
no but afterwords this happens to the player, and the player is invisible for others, and the player cannot interact with the server at all
^ when saying anything or executing any command
probs a bug
and I got an alt on and it cant see the player that caused the prison to happen
just rejoin the world?
this is an in combat thing. Actually only the person casting sees it
one sec il lsend more scs
use paper and mark your generator as async capable
@quartz goblet is your server lagging while spawning that prison?
Make sure you aren’t causing cascading gen
2-3ms is a pretty long time
not really, not noticeable anyways. Should I make a quick video on what happens?
issue is that each chunk requires adjacent chunks to be loaded already
and that there are a lot of chunks being loaded when you fly in a given direction
doubtful
Wonder if it’s related to minecrafts jank lighting
if you're calling setblock or something, each call fires lighting updates and shit
i haven't really worked with custom generators as the api is so hamfisted around them
how do i change the drop item of a block
with a datapack
blockdropitem event or something along those lines lets you modify the drops
thx
does any one know of a good picture downscaler to make custom textures
paintdotnet usually does it for me
did you make your avatar with mspaint perchance
?
It makes no sense to insult someone because of their pfp was made in ms paint
what
just use gimp
perhaps I should insult you on the basis of your anime avatar instead
Has a girlfriend (actually a love)
you forgot the "imaginary"
I'll post that test case on the forums and see if anyone has a theory
maybe it's because oak planks are a shapeless recipe
but i have no idea what your problem is
i only scrolled up half an hour
How can I send a player to another server with a Bukkit plugin?
that is actually a pretty convincing theory
you did account for other recipe types from just shaped, right
there are complex and shapeless recipes as well
no his code only has shaped lol
and like smithing recipes or something i think
Hi again.
What do you mean my .yml file messed up?
is it possible to give a crop a special name and put a custom texture on it using a resource pack??
Can you help me fix it?
not easily
not the block form at least
item, sure do what you want
well there's the issue
What issue?
Hello: is a map
if you want it to be an empty map, set it to {}
right now, it's null
I literally posted a complete test case. the type of recipe doesn't matter in this specific case because it's Bukkit.getRecipeFor that fails. Bukkit.getRecipesFor(itemStack) fails for OAK_PLANKS when their itemstack comes from getIngredientMap on STICK
i mean I suck at java.
that's not java
It still doesn't work.
you already said that
but without a full stacktrace nothing will happen
?paste it here and we can get started
What's that for?
your stacktrace
what's a stack trace
- him, in 2 seconds
What is stack trace????!
xD
?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.
That's nice I don't remember asking
I don't remember asking you either.
bro that's crazy
A-alrighty
LOL
Friday night funkin was glitching
the game was pausing without pausing
it was weird
it looked like it froze
but it didnt
xd
damn bro that's crazy
the notes stop but the camera still pans
and the animations stop to
let me record it
if its still happening
lol
you don't include your plugin.yml file in your build
I don't know how to add it on oracle, but your problem is that the .jar (which is basically a .zip file) doesn't contain the plugin.yml file
on intellij, you just go to project settingsa and to your artifacts and add it to the jar
#general message
why does essentials not work for 1.8
yes
target.sendTitle("", ChatColor.RED+"YOU ARE BEING WATCHED", 0, 30, 10);
Doesnt work as it doesnt recognize that there is a title, yet doing similar commands in vanilla minecraft works.
target.sendTitle(".", ChatColor.RED+"YOU ARE BEING WATCHED", 0, 30, 10);
Does work, but it leaves the dot there.
How can I just send a subtitle without a title?
what version are you using?
you could try just putting a space in
null?
should still work if just empty, though
Yeah isn’t that method just an abstraction of sending a packet
1.17 and the space didn’t work
Null cancels it out completely
you're passing an int instead of a consumer
apparently a space definitely still works tho
but, the comments are also saying this is intentional
slenderman is a hate symbol of white supremacy
ok
How to allow a player to nick using &2 or any other color code
What premission node
Essentials X allows that but if ur coding it you will have to use the ChatColor API I think
declaration: package: org.bukkit, enum: ChatColor
Not sure
Don't actually ask me lol
you need to use Bukkit.shutdown() in the AsyncPlayerChatEvent
i wonder if that's thread safe
Probs not
you might want to schedule it to be done on the main thread just in case
no no, it should be done asynchronously
you wouldn't want your plugin to cause lag, would you?
Doesn't the bukkit scheduler not allow you to do bukkit things in it?
only when it checks >:)
does anyonw why this doesent work if("Cpro Industry Projects & Solutions GmbH-Bewerbung.pdf".equalsIgnoreCase("info@cpro-ips.com")) {
System.out.println("1");
} else {
System.out.println("2");
}
Lol what's this
ok the reason getRecipeFor doesn't work with ItemStacks from the ingredients list is because the ingredient items, at least for STICK, has UNSPECIFIC_META:{meta-type=UNSPECIFIC, Damage=32767} in the meta
create new ItemStack with the material
say I have a class that gets serialised using normal java serialisation and it has transient fields. I initialise those fields in (private) readObject(). If I then have a child class which extends it, with its own transient fields, will giving it a private readObject() automatically call the super's readObject(), or do I need to make it protected and override and super.readObject()?
I did, but I didn't like not knowing why that worked
?
that's literally in my test case
code blocks, please
lwjgl
rly where
probably because RecipeChoice's ItemStacks are wacky af
wdym
it will always return false
if("Cpro Industry Projects & Solutions GmbH-Bewerbung.pdf".equalsIgnoreCase("info@cpro-ips.com")) {
System.out.println("1");
} else {
System.out.println("2");
}
```java
code here
```
"Cpro Industry Projects & Solutions GmbH-Bewerbung.pdf" will never equal "info@cpro-ips.com" no matter the case-sensitivity
if("Cpro Industry Projects & Solutions GmbH-Bewerbung.pdf".equalsIgnoreCase("Cpro")) {
System.out.println("1");
} else {
System.out.println("2");
}
and the issue is
ok but how can i fix it
what are you trying to achieve
i want to return a file based on a email-adress
uh
you want to use a map then
equalsIgnoreCase only tells you if two strings are the same, ignoring capitalisation
"aaabb".equalsIgnoreCase("AaabB") will be true
it returns false because "Cpro Industry Projects & Solutions GmbH-Bewerbung.pdf" does not exactly equal to "Cpro"
oh okay and how can i fix my problem
look into maps (i.e. hashmaps) in java
Just Fucking Google It helps you help others to use Google and search on their own!
unrelated, is there a place I can see how the equals/hash logic for Material is implemented, I have some funky things happening where list.contains(material); is returning true when it shouldn't
@lofty junco to elaborate, a map is a data structure which associates a unique input with an output. So you can use it to associate a string (email address) with another string (file path) (or a File depending on which you prefer to use)
Material is an enum...
ok so no custom equals logic
what is the problem case?
I use contains w/ Material and found no issues
with sets instead of lists but it should make no difference
enum constants are identity elements
overriding equals isn't necessary
and yes they work with collections just fine
I'm loading a map of material keys from a config and a stick is not one of them, but later map.containsKey(Material.STICK) returns true. stick is never inserted
hello guys I am having an issue every time a player spams clicks an armor on and off it starts to add the amount of health every time
I am not sure why it is doing that
here are my code for when they put it on and when they take it of
https://hastebin.com/owanivunal.java
https://hastebin.com/enadepelug.java
print the map
I did
can readObject be protected or must it be private
I want to super it cause I use it for setting up transients
print the map right after the check 👀
ok so it only happens when the check is inside a loop of Material.values()
also on my intellij it tells me that addModifier may produce a null exception error but i get no errors on console
using Material.STICK directly returns false
Mr skull head I got it working
I'm having quite the issue here, i know it has something to do with a loop or something but every time i try and send a message, it sends the message like this: 3 players online, sends it 3 times to each player if that makes sense. https://paste.md-5.net/ihofecozaw.cs
when do you sendRoleMessage?
Deleting messages be like
he deleted his ¯_(ツ)_/¯
is a null check slow compared to a boolean check
if I have someReference != null vs. isReferenceNull == false
in my case for custom recipe stuff
public void execute() {
playerRoleAssignment();
sendRoleMessage();
}``` I just execute it by just doing execute();
🤨
dude
ok... but where do you call execute
if(recipe == null) vs if(!isProcessing), where isProcessing would always match the value of recipe != null
You're way overthinking it
in another file
The speed difference is negligible
there is almost no difference in speed
🤦
okay thats good, ty
public void in_game() {
StateManager.setState(StateManager.IN_GAME);
roleAssignment.execute();
}```
thats literally where I do it
Value == Value
is literally what both of those are
Java Coding Conventions: https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html
inGame
and where do you call in_game
in a fat runnable 🤦 oh god
ah yeah forgot about that
Once you do java enough conventions are second nature
I have one big one for a few timers
just a few
which I hoped would make it easier but yeah
want me to send the timemanager class?
How do I make a npc?
When I use nms i get errors like:
package net.minecraft.server does not exist
in idea
What are you using for dependencies
?paste
Spigot jar, Minecraft jar, and some other depencencies for other stuff
Minecraft Jar.... why
I already know its a big mess and I probably should not do it this way but here it is https://paste.md-5.net/jaralafodi.java
A test
If you are depending on jars directly, you only need spigot
well here's the issue :)
for (Player player : Bukkit.getOnlinePlayers()) {
//lots of code here
if (warmupValue == 0) {
player.sendTitle(ChatColor.translateAlternateColorCodes('&', "&c&lPLAY!"), " ", 0,37,3);
player.playSound(player.getLocation(), Sound.ENTITY_ENDERDRAGON_GROWL, 2.0F, 1.0F);
manager.InGame();
cancel();
}
}```
Well other rhan that whats wrong
what version
How do I make an npc then?
I would personally recommend the citizens API
Citizens API
idk how to use that
But your IDE should give you the proper imports if you have the class name right
no
those were the imports
probably imported from elsewhere
Ah yes I moved manager.InGame(); out of the loop and it works now, thank you
But your IDE should give you the proper imports if you have the class name right
Then those are correct
No
Because i'm getting:
package net.minecraft.network.protocol.game does not exist
and many more
Let me have a look
hacks u
Yep those are correct
You probably don't have dependencies set up correctly
I just imported spigotjar
Share your pom ?
?
where did you get this code
Run buildtools for your version and switch spigot-api to spigot
?bt
3.2, nothing that unusual
Unless there has been another one the internet hasn’t picked up yet
Also #general
my my
the internet is fast
wait isnt it 4.2
hello guys I am having an issue every time a player spams clicks an armor on and off it starts to add the amount of health every time
I am not sure why it is doing that
here are my code for when they put it on and when they take it of
https://hastebin.com/owanivunal.java
https://hastebin.com/enadepelug.java
the whole house shaked
and it not unusual
if its frequent i bet half of the houses in cali will be gone
“During the past 30 days, California was shaken by 1 quake of magnitude 5.3, 6 quakes between 4.0 and 5.0, 90 quakes between 3.0 and 4.0, and 467 quakes between 2.0 and 3.0”
im in california, felt nothing
It's not working
it's not working
I ran buildtools, then added the dependencie and it didnt work, I get the same errors.
would anyone know how to use the getPing() function so that I can send it in a string
What does it return
this chat is always great
asking again since I don't think I worded my questions correctly earlier:
If a Serializable sub-class doesn't have its own readObject method, will it be deserialised using the default readObject behaviour or that specified by its super-class (which let's assume does implement readObject)?
readObject?