#help-development
1 messages · Page 2249 of 1
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
ew
?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
this is what it looks like on the server i'm testing it on since i have a command that changes DefaultNETHPOTINVInventoryContents but on the project itself it's just blank
did you verify the output from the SQL is actually NETHPOTINV
I don't know sql so I can't help tehre
yes
How to change the chest title? I heard you can do it with NMS but I don't know how
do you have the full error you can send
the error happens because when i try to deserialize the inventory the given string is null
but there is the error
how do you make a horse attack players
You use NMS and add an attack goal
yeah i did
i added the NearestAttackableTargetGoal target seelctor and a MeleeAttackGoal goal selector
thing is if i go next to a horse the server crashes and i get this error message:
I understand what this means, I haven't set the amount of damage that the horse can do
but like, how do i set it
can i just grab the bukkit entity and do that
Maybe
Hello, I have such a problem, I am trying to fix it for almost 1 hour
error in console:
Index 0 out of bounds for length 0 initializing Mediumhc v1.0-SNAPSHOT (Is it up to date?)
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[?:?]
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[?:?]
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248) ~[?:?]
at java.base/java.util.Objects.checkIndex(Objects.java:372) ~[?:?]
at java.base/java.util.ArrayList.get(ArrayList.java:459) ~[?:?]
at org.bukkit.craftbukkit.v1_8_R3.CraftOfflinePlayer.<init>(CraftOfflinePlayer.java:34) ~[servert.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.getOfflinePlayer(CraftServer.java:1324) ~[servert.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.Bukkit.getOfflinePlayer(Bukkit.java:759) ~[servert.jar:git-Spigot-db6de12-18fbb24]
at net.jedzius.mediumhc.data.Deserialization.deserializeGuild(Deserialization.java:112) ~[?:?]
at net.jedzius.mediumhc.data.Deserialization.deserializeGuilds(Deserialization.java:105) ~[?:?]
at net.jedzius.mediumhc.guild.GuildService.load(GuildService.java:47) ~[?:?]
at net.jedzius.mediumhc.CorePlugin.onLoad(CorePlugin.java:77) ~[?:?]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:297) [servert.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:198) [servert.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [servert.jar:git-Spigot-db6de12-18fbb24]
at java.base/java.lang.Thread.run(Thread.java:829) [?:?]
Code: https://paste.md-5.net/eritisehev.js
any idea how to fix?
I have analyzed the code 10 times already and I still don't know why
Wait you can't set an attribute thats not applicable to a mob with spigot
theres the Attributable#getAttribute that returns null if the attribute is not applicable
theres no setAttribute
Oh well use NMS
how do i do that with NMS
There should be a method in there can't remember the name
Should be pretty obvious
NPE
hm wait
i found this in the zombie class
public static Builder createAttributes() {
return Monster.createMonsterAttributes().add(Attributes.FOLLOW_RANGE, 35.0D).add(Attributes.MOVEMENT_SPEED, 0.23000000417232513D).add(Attributes.ATTACK_DAMAGE, 3.0D).add(Attributes.ARMOR, 2.0D).add(Attributes.SPAWN_REINFORCEMENTS_CHANCE);
}
doesn't really help though
it doesn't override a super class
everything you post is always so impressive lol
how did you take away the players inventory
damn without any mods?
yes server resource pack only
?paste
https://paste.md-5.net/ixomapecad.java here's the class of NMS container wrapper which contains a way to disable player inventory item rendering
its basically bunch of hacks for NMS to get fooled
this class is not perfect tho
how do I register custom attributes with NMS
i want to set attack damage on a hrose
is this a method that i override?
Yes
Actually wait it's static
It might be a bit tricky
Maybe just create your own attack goal with a hardcoded value
yeah i just realized
don't I still have to set the attack damage if i wanted to do that
bump
Do you think it’s possible to somehow use reflection to change the method?
change the method?
foo you can't change the inside of amethod with reflection
thats a mixin
Mob.createMobAttributes().add(Attributes.JUMP_STRENGTH).add(Attributes.MAX_HEALTH, 53.0D).add(Attributes.MOVEMENT_SPEED, 0.22499999403953552D)
that static method literally contains this
mob.hi()
Why inline
Multiline good
Looks like all you need is to override doHurtTarget
Alternatively you can replace the attributes in the constructor
You can use bytecode injection to change methods.
If you have the nerves for that.
Just get the attribute and add '1' to it
what class is the original method in
Just replace the attributes field with reflection
oh nvm i see it
It's probably better
what attriubutes field lmao
public void increaseMaxHealth(Player player, int amount) {
AttributeInstance maxHealth = player.getAttribute(Attribute.GENERIC_MAX_HEALTH);
maxHealth.setBaseValue(maxHealth.getBaseValue() + amount);
}
AttributeMap attributeMap = new AttributeMap(createBaseHorseAttributes().add(Attributes.ATTACK_DAMAGE, 3.0).build());
try {
Field attributes = LivingEntity.class.getField("attributes");
attributes.setAccessible(true);
attributes.set(horse, attributeMap);
} catch(NoSuchFieldException e) {
//Handle
}
Untested code
Ive not used javas instant much before, would this be the best way of removing another instant
thanks
If you want to use the API with the attack attribute you will need to replace the craftAttributes field too
in LivingEntity?
wait also wont this make all mobs deal 3.0 damage?
I'm assuming you mean like this?
AttributeMap attributeMap = new AttributeMap(createBaseHorseAttributes().add(Attributes.ATTACK_DAMAGE, 3.0).build());
CraftAttributeMap craftAttributeMap = new CraftAttributeMap(attributeMap);
try {
Field attributes = LivingEntity.class.getField("attributes");
Field craftAttributes = LivingEntity.class.getField("craftAttributes");
attributes.setAccessible(true);
attributes.set(this, attributeMap);
craftAttributes.setAccessible(true);
craftAttributes.set(this, craftAttributeMap);
} catch (Exception e) {
e.printStackTrace();
}
i'm getting a NoSuchField exception
but i know why
the fields get re-obfuscated
behind the scenes
Almost the craftAttributes field is a should be set to new CraftAttributeMap(this.attributes);
Wait
nvm
lmao
lol
I'm trying to use this
to fix the nosuchfield thing
Are you on 1.18.1?
yes
Why not use 1.18.2
reasons
dw about it
but here i found this
so I replaced the first field declaration with Field attributes = LivingEntity.class.getField("bQ");
but craftAttributes is not there
I don't think that's obfuscated since it's a bukkit only field
nope not a thing
Hey guys I got a question.
So I got the following case:
-
I got the PlayerInteractEvent
-
I got the PlayerInteractAtEntityEvent
-
both of them are doing basically the same but only one should be triggered
The problem is when I am clicking an invisible armorstand it selects the block beneath as well, so both events are triggered.
Is there a way to like (I thought this could be done by setting the priority if I am right?) to say something like, if event A was triggered, cancel event B?
items: any-text: id: 284 slot: 0
display-name: ''
lore:
- another-item: id: SEEDS slot: 2
display-name: ''
lore: - wheat-item: id: WHEAT slot: 4
display-name: ''
lore:
I'm trying to make a customconfig item.yml and make something like this.
I cant seem to find out why the file is not working properly. Comes out blank
bump, still stuck
is vscode good for making java stuff
no, eclipse or intellij would be the best for Java
No
vs code is a literal handicap for working with java compared to the dedicated IDEs
thats why im asking, i've used vscode for literally everything but i heard its not really good for java
anyone got an idea?
I mean, give both a try 🤔
anyone pls im suffering lmao
Cancel the event that was fired first. The other events shouldnt fire afterwards.
*Assuming this behaves like PlayerInteract and BlockBreak
tho ngl, jetbrains suggestions, auto completion and all its context aware shit is kind of OP vs vs code just vibing on the language server
NMS means you are on your own. Use the mojang mappings and reverse engineer your way through. Custom attributes should be
moderately hard to do.
Entry point for everything data driven: Registry.class
public static final Registry<Attribute> ATTRIBUTE;
canceling the first event after all the code I used? - this will cancel the other one as well?
Depends on which one is fired first
The other one wont be fired at all
which class is this located in
net.minecraft.core.Registry
i have no idea whats going on here lmao
Im curious so im looking through it atm
Doesnt look to bad. You just need a ResourceKey
i have no idea how this operates or what it even does
does Horse implement or extend this class?
Yeah data driven designs can be quite hard to follow because so much is decided at runtime
Huh?
nvm lmao
No this is for registering new custom attributes data
i'm not making a custom attribute though
I'm just trying to add attack damage attribute to a horse
https://jd.papermc.io/paper/1.19/org/bukkit/attribute/Attributable.html#registerAttribute(org.bukkit.attribute.Attribute) a paper > spigot moment
declaration: package: org.bukkit.attribute, interface: Attributable
my bad sorry
nah this won't work
Horse < AbstractHorse < Animal < LivingEntity
Then from there
LivingEntity#getAttributes() : AttributeMap
LivingEntity#getAttributeValue() : double
...
and so on
getAttribute(Attribute.GENERIC_ATTACK_DAMAGE) returns null
on a horse
I have a custom config file item.yml. I'm trying to make it take the default data of the item in the stack and place it into the config. Does not happen thought as I get a blank file. it says my itemstack is null but with getCustomConfig().set("path", itemstack); I thought it should autogenerate by default
yes
How would I fix this problem or reprogram it
that method would actively register your attack damage attribute
which is exactly what you are trying
tho I guess you are on spigot-api
wait yeah I haven't seen this before
is registerAttribute new?
i'm on 1.18.1 though
it is a paper only method
you could look at the patch impl
and just do the same
tho that will need NMS/craftbukkit
i'll take a look
bump
It generates the values on default. You probably didnt write the FileConfiguration to a File afterwards.
public class FileManager {
public static File customConfigFile;
public static FileConfiguration customConfig;
public static FileConfiguration getCustomConfig() {
return customConfig;
}
public static void createCustomConfig() {
customConfigFile = new File(LobbyGadgets.getInstance().getDataFolder(), "item.yml");
if (!customConfigFile.exists()) {
customConfigFile.getParentFile().mkdirs();
LobbyGadgets.getInstance().saveResource("item.yml", true);
}
customConfig = new YamlConfiguration();
try {
customConfig.load(customConfigFile);
} catch (IOException | InvalidConfigurationException exception) {
exception.printStackTrace();
}
}
}
i can't exactly modify the AttributeMap returned from LivingEntity#getAttributes()
i cant add new attributes
From AttributeMap.class
👀
....
And whats not working with your code?
How does your item.yml look like inside your jar?
in resources
sure, or there
bruh the constructor for Attribute is protected, and I don't know how to use it
Attribute has constants
I really want to fix this but I dont know what to do. I've been trying to find solutions for 2 days now on spigot and other forums...
Attributes.MAX_HEALTH
From
net.minecraft.world.entity.ai.attributes.Attributes
There is "supposedly" nothing wrong
yeah i just found this
How does your item.yml look like?
item:
gadgetsmenu:
And if you open your jar with a compressor (7zip, winrar etc), how does your item.yml look like?
For a horse? I highly doubt that
it is
Then you are doing something wrong
funny enough the item.yml file opens as a vscode file? and it just says
item:
gadgetsmenu:
Is your project on github?
no but there has to be something to do
no?
I dont find anything on item.yml on spigot or bukkit forums
either
item.yml is your own thing. You wont find anything on that.
Why do you want to save an yml with just empty paths anyways?
?
item:
gadgetsmenu:
this is just an empty path without any real data
I create the itemstack, use customconfig.set path and get the default item meta like type: displayname: lore:
Then send the whole code
FileManager: https://paste.md-5.net/tudavaxalo.java
ItemManager: https://paste.md-5.net/otocozivox.cpp
Main https://paste.md-5.net/ozukutavan.java
i mean this is all I'm doing..
AttributeMap attributeMap = getAttributes();
attributeMap.getInstance(Attributes.ATTACK_DAMAGE).setBaseValue(3.0);
Read in the javadocs what saveResource does.
No wonder your data vanishes. (in ItemManager)
sidenote but has anyone noticed vpns getting worse recently? It feels like services are starting to get 100% block coverage, I get capchas and denials everywhere and sometimes my latency is measured in seconds when loading pages
public static void setItem() {
FileManager.getCustomConfig().set("item.gadgetsmenu", gadgetsMenu);
LobbyGadgets.getInstance().saveResource("item.yml", true);
}
saveResource copies a File from your jar and writes it into your plugin folder
You can edit your config all you want. If you just copy the same file from your jar into the
plugin folder and overwrite everything then you can edit all day long and dont see any changes.
@ornate patio Found the issue replace getField with getDeclaredField
Remove it and check out how to work with the configuration api
i should noticed that earlier
Of course
LETS Go
finally man
thanks
the whole thing worked
I'm trying to do something like this SampleItem:
==: org.bukkit.inventory.ItemStack
type: DIAMOND_SWORD
damage: 1500
amount: 1
meta:
==: ItemMeta
meta-type: UNSPECIFIC
display-name: §6Sample Item
lore:
- First line of lore
- Second line of lore
- §1Color §2support
enchants:
DAMAGE_ALL: 2
KNOCKBACK: 7
FIRE_ASPECT: 1
And you are almost there. You just need to save the edited FileConfiguration to a File
How would yall go about modifying the format of the console log of chat messages in console?
For instance, currently if I send a message chat, the message sent to the console will show[current:time INFO] <MrMcyeet> Hey, I am a sample message!
If I wanted to change that to show the player's level, like [current:time INFO] <MrMcyeet [Professional]> Hey, I am a sample message!how would I go about that?
how do you deconnect a variable form a file configuration.
public static List<List<Object>> oreList = new ArrayList<>();
oreList = FileHandeler.getFile().getObject("oreTypes", oreList.getClass());
the problem is when im editing oreList it also edits the file.
and how would I do that
Use getList() instead of getObject()
Also wtf is this code
its for a list of diffrent ore types for a custom block im creating
File file = new File(getDataFolder(), "test.yml");
FileConfiguration configuration = YamlConfiguration.loadConfiguration(file);
// Edit config
configuration.save(file);
getting this problem when im trying getList.
Incompatible types. Found: 'java.util.List<capture<?>>', required: 'java.util.List<java.util.List<java.lang.Object>>'
Yes. Java.
?
Of what type is this list?
new to java. what do you mean by list type. is it List<List<Object>>
unhandled exception IOE
How does your yml look like?
on configuration.save
yeah then handle it
`oreTypes:
-
- ==: org.bukkit.inventory.ItemStack
v: 2865
type: RAW_IRON - 50.0
- ==: org.bukkit.inventory.ItemStack
-
- ==: org.bukkit.inventory.ItemStack
v: 2865
type: RAW_GOLD - 25.0
- ==: org.bukkit.inventory.ItemStack
-
- ==: org.bukkit.inventory.ItemStack
v: 2865
type: LAPIS_LAZULI - 20.0
- ==: org.bukkit.inventory.ItemStack
-
- ==: org.bukkit.inventory.ItemStack
v: 2865
type: DIAMOND - 5.0`
- ==: org.bukkit.inventory.ItemStack
Why do you have a list of lists, and the nested list has arbitrary garbage in it?
oreTypes:
-
item:
==: org.bukkit.inventory.ItemStack
v: 2865
type: RAW_IRON
cost: 50.0
-
item:
==: org.bukkit.inventory.ItemStack
v: 2865
type: RAW_GOLD
cost: 25.0
This is the structure you should have.
But thats still a bit weird.
and now I have a blank item.yml
Show your code
I have showed you my code. What you sent and told me to remove did not work at all
Ive just tried it. Works like a charm. Show me your new code
this custom object is a drill with special chances depending on the second value of each itemstack
Main: https://paste.md-5.net/zadihufipu.java
ItemManager: https://paste.md-5.net/teruvuxega.cpp
FileManager: https://paste.md-5.net/ojoqedowam.java
Your ItemStack is null. Setting a ConfigurationSection to null simply removes it.
An ItemStack doesnt just get written out of thin air. You need to specify what you want to write. If
you simply tell the FileConfiguration to write null into a path, then the path is removed.
okay so how do I tell it to write type, displayname, lore, enchants etc
unless, of course, it is an air itemstack
public static void setItem() {
ItemStack itemToWrite = gadgetsMenu == null ? createDefaultItemStack() : gadgetsMenu;
FileManager.getCustomConfig().set("item.gadgetsmenu", itemToWrite);
}
private static ItemStack createDefaultItemStack() {
ItemStack itemStack = new ItemStack(Material.STONE);
ItemMeta meta = itemStack.getItemMeta();
meta.setDisplayName("CustomName");
meta.setLore(Arrays.asList("Line 1", "Line 2", "Line 3"));
itemStack.setItemMeta(meta);
return itemStack;
}
Hi there, I'm totally new to Java/Spigot programming and I'm wondering why my args length is always 0. Even when I enter /wild nation the args.length is always 0 and I never go in the next condition. Any idea ?
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)) {
// Command can be only executed by player
return false;
}
Player player = (Player) sender;
Location tpLoc;
System.out.println("args.length: " + args.length);
if (args.length > 0)
System.out.println("args[0]: " + args[0]);
if (args.length > 1)
System.out.println("args[2]: " + args[1]);
if (args.length == 0 || !args[0].equalsIgnoreCase("nation")) {
sender.sendMessage("Téléportation aléatoire en zone neutre dans 5 secondes");
tpLoc = getRandomLocation("neutral");
} else if (player.hasPermission("kokiria.wild.din")) {
sender.sendMessage("Téléportation aléatoire à Din dans 5 secondes");
tpLoc = getRandomLocation("din");
}...```
[00:24:13 INFO]: Litorax issued server command: /wild nation
[00:24:13 INFO]: [Kokiria] [STDOUT] args.length: 0```
Sounds impossible to me.
First of all: Add brackets to all your code blocks. Even if they are only one line in size.
Have you tried the command with an arbitrary amount of arguments? 3 or 4
What Spigot version are you using
What you mean add brackets ?
Is that new programming rule haha ?
It's only for debugging
if (args.length > 0)
System.out.println("args[0]: " + args[0]);
to
if (args.length > 0) {
System.out.println("args[0]: " + args[0]);
}
This is a clean-code rule
Alright
One I sometimes follow. It all depends how I feel 😉
I'm using IntelliJ with the Minecraft Development addon, seems like it's using Paper
Good choice
Go away
oneliner always without brackets
<dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
Thanks for the support haha
You guys go read "Clean Code" from Robert Martin and then come back.
Or at least watch the yt video about his lecture.
i did
its garbage
actually thats a convention of my work place to not use brackets if its a oneliner
I think the clean code debate will never end
But could I get some help with these args please haha I have no clue what to do
Sounds like the type of workplace where you would find Nodejs backends.
Well the code you posted is impossible. args can;t be zero
Well, it is, wanna come and see my stream ?
we're not gay
Maybe I'm doing something wrong idk
!verify
Usage: !verify <forums username>
then send us yoru jar
!verify
Usage: !verify <forums username>
Sounds pretty gay to me
!verify Litorax
A private message has been sent to your SpigotMC.org account for verification!
agree, to avoid this sounds pretty gay to me too
eff Oracle
Oracle, Google, ASAP, AWS.
Pick one. All of them agree on this code style.
how can I stop chunks from preloading after world creation? so I wont have to unload them and then load the back in. reason is that i have block populators which I can apply only after creating the world, so I have to unload the loaded chunks, apply the populators and then load them back in with the populator to get the effect
True, but they are all wrong 😄
google writes in blocks, they dont even have something to say
not even a whitespace
they just glue all of their code together
There is a rule in the WorldCreator iirc that lets you specify if the spawn chunks should be loaded
that is?
Hey! Anyone have an idea how I could read a jars execution?
looks good to me
What do you mean by "read a jars execution"
An execution is an action. You cant read that.
Here is my jar
/wild nation
should give an error if you don't have the good permission, but never output "Téléportation aléatoire en zone neutre dans 5 secondes"
server starting
thx
so? @lost matrix
?jd-s
its on 1.8
well then you are out of luck.
Support for that ancient version was dropped almost half a decade ago.
Go read in old forum posts or update to a version that is actually used.
Such as if it prints text
I can't update, and that's why I'm asking because I can't find anything online
Can i guess you want to read the output of the server jar
I mean... sure. You could just grep the output of your jvm. Idk what you are trying to do.
[23:42:26] [Server thread/INFO]: args.length: 1
[23:42:26] [Server thread/INFO]: args[0]: nation```
Hoooow
and it teleported me somewhere
Did you die btw ?
I’m trying to catch things such as prints, certain executions etc…
no
I was op though
I am too
seems your plugin hates you
Did you compile your server jar by using BuildTools?
Are you using last build of Paper 1.19 ?
Ah you are on Paper
Build Artifacts from IntelliJ
Let me update and see
I do everything on Spigot
Is the teleportation very long for you too ?
It takes more than 3 seconds for me but I didn't add any delay
It almost crashes my server
Also, that no damage thing is random, don't know why
player.setNoDamageTicks(20*20);
player.teleport(tpLoc);
looks like you are loading tons and tons of chunks in a single tick
Hmmm
I'm checking the highest y in a 11x11 square
int highestBlockY = 0;
// Get the highest block in the surrounding locations
for (int i = (int)x - 5; i <= x + 5; i++) {
for (int j = (int)z - 5; j <= z + 5; j++) {
int y = Bukkit.getWorld("world").getHighestBlockYAt(i, j);
if (y > highestBlockY)
highestBlockY = y;
}
}```
If the chunks at those locations are not loaded then the server first needs to generate all of the chunks in that square
before it can check for the highest coordinate. Makes sense because you cant test the height in a an non-existent chunk.
oh yeah smile
Are the args working for you ?
In paper you can request the chunks async and then do your checks in a chain.
Yes
did you see the code i made to write PlayerData yet
Paper 1.19 build 36 ?
build 41 is the latest
Nope
hey there if anyone knows IO stuff I have an issue https://www.spigotmc.org/threads/issue-copying-a-server.562683/
[00:54:03 INFO]: Litorax issued server command: /gamemode survival
[00:54:07 INFO]: Litorax issued server command: /wild nation
[00:54:07 INFO]: [Kokiria] [STDOUT] args.length: 0```
Still
[00:55:08 INFO]: Litorax issued server command: /wild abc def jhi klm
[00:55:08 INFO]: [Kokiria] [STDOUT] args.length: 0```
May it be because of another plugin ?
Omg
My aliases are working
/rtp and /randomteleport work
oh my god I think i know
something like this
Should probably put the method after the login is allowed
is there any way to change the gamemode of the fake player?
Any good way to make a player climb like a spider?
I could always detect if a player is near a wall then give them Levitation
but I would like for it to work just like a spiders climb (kinda like a invisible ladder)
Hey 🙂
How can i get the offline player object? 👀 I only get null xd
Bukkit.getOfflinePlayer(...) will never return null
even when you ask for an invalid OfflinePlayer
?jd-s
should i register my configs in my main class
or should i make a separate class for registering it
"registering"?
plugin has its own config. If you are talking about other configs (multiple) then definitely a handler class
Hi, I'm doing fake players tablist right now, and I have one question. Should I recreate player tablist slots with fake players too or there is no need? (one problem that i noticed is when player changes gamemode to spectator, it disappears)
it returns the uuid indeed 🙂 But can I get access to the player object? 🤔
a Player object only exists for Online Players
👍
30.06 22:47:52 [Server] java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LnV0aWwuaW8uV3JhcHBlcvJQR+zxEm8FAgABTAADbWFwdAAPTGphdmEvdXRpbC9NYXA7eHBzcgA1
30.06 22:47:52 [Server] ...' at line 3
public void createTable(){
PreparedStatement ps;
Configuration CallousConfig = CallousPvP.getInstance().getConfig();
String NethPotInv = CallousConfig.getString("DefaultNETHPOTINVInventoryContents");
try{
ps = plugin.SQL.getConnection().prepareStatement("CREATE TABLE IF NOT EXISTS callouspvp (UUID VARCHAR(100) DEFAULT 'Nan' NOT NULL," +
" NAME VARCHAR(100) DEFAULT 'Nan' NOT NULL," +
" FFAKILLS INT(100) DEFAULT 0 NOT NULL," +
" FFADEATHS INT(100) DEFAULT 0 NOT NULL," +
" NETHPOTINV VARCHAR(65000) DEFAULT "+NethPotInv+" NOT NULL," +
" PRIMARY KEY (UUID))");
ps.executeUpdate();
} catch (SQLException e){
e.printStackTrace();
}
}
how do i make the default value be NethPotInv?
it ends up erroring
for context nethpotinv is a serialized inventory
a huge string
I am unsure if I can still get support for spigot 1.8.8, but is there any way to find out whether a slab (step) is located on the bottom or the top? https://prnt.sc/snX2rsZeyeRm
Try it with adding ' '
like instead of "+NethPotInv+" you do '+NethPotInv+'
yes
oh wait hmm
and no spaces?
I can't find any resources on how to add tab completion on existing arguments such as if you do "time set 0" while you are still on the 0 it lets you tab for "s" "d" "m"
it just returns nan
not config
when i print it out it prints what it is supposed to
okie
public void createTable(){
PreparedStatement ps;
Configuration CallousConfig = CallousPvP.getInstance().getConfig();
String NethPotInv = CallousConfig.getString("DefaultNETHPOTINVInventoryContents");
try{
ps = plugin.SQL.getConnection().prepareStatement("CREATE TABLE IF NOT EXISTS callouspvp (UUID VARCHAR(100) DEFAULT 'Nan' NOT NULL," +
" NAME VARCHAR(100) DEFAULT 'Nan' NOT NULL," +
" FFAKILLS INT(100) DEFAULT 0 NOT NULL," +
" FFADEATHS INT(100) DEFAULT 0 NOT NULL," +
" NETHPOTINV VARCHAR(65000) DEFAULT ' "+ NethPotInv +" ' NOT NULL," +
" PRIMARY KEY (UUID))");
ps.executeUpdate();
} catch (SQLException e){
e.printStackTrace();
}
}
when i print out NethPotInv it prints out what it is supposed to
i want it to be at nethpotinv by default instead of Nan
you should use parameters instead of just concatenating the string
it would look like " NETHPOTINV VARCHAR(65000) DEFAULT ? NOT NULL,"
and then ps.setString(1, NethPotInv)
oh
Java Coding Conventions: https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html
ps = plugin.SQL.getConnection().prepareStatement("CREATE TABLE IF NOT EXISTS callouspvp (UUID VARCHAR(100) DEFAULT 'Nan' NOT NULL," +
" NAME VARCHAR(100) DEFAULT 'Nan' NOT NULL," +
" FFAKILLS INT(100) DEFAULT 0 NOT NULL," +
" FFADEATHS INT(100) DEFAULT 0 NOT NULL," +
" NETHPOTINV VARCHAR(65000) DEFAULT ? NOT NULL," +
" PRIMARY KEY (UUID))");
ps.setString(1, NethPotInv);
so like that?
yeah
still nan
Your config getter is bad
Idk how you manage your configs in depth
But something is wrong with it
how
i am just so confussed
How do I edit the format of a chat message in console?
For instance, if I wanted to show additional information about a user in the console log of their message, how would I go about doing this?
For instance, if I wanted to change verilog [currentTime INFO] <MrMcyeet> This is a message! to this ```verilog
[currentTime INFO] <MrMcyeet@WORLD_NETHER> This is a message!
Does anybody know why this happens?
public class TerrainGenerator extends ChunkGenerator {
private int size;
private boolean generateStuff;
public TerrainGenerator(int size) {
this.size = size;
}
@Override
public void generateNoise(WorldInfo worldInfo, Random random, int chunkX, int chunkZ, ChunkData chunkData) {
for(int y = chunkData.getMinHeight(); y < chunkData.getMaxHeight(); y++) {
for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
if(chunkX < (size) && chunkZ < (size) && chunkX >= -(size) && chunkZ >= -(size)) {
generateStuff = true;
} else {
generateStuff = false;
}
}
}
}
}
@Override
public boolean shouldGenerateNoise() {
return generateStuff;
}
@Override
public boolean shouldGenerateBedrock() {
return generateStuff;
}
@Override
public boolean shouldGenerateSurface() {
return generateStuff;
}
@Override
public boolean shouldGenerateDecorations() {
return false;
}
@Override
public boolean shouldGenerateCaves() {
return false;
}
@Override
public boolean shouldGenerateMobs() {
return false;
}
@Override
public boolean shouldGenerateStructures() {
return false;
}
}
or how I can make it not do this
because apparently, just replacing all blocks with AIR outside of the chunks totally overload the server, who would've guessed !!
I see the problem. The chunks are not generated from inwards out. If a player joins, then all chunks in the view distance are being queried for generation.
But you have no control over which chunks are generated first. This means that if you hit one of the outside chunks, then the next "shouldGenerateNoise" returns
the previous value.
Hmm
So how would I go about fixing that
Resetting the value ?? Surely that won't work because it might just load an unwanted chunk outside
or the other way around, an empty chunk inside
Its a bit tricky. Let me think...
Is there any way for me to detect when you press space on a mount?
The problem is that shouldGenerateNoise() does not provide the x and y coordinate. That honestly seems like a flaw in the api
Well I got it to not generate any chunks outside .. But now it's only generated 3 chunks out of 16 inside lol
Truly
I mean what you can do is request the chunks in a spiral from inwards out. So as soon as the first chunk outside of reach is
hit, you simply dont let the server generate vanilla noise anymore.
You can detect the jump.
but on a mount?
its a phantom too which by defualt cant jump. I can switch to a custom entity if that would help
Let me check the protocol if the client sends this information
Wdym request them in a spiral ?? Can I change how they're loaded?
Better yet - is there a way to load certain chunks manually?
Looks like the player only sends an action packet when he specifically jumps on a horse. Nothing else.
ok tysm!
Yes. Just get the chunk at a certain x, z position.
World#getChunkAt(int, int)
Oh
Well that might have been a bad idea
because I still don't have any way for it to not generate it wrong
Unless, can I stop it from generating at all ??
So that I choose specifically what chunks to generate, and it doesn't do it at all
Another approach:
let shouldGenerateNoise() always return false.
Create an instance of the vanilla generator inside your custom generator.
In your generateNoise(WorldInfo worldInfo, Random random, int chunkX, int chunkZ, ChunkData chunkData) method you use
the vanilla generator (just pass every parameter to the vanilla instance) and outside of your radius you do nothing or generate water.
as far as i've read, it's not so easy getting the vanilla generator as an instance?? or have i read wrong
Like that
No idea. Let me check.
Yeah looks like there is no vanilla instance...
Yeahh
Ill think about writing a pr for this
public class TestCommand implements TabCompleter {
private static final String[] COMMANDS = {"minecraft", "spigot", "bukkit", "google"};
private static Main main;
//create a static array of values
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
//create new array
final List<String> completions = new ArrayList<>();
//copy matches of first argument from list (ex: if first arg is 'm' will return just 'minecraft')
StringUtil.copyPartialMatches(args[0], Arrays.asList(COMMANDS), completions);
//sort the list
Collections.sort(completions);
return completions;
}
}``` How would I get a response when I use the command?
Normally I would use something like java @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {but I'm just lost.
What do you mean by "get a response when I use the command"
Basically, I just want to send this message whenever I use the command: java sender.sendMessage(MiniMessage.miniMessage().deserialize(prefix_message + ' ' + non_player_message));
And why would you need a tab completer to send a message when a command is used? (btw this naming is not java standard)
Well, my hopes in the future is to make the command /kit and have kits. However, right now I'm just testing to see how it works.
All of this makes no sense...
TestCommand implements TabCompleter
This is used to auto complete arguments for commands.
Its not an actual command implementation.
I see, would I need to make a new public class with CommandExecutor?
(I'm very new to java lol)
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Sorry, I'm still confused on how I would use the tab completer with it?
anyone familiar with a way of fixing this?
https://gyazo.com/8f843bffb97816ff67bbd1cdd8576099
here's my code:
@EventHandler(priority = EventPriority.MONITOR)
public void invMove(InventoryMoveItemEvent event) {
if(NBTEditor.getBoolean(event.getItem(), "ModernFFA", "immovable") || event.getItem().getType() == Material.AIR) {
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.MONITOR)
public void invClick(InventoryClickEvent event) {
if(!(event.getWhoClicked() instanceof Player player)) {
return;
}
ItemStack clickedItem = (event.getClick() == org.bukkit.event.inventory.ClickType.NUMBER_KEY)?
event.getWhoClicked().getInventory().getItem(event.getHotbarButton()) : event.getCurrentItem();
List<ItemStack> items = Arrays.asList(clickedItem, event.getCurrentItem(), event.getCursor());
for(ItemStack item : items) {
if (NBTEditor.getBoolean(item, "ModernFFA", "immovable")) {
event.setCancelled(true);
if(event.getAction() != InventoryAction.HOTBAR_SWAP) {
player.chat("/menu");
}
}
}
}```
not directly related to spigot, but to regex.
idk regex that good, but shouldn't "[0-9A-Fa-f]{6}" match for FF00FF or similar hex codes? because it doesnt apparently
it should
^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$
well java says it doesnt apparently
?paste ur code
at least 00FFFF doesn't
also https://regex101.com to test patterns
it's just Pattern.matches("[0-9A-Fa-f]{6}", s)
^
why tf is there a need for such a long one
try it
the one u have now is fine
if the short one should normally work
dw abt it
¯_(ツ)_/¯
well lets try
works for me with it set to Java 8 tester
apparently its not the regex thats not matching
but bungee's ChatColor.of("#FF00FF"); beeing null... odd
isnt that the right format?
seems to be
looks like it is right format idk
#00ff00 should be 7
it is
You want to use hex? Just use iridium chat color api I really like there's
i try to not use 50 api's in my plugin rn
well just dont
I can't count to 50
also that doesn't answer the question why tf it's null... i'm confused
i can't count to 1
why does spigot hate me
the result of ChatColor.of is null
?
even when supplied with a valid argument "#FF00FF"
?
if (color != null) {
PDCUtil.setString(player, "nameColor", color.getName());
player.setPlayerListName(TranslationUtil.translate("player_display_name", new Placeholder("<player_name>", player.getName()), new Placeholder("<player_color>", color.getName())));
player.sendMessage(color + "This is your new name-color ^_^");
} else player.sendMessage("§cPlease use a legal color code §7[§e0-9§7|§ea-f§7]");
it sends me the else message, so it apparently is
lemme check smt
i highly doubt the string of the color is ok
anyways lets bump this and ignore Cxlina for good
i know 😄
i hope you have a really bad day ._.
Timezones exist
i know mine is as same as Germany's
wait do you even remember me
I guess you could try preventing the InventoryDragEvent as well
whats the value of the string right before its passed into .of @slate mortar
actually that probably wouldn't work since that's for cursor events
https://paste.md-5.net/isonihuyis.cs
this one just sends me the please use legal lmfao idk whatever message, while at the same time printing out #00FFFF
well what u just sent is bs 😄
validateColor(args[0]); returns null
thats why you should have sent that
if it returns null
are u incapable of not being toxic when u respond to someone's questions of help
why tf does it print out #00FFFF
you said the color is null
but she's always toxic to me you dont know her
ok and
lmfao
especially in ESS
okay 👍
because it has become a pile of toxicity
cool
its called hotswap and yes
instead of manually moving it into the paper
oh, how is that done?
ok
wait... so color is null but color.toString() isnt?????????????
maybe String.valueOf(color) isnt
hmm so it seems to be not null
so
the output of ```java
ChatColor color = this.validateColor(args[0]);
System.out.println(args[0]);
System.out.println(this.validateColor(args[0]));
is
```console
[06:04:30 INFO]: LinaGHG issued server command: /namecolor 00FF00
[06:04:30 INFO]: [Survival-Core] [STDOUT] 00FF00
[06:04:30 WARN]: Nag author(s): '[Cxlina]' of 'Survival-Core' about their usage of System.out/err.print. Please use your plugin's logger instead (JavaPlugin#getLogger).
[06:04:30 INFO]: null
and yes, i'm putting the # in front of it
return ChatColor.getByChar(s.charAt(0));
returned by validateColor
oops
last one is ChatColor.of("#" + s);
wrong line lol
oh i'm an idiot
absolute idiot
private ChatColor validateColor(String s) {
//LEGACY codes ( §b )
if (s.length() == 1 && ChatColor.getByChar(s.charAt(0)) != null) {
return ChatColor.getByChar(s.charAt(0));
}
//Hex-Codes ( 00FF00 )
if (s.length() == 6 && Pattern.matches("[0-9A-Fa-f]{6}", s)) {
ChatColor.of("#" + s);
}
return null;
}
```happy guessing what's the reason ._.
just forgot the return one the line lol. now it works fine ahhhhhhhhhhhhhhhhhh
F
we will never know
so, just to let everyone know, InventoryClickEvent doesn't seem to be consistent in behavior for normal mouse mode vs. touch mode.
If someone changes to touch mode, click events may not be handled properly.
If you rely on a click event for example where someone clicks outside the container (menu) to cancel, its not going to fire an event.
specifically, say if you are checking if the RawSlot = -999 when they click outside the menu, this event may not occur at all when the container closes
if you are dependent on this for state related stuff, it may break your code.
i mean, isnt there inventorycloseevent for that?
Current code: https://paste.pythondiscord.com/bumipawuyi
Could someone give me some guidance on how to fix this?
Main.java: https://paste.pythondiscord.com/orixeroxod
https://wiki.helpch.at/piggys-barn/java/hot-swapping how can i implement this
its kinda confusing
and its saying that it only suports v8 and v11 jvm
set TestCommand.main to an instance of ur main plugin
alternatively, use DI
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
In another command I have, I have java public Kit(Main main) { this.main = main; } Is that what you mean?
(I'm very new to Java, so I don't really understand the methods yet :P)
i figured it out
its not firing (well, i think it's not firing)
that's called a constructor, it runs when your object is created with new ...()
and it takes in a Main object, like a normal function can take in arguments
and it sets the Kit object's main variable to the main variable that was passed into the contructor
so to create a new instance of a kit you would do new Kit(yourMainVariable)
and if youre instantiating a kit from your Main class then you can use this as your main variable
TestCommand test = new TestCommand();
getCommand("test").setTabCompleter(test);
getCommand("test").setExecutor((CommandExecutor) new Test(this));``` Is this somewhat on the right page?
why separate?
implement TabExecutor in one class then register .setExecutor(...) It will register as both
Hmmm, I'm having issues doing it not seperate.
.setExecutor((CommandExecutor).SetTabCompleter doesn't work which is one of the main things I would've assumed.
public class TestCommand implements TabExecutor {```
```java
getCommand("test").seExecutor(new TestCommand(this));```
no casting
That will handle both the command and Tab completion
Code: https://paste.pythondiscord.com/opesasotac
Main: https://paste.pythondiscord.com/osutexukab
Same error
delete from your Main private static Main plugin;
In your TestCommandjava public TestCommand(Main main) { this.main = main; }
also delete this as it does nothing getConfig().options().copyDefaults();
public class TestCommand implements TabExecutor {
private static final String[] COMMANDS = {"test", "test1", "test2", "test3"};
public TestCommand(Main main) {
this.main = main;
}
//create a static array of values
@Override``` Like this, correct?
and make it not static
public class TestCommand implements TabExecutor {
private static final String[] COMMANDS = {"test", "test1", "test2", "test3"};
private Main main;
public TestCommand(Main main) {
this.main = main;
}```
can i make maven, to build only the plugin's jar file into another folder
instead of keeping it in the target folder
does it include armorstands?
i cant seem to figure out why my code is giving errors can anyone help
repo: https://github.com/AkiraDevelopment/Sabotage/tree/development
error: https://bin.birdflop.com/mibudihewo.rb
None of your Listeners are annotated
they are all static
You never register any listeners
the listeners in the SharedListener file are called on from other files i think
test it on Spigot and see if it still errors
?bt
private UUID uuid = UUID.fromString("b292e61a-e293-47cc-a6a6-5982a1ec5c5f");
@EventHandler
public void InvClickEvent(InventoryClickEvent event) {
String worldname = event.getWhoClicked().getWorld().getName();
if (worldname.equals("spawn") && event.getWhoClicked().getUniqueId() != uuid) {
event.setCancelled(true);
}
}
@EventHandler
public void InvSwapEvent(PlayerSwapHandItemsEvent event) {
String worldname = event.getPlayer().getWorld().getName();
if (worldname.equals("spawn") && event.getPlayer().getUniqueId() != uuid) {
event.setCancelled(true);
}
}
@EventHandler
public void ItemDropEvent(PlayerDropItemEvent event) {
String worldname = event.getPlayer().getWorld().getName();
if (worldname.equals("spawn") && event.getPlayer().getUniqueId() != uuid) {
event.setCancelled(true);
}
}
RaiderRossUUID of player RaiderRoss is b292e61a-e293-47cc-a6a6-5982a1ec5c5f
The events are still triggered even if I trigger them, I am sure it's a simple mistake but what am I doing wrong?
you can;t compare a UUID with !=
its an object you are performing an instance comparison.
use teh UUID compare methods
ah thanks :D
true true
ok well i ran build tools but cant find the spigot.jar
um, I have no idea. I've never seen that error and google search shows nothing
rip
did you run buildtools in a folder? and not on your desktop?
i ran it in a folder on my desktop
move it off your desktop
That usually gives a OneDrive error not teh one you have, but worth a try
I believe teh desktop on win10 is in OneDrive
mine isnt because i hate onedrive
good
i got ransomeware when i first got a pc and onedrive made it so anytime i would try wiping my pc it would come back since u know my desktop was onedrive
still errors out when not in desktop
moved it to a whole other drive
same error?
ok
Mines into decompiling so its past where yours fails
Try removing fast util from your .m2
and make sure ur running it with git bash if ur on windows
bc for some reason BT doesnt like cmd
idk i get one build out of it and then i need to clear the entire directory if i need a new ver
if i run it with git bash i dont need to clear the dir
i was using git bash
you didn;t specify a version so it's building the release version
but that doesn;t matter
get it to build first
it built
ok now add teh version to the command
me when --rev 1.19
bro edited his message but didnt fix the
I rarely do. I do it so often I no longer bother
ok time to test this on spigot
im prob pretty dumb but idk what is going on..
Im setting integer sellValue to persistent data contairner of item
but it doesn't save?
public ItemStack setSellValue(ItemStack item,int value){
ItemStack nev = item.clone();
ItemMeta meta = nev.getItemMeta();
PersistentDataContainer pdc = meta.getPersistentDataContainer();
NamespacedKey key = new NamespacedKey(Pirates.plugin,"sellValue");
pdc.set(key,PersistentDataType.INTEGER,value);
nev.setItemMeta(meta);
return nev;
}
public static int getSellValue(ItemStack item){
ItemMeta meta = item.getItemMeta();
PersistentDataContainer pdc = meta.getPersistentDataContainer();
NamespacedKey key = new NamespacedKey(Pirates.plugin,"sellValue");
if(pdc.has(key,PersistentDataType.INTEGER))
return pdc.get(key,PersistentDataType.INTEGER);
return -1;
}
it always returns -1
tested on spigot didnt error switch backed to purpur and then still didnt error minecraft confuses me 😭
Magic pixies in the machine
som1 can help me?
write down what you need help with
i need help with serverr
Hey
If anyone knows IO stuff I need some help https://www.spigotmc.org/threads/issue-copying-a-server.562683/ thanks !
okee
anyone know anything about perlin noise cave generation?
Hey guys, I am not sure if this is the right channel so I apologize in advance. I am trying to create a plugin that will allow players to claim 1 out of 10 islands which are in a circular formation, in their center is a island that will automatically regenerate "every n amount of hours". I am not sure what exactly I need to learn and study to be able to do that, so any help will be highly appreciated. If you can point me the right way of how custom generations work and stuff like that I would really appreciate it!
Ever made a plugin before?
Not really, just recently started doing that.
how long have you been working with java? @chrome snow
Not that long, studied it last semester in university. Im quite new to all of this, i am learning java while I am in summer break.
Also I apologize if I was supposed to make a Thread and not post my question like this.
okay, I know this may sound a bit harsh for you but you need to learn a lot of concepts for this, I don't know if you were asking how to make it (process) or tips how to make it efficient but if you want custom generation then you have a long way to work, not only learning java but all the math an concpets behind it, so it would be better to take something msllaer on your shoulders
First start with a tutorial to learn how to make a plugin
I am not sure how to ask my question properly I guess haha
It doesn't sound harsh at all, it makes sense. I am not intermediate in Java yet.
I know how to make simple basic plugins as of now. And I understand that what i asked about above is quite far from a simple basic plugin.
then you're nowhere near to making that complex plugin, it's better to start slower and work your way there
Ok, well your question. If this is a designed map, you can specify the location of the islands.
so I'll assume you want only owners of the islands to build there or something
he can use schematics for islands instead of procedural generation
I can explain in more detail if you would like?
yep schematics would be simplest
I thought about that, but I would like the islands to generate randomly as well.
The concept is this:
you can have more than one schematic but really procedural generation is hard AF and I know people (including me) that have more than 2 years experience with math, programming and these and don't know how to make it
you would probably have to use perlin noise, determining the block that should be placed, and knowing the surrounding in numbers
A flat ocean world in a specific size. Let's say 50kx50k block range.
People would use a command / custom gui which will let them create an island (each island will be randomly generated but based of a theme, like having lakes, custom trees etc). Total of 10 islands for players. Which will be in a circle. In the center will be a bigger island that will generate randomly each let's say 10 hours or so.
50000 x 50000 blocks??
That is an extensive and very complex idea
Concept of this is that players won't be able to play in other worlds and stuff.
So that's basically their entire play world, and the center island is where they get resources and stuff.
Anyone know why setItemInOffHand always sets the amount of the item to 2?
shows us the code
player.getInventory().setItemInOffHand(new ItemStack(Material.STICK, 1));
Gives me 2 sticks
try setting it to 0
You might be right eh, but it was just an example. Poor example but still haha
yea
I understand the concept is complex, tho I have to learn it one way or another. What's the best way to approach this? Any forums or videos I can watch to implement the basic of basic generations? So i can get the hang of it ? Or at least ways to implement schematics ? I find it fascinating so I am really interested
Then there's no stick at all
hmm, tried googling?
Try to remove the 1 and the ,
probably not. Worldgen was recently redone so most examples will no longer be valid
Dang, really.. ? Sigh
that a good question, first you would need to learn procedural generation, that includes perlin noise, looping blocks and math behind it (general sense), then as @eternal oxide mentioned, worldgen which has been redone so yea, and then learn how to implement it in a project, you should use javadocs to learn about populators but mostly worldgen
Kind of unrelated but I did something similar to this, and it totally flopped and I believe it was because the world was too big and nobody cared to go to the middle
@chrome snow Why don't you divide your world in multiple worlds
Each world is an island
That would be much easier to manage
yes, but the main point is about the generation
A friend created a plugin called PersonalWorlds, which allowed each player to have their own world. Basically you are doing this but on one map.
with a Mining world
You can say so yeah. The idea is so people could have their own homes, which are their islands. The only world could actually farm and build stuff etc. The center island's only purpose is to be able to harvest resources. And you won't be able to go to other islands unless u are related to them via party/friends system I am currently working upon.
I have Enum with Strings
and I don't want to call SoundManager.SHOVEL_DIG.getName()
isn't there a way to just do SoundManager.SHOVEL_DIG?
Like Bukkit Sound does?
The only idea I get is creating n amount schematics and just place them on the exact cords I need..
I don't understand, shows us the code
for example rn with my code I would need to do this:
then do that, but I warn you, the bigger schematic the longer it takes to create it
look what the Sound enum returns
what does that playSound func takes in
It will work for the player islands since they are static, but what about the center one which has to be updated in a period of time? That's the part that get's me
use runnable to countdown, then swich to different schematic with random
Is there an equivalent of Mini's Mapping Viewer to translate Spigot Mappings to Mojang Mappings?
Hmm I guess that will work. What's the easiest way to implement a schematic you reckon? I am thinking of worldedit. Use their built in feature or so.
Spigot has Schematics
Oh, didn't know that lol, my bad. Will check it right away ! Haha
I can;t remember their name for the life of me though
Alright boys, thank you a lot! Appreciate all the help.
Research will do the work probably
Thank you very much !
@chrome snow It sounds really impossible to achieve what you need. Putting all of the 50k² islands on the same map is just too much in my mind. I don't even see how you can manage to generate it while the other players are near. Cause Worlds sucks in mc and it will just freeze everything (I think you can't it on multiple threads).
- I can't imagine the size of your world after that 🥲
You should probably just create on world for each island, and if you want to make the switch, why not check if the player is in the water on the edge and make a smooth teleport to link all islands
The size was just a poorly made example. And i am planning on making a field barrier around the builds at a specific range so people don't get lag when they are nearby.
I think you understood me wrong haha, the islands wont be that big. The flat world that will contain everything will be with that size. Islands will be simply 500x500 blocks or so.
bump
Yeah but I mean while creating or regenrating the island, it will freeze the entire world
Okay that's more reasonable ^^
cancel the event even when its not that item i would suggest, but you will have to debug and learn why it doesnt know that that item is not in the list
I am pretty sure if I use FAWE's feature of removing stuff it won't cause much of an issue unless it removes quite the hefty region. I might be wrong tho hah
did you even understand what i sent?
i only want to cancel that item
not anything else
you asked "anyone familiar with a way of fixing this?"
thats it
and I told you to debug why it doesnt recognize it
Still I guess it will cause so much difficulties. (But it has been a long time I haven't played or dive into mc)
But try. This is the best advice
Makes sense, try and error you know. Hope it goes well
ok so you didn't understand what you saw still
the event geta cancelled when the croshair isn't on the item but when it's it doesn't
well, you didnt ask a specific question adn this thred is not your personal feed so others can debug you code
i did show a gif
still, this is not your personal thread for others to fix your code
and it's obv why because the code is obv
Anyone know why EntityPickupItemEvent gets called twice?
That was the reason why I got 2 sticks
Listener is only registered once
Wait I know why, because I'm cancelling it so the player tries to pick it up again right away
I wish I could find my bugs that fast lmao
the obv should be the question you ask, if it doesnt work and you want someone else to fix it, pay someone else, we can only give tips and help with what to do but not do the work for you
ok so you didn't understand and you are fighting because you didn't understand
instead do something else fam
it's really obvious to get what's wrong
hmm, and you wonder why noone responds to you
you just don't get it yet
so if you know whats wrong go fix it, dont make others do it for you
because i found out it's impossible to fix through the spigot api
then why are you asking on spigotmc?
because that's maybe what i use
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
you just said it cant be fixed through spigot 😐
and what does that have to do with spoon-feeding
no, but youre asking for someone to fix it for you
no i said if anyone is familiar with a fix maybe im wrong and there's one through the spigot API
what is your goal ahmed?
and apparently the Spigot API doesn't provide the item slot destination
@topaz cape You shouldn't use monitor priority if you're actually changing anything in the event
actually it gets called last
No changes are to be made in Monitor
Use HIGHEST for that
but the event gets cancelled
use highest for that
then cancel at HIGHEST. No changes at MONITOR
ok ok
btw I just want to say that he just asked if anyone know how to fix it, now saying what
even though that's not a fix
Can I somehow display text in upper right corner?
Try it first
whats wrong with that? stop complaining, he did nothing wrong but being rude
ok
No idea what your actual question was
that this thread is for help with things people dont understand and solutons with spigot api, not asking: "hey, this doesnt work, can someone fix it?"
when i cancel the event it only gets cancelled if my cursor isn't on the item
that's my question
Still if you need help or information feel free to ask. Pretty challenging plugin I like it
notice that im willing to cancel the moving of only that item
What event?
now I understand, and I think im not the only one
i'll take that "being rude" back, he was right, you didn't understood a thing.
here's what i wrote for it
How are you moving the item to the first slot without hovering over it?
number key
i can press the number key
because he didnt ask a question, I'm not the only one who didnt understand, @eternal oxide didnt understand too, so 🙂
just press 9 when hovering to the first slot
Well but it looks like it does get cancelled, doesn't it?
actually other people got it
lol
because elgar wasn't there,
.
anyone familiar with a way of fixing this?
the original question. learn how to read.
and just for the protocol, i understood it right away
Or are you just trying for it to not glitch like that?
what?
bruh, the original question is just that, and thats not a proper question for this thread
then why didnt you help right away?
My suggestion. Remove all your logic code and just blindly cancel the event. (as a test), at HIGHEST (never modify in MONITOR).
so thats why you had to explain it to them again, right?
it's not a glitch it just calls the event on the item im not hovering
i was enjoying your nonsense
when they saw the message they got ot first time now stop pinging me arguing for no reason
Okay now I understand your problem
oh right, because you understood it and knew how to help but rather watched me explain to him thats not a proper question
you started being rude and pinged me, i tired to help you but you didnt want it, enjoy
i sent a gif of what's wrong and what i wrote my code if my question isn't proper I don't know what is
let him trashtalk
im thinking it's possible to be fixed if i could get the destination of the slot through the sent packet
and maybe then i can either cancel the packet or just change the slot back
Can't you get both slots?
nope
Using getSlot() and getHotbarButton()
declaration: package: org.bukkit.event.inventory, class: InventoryClickEvent
wait.. that should be able to fix it
It returns which number was clicked
what are you trying to do?
YOU'RE A GENIUS (will have to hardcode the numbers currently but yeah hopefully that works)
Glad I could help!
always thought that getHotbarButton just gets the current item slot
that is why we have docs
bump, anyone know anything about perlin noise cave generation?
What do you need?
Im trying to make custom cave populator and doesnt really understand how to implement it into the code, this is the function that i made
private double perlin3D(World world, double x, double y, double z) {
PerlinNoiseGenerator perlinNoise = new PerlinNoiseGenerator(world);
double ab = perlinNoise.noise(x, y);
double bc = perlinNoise.noise(y, z);
double ac = perlinNoise.noise(x, z);
double ba = perlinNoise.noise(y, x);
double cb = perlinNoise.noise(z, y);
double ca = perlinNoise.noise(z, x);
double abc = ab + bc + ac + ba + cb + ca;
return abc / 6;
}
@agile anvil
Well i don't know how bukkit manage it's world generation
But have a look at WorldGeneratorAPI
I think you can easily implement your noise generation
the thing is i know how it works (mostly) but doesnt know how to add the perlin noise
what would be the output of this function?
For each coordinates, you generate a number. This is like an heatmap.
number between 0 and 1?
Couldn't tell just by memory, you should debug to know (i don't think so cause it would have been a float and not a double)
but double can be decimal and the noiseGenerator is returning double
so if I do this I should be fine?
if(perlin3D(world, blockX, blockY, blockZ) > 0.5) {
worm.add(world.getBlockAt(blockX, blockY, blockZ));
}
Long time no see bro
Yeah I guess so. But actually have to try cause I don't remember the values
okay, thanks
Could you imagine that 😂
.
how can i set weather to clear????
nope. doesnt work
what version?
1.8.8, to save resources
uh 1.8.x
saying youre using 1.8 here is dangerous, people will send you death threats
try it
no idea about old versions
there is:
#setWeatherDuration(int)
#setStorm(boolean)
#setThundering(boolean)
but you could maybe try to set gamerule
there is no gamerule for weather cycle in 1.8 :(
@EventHandler(priority=EventPriority.HIGHEST)
public void onWeatherChange(WeatherChangeEvent event) {
boolean rain = event.toWeatherState();
if(rain)
event.setCancelled(true);
}
@EventHandler(priority=EventPriority.HIGHEST)
public void onThunderChange(ThunderChangeEvent event) {
boolean storm = event.toThunderState();
if(storm)
event.setCancelled(true);
}
try this
old version = 💀
bro


