#help-archived
1 messages · Page 61 of 1
hmm
dont edit server-ip unless you know what youre doing
amazing how many people fill it with garbage
just leave it blank
: **** FAILED TO BIND TO PORT!
[23:34:14] [Server thread/WARN]: The exception was: java.net.BindException: Cannot assign requested address: bind
[23:34:14] [Server thread/WARN]: Perhaps a server is already running on that port?
[23:34:14] [Server thread/INFO]: Stopping server
yeah thats the thingy
leave it blank
just leave it blank
you dont need to have anything in server-ip usually :)
though
mine is set to an ip but works, cant really remember the reason though
also, came here with a question
blurred out the info but. rich presence
how do?
i cant join my server know
omg bruh
heck
not even sure if it's possible to get a rich presence thingy working. curious though
wynn is a mod-free server though and they managed to do it
that isn't your public IP, that's local
exACTLY
if you want to find your ip, use ipchicken.com :)
keep in mind, some are "dynamic" which means they change
which is bad
you'll want to change it to "static"
WHAT
Is there a reason why the PreLogin events don’t fire when the player joins the server while the server is still starting?
If the server has already finished starting, then the events fire fine
Otherwise if the player joins say mid world load, the events won’t get fired
not sure if this is a great idea but for me i changed late-bind in spigot.yml
Is that in response to my question?
ye!
i think i might have another answer though
Late bind on what toggle? true or false
I'm using a file configuration object and I was wondering if there is any way if I can get a list of all the boolean values that map to a string in that object. Ex: I want to get a list (with this image) like e54bb1e5-ee8d-44a5-8ebd-a44daf8c8dbd, 49a591c5-e116-4434-a8bf-6d3f225770e, more values.
i broke everything
late-bind: true seems to help :D
maybe your plugin is loading last, so when someone joins during the load, they "fly under the radar"
not sure how to change the 'load order' though
Well no because iirc, players can’t actually “join” until all plugins are loaded
event priority?
^
hmmmm alright, i'm not sure then :U
PlayerJoinEvent works fine, it’s just the pre login events
Nope, priority is something entirely different
why don't you just stick with PlayerJoinEvent then?
Ill try late bind once I’m out of the dumper
Because I’m trying to deny join if something in my plugin hasn’t loaded yet
this is a really bad workaround but uh
And I don’t really wanna have to kick 1-2 ticks after PlayerJoinEvent if that’s the case
you could still do that with playerjoinevent though
ye
event.setCancled(true);
maybe just declare some boolean somewhere, check if it's true, if not, kick
Seems like a hackjob
Wat
it’s not cancellable m8
I know but that’s what I’m trying to avoid entirely, and imo that’s something the pre logins SHOULD be able to handle
the kicking seems like a hackjob to me and i don’t wanna have to implement it if I don’t have to
wish i could help more
Yea no worries, gonna try the late bind thing when I’m done shitting
Not trying to grab a player, just need to disallow the joining
wait
actually
not sure if players can join before all plugins have loaded
something tells me they can
but late-bind: true will disable this
Yup, gonna try that in a bit
Having stomach problems rn
heck
hope you recover soon :^)
stomach empty probs
Tbh I think it’s the new protein I’m using
made me blast my toilet to oblivion
what are you using
Fortress-somethinf
probably some soy crapola
yeh, soy will grow you nipples
whey>>>
well you know what i mean
switching back to muscle pharm after i’m done with this bucket
anyway that stuff can go bad if left open
do you use protein
stick with the muscle milk, can't go wrong
i do pre workout before i workout
pre-pre-workout?
?
I have a post-post-workout, involves tacos
Sorry for interrupting the conversation, but anyone know how I can create a list of all the items in a file configuration object? #help-archived message
you mean to get the keys?
look at the javadocs for ConfigurationSection
kk
probably just ConfigurationSection#getKeys(depth)
wait
you want to get all of the keys in a HashMap?
oh
nevermind
i was going to say getKeys
er
what in the world is a deep list?
keySet()
well that gets a list of the keys in a map
same, it's a map
so I'm not following do you already have a Map object, or are you getting one from a ConfigurationSection?
deep list?
you mean the bool for getKeys?
I'm confused
ok, start over, what do you have and what are you trying to get?
so I have this data.yml file e54bb1e5-ee8d-44a5-8ebd-a44daf8c8dbd: true 49a591c5-e116-4434-a8bf-6d3f225770e9: true
right, so yml, means configuration file.
and I want to list all the uuids that have the "true" hash in a list
you will have a ConfigurationSection returned
but in getMapList() do I put true or false?
how can i escape this issue
why are you assuming it's a map
because it is?
what else could it be?
because the only values in the config are string:boolean
yes
@frigid ember thanks
it worked
late bind feature was auto implemented in later versions, didn’t know that being disabled caused that issue in legacy versions
and you then iterate over whatever the base set of object (keys) are in it
glad it worked :)
yes
so simply iterate over getKeys(false) and get the boolean value of the key.
if they are always boolean values, then you won't have to worry
do you have anything else in this file?
nope, just that
I think I made a noob mistake
Map<String, boolean> police = Main.getInstance().Data.getMapList(false);
@green hornet you have something that is trying to modify something concurrently, looks like entities maybe. Either way its a plugin doing something it isn't suppose to
I just like yml though
a plugin changing a pathfinder while minecraft is looping it?
are you trying to change a PathfinderGoal?
i have a method which can many any moving entity walk to any location if you like
it's kinda hacky and dirty though
@green hornet I can't say for certain other then it involves the skeleton entity and something trying to be done concurrently
nevermind HashMap<String, boolean> police = Main.getInstance().Data.getMapList(false);
ok thanks
@pastel condor what is Data
the config file object
@green hornet I will bet it is probably MythicMobs
best way to find out is remove plugins one by one until it stops crashing
the last plugin you removed is most likely the one causing the issue
how are you getting/saving your data from the plugin instance?
Main.getInstance().SaveDataFile();
try {
Data.save(DataFile);
} catch (Exception e) {
e.printStackTrace();
}
}```
you've lost me
how about loading?
DataFile = new File(getDataFolder(), "data.yml");
if (!DataFile.exists()) {
DataFile.getParentFile().mkdirs();
saveResource("data.yml", false);
}
Data = YamlConfiguration.loadConfiguration(DataFile);
}```
then createData(); on the onEnable()
and you keep a reference to this object?
so Data is static?
Doesn't appear you have a reference to Data in the main class, which is what you need
wdym I have my public static Main getInstance() { return instance; }
normally I put the saving/loading methods for custom yml files in their own class
makes it easier
soz, I haven't seen any code yet.
Lets see that main class
but anyway, you load the yaml file with YamlConfiguration.loadConfiguration, and it puts it in Data
yes
Anyone here know the 1.15.2 entity NMS mappings? Please dm or @ me 🙂
and you then access Data and get the keys with the getKeys(false)
or Main.getInstance().Data?
hey someone give me an urgent help
/nocheatdkjsakjhlsadhjksa21
someone came
and did this command
and got op on our server
Depends on where you are acessing it from
wdym?
can just static import Data from Main class if it is public
https://github.com/ramdon-person/SimplePolice/blob/master/SimplePolice/src/com/voidcitymc/plugins/SimplePolice/Main.java#L47-L48
that can be replaced with SaveDefaultConfig(); and if you use that method, then in your load method for your custom yml file, you don't need to check to see if the directory was created as the server will do that for you.
@stable egret sounds like you got a plugin w/ malware
@stable egret means you are using a malicious plugin
entity NMS mappings? what does that mean?
@inland oxide NMS mappings have changed for entities from 1.14.4 to 1.15.2, looking to find what the new methods/classes are
@frigid ember If you don't want to worry about some cross-compatbility later from when late-bind setting was removed, etc. You can just use PlayerLoginEvent
@stable egret copy your plugins to another server, and then start removing them one by one, and use that command they used to see which one gives you ops. The moment that command don't work then you know the last plugin removed is your malicious ones. Generally shouldn't download plugins from random places. 😉
I will try that, will be much cleaner than working with late bind setting through server code
omg I meant to use getValues(false); not the map thingy
sorry about the time waster guys
usually, it's getKeys(false), then check if said key is boolean, then get value.
but if you are the only one saving to that file and it's all boolean then ...
yeah
or I could just check if the object is instanceOf boolean
just to make sure
people don't dump garbage in the config file and have my plugin spam errors
it is a text file
yes
omg
i just pulled a seed ive used before
i delte the world every time
and
i got one that had placed blocks
i use for speedrunning
just wondering which plugin was it? @stable egret
if it is a plugin that you downloaded from spigot resources, I would highly recommend reporting it @stable egret
but I doubt that is where you got it from though lol
no
my stupid developer
so here the story
we have a rival server for some reason they came on our server and used cheats
and then logged in with another username
told my stupid developer that i have a anticheat you can use its really god
good*
i was offline then
so my dev thought it was ok to use a plugin from a player
thus this happened
@stable egret prime example of not using plugins from unofficial sources
Helo
never accept plugins from random players XD
Where general ?
next channel up
umm ok thanks
Hewoo i need halp
why?
I cant start the server, as soon as I try to ping it the console goes crazy
Im using spigot 1.8.8
umm maybe ur host
The PC is next to me
the Server PC
Vanilla minecraft works fine, but when I use the Spigot server.jar it doesn't work
I just spits out some information that I cannot read because its gone too fast
@frigid ember Are there any console error?
I cant read them
If there is, please send here so we can try to understand what problem is.
Try to open logs
logs/latest
Just use pastebin or hastebin
whats that
Try to paste last 100 line
can I past all of it?
I dont see lines, it just a basic text editor
l
...
I made about 5 Million lines in 3 seconds
but 1.8 should also work?
1.8 bad 1.15 good
you should expect zero support for such an outdated version
regardless if outdated servers exist has no bearing on whether or not to expect support for outdated versions
officially supported version here is 1.15.2 There is little reason to run outdated versions
...
1.8 only makes up 10% of servers, where 1.15 is like at 55%
ok
not entirely sure what the screen shots are for o.O
for minecraft cancer 1.8 community
that servers also run 1.8?
so there're a lot of 1.8 servers which has a thousand players
I never said they didn't, just that it is severely outdated
and there is no official support for outdated versions
as you mention it. I hope the community will move to 1.16
if you want to consider 10% of servers a lot I guess @chrome edge
but 1.15 is at 55%
But there're not big enough. I love Minecraft latest version of course but there're no 1.15 server which has more then 100 players
that is on the network to figure out how to get more 😉
its not imposssible to have more then 100 players on 1.15 if you know what you are doing
Should I wait player until GUI loads. GUI has data which comes from database but whenever I consider it, it's weird. Imagine you send request to open gui but you're waiting and you send 10 more time. I run async task back and can detect if there's request or not. If there is, it can cancel other request but what about others? There're a lot of database request in server like getting player data or guild datas. Have I use same method for all of them? 😭
bit hard to read that
Anyways, grab the stuff from the DB first before launching the GUI
and it would be wise if you could centralize the methods, this way you don't have a bunch of duplicate code everywhere
There are a lot of datas which can gets by sending request. Should I use same method as gui?
what same method?
Like I run asycn back. If you send request again it cancels due to there is already.
your DB connections should be ran in their own threads using connection pooling
it would take a lot to bog down a decently configured mysql server
literally can handle millions of requests per second if configured properly. So your issue isn't going to be the connections or the amount of data going between the server and DB. Its going to be how you code your plugin and whether or not you take advantage of connection pooling.
My datas takes 1-3ms each. There's no problem for that but I've to take care for future.
You may understand what I said to looking hypixel profile. If you click "guild" category, your menu freezes and waiting until data comes. My question is should I use the method that is same what hypixel did for his guild menu for every data.
have no idea how hypixel does it
however, you could use a caching mechanism like redis
to store cached data for later use that you know you might need
I use both mongo and redis. Mongo for saving player profile. Redis for cache
Then you shouldn't have an issue with loading gui's if you can cache the data ahead of time
You don't understand my question or I couldn't write it properly 😦
hypixel if they are smart they would have a server app specifically designed to handle this data
most likely
But hypixel pays devs to solve those problems too
like what a large network should do 😛
My solution is cancel same process while its in async.
you shouldn't need to cancel it
Example /profile X waits until data comes. But if you execute again you have to wait
why would you have to wait?
'cause data is not coming yet
if you write it it'll going to pool and after a while it would kill database xD
no, that isn't how that works
connection pooling works by not killing connections and just re-uses the connections no longer being used
and it won't kill the DB
I'fve tested a thousand ways to do. I meant to say not killing database just slowdown the data comes.
Like this picture;
then you need to redesign your db or re-configure your db server to handle it
It's just a test. It's not possible to send 10K data with my systems.
But I should thinking future
Am I crazy about it? :/
anyways, if you want to handle the Queue, just make a custom object where it contains your methods for the DB that has a method that keeps track if the data was requested before
this way if the command is ran again, you can handle and know that data is waiting
and thus not make an additional call to the DB
I lost my account and I can’t get it back because I lose the device for the 2fa aswell as the back up codes
@keen compass that's what I said before 😭
I don't normally mess with mongo, so I have no idea what methods are available for mongo to take advantage of if a request is pending
@dreamy ermine email support using the email of the account you need to get back into
?support
if you lost both the email and 2fa then you are pretty much screwed but you can try contacting support anyways
In the end I've decided to use check if there are async for this request. If it is, not call the db again.
@keen compass I’ve got resources on the account that I need to update
I am not the one that makes the rules, have to contact support
I am not even staff, just pointing you in the direction for you to get the appropriate help
Thanks man x
@keen compass I think CompletableFuture may help me. What do you think?
It's best for getting value without callback.
It can return back the method.
Hello there.
Anyone aware of a bug whereby Bad Omen isn't given after killing a Pillager captain?
you could try using that @chrome edge
anyways brb, I need to go check my property for predators. Dogs going crazy XD
Is CompletableFuture Supplier block spigot main thread?
it should be ran async otherwise it will
CompletableFuture<String> future = CompletableFuture.supplyAsync(new Supplier<String>() {
@Override
public String get() {
try {
TimeUnit.SECONDS.sleep(5);
} catch (InterruptedException e) {
throw new IllegalStateException(e);
}
return "result...";
}
});
return future.get();
}``` Is there any mistake?
oh wait I should run in background 😭
i still don't understand completable future, if you put something to run async and then use get, wouldn't that lock the main thread till the async task is done? 🤔
put get() into a variable so that you can check on it.
I can use it as a interface and callback with interface
but I just want to use get
and use ``` new Thread(() -> {
}).start();``` works for interface and doing your work in background
so, if you use get() in a separate thread, it will block just that thread and not the main thread
You can pass information from threads, not all that difficult to do.
But it how CompletableFuture works as I see from tutorial. As tutorial said If I want to return it, I should use it.
Even the code comes from tutorial pages on internet -_-
weird..
if you want it now just don't use completable future at all :p
just delete minecraft it's solution for me xD
I noticed how weird I am. It is freeze main thread of course.. 'cause I'm trying to get future data...
You need to return the future itself so that you can tell it what to do with the data once it's done
calling get() will just block for the outcome
Is it possible to check if lightning is summoned by a plugin such as essentials?
@narrow crypt what is essentials doing to summon lightning?
the case is i dont know which plugin it is
one of my users that uses my plugin
the plugin summons a airdrop on lightning but he has a plugin that adds an enchantments which brings lightning as enchantments
I suggest creating a disabled-plugins folder, put all the plugins in there, and then start adding the suspected plugins one by one (testing each one) into the plugins folder
When it happens, you know which plugin it is
yea but can i do event. cause. pluginname @patent monolith
cause its not only for him but for all users
this bug is making me go crazy can some one help?
https://www.spigotmc.org/threads/sorting-list-from-a-hashmap.436364/
Are there any other plugin that does the same thing as viaversion?
Viaversion kicks disconnect.spam
Hello!
I've this:
EntityPlayer npc = new EntityPlayer(nmsServer, nmsWorld, gameProfile, new PlayerInteractManager(nmsWorld));
Player npcPlayer = npc.getBukkitEntity().getPlayer();
npcPlayer.setPlayerListName("");
npc.setLocation(spawn.getX(), spawn.getY(), spawn.getZ(), spawn.getYaw(), spawn.getPitch());```
The problem is the Yaw
It only rotates the body, but not the head
I should do * 2 PI ?
try switch all the internal values instead
something like am = lastyaw= yaw = youryaw
@paper pumice As I see, you're saving player's points into list integer but you forgot something very important. Map cannot containg same keys. So if you have "test" key in hasmap you cannot save another "test".
You can use java 8 method for sort maps effective way.
Map<UUID, Double> r = map
.entrySet()
.stream()
.sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
.collect(
Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2,
LinkedHashMap::new));
It sorts highest to lowest due to "reverseOrder"
Ahh I see, how can I implement this into my code? @chrome edge
Also thanks for the reply.
Do I just change the hashMap?
put your map data to "map"
"map".entrySet...
.entrySet()
.stream()
.sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
.collect(
Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2,
LinkedHashMap::new));```
change "myMapData" to your map data.
`
Map<Integer, Player> getPlayerFromValue = new HashMap<Integer, Player>();
Map<Player, Integer> getValueFromPlayer = new HashMap<Player, Integer>();
Map<Player, Integer> topList = getValueFromPlayer
.entrySet()
.stream()
.sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
.collect(
Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2,
LinkedHashMap::new));`
code
So like this?
Yes
You shouldn't use "Player" into hashmap
you should save their UUID
It's bad to save it.
Player can changable and huge data inside its. If you leave and join again, the hashmap will not work for this player
Save UUID trust me.
@tiny dagger Don't work. I had to use the Packet Head Rotation.
Okay Iwill
// This is test
I will use UUID
but ty anyway
@lament wolf what's your problem?
for example
I figured out
@frigid ember what are you trying to do xD
ah
when I did npc.setLocation(x,y,z, yaw, pitch); the yaw only affected the body of the entity
tell him how to send php code
@lament wolf NMS entitys has different yaw and pitch
it's upto 360 degree
so you have to convert it
and send head packet
@lament wolf strange because for me it works
return (byte) ((int) (yawpitch * 256.0F / 360.0F));
}```
@chrome edge
Like this?:
``
Map<Integer, UUID> getPlayerFromValue = new HashMap<Integer, UUID>();
Map<UUID, Integer> getValueFromPlayer = new HashMap<UUID, Integer>();
Map<UUID, Integer> topList = getValueFromPlayer.entrySet().stream()
.sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2, LinkedHashMap::new));
public List<Integer> getTop(String crop) {
List<Integer> top10 = new ArrayList<Integer>();
for (Player pl : Bukkit.getOnlinePlayers()) {
getValueFromPlayer.put(pl.getUniqueId(), getData().getInt(pl.getUniqueId().toString() + ".crops." + crop));
pl.sendMessage(getValueFromPlayer.get(pl.getUniqueId()) + "");
top10.add(getValueFromPlayer.get(pl));
getPlayerFromValue.put(getValueFromPlayer.get(pl.getUniqueId()), pl.getUniqueId());
}
Collections.sort(top10);
return top10;
}``
oh nvm
```Java
Some code
```
((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutEntity.PacketPlayOutEntityLook(entity.getId(), getFixRotation(yaw), getFixRotation(pitch), true));
((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityHeadRotation(entity, getFixRotation(yaw)));
}```
😌 I sought it
@paper pumice Let me fix your code and send it.
Thank you a lot
@paper pumice
public void showTopList(Player player) {
Map<UUID, Integer> topList = playerSugarData.entrySet().stream()
.sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2, LinkedHashMap::new));
int n = 1;
for (UUID id : playerSugarData.keySet()) {
player.sendMessage(n+"- "+Bukkit.getPlayer(id).getDisplayName()+" value: "+playerSugarData.get(id));
n++;
}
}```
try it then feedback here
spoonfeeding :ssss
@keen compass I've finished to make it. Take a look at it. It looks great xD I also add timeout so if data won't arrive, thread kill itself.
Also made already in progress feature for if there is same request.
It's up to you. You may make another hashmaps for other sugars
playerSugarData, playerWheatData etc.
Is there not a way to use the crop type for params?
You can use classes
but I don't think you able to do it. You've to learn Java to make process on spigot
As an example you may take a look at https://introcs.cs.princeton.edu/java/32class/Student.java.html
PersistentDataContainer is basically NBT, right?
probabily
i never used it or looked into it but i bet it's an extension of the nbt to allow custom data storage for plugins
that persists after restart
Pretty useful
yes it is
hi
do you guys know how to put kits in crates ? (im sorry if that might seem easy im just new to server managment and stuff)
depends. if you want dynamic then probably get someone to make it for you. otherwise just put static stuff into your crate
like Poop sword
k
ok
Hello, I have an issue with WorldEdit and WorldGurd API.
I have two locations (b1 and b2) and I transform them to sk89q's Vector using getBlockX(), Y and Z methods
Vector min = new Vector(b1.getBlockX(), b1.getBlockY(), b1.getBlockZ());
Vector max = new Vector(b2.getBlockX(), b2.getBlockY(), b2.getBlockZ());
Then I create my region and my protected region with
CuboidRegion region = new CuboidRegion(min, max);
ProtectedCuboidRegion wgr = new ProtectedCuboidRegion(name, min.toBlockVector(), max.toBlockVector());
BUT I'm getting regions with random coordinates ingame, and the regions does not have b1 and b2 for bounds.
sec
I think you want a diff method gimme a sec to look at my code
@solar sandal what exactly is the end result?
the end result is a region with the first boundary wrong and the second one with the right boundary
@solar sandal I meant what do you want it to do
but
try
ProtectedRegion region = new ProtectedCuboidRegion("RegionName", BlockVector3.at(x1, 0, z1), BlockVector3.at(x2, 256, z2));```
I'm using World Edit and World Guard 6.. No BlockVector3
oh WG6?
yes
sry can't help you with that one. I only know 7
and i only wanted to create a region which goes from a specific pos to a specific pos
good luck @solar sandal. Docs on this one are rather, well, not there.
So I have a question about this keyword, should it be used to specify that I'm accessing as class variable?
Like it's not required but it better makes who read know that the variable I'm using is from the same class
No, this is used only if you have variable with the same name like in a method
private String name;
public ClassName(String name) {
this.name = name;
}
Yeah I know about that but I also see it used very often even when it's not absolutely essential
How is it not essential
ok thank you
if this wouldnt exist you would have to name the variables differently
anyone know of a plugin that i could say /claimtool and then i get a golden shovel?
Doesnt the claim plugin already have this? Also most people just put golden shovel in the starting kit
quick question, comparing blocks, == or .equals()
equals..
blocks or Material ?
uh?
nvm he said Block
My plugin seems to be crashing my server and I have no clue how
there is always a error
check crashlog in the folder
there is always a trap error
@vernal spruce there is not a kit
@frigid ember https://bukkit.org/forums/plugin-requests.96/ request and it most likely gonna get filled
i will wait for 1.16x
its not rly gonna be any difference
or just learn java my self lmao
@vernal spruce , I don't think it actually crashes, it goes completely unresponsive and players just time out
what does the plugin do
Oh wait
Found it
[14:54:22 ERROR]: java.lang.String.toLowerCase(Unknown Source)
[14:54:22 ERROR]: org.spigotmc.CaseInsensitiveHashingStrategy.computeHashCode(CaseInsensitiveHashingStrategy.java:11)
[14:54:22 ERROR]: gnu.trove.impl.hash.TCustomObjectHash.hash(TCustomObjectHash.java:94)
[14:54:22 ERROR]: gnu.trove.impl.hash.TObjectHash.index(TObjectHash.java:168)
[14:54:22 ERROR]: gnu.trove.map.hash.TCustomHashMap.get(TCustomHashMap.java:420)
[14:54:22 ERROR]: net.minecraft.server.v1_8_R3.PlayerList.getPlayer(PlayerList.java:1028)
[14:54:22 ERROR]: org.bukkit.craftbukkit.v1_8_R3.CraftServer.getPlayerExact(CraftServer.java:431)
[14:54:22 ERROR]: org.bukkit.craftbukkit.v1_8_R3.CraftServer.getPlayer(CraftServer.java:405)
update
did you make it for the right server version
oh boy just noticed 1.8
also paste the full crash log to pastebin
That's all there is
nobody here really wants to time travel into 2014
2013
@chrome edge nice
lol how do i load a schem into my world?
does getItemInHand on blockplacevent return the correct itemstack on both hands?
I think you need to check each hand individually
the default is the left hand too if I recall
If the block is placed using left hand then left hand item it is, or right hand item if the block placed using right hand
yeah already getting the item based on what hand is used
wished we had a getItem on it though
getItemInHand
Deprecated. Gets the main hand
Use event.getItemInHand() in BlockPlaceEvent
@vernal spruce
Yeah thats what im asking about
does it return the right item no matter what hand?
How do you update the scoreboard for a specific player?
Objective pobj = player.getScoreboard().getObjective("test");
Score spacer2 = pobj.getScore(Formatting.colorize("&8 "));
Doesn't seem to work
java.lang.NullPointerException
at me.straggly.minetropical.events.PlayerScoreboard$1.run(PlayerScoreboard.java:51) ~[?:?]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71) ~[server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [server.jar:git-Spigot-db6de12-18fbb24]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_241]
Score spacer2 = pobj.getScore(Formatting.colorize("&8 "));
Yes it does, Stellrow
It will return the item used in that event regardless of the hand used
Jeeb, that objective doesn't exist, it returns null
o = board.registerNewObjective("test", "");
I'm assuming "test" is the name
Or the String s argument for getObjective()
Correct?
Any help?
does anyone know how i can get a superflat Nether world with multiverse?
I was thinking- should I keep a cache of stuff I read from config files ? Currently im actively retrieving and instantly saving content from config and I feel it’s super taxing on the machine.
When a player is in an inventory and I am adding blocks to it - they are not showing. What's an efficient way to update the inventory when a block is added?
I was thinking- should I keep a cache of stuff I read from config files ? Currently im actively retrieving and instantly saving content from config and I feel it’s super taxing on the machine.
@marsh hawk depends
if you plan to often read stuff you should
Player.updateInventory()
does anyone know how i can get a superflat Nether world with multiverse?
@marsh hawk is that not meant for debugging?
tried that
Is it? I use it often lol
does anyone know how i can get a superflat Nether world with multiverse?
@frigid ember I do know
Its a common error
just specify the ambient type upon generation
@sturdy oar what?
Hmm interesting what is a good alternative then? Guess I have to update my code
Well honestly I'm not quite sure, I never had to really use it. Just from a lot of things I read about Inventory Updating that .updateInventory is purely used for debug purposes. I don't tend to work with updating inventories because I find them a pain in the ass when it comes round to finding efficient ways
@sturdy oar i tried that it just loaded a normal nether world
If it works for you then I'm sure it's okay as it is, in @bitter kernels instance he might not be using it correctly
Player.updateInventory()
updates the players inventory, not custom inventories or other inventories
you are probably best off closing the inventory and then re-opening it @bitter kernel
or you can make it a chest inventory which should show blocks being added
ah okay thank you very much @keen compass I will try those methods
how do i make my sky block to start
What
How do I access my spigot server from the outside of the server's network? I've enabled port forwarding for port 25565 (automatic port), I am using my network's correct public IP address, we tried to go to the forums (couldn't post because couldn't find the button), and looked at reddit.
The only thing that would hinder us would be a Double NAT, but I don't want to contact my ISP to put my modem into bridge mode.
What should I do? The server is running, but I can't connect to it.
if you corectlly port forward all you need to do is connect through the ip
if its your own computer test your port here https://www.yougetsignal.com/tools/open-ports/
it should autofill your ip
also have the server open at that time..
It says the port is closed, but I already enabled port forwarding for that port in my router settings
Have you reset your router?
either firewall might be blocking it
Sometimes it requires a restart to take effect
or as usual your isp placed you behind a NAT
(second router from the isp wich has to be on)
yeah ur behind a NAT..
firewall already dealt with
if you don't want to set your modem to bridge mode to resolve double nat then your only option is to set the router in bridge mode and let the modem do the routing and the router acting as a repeater.
my router is a nighthawk AX4 tho, ig i have to say goodbye to wifi 6
so basically i just need to make the ax4 the bridge?
yes
would that require physical access?
i hate my isp
ur still paying for it
so dont worry..
do i need to physically access the router to change the modes?
the isp would just say the same as I am, either the modem gets placed in bridge mode and their personal router handles that, or the router gets set as a repeater/bridge mode and gets its settings from the modem
most of the time
no, you just need to log into the router
they put theyr own modem in bridge
yes most of the time they will do that
as they do it through a simple button..
hopefully I can just use the router settings because i am over 10k miles away from the server
tq for the help
however, if I put my AX4 into bridge mode, will the TV service get cut off?
or will it still work?
i mean tv =/= internet..
also no.. the worst it can happen is needing to reset the router to default
who know a plugin: it makes a portal and when people are in the portal a command is sended (console command sender)
@frigid ember as it says in the messsage, ask the viaversion devs
Hey guys, is there a wiki or something where I can see all the methods of Entities, like when I extend EntityPig or whatever, how do I know which method does what
look at the java docs
is there javadocs for nms entities?
I couldn't find anything
Yes
check the mappings
Lol Javadoc for nms
How do I check if a player is gonna die with EntityDamageByEntityEvent?
So I can "respawn" the player
check if the health < 0
i usually respawn on the death event
with a 1 tick delay
though it's probably better to do it the other way, I'm just lazy
if (p.getHealth() - event.getFinalDamage() <= 0.0D) {
@paper compass Check if health - finalDamage <= 0
will need to put it at highest priority
I think even then, you might have instances where it slips by annoyingly
why would you need to handle respawning the player o.O
Tournaments/ect
to put them into spectator mode for instance
Turning them into a spectator
auto respawn
tons of reasons
I'm creating OITC
oh he meant nms
don't know what oitc is
yeah you're going to have to look into that yourself
you basically get 1 arrow to shoot someone with a bow
and it will instant kill them, usually first to X kills
@frigid ember What method you looking for?
Yeah I'm just looking to browse for interesting stuff
@paper compass If you're doing OITC, you should just "respawn" on hit instead of damaging the player.
That's easy. All you need after doing that is to register your entity
So the ID is binded
oh, I see
see
😎
@frigid ember Register your new entity in the "EntityTypes" object
In the NMS package
@paper compass You need to check that the target entity is a player.
Use reflection to call those private functions
@lusty vortex , I'm not having problems with registering the entity, I'm just trying to add stuff to the class but it's hard to tell what all the methods mean
oops
That's NMS for you. Some of the functions are mapped, like damageEntity. You just gotta figure them out
alright
Yeah
The only reason why I'm staying on 1.8 is because 1.15 takes forever to load
Don't try to start a debate 😆 . The people here HATE 1.8
lmao...
1.8 move tick is super weird, every entity has their own method name
When my friend kills me, his body gets deleted?
Oh, how do big servers do it then, proxy? @hoary parcel
Player p = (Player) e.getDamager();
Player target = (Player) e.getEntity();
if (p.getItemInHand().getType().equals(Material.WOOD_SWORD)) {
if (target.getHealth() - e.getFinalDamage() <= 0) {
target.setHealth(20);
User sUser = userManager.getUser(p);
User dUser = userManager.getUser(target);
if (manager.isInGame(p) && manager.isInGame(target)) {
sUser.addKills(1);
e.getDamager().remove();
dUser.removeLives(1);
p.sendMessage("§eYou killed §6" + target.getName() + "§e!");
p.getInventory().setItem(2, new ItemStack(Material.ARROW, 1));
if (dUser.getLives() <= 0) {
manager.removePlayer(target);
target.sendTitle("§cYOU DIED!", "§eYou are now out of the game.");
dUser.setAlive(false);
dUser.setInGame(false, null);
return;
}
target.sendTitle("§cYOU DIED!", "§e" + dUser.getLives() + " Lives remaining");
target.teleport(dUser.getGame().getRandomSpawn());
target.getInventory().setItem(2, new ItemStack(Material.ARROW, 1));
}
}
}
}```
SHIT
I REALISED
e.getDamager().remove();
LMAO
what do people think of ip
they instead put ddos protection in-between you and the actual server
it's not the gateway to evil it's your internet address
@lusty vortex do you know how to fix this? When I'm loading my 1.15 world it just says 0 for a long time
it's not the gateway to evil it's your internet address
I mean
its the gateway to the internet
so its the gateway to evil 😂
which can be evil
Does anyone know how to get the ID of a hologram using HolographicDisplaysAPI?
Ok but if someone has my public ip what can they do with that?
Is ddos it? In which case I'm not worried
"erm well" doesn't sound assuring, lol
I mean... Depends who has it.
Well you shouldn't be hosting from your home computer anyways
As long as you secure your end behind a firewall and complex passwords and better yet SSH keys you'll be fine.
depends on your opened ports tbh
I know nothing about networking really, what do I need to do be secure?
If your hosting from your home computer and streaming a movie then everyone on your server could lag
It's on a separate machine
MC don't use that much bandwidth xD
eks dee
Streaming movies might
I mean you leave your public IP everywhere so it's not something I would worry about.
close ports
If you're home hosted it's likely to change every so often anyway.
especially 80
I've set it to be static
what are the sensitive ports btw? 🤔
Alright how do I close ports freestyler? If I was to google that what exactly would I google?
You don't just set a public address to a static address, that normally costs extra.
your router does it for you
Ok, if my router does it for me why'd you saY?
nice bios
I assume there's something I've got to do
If you haven't touched anything your end it'll be setup as default.
Port forwarding is your main concern at this point, only open the ports MC is using.
Example 25565 and what ever RCON is
What does RCON mean lol
i have errors. Please Help
at org.mcstats.Metrics.postPlugin(Metrics.java:336) ~[?:?]
at org.mcstats.Metrics.access$4(Metrics.java:329) ~[?:?]
at org.mcstats.Metrics$1.run(Metrics.java:224) ~[?:?]
at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:81) ~[spigot-1.15.2-R0.1-SNAPSHOT.jar:git-Spigot-2040c4c-893ad93]
at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) [spigot-1.15.2-R0.1-SNAPSHOT.jar:git-Spigot-2040c4c-893ad93]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
Don't worry about it then, you're probably not using it.
Alright my only ports open are 25565 on tcp and udp
@digital sphinx Paste bin the code mate.
Huh?
Plot²
So it's a plugin you've downloaded ?
Yes, i bought it. And then i downloadeded
I wouldn't be reporting it here, doesn't look like something you can deal with. I would submit a bug report to the seller, check his instructions first.
Yeah, they have a support discord I think
Im getting errors like this every time i go to chunks near the corner of my pregenerated world:
> [18:33:49] [Spigot Watchdog Thread/ERROR]: net.minecraft.server.v1_15_R1.World.setTypeAndData(World.java:297)
> [18:33:49] [Spigot Watchdog Thread/ERROR]: net.minecraft.server.v1_15_R1.World.a(World.java:380)```
I have no idea what to do about it tho
@rapid sand As I understand from the 3 line error code it's about placing block in chunk and notify the chunk that block is places so chunk can do physic to it.
If you generate world another version, it can make those error or maybe block id problems.
If i were to run this through a chunk fixer program, would it fix it?
basically ive put a 1.12 singleplayer forge generated custom biome OTG world, deleted all the entities and put it into a 1.15 world by forceupgrading
anyone know why this code wouldn't be working its supposed to set sugar cane blocks mined to air and put them directly in the inventory of the player
@EventHandler
public void onSugarCane(BlockBreakEvent e) {
Player p = e.getPlayer();
Block b = e.getBlock();
Material m = b.getType();
if (m == Material.SUGAR_CANE) {
int canes = 0;
e.setCancelled(true);
do {
b.setType(Material.AIR);
b = b.getRelative(BlockFace.UP, 1);
canes++;
} while (m == Material.SUGAR_CANE);
p.getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes));
}
}
}```
whats the bukkit datapacks folder for?
Is there a way to load a datapack from within a plugin?
No there is not. Datapacks should be world/data or something like that. Whatever the vanilla per-world one is
But it isnt crashing my server so I'm happy 🙂
It should. If you're running that code, it will crash your server
It's an infinite loop
ah right, there's a bukkit datapack folder though. The description says "datapack for resources provided by bukkit plugins"
That being said, change while (m == Material.SUGAR_CANE); to while (b.getType() == Material.SUGAR_CANE); and it will work
so I haven't coded for spigot since bukkit died. it seems like the item IDs:sub ids have been fully replaced by Material entries, correct?
oh okay
sweet
Each block has its own separate material, states define how they interact with the world
my old code was so hacky
is that folder for future use with bukkit then choco?
I was unaware there was a folder designated for plugin datapacks
Mostly because plugins aren't data packs nor do they supply any lol
I mean you could include one and move it to that folder I guess 🤷♂️
However they most definitely should be. It's a change that will inevitably have to be made so all data-based things can just be defined by files in the plugin
right
Though I think md is hesitant because of two things. (1) That's a MASSIVE change. (2) What happens when you remove that plugin?
How should the server handle that? If at all
yeah makes sense
that an other priorities, but yea lol
I wonder if we can use a function from a datapack with nms
I was looking for a cheap way to play a midi xD
dont thnk they do, but the noteblock studio has a way to export
to datapack
not sure how it works
Likely a function to run playSounds
yeah
(the /sound command)
it uses scoreboard teams as well. weird lmao
Yea that should work fine. Is the listener registered?
yep listener is registered hmm
I tried something with the plugin yml
might have not been loading?
I would say run this bit a tick later:
do {
b.setType(Material.AIR);
b = b.getRelative(BlockFace.UP, 1);
canes++;
} while (m == Material.SUGAR_CANE);
p.getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes));```
Schedule a task for the next tick
so delay the action one tick
Yea
see I made base examples for all this stuff its all about digging it out of files to remind myself xD
Bukkit.getScheduler().runTaskLater(plugin, () -> {}, 1L);
Bukkit.getScheduler().runTaskLater(plugin, () -> {
// the code here
}, 1L);```
Local variable b defined in an enclosing scope must be final or effectively final
Getting this error with 2 varriables now
Would it be better to store information about a player in memory and then save to database when the player leaves or on server shutdown or use a task to periodically save the information that has been updated?
Seems like the latter would be safer, but would it slow the server down?
Bukkit.getScheduler().runTaskLater(plugin, () -> {
Block block = b;
int canes = 0;
do {
block.setType(Material.AIR);
block = block.getRelative(BlockFace.UP, 1);
canes++;
} while (block.getType() == Material.SUGAR_CANE);
p.getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes));
}, 1L);```
(move canes into the runnable, re-define block)
i wish the compiler knows the value at that point would be final anway :p
I think he means they're being modified by the inner class, right?
So it should be smart enough to realize it's fine???
Yep
No
lol
The fact that they can't be modified from the inner class is the reason it's yelling at him
The variables were defined out of scope
@EventHandler
public void onSugarCane(BlockBreakEvent e) {
Player p = e.getPlayer();
Block block = e.getBlock();
if (block.getType() == Material.SUGAR_CANE) {
e.setCancelled(true);
Bukkit.getScheduler().runTaskLater(plugin, () -> {
int canes = 0;
Block b = e.getBlock();
do {
b.setType(Material.AIR);
b = b.getRelative(BlockFace.UP, 1);
canes++;
} while (b.getType() == Material.SUGAR_CANE);
p.getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes));
}, 1L);
}
}
}``` this should fix it?
As far as I'm concerned, yea. Indentation is off but it should work fine
Yeah, it'll screw you up later.
Anyway... what should I do about my database changes?
Up to you. How time sensitive is that data?
Should I create a PlayerInfo object and initialize it from database information when the player connects and edit everything there then save when player quits?
its still dropping on the ground?
It's player level/exp data that gets changed frequently.
So I don't want to update the database every time.
I'm just wondering if I should do it on player quit, or in a task every minute or so?
I'm thinking on quit? Just because I can work with the information in memory until the player quits. It doesn't need to be in the database yet, no one else is using it but me.
no need to really keep constantly updating it until the player quits imo
package me.y2k.dragonstokencommand;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.inventory.ItemStack;
public class ScaneToInv implements Listener {
DragonsToken plugin;
public ScaneToInv(DragonsToken dragonsToken) {
plugin = dragonsToken;
}
@EventHandler
public void onSugarCane(BlockBreakEvent e) {
Player p = e.getPlayer();
Block block = e.getBlock();
if (block.getType() == Material.SUGAR_CANE) {
e.setCancelled(true);
Bukkit.getScheduler().runTaskLater(plugin, () -> {
int canes = 0;
Block b = e.getBlock();
do {
b.setType(Material.AIR);
b = b.getRelative(BlockFace.UP, 1);
canes++;
} while (b.getType() == Material.SUGAR_CANE);
p.getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes));
}, 1L);
}
}
}``` put it into its own class so its easier to read. still not working no idea why rest of the plugin is working fine gui's giving items etc this code should work it reads like its working no errors not sure why it just doesn't go straight into the inv and items are still dropping
Is it possible to add some form of "selector" to indentify worlds besides just the world name? I plan to create a world for every player using their hashed + salted UUID as worldname, but there are certain things I need to do codewise. Think of it as adding a class to a div tag in HTML/CSS, but the div tag is the world instead. If not, is there some form of workaround I can do whereas I place for example a always loaded armorstand somewhere in the world and assign it a name as a selector (and consequently always keep that chunk loaded as long as the player is in the world)?
The thing is that I plan to play sounds that normally never occours from events seperately in these worlds.
depending how many players you have thats gonna fill up your storage fast
Ah, I already tought of that. Worlds are deleted when the player has finished the world.
like beat the ender dragon?
No, I am not going to give out that much information. (And we are getting away from what I asked.. 😦 )
There are events for chunk loading and unloading that you can work with.
Also, worlds should have a UUID.
I'll check it out. Thanks.
@hallow surge Are the items put into the player's inventory?
no
they are dropped on the floor
my code's entire purpose is to have them put directly into the invenotry
@wraith grail You should track the EntityID of the armor stand. When a chunk is unloaded, if its entities contain that entity, cancel it. Could get laggy if there are lots of entities in the chunk. There might be a better way to do it, but that's my first thought
Yeah, that's why I asked.
Seems like the code isn't running at all.
