#help-archived
1 messages · Page 188 of 1
So best way would be to store ur own
Either database or config
not going to really matter what you store
can't guarantee that a player is the same player in offline mode unless you implement some kind of registration system
authme?
yeah but he wants online mode
and offline
Im making it for anarchy servers
name ≠ online uuid (online mode)
What?
Oh you want online mode uuids
i mean storing ur own uuid = lastname
yes
would cover both
way to get uuid:
OfflinePlayer op = Bukkit.getOfflinePlayer(/* your name to lookup*/); if (op.hasPlayedBefore()) { UUID uuid = op.getUniqueId(); } else { //hasn't played before }```
Query mojangs api for UUID's
just make it online
if it doesn't exist make your own
but I mean since you are in offline mode you can't guarantee that they are the true owner of a given name
@frigid ember bro i ALREADY said that getting a offlineplayer by name is deprecated
yes
@keen compass does mojang api even accept requests from a offline server?
thats the reason why im here
@frigid ember bro i ALREADY said that getting a offlineplayer by name is deprecated
@frigid ember ur stupid
look what is sent
@vernal spruce Mojangs API will accept any request so as long as it is valid
/* your name to lookup*/
deprecated doesn't mean it doesn't work
yeah, but it might get soon removed
the reason it is deprecated is because using a players name isn't guaranteed since players can change their name
Its a more of a no touchy method
yeah
If we're talking about getting offline players by name, then it'll work just fine. As long as you're willing to wair 300-3000ms if you enter a name that hasn't joined the server
hm
Doesn't guarantee it will map to the same UUID if they have
Just dont bother and try either ways
uuids in offline are generated from name and on online from mojang
nope
they are
online are from session
which comes from Mojang
Offline mode servers
generate UUIDS from the player name
since it doesn't query Mojangs stuff
ye
Oh, we're talking about offline mode here?
Online mode servers query the API from Mojang
and online
i want my plugin on both
possible
oh sorry
not minecraft.net
i have a question. What even means unique? How is it possible that they aren't similar
it means by name
?
unique by name
by player
yes
not name
UUIDS are unique due to low collisions when generating them
however despite that, there is accounts with the same UUID's and names btw
oh ok
it means the odds of someone having the same UUID as someone else is very low
it has already happened
ah
odds that you will have such players on your server is very low as well
But it is still a problem however
so two online players can have the same UUID?
yes
Isn't there any way to stop that from happening?
like comparing
if it already exists
wtf
you can't stop it from happening but you can mitigate it so you can still make them unique 😛
two online players simply cant have 2 same uuids
never
@frigid ember who told you it was impossible?
@frigid ember I have seen your code. You do not have the right to call anyone a noob.
I swear to god.
lol stop that. your a noob too. You don't even know how to setup rich preference properly
go to launcher.propetes
and try to change ur name
Why call someone noob lol
idk
Doesn’t make sense in a help channel
@frigid ember No worries he is an absolute beginner too. Listen to Frostalf for advice and ignore petakou
Are you?
wait
What’s your gh
I am not entirely sure what launcher.properties has to do with anything
;-;
yeah
What’s the right one lol
you're
Instead of?
your
“What’s you’re gh”
lol stop that. your a noob too. You don't even know how to setup rich preference properly
Oh
Whats you are gh makes no sense XD
I would like to see some actual evidence of UUIDs being the same
Yeah I got confused as hell
@frigid ember No worries he is an absolute beginner too. Listen to Frostalf for advice and ignore petakou
@grim halo https://prnt.sc/tl8rvm
@torn robin I had a list somewhere trying to find it
anyways there is duplicate names
that map to different UUIDs
How recent are these UUID duplicates?
and then there is UUID duplicates. Which is rare but has already happened
Generate 10 Million UUIDs by UUID.random and see how many duplicates you get. I bet you there wont be a single one
That’s not nice
but basically Mojang ends up eventually fixing the UUID problem
but not the name one
any evidence for the UUIDs? other than "it has happened"
UUID is essentially a long long (2^128) - 1 values
Not entirely sure how I would prove it, if they eventually get fixed since Duplicate UUIDs cause more problems then duplicate names do
are you saying they already got fixed?
Yes, but the problem is still there. Just mojang has to manually fix it by generating a new UUID for whoever reports the problem first lol
Oof
I can't imagine any programmer would reasonably compensate for such an unlikely event
yeah. Because they are called unique
So the code is coded in a way they MUST be unique
Thats the chance to generate the same UUID twice 1 : 340,282,366,920,938,463,463,374,607,431,768,211,456
they are suppose to be unique, but once you start getting into the laws of large numbers, duplicates are guaranteed to happen
Just because they’re called unique doesn’t mean they’re actually unique
I didn't say it was common
Its possible but highly unlikely
Anyways, duplicate names still continues to be a problem however
you can have 2 players with the same name
but 2 different UUID's
How
yeah
That's a much lesser issue
Doesn’t it check for the name when creating an account?
they changed their names to the same thing within the same time
really just funny to see
That’s possible?
Yep
Thought it was patched
Even if it is fixed
One loggs out -> changes the name -> someone else changes the name to this guys name and loggs in -> problem?
The players still have the same names
Yh
so, that is something that all plugins do not account for however
as far as I am aware
no plugins should be basing anything off of player names
while true, there is cases where you need the player name however and all you have is the UUID
when you query mojangs API, its not guaranteed which UUID you will get 😛
what's a username that's duplicate? I'd like to test it
uh let me see if I can find you one
Can you even check that?
Basically I need to get block update events. Can anyone help? Example:
I place rail and I place another rail next to it, the rail nearby changes direction. How to get an event of that nearby rail?
Like I mean sites like namemc
declaration: package: org.bukkit.event.block, class: BlockEvent
there's the list
first one I think of would be BlockPhysicsEvent
I was searching but I didn't find anything related
you might have to listen to BlockPlace specifically and check nearby blocks
Next has 2 duplicates
I'll take a look at that, thank you!
also not sure what you mean by when you query mojangs API, its not guaranteed which UUID you will get :stuck_out_tongue:
assuming you have their UUID already, whichever name you get "Next" or "Next" doesn't matter?
while true, there is cases where you need the player name however and all you have is the UUID
@naive goblet https://namemc.com/name/Inkreased
there is 2 profiles
the top one you will notice didn't change their name till 2020
the bottom one was able to have that same name before that happened
so, it does happen that players can have the same names but different UUID's 😛
Just tested it, it's consistently one player
Okay, this might seem stupid, but how to broadcast a message to whole server?
bukkit#broadcastmessage
@torn robin its not recent they have the same names right now
it is an example that it is possible to happen
if you look at the username history
LockerBlocker (the original name for one of the accounts) made the account in 2015
The other person made their account I'm guessing 2020
the first account changed their name long before the other person even made their account
6/2/2016 they changed it to Godcreased
@torn robin https://namemc.com/search?q=vice
there you go
oh wait
nvm
I can't read >>
stupid 1's
I'm agreeing it's possible, next has duplicates
weird, there's so many duplicate events... (onPhysicsEvent)
@torn robin https://namemc.com/search?q=Chevy
there we go
that has an active duplicate
not sure if it is still possible to have duplicate names created
it's not possible
but there is still players running around with duplicate names
@frigid ember yeah it’s an event which is ran often
7 times...
anyways just some fun facts that most people don't really think about 😛
Don’t make some heavy checks and it should be fine
Heavy?
depending on what you are doing you can do your stuff outside of the event
Oh, also it is possible that a player can end up with 2 UUID's with no name change history as well. Which most plugins that track players don't account for
this one is possible if you purchase an account, and it fails
and then you create it again 😛
Ngl it would be nice to have 2 uuids
while payment is processing it doesn't prevent your use of the account
yeah, bit weird how you would explain how you have 2 UUID's XD
Do any of you know a plugin that gives you points by playing different minigames a little bit like MC Champions or Mondays?
I am sure there is a way to handle it
just as far as I am aware most developers don't account for these glitches happening
or even just thinking that they are possible
How are you even supposed to deal with it?
Frostalf though the question is, is it worth handing it
I mean if it’s hypixe yes probs
I didnt even know this was possible...
But I mean just having a casual server
probably not since the odds of encountering the scenarios above is probably just as equal to it happening 😛
The duplicate name one was a problem a couple years ago
since there was like a lot of players running around with the same names
this caused problems with some plugins that used both UUID and player names
item duping here I come
I mean technically it can still cause problems, just not common to see anymore
chat plugins for instance
can't cope with 2 players with the same name
which btw, 2 players with the same name can log into a server
just as long as the UUID's are different
good luck others trying to message/pay you
Pretty much that is exactly what happened
one player would be pretty much a ghost
still existing in the server but can't really use commands
and others can't do commands to them
also the ban command doesn't work properly if you use the name
IE, only 1 player will get banned using the name
Guys I need help with big O notation
and then you are left with the other not being bannable still existing in the server XD
Is it the same complexity to search for a value in an HashSet or for a key in an HashMap. If not why not
Yes. The HashSet is essentially just the key tree of a HashMap
HashSet implements a HashMap though?
HashMap is faster because keys are associated, HashSet member object is used for calculating hashcode which can be the same for two objects
so HashMap doesn't use Member objects for the keys, HashSet does
So one has greater odds of key collisions while the other doesn't
I mean it's UUIDs
I'm saving them in a set
It's basically a set of player UUIDs that have an active animation
Then I remove them from the set when animation finishes
@naive goblet HashMap implements Map, HashSet implements Set
so no they are both different
Ok but speaking if big O notation they are both the same. O(1)
How fast this operation is was not in question. Also the difference is negligible.
HashSet uses a HashMap internally
Hmm yeah
Why do you need a thread safe keyset?
I have multithread animations
They start/end from other threads
So I think it's not safe to use a regular HashSet
HashSet is not thread safe
ConcurrentHashMap.newKeySet
@sturdy oar
This is what I'm using
If you dont have constant access from different threads its somethimes just better to sync with the main thread via the BukkitScheduler
I think get() is nonblocking but put def should be.
for future reference
😉
Ah nice. I kept a table myself that i made manually with the jmh but i dont have some of these implementations.
Limited pvp is server or client side?
server side. Every damage event is calculated server side.
Ok so I can create plugin that removes that shitty pvp?
I dont think i understand what you mean by "shitty pvp". Do you want to prevent ppl from attacking each other?
I think they want the old mechanics
Yes
However, I don't know which things it is specifically, but there is a couple things that the client does predict
so for that thing or two it can seem weird when changing to old mechanic style
other then that, very possible to do
Dont you just need to set the attack speed attribute at a high value?
I want to cancel rail rotations. I tried cancelling all BlockPhysicsEvent with setCancelled(true) but still that doesn't work as expected.
Any suggestions?
there is also some movement on paper's side to create a fork or a patch to restore it
set the metadata tag for the orientation
Or do you actually listen for swing or packets adn react to them
since the plugin is not an exact reproduction
metadata is unrelated to block state
@keen compass why it's impossible to cancel it?
metadata is the aborted fetus of something that was meant to become the PDC
i believe what you want to modify is called blockdata by bukkit
for whatever reason bukkit seems to invert the concept of data and state
I want to get BlockPlaceEvent and change those blocks manually, Physics events sends too many events for one block
you don't need to cancel the event, just need to modify the blockstate as mention earlier
NBT works too, but probably best to stick with the API though 😛
Okay I'll do that
At least send first 5 lines
or to pastebin/etc
Make sure the plugin you're using is the same version as spigot
Okok
just fyi
what you posted isn't an error
it is a warning
odds are, it isn't really going to affect what is going on in the server
What's the material for the 6 sided wooden log in code
is there an enum for it in Material
Yes
Yes. i think its just OAK_WOOD
declaration: package: org.bukkit, enum: Material
Are you on 1.8?
You have to specify which type you want in 1.16
there is no generic
if you are using an older version it was just called LOG
Then there is no enum for that
How do I get it then
what for
The Material for it
that doesn't answer the question
Why does what im going to do with it matter
because this is clearly an xy problem and there is probably a better way to do what you want to do
I want to detect when a player clicks it
I'm trying to get the Material so I can do .getType ==
Just told you the material names for it
In 1.12 there is no material for 6 sided logs
The only thing with LOG in it is LOG and LOG_2
yes
which are different colored logs
That is it
no its not
LOG is for OAK_LOG, SPRUCE_LOG, BIRCH_LOG, JUNGLE_LOG. Log2 is ACACIA_LOG and DARK_OAK_LOG
You can use either the metadata byte or go over the MaterialData. I dont know how it was done back then.
https://prnt.sc/tlapnd this is LOG and LOG_2
don't know if orientable was a thing back then but that's what you want to check
@keen compass but does it automattically make it 6 sided wiht the texture?
how can i make a straight line up of particles?
if it isn't in the Material list, it doesn't exist
@spare frost You can go with Block#getData()
It returns a byte that defines how the block looks like.
it doesn't exist, however I know how you can get in the game however
but it isn't a real 6 sided log
you need to use the command block with a certain byte value and it will make it use the texture you are wanting
but as I said, the 6 sided log does not exist in 1.12
not as a distinct material
Am i beeing ignored or just wrong?
You are on 1.12 so you dont have to worry about deprecation.
Just use Block#getData() to check if a placed Block is 6 sided log
myes
ideally you would use orientable
but i don't think that is a thing in 1.12
I know, not as an enum in Material but I can still get it through code
then why are you asking for the material of it
I already dropped that
give @s minecraft:command_block 1 0 {BlockEntityTag:{Command:"setblock ~ ~ ~ minecraft:log variant=oak,axis=none",auto:true}} relevant command, however while although it has the texture of a 6 sided log, it is still a command block
you have already been told how to do what you want to do, by the way
when I found out it wasnt possible in that way, I was like how else to I get it then
I dont think you need a command block to represent a 6 sided log.
Just get the data byte and check if its >12
greater than 12 or equal to 12?
Ok Kyrix im not giving you any advice if you ignore me. bye
my bad
Hello Is There Away I Can Make It So My PuTTy Doesn't Go Inactive. I'm Trying To Run My Mc Server On There
I didnt see it
anyway
how can i make a straight line up of particles?
anyone?
I'm not
error bukkit-plugin shem ?
but okay
I should have clarified, @pastel nacelle it is a command block until placed
that abstracts them into things like orientable
however even when placed, the game still considers it an OAK_LOG
@frigid ember Use Screen and let the server run in a seperate screen window
help why error 'JSON SCHEM ERROR' ?
its a warning
ill write up something then send code
i dont know anything about intellJ
What is Screen?
@frigid ember Definition of screen (Entry 1 of 2)
1: a protective or ornamental device (such as a movable partition) shielding an area from heat or drafts or from view
2: something that shelters, protects, or hides: such as
a: a growth or stand of trees, shrubs, or plants
b: a protective formation of troops, ships, or planes
c: something that covers or disguises the true nature (as of an activity or feeling)
his geniality is just a screen
d(1): a maneuver in various sports (such as basketball or ice hockey) whereby an opponent is legally impeded or the opponent's view of the play is momentarily blocked
(2): SCREEN PASS
screen is a way to separate processes without terminating them in your main shell screen
Basically allows you to run multiple servers at once for an instance
You can think of it as a new console window.
how do i get "Screen?"
Well might be time for you to learn linux if ur planning to use it
almost all linux distros have screen by default
alpine and older (headless) ubuntu versions don't
- "apt-get install screen"
- "screen" and read
Here are the basics
-
List active screens
screen -ls -
start new screen with <name>
screen -S <name> -
resume (or jump to) screen with name
screen -r <name>
ctrl + C to exit active screen
well shouldn't be using an outdated linux version 😛
if it's attached on some session and you're not able to attach it, use -d to deattach iirc
you don't have to write names if it's the only session
Thanks Once Again
btw one cheap hosting provider gives cheap servers but with old kernel and old system version. that sucks but it is damn cheap
so there are some occasions when you might have to use old systems
More or less
getData is deprecated
how can i make a straight line up of particles?
So right now im thinking that this is hard and thats the reason no one is answering
Because we dont use it anymore
Is this a hard thing to do?
What r u trying to do @spare frost
Trying to see if a block is a six sided log block
there isn't an enum in Material for it
So right now im thinking that this is hard and thats the reason no one is answering
@dusky sigil nope its just soo asked 1 google and u found the answer
Six sided?
Create a vector then draw a particle from start to finish with a runnable
@grim halo https://hastebin.com/iqacecoqim.java
that sounds fun
Is there any other way I can do it without deprecation?
That would only include oak wood
You are on 1.12 There wont be an update ever so deprecation is not an issue.
I have search but everythin has led to the deprecated byte values
when 1.12.2 was out and it was the official supported version, there wasnt a way?
@vernal spruce no no one sec
this
just because something is deprecated doesn't mean it can't be used
or doesn't work
since you are on an old version, this isn't even relevant
second, I already told you 6 sided log in game is considered oak_log
there is no OAK_LOG sir
the only way you are going to identify it differently is by its byte value
Whoever asked for a straigth particle line. Here is an example i just wrote.
public void particleLine(final Location from, final Location to, final double delta) {
final World world = from.getWorld();
if (world != to.getWorld()) {
throw new IllegalArgumentException();
}
final Vector deltaVector = to.toVector().subtract(from.toVector());
final double distSquared = deltaVector.lengthSquared();
deltaVector.normalize().multiply(delta);
final Vector stepVector = deltaVector.clone();
while (stepVector.lengthSquared() < distSquared) {
world.spawnParticle(Particle.CLOUD, from.clone().add(stepVector), 1);
stepVector.add(deltaVector);
}
}
@dusky sigil i think
oak_log is the default type in 1.12, it has an id of 17 with a byte value of 0
@keen compass https://prnt.sc/tlbecg
look for LOG_OAK
Nothing
well its is LOG then
and just going to have to use the byte value to determine the types
so am I doing it right
The while should probably be replaced by a for loop but im too lazy to do the math rn
Log2 is for the 2 other types I listed earlier
I am not entirely certain of the byte value
but that appears to be correct
I don't have way currently to verify that as I don't really mess with old versions of MC nor really keep that stuff around
ok
the only downside is that the moment it is picked up if I recall
it will revert
so that is something you are most likely going to have to handle
@grim halo thanks for doing all that FUN stuff yourself (:
also it will revert on being placed as well too not entirely sure on that
just have to handle changing it back is all
do i import the bukkit vector or the java vector?
Bukkit vector
kay
The bukkit vector. Its a geometrical vector (x, y, z)
The java vector is more of a stack thing (i think. Never rly used it)
A vector can represent speed
java
Vector(int initialCapacity, int capacityIncrement) Constructs an empty vector with the specified initial capacity and capacity increment.
Its a arrow thats points in a direction. The lenght represents the speed and the direction... well represents the direction of the speed
bukkit Vector(double x, double y, double z) Construct the vector with provided double components. Vector(float x, float y, float z) Construct the vector with provided float components. Vector(int x, int y, int z)
Vectors are trajectories of an object
it does account for the speed of an object
so you can use vectors to know where an object will be ahead of time 😉
Also implies that the 4 ARMOR slots are accessible.
yet the size is 5 and not 9?
Anyone know why I can't access the 4 "crafting" slots?
Well I just iterate through the opened inventory but it's as if it won't interact with those 4 🤔
you have to interact with those 4 specifically. Also the reason it doesn't show 9 is because there is only 5 slots for crafting
the reason it implies that the armor slots are accessible is because the only time you will have the 4 slot craft matrix is in the player inventory
how can i get an entity location without getting the x y and z or is there no way to do that?
entity.getLocation()
guys fast question im trying to do that
@SuppressWarnings("deprecation")
@EventHandler
public void Command(PlayerCommandPreprocessEvent e) {
Player p = e.getPlayer();
if(e.getFormat().equals("queue leave")) {
p.getInventory().setItem(3, playerhead);
}
}
i want to do something like this
ZombieLoc = new Location(Zombie.getLocation());
but it doesnt work
because new Location doesn't take a location
use Zombie.getLocation().clone()
^
the reason it implies that the armor slots are accessible is because the only time you will have the 4 slot craft matrix is in the player inventory
@keen compass why would iterating through the top inventory of the view not iterate through those 4?
You can create a new location with the same values with .clone() as Location implements Cloneable
new implies the call of a constructor.
get rid of the new keyword lol
Location ZombieLoc = Zombie.getLocation().clone();
is Zombie the instance of some entity?
Cannot make a static reference to the non-static method getLocation() from the type Entity Main.java /Boss/src/me/ronsiv/Boss line 68 Java Problem
yea
its a entity
wait
waitt
sorry
oh boy static location hmm
lmeo
@hardy cedar getFormat isnt a thing anymore. Are you on 1.8?
@frigid ember You just get the player inventory and iterate over 80, 81, 82, 83
can i add 10 in y for a location?
for example location x is
x y z
and location x2 is
So getting the top inventory from the view won't do it?
x y +10 z
Huh, thanks I guess
Yes you can add and subtract values from xy and z as you like
how do i do such magic?
location.add
witchary
If you want to add only 10 in y direction you call
loc.add(0, 10, 0)
@hardy cedar getFormat isnt a thing anymore. Are you on 1.8?
yup but ty i could fix it
@grim halo in the code you sent, whats the double delta?
Its the distance between each point
oh
so if i make it zero
will it just be a stright line
i imagine that would be laggy tho
So smaller values mean a more defined line but more performance impact. If you make it 0 then the distance between each
point is 0... so it will never reach the end
And freeze the server
because im dumb and write a while loop instead of calculation something with a for loop
then you would only have an arithemtic error bc you are dividing by 0
its a particle for each block?
1 = 1 Block.
I think a value between 1 and 0.4 is fine
What version are you on?
I had something in mind that there is a particle lifetime but im not quite sure... let me look it up
so im doing this
ZombieLocEnd = ZombieLoc.add(0, 10, 0);
particleLine(ZombieLoc, ZombieLocEnd, 0.4);```
Ronsiv the first letter of a variable should be lower case
and it doesnt work
Yes because end and start are the same location
You need to clone one and add 10 to it
whats wrong with doing 2?
also, how do i do that?
do i add .clone() to zombielocend
zombieLocEnd = zombieLoc.clone().add(0, 10, 0)
Otherwise you just put the loc in a new variable and add 10 to it. So both variables point to the same Object
Huge lag. Please help :/
https://www.spigotmc.org/threads/huge-ping-at-chunk-loading.452897/
Timings: https://timings.aikar.co/?id=7036dec0015149cea9fbf584fd9da212
Video showing the problem: [MEDIA]
Ask me questions in comments. I am available...
@frigid ember Did you pregenerate the world?
sorry im just throwing a guess
should not lag. Its 1.12.2
lol
@frigid ember Did you pregenerate the world?
simply reduce the view-distance
If yes -> run your server once with the --forceUpgrade parameter. Otherwise the server has to update the chunks live.
no
ok
No dont just reduce the view distance... its a chunk loading problem and the server should be able to handle that
it was lagging on 4 render distance
how much big
If yes -> run your server once with the --forceUpgrade parameter. Otherwise the server has to update the chunks live.
200x200 around
hmm
im not updating from 1.12.2
maybe if mojang add multithreading and lag fixes for game
sure
being largely on a single thread is not the issue behind performance
1.16.1 is also optimized on server-side
I will pay 5$ for someone who fixes it
the issue behind performance is that nobody optimizes anything
its not much
1.16.1 runs really well
but its something
yeah
yeah for 500 player server....
in 1.16 though mojang has indicated interest in actually putting some time into optimizing things
But we have entity lag yay
they actually did a pretty nice optimization pertaining to chunk data
it's not much, but it means they are moving in the right direction
So you are on 1.12.2
Do you have high hdd usage? Does your server run on an SSD?
SSD
and its like 5%
XD
and tps are good ram
what is good
cpu too
i mean usage
@frigid ember get a NVMe ssd
its shared host
are u using a hdd
ok
Wtf Kshitij... you dont need an NVME for minecraft. SSD is more than enought
most competent shared hosts provide nvme
its a shared host. u never know how much the cpu load is, and u also don't know how much cpu you have
im happy with SSD and ryzen
they didnt "gurantee" you
A shared host and you have 500 players?
lol
weird, my message got deleted
its because of "spam"
i blocked bot 😂
🤣
Ok lets try to narrow down the problem.
There are essentially 3 things that can be wrong here.
- You dont heve the necessary IO speed.
- Your world version is not compatible with your server version and the chunks need to update
- Some plugin hooks into the ChunkLoadEvent and delays it
Yeah if it's just a test server, I would disable all plugins and see if you still have the problem, to start
the only thing i can see is that, it is a "shared host", where we never know how much of cpu usage is available for the server
okay
but weird
should i just rename plugins folder to plugins2
ur other world loads fine
should disable?
ok
@grim halo alright the particles work now but how do i make it so they live more?
Schedule a BukkitRunnable
BukkitRunnable allows to make timers (loops) and delayed tasks
i had seen a tutorial but i forgot
how do i implement one?
it does sound compelling
final int tickDelay = 10;
Bukkit.getScheduler().runTaskLater(plugin, () -> {
System.out.println("This will run after 10 ticks.");
}, tickDelay);
Here is a example
https://www.youtube.com/watch?v=jEFkL1uTyHA
@dusky sigil
Check out our new website! http://www.bukkitlessons.com/
Contact me on Skype with ANY questions or email me!
Skype - Appljuze
Email - appljuzeprogramming@gmail.com
This example is a bit more beginner friendly i think
final int tickDelay = 10;
Bukkit.getScheduler().runTaskLater(this, new Runnable() {
@Override
public void run() {
System.out.println("This also runs after 10 ticks.");
}
}, tickDelay);
ok guys, good night
anyone knows what im doing wrong?https://paste.helpch.at/tigujuboke.java https://paste.helpch.at/wuvaxafila.md
gotta go
update: issue occurs on clear server without any plugins
Not using lambdas, ew.
Or a hardware issue?
no
no
other worlds load fine right? @frigid ember
it was happening on other hosting
Oh do they
ok gn guys
ty
anyone knows what im doing wrong?https://paste.helpch.at/tigujuboke.java https://paste.helpch.at/wuvaxafila.md
@frigid ember
good day
If it was also happening on another host then the world is not compatible with your server version
how can i fix the world?
@frigid ember That code is unreadable. Try early escaping
??
eg
if (!CHFenabled) {
return;
}
It's an NPE, meaning that something you're trying to call a method on is null
Write readable code and i will be glad to read it and give you advice.
what?
This is driving me crazy! Trying to run CraftBukkit from source, after running BuildTools and applyPatches I'm getting this error when trying to run Main 🤔
you never init the field, it's null
hold on you're trying to do what now lol
anyone knows what im doing wrong?https://paste.helpch.at/tigujuboke.java https://paste.helpch.at/wuvaxafila.md
@frigid ember look at console
We've told you
hold on you're trying to do what now lol
@bronze acorn me? 😄
You have a field which you haven't set, hence it's null, hence the NPE
Go create the map
badwordCount?
yes
basically (again); learn java and try again
I swear petakoumak just called 2 ppl "noobs" today/yesterday... because they asked something.
Yeah I'm making a PR to CraftBukkit and I made a new project to make some new patches but I can't get it to run with a fresh BuildTools
Those errors look like the obfuscation mapping might be off
public static HashMap<String, Integer> badwordCount = new HashMap<>(); ?
Yep I can see NMS code
The fact that it's all red....
That's just the version control, because they're not staged?
Reimport the maven project, or try the famous "reset caches"
all of the commits should be fully applied by the point you come to edit it
Huh? NMS code isn't going to be committed is it?
It will be to a sub repo for patches and stuff.
Yeah that's what I thought
Idk what's causing this error in PiglinAI though, it doesn't happen in my older instance of BuildTools hmm
huh
All I've done is run BuildTools --rev 1.16.1, run applyPatches and then imported Bukkit & CraftBukkit into IntelliJ as maven projects
Oh and mvn install
on both
Where can I find how rails work?
I need the actual algorithm
So InventoryCloseEvent doesn't get called when a player closes their own inventory?
sucks
i think it does
Player inventory is very much clientside most of the time
Welp, this:
public void onInventoryClose(final InventoryCloseEvent event) {
System.out.println(event.getView().getType());
doesn't get called with the player inventory xd
It won’t tell you you opened it either
the player inventory is considered to be always open by the server as far as i understand
if you want one key shortcut like "e", you can use "f" key which will swap hands, but I don't recommend that
i mean overall as a server without forge
the only limitation is that you can only capture the key presses that are defined and not just any arbitrary key press
so that means if someone maps the forward key to say the up arrow, it still shows it as a w key press in the packet
basically any key press
Question, however, one can method as Boolean.parseBoolean(); in a Generic Class ? So I have a string and I want to make it a T. Casting wouldn't work in this context i think?
How can I get EntityPlayer from GameProfile?
Dont think you can
As that would need that player to be online in the first place
but i might have some code
you can but it involves nms fucknuggetry
let me check
@tacit trellis get the UUID to fetch the relevent EntityObject
iirc loka has a an util for that
1 min
But the GameProfile is a NPC
NPC's still have UUID's
private Location loc;
private QuestsMain pl = JavaPlugin.getPlugin(QuestsMain.class);
public Npc(Location loc,String nume) {
this.loc=loc;
MinecraftServer server = ((CraftServer)Bukkit.getServer()).getServer();
WorldServer world = ((CraftWorld)loc.getWorld()).getHandle();
GameProfile gp = new GameProfile(UUID.randomUUID(),ChatColor.translateAlternateColorCodes('&', pl.getConfig().getString("Npc.Nume")));
gp.getProperties().clear();
gp.getProperties().put("textures", new Property("textures","
"));
EntityPlayer npc = new EntityPlayer(server,world,
gp,
new PlayerInteractManager(world));```
Aren't the key presses processed client side and the packets bounded to those are sent appropriately to the server?
more exactly
EntityPlayer npc = new EntityPlayer(server,world, gp, new PlayerInteractManager(world));
well I tried this and it gave me NullPointer ((CraftPlayer) Bukkit.getPlayer(profile.getName())).getHandle()
i kinda spooned you the code above
oh
Question, however, one can method as Boolean.parseBoolean(); in a Generic Class ? So I have a string and I want to make it a T. Casting wouldn't work in this context i think?
Npc packets are quite annoying ngl
Why new PlayerInteractManager(world))?
after like figuring out how to do it,the guy was like 'i dont want it anymore because it flashes sometimes in the tab'
Why
new PlayerInteractManager(world))?
@tacit trellis becausePlayerInteractManager playerinteractmanager
the perameter is a interactmanager
wich has this parameter
public PlayerInteractManager(World world) {
I did this: java EntityPlayer npc = new EntityPlayer((MinecraftServer) p.getServer(), (WorldServer) p.getWorld(), profile, new PlayerInteractManager((World) p.getWorld()));
p.getworld is a normal player?
yes
it need WorldServer not World
ahh yeah
nvm then
welp ur right
forgot i get worldserver
WorldServer world = ((CraftWorld)loc.getWorld()).getHandle();
(WorldServer) p.getWorld() doesnt work?
you need the handle
true
not the world itself
or rather, you need the world itself, not the bukkit wrapper
depending how you look at it
how rails work guys?
what you mean
the actual algorithm which rotates the rails correctly after you place it
How do I cast p.getServer to MinecraftServer?
declaration: package: org.bukkit.block.data, interface: Rail
that doesn't answer anything
MinecraftServer server = ((CraftServer)Bukkit.getServer()).getServer();
It just does a physiccheck when a block is placed
and checks adjacent block
Well I know
no algorithm or shit
I did that but can't figure out how to correctly implement it
(it's retextured rails)
@toxic pine stop
?ban @toxic pine
🔨 Banned 584764082163286028 indefinitely
and gone
shouldn't you include a ban reason
dont think it matters
You guys are my proof 🙂
makes no sense for these peoples
Hey! I ran /version on my server and got this response
19.07 23:34:49 [Server] Server thread/INFO This server is running CraftBukkit version git-Spigot-8fc58f1-50484a6 (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT)
19.07 23:34:49 [Server] Server thread/INFO Checking version, please wait...
19.07 23:34:49 [Server] Thread-27/INFO You are 91 version(s) behind
it makes sense because when they appeal 2 years from now nobody will remember why they were banned lol
How do I update spigot?
?bt
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
@pastel nacelle im confident md has trust in his moderators
🔨 Banned
584764082163286028indefinitely
Thats a very long time.
Good thing I'm a junior moderator 😄
also i think cafebabe is logging us 👀
👀
Lol what did I miss 😄
And reporting to NSA btw
but were from EU though
But if you wear a tin foil hat, you'll be protected
not from Choco
hey there I
I'm playing on a server which has spawn world as well as survival world.
whenever trying to exit nether portal from nether, we are spawning in a void world instead of survival world.
does anyone know how to fix it?
Checked config options for some kind of "use worlds nether"
As you have 2 normal worlds but only 1 standard nether world
yes
thanks
Oh wow, I just updated to IntelliJ 2020 and it has a new font and it can parse JavaDoc inline
That's gonna take some getting used to
ew
inline methods is ugly
You can toggle them, guess it's useful to see what the JavaDoc will look like
Although the font size looks huge now :S
I really like eclipse and intellij
I used to use eclipse but IntelliJ just takes my productivity to the next level
Its own decision what we can use
I get IntelliJ Ultimate edition free through University too 😛
I got MS Paint for programming lessons
I got IRL notepad for notes, vim for editing, netbeans for IDE (eh
I was lazy to set up vim), gimp for image manipulation
I have somewhere a graphic tablet but it's easier to use old notepad
(oops it's not #general sorry)
Well, anyone can get IntelliJ for free now, if they have a student email
isn't intellij open source?
They offer an Ultimate edition with additional features, for Hibernate and Spring support etc
I switched from eclipse to intellij and intellij is 20x better
isn't intellij open source?
Community only
I want a mob to tp to a random spot within a area, how can i do that?
I can't tell if I like this font, even after I've made it smaller
thats pretty smol
Which part are you unsure about, teleporting the mob or figuring out the random location?
And lol, updating IntelliJ fixed that issue I was having running CraftBukkit
Just use random to create a random set of coordinates
Sometimes intellij will just randomly flip out. Been fine for me for a while now tho.
and how do i check if that block isnt already a block?
Find the highest block at that location and teleport them there
Or just iterate through all blocks on the y coordinate until you find air