#help-development
1 messages · Page 1236 of 1
i haven't used it much, but it works for bulk tasks where you don't care about timeout errors or things taking forever
i used it to generate a few thousand textures for custom sword trims, with like sd 1.5 or something iirc
well uh i actually only meant to generate a few hundred
but it took so long that i left it running and forgot about it for days
at least now, no two players will have the same trim
digital scarcity, yes?
Ohh it does?
lol don't care
also goblets
for le dungeon loot
they look kind of crinkley and shit but at least there are thousands of them
i also have 2000 rings somewhere but i can't find them
All generated?
Can you somehow check which ones are used?
the model card on their site usually says on the sidebar how popular it is and whether it's eligible for inference on the spot
just simple diffusion 1.5 with a lot of post-processing
how can i check if the player connects from one or another ip or if he connect by direct connection or if the server is in the player list
wdym?
not replying to you
oh okay sry
there should be something on the async prelogin event for that iirc
the client tells the server what address the client is connecting to, which could e.g. be a domain name rather than the server ip
idk if that's what you mean though, i can't really make heads or tails of what you're saying
how he said you can check their ip but not how they connect in terms of direct connection or if the server is in their server list. What's the xy to that?
i want like to give a rewards if someone join from the server if it's in the server list and doesn't if he does from direct connection or if it's possible i want to make too that if he connect from xyz.discord.gg he get a stuff but if he connect from www.discord.gg he get only a welcome message
well the first part with direct connection etc is something thats only for the client, the server has nothing to do with that. The second thing tho can be achieved through some sort of proxy perhaps (never worked with so no clue on the how excactly, sorry)
it's fine, sorry for bothering and thanks for giving me a bit more clue on that 🙂
never allow direct connect when using a proxy
it's a 1 server no proxy
k
would it skip the proxy?
i still can't parse what you're saying
try using some punctuation
you want to give someone a reward if they join from a server list?
sounds like he wants some kind of referal system
which sounds like this to me
but you'd have to have a separate subdomain for every server list
and you probably don't want players getting rewards every time they join with that address
not sure why you'd want to reward people from a server list specifically either
referrals would make more sense
ye i think that referrals is better too but i was just couriouse how a stuff like that is possible and if it's possible do use it for do something cool
the async prelogin event iirc has a method to get the address the player is connecting with
what this do e.getPlayer().getAddress().getHostName()?
not what you want
Yep, even has a check for isTransferred, but its just a boolean
How would I make a skeleton shoot rockets in the same direction as the arrow?
@EventHandler(ignoreCancelled = true)
public void onEntityShootBow(EntityShootBowEvent e) {
if(!(e.getEntity() instanceof Skeleton)) return;
if (!(e.getProjectile() instanceof Arrow arrow)) return;
Firework firework = (Firework) arrow.getWorld().spawnEntity(arrow.getLocation(), EntityType.FIREWORK_ROCKET);
FireworkMeta meta = firework.getFireworkMeta();
meta.addEffect(FireworkEffect.builder()
.with(FireworkEffect.Type.BALL_LARGE)
.withColor(Color.RED)
.withFade(Color.YELLOW)
.flicker(true)
.build()
);
//meta.setPower(1);
firework.setFireworkMeta(meta);
//firework.setVelocity(arrow.getVelocity());
e.setProjectile(firework);
}
```I tried this and also experimented with the velocity and power (also set it to 0) but all it does is make the rocket fly straight upwards
get the velocity of the arrow and set that as the velocity of the rocket
that's the first thing that comes to mind at least
that's the second to last line but it didn't change anything, probably because rockets change their velocity by themselves
But a player can shoot rockets with a bow in any direction so there has to be a way
*crossbow
man i'm so behind on the times with game features
It's quite easy to miss since they are only loaded into the crossbow when they are in your offhand
public void tick() {
super.tick();
HitResult hitResultOnMoveVector;
Vec3 handHoldingItemAngle;
if (this.isAttachedToEntity()) {
if (this.attachedToEntity == null) {
((OptionalInt)super.entityData.get(DATA_ATTACHED_TO_TARGET)).ifPresent((target) -> {
Entity entity = this.level().getEntity(target);
if (entity instanceof LivingEntity) {
this.attachedToEntity = (LivingEntity)entity;
}
});
}
if (this.attachedToEntity != null) {
if (this.attachedToEntity.isFallFlying()) {
Vec3 lookAngle = this.attachedToEntity.getLookAngle();
double d = 1.5;
double d1 = 0.1;
Vec3 deltaMovement = this.attachedToEntity.getDeltaMovement();
this.attachedToEntity.setDeltaMovement(deltaMovement.add(lookAngle.x * 0.1 + (lookAngle.x * 1.5 - deltaMovement.x) * 0.5, lookAngle.y * 0.1 + (lookAngle.y * 1.5 - deltaMovement.y) * 0.5, lookAngle.z * 0.1 + (lookAngle.z * 1.5 - deltaMovement.z) * 0.5));
handHoldingItemAngle = this.attachedToEntity.getHandHoldingItemAngle(Items.FIREWORK_ROCKET);
} else {
handHoldingItemAngle = Vec3.ZERO;
}
this.setPos(this.attachedToEntity.getX() + handHoldingItemAngle.x, this.attachedToEntity.getY() + handHoldingItemAngle.y, this.attachedToEntity.getZ() + handHoldingItemAngle.z);
this.setDeltaMovement(this.attachedToEntity.getDeltaMovement());
}
hitResultOnMoveVector = ProjectileUtil.getHitResultOnMoveVector(this, this::canHitEntity);
} else {
if (!this.isShotAtAngle()) {
double d2 = super.horizontalCollision ? 1.0 : 1.15;
this.setDeltaMovement(this.getDeltaMovement().multiply(d2, 1.0, d2).add(0.0, 0.04, 0.0));
}
handHoldingItemAngle = this.getDeltaMovement();
hitResultOnMoveVector = ProjectileUtil.getHitResultOnMoveVector(this, this::canHitEntity);
this.move(MoverType.SELF, handHoldingItemAngle);
this.applyEffectsFromBlocks();
this.setDeltaMovement(handHoldingItemAngle);
}
try setShotAtAngle
Oh that sounds reasonable from the javadoc, thanks. I'll try
i have this bad habit of going to the impl source rather than the docs
maybe because half of the bukkit docs are
setShotAtAngle(boolean shotAtAngle)
sets if shot at angle
shotAtAngle: whether shot at angle
hahaha yeah fair point
it still doesn't work though, wait let me record that
hmm xD
Firework firework = (Firework) arrow.getWorld().spawnEntity(arrow.getLocation(), EntityType.FIREWORK_ROCKET);
FireworkMeta meta = firework.getFireworkMeta();
meta.addEffect(FireworkEffect.builder()
.with(FireworkEffect.Type.BALL_LARGE)
.withColor(Color.RED)
.withFade(Color.YELLOW)
.flicker(true)
.build()
);
meta.setPower(3);
firework.setFireworkMeta(meta);
firework.setShotAtAngle(true);
firework.setVelocity(arrow.getVelocity());
bowEvent.setProjectile(firework);
```I set the velocity back but no luck
oh the arrows velocity is 0 for some reason, lemme check that
get the shooter's direction and multiply appropriately i suppose
You should use the spawn method that takes a consumer and modify the firework there. Otherwise you will spawn it and then modify instead of spawning a modified firework
Yeah that's what I will do but I'm confused that the arrow has no velocity in that event
good point, will do that also. But won't change that the Arrow in the EntityShootBowEvent has a 0 velocity sadly
why not js cancel it and use launchProjectile(Firework.class) on the skeletton
by canceling i mean removing the arrow
Would be kinda against the api to cancel an event, just to trigger another one if it has a "setProjectile" method, wouldn't it?
I'll just do what vcs2 said and get the direction with multiply
true
Works now :)
Chat, im tryna make enchanting bottles with specific PDC data drop a specific number of xp orbs. My plan was to set the xp to the value the shattered bottle would have in its PDC, however I cannot find a way to transfer it from the item to the entity when it's thrown. Any ideas?
ThrowableProjectile#getItem
tysm :D
I have this weird bug, sometime a player doesn't appear to their opponent, and their opponent cant hit them or interact with them in any other way. The player itself can hit the opponent though. Does anyone know what could be causing this behavior? P. S. The player appears in tab for the opponent. P. P. S. when I /vanish the player twice they appear for the opponent.
Is Spigot up to date
Also that sounds more like a #help-server question
Unless you believe it's your code causing it
1.21.3
Time to update



Paper emoji
📸

Cmon...
Is tthere some way to make an item glow without enchanting it?
declaration: package: org.bukkit.inventory.meta, interface: ItemMeta
Ty
how can i make npc and store them so when i restart the server they are back where they was
are you trying to make your own npcs?..
yes
but i just want to create and remove an npc stop
what kind of model is expected in setItemModel
a key to an item model in a resource pack
an item model

does that mean I can set the texture of an item to the texture of another minecraft item without a texture pack?
what's the difference? 😭
also, I'm assuming it won't work if I want to retexture a an item to a specific player's skull?
why it doen't work now?
import com.google.common.collect.Lists;
public static final List<String> players = Lists.newArrayList();
i never touched this list from 1h
a model is a 3d model, a texture is not
what the heck is Lists.newArrayList 😭
where did new ArrayList
go
💀 💀 💀 💀 💀 💀 💀 💀 💀 💀 💀 💀 💀 💀 💀 💀 💀 💀 💀 💀 💀 💀 💀 💀 💀 💀
you cant be making this shi up
lmfao
I cant
the problem is not newArrayList is that Lists does't get imported
Cannot resolve symbol 'Lists'
Did you get rid of Guava from your dependencies
I mean you don't need it in this case
yep, use UUIDs
i aready use Uuid but under string the name was just a reference
i never had Guava in my pom
Transient dependency
i don't have it
You had it if it was working before
If you haven't modified your dependencies at all and you're using Intellij you can try invalidating caches
i edited it for adding worldedit
Guava is provided by spigot is spigot still in your pom
yes
i done it np i changed it in new ArrayList();
with the old sd model it gives you something like this:
that's honestly not too bad
It can probably get better with more stylized words and negative embeddings
This was done before the diamond operator could be left empty.
To prevent
List<String> someList = new ArrayList<String>();
and
List<String> someList = Lists.newArrayList();
could be used instead. But since java introduced type interpolation for the diamond operator a decade ago, all those methods are pretty much obsolete now.
People forget that Guava's kinda old as shit lol
you're also 829 years old
true
i have a permission check in my plugin, and i have the permission assigned to a player via luckperms, but for whatever reason, the check always returns false unless the player has every permission
any ideas on what might be causing this?
every permission ever
odd, how are you checking
it happens in several different places but this is one example:
@EventHandler
public void onBlockBreak(BlockBreakEvent e) {
Match match = Queues.GetMatchContainingPlayer(e.getPlayer());
if ((match == null || !match.hasStarted) && !e.getPlayer().hasPermission("novinitypvp.bypassprematchrestrictions")) {
e.setCancelled(true);
}
}
i have also spell checked it
are you sure the permission is it
Try checking only that
Maybe the match is failing
yes, i tried logging the e.getPlayer().hasPermission("novinitypvp.bypassprematchrestrictions") and it returned false
can I add to spigot server fabric engine?
fixed by implementing a custom method instead:
this is not the right solution but a workaround
please try logging every permission from player.getEffectivePermissions()
or, better, use luck perms api that they provide since you're already using their plugin
i did log every permission, and it showed they have the correct permission
but still returned false with hasPermission
Player#hasPermission can not return false if it is in their effective permissions
this ^
also it's evidently working with the workaround, which uses their effective permissions
then you have the permission granted but set to false or op
how do i fix that?
set it properly!?
listen @placid estuary if luck perms explicitly sets novinity.whatever to false your method is still going to return true
i feel something is wrong here i just cant explain it :/
output the getPermission and the getValue
righto
CraftEntity has a Map<String, PermissionAttachmentInfo>, calling getEffectivePermissions() returns a set of the values, and hasPermission() does a string lookup in that map, if it finds something then it returns the value of that permission (which may be false!), otherwise it returns something depending on whether the player is op
Then what is the best method to do it
Try java Bukkit.getServer().getPluginManager().getPermission("novinitypvp.abcdefgh") and see what it outputs
that specifically? or replaced with the problem permission?
whichever permission you'd want to test with
preferably turn it into a debug command
hey anyone know why the enderDragon health can't be changed (with NMS)
public class EnemyDragon extends EnderDragon {
public EnemyDragon(EntityType<? extends EnderDragon> entitytypes, Level world) {
super(entitytypes, world);
this.setHealth(10f);
}
}
I only have this
do you maybe want to change max health?
that will only tell if the permission exists. It won;t return its value
correct
edit the dragon's attributes if 1.21.1+
i'm in 1.21.1
okay it is returning false on the getValue, but i have no clue why as i'm setting it to true in luckperms
do you ONLY set it in LP?
doesn't luckperms have a verbose mode for shit like this
did you add luckperms into softdepend in your plugin.yml?
yes
one of the few actual improvements over pex
luckperms also has a command to test permissions i think
it does yeah
no
i also dont know how to do that though lmao
huh?
ask chatgpt that
also, you're using player.hasPermission which, afaik, luckperms performs a hack to make it work
(e.g. if your plugin never calls player.hasPermission("novinitypvp.somestringhere"), then luckperms will never offer that autocompletion in the web editor)
it would probably be the best to use Luckperms API directly
but what if i dont want the plugin to require luckperms
that's why it's a softdepend
if you don;t need wildcards then Player#hasPermission is fine
will calling the api not make it a requirement?
since itll just give an error if it doesnt exist
IF you don;t care about the value then use Player#isPermissionSet
You don’t need the luckperms api to check permissions
nope
// in onEnable
if (Bukkit.getPluginManager().getPlugin("LuckPerms")) {
loadLuckPermsAPI()
}```
That’s exactly what hasPermission is for
I believe his problem is that his plugin loads before luckperms, and luckperms does not catch up all the hasPermission calls
how can the player be online before luckperms loads
or are we working with an offlineplayer?
change this attribute if you wanna change max health, if i got you correctly
a
i meant the plugin that needs permissions but does setup before luck perms can create some invalid state in between
no but i can change every livingEntity health but not the enderdragon...
it does in fact load before luckperms
i doubt this matters; for autocomplete or something at most
should not really matter as you are using SPigot API
You should/could register your permissions in your plugin.yml (as ALL plugins should)
the user had 2 roles: builder and default
default had the permission set to false
builder had it as true
i forgot that default had it as false and also thought it wouldnt matter since builder was higher
can You guys send me full end script and tell me where i must put it?
Pleaaaaaaaaaaaase
but i guess i was wrong
next time use luckperms verbose
since you said luckperms' command is correct
did you create your own command that does the same thing? /checkmypermission novinitypvp.bypassprematchrestrictions
what?
this is #help-development
aka. for people who know programming
you want #help-server
do not grant it if you are setting it false
man, you asked this weird question, it's half incomprehensible too but you cannot interchange spigot and fabric plugins and mods....
and your question was already answered
so sorry for wasting your times 😭
so ticket closed
set its default to false and only give true in teh actual group which needs it
not a waste if it produced a result
also (register your permissions correctly in plugin.yml) https://github.com/ElgarL/GroupManager/blob/54a344cd595fac0c870bda55d192a889279107d0/resources/plugin.yml#L24
well it wouldn't if the weight for builder is larger, and you added yourself to builder group
Thanks
is there a spigot version of paper's ```java
getOfflinePlayerIfCached
no
is there a similar thing that will prevent my server from exploding?
get the offline player by UUID. if the getName method returns empty then they don;t exist
there is a way for get the items of the book (next page etc)
i don't have the UUID
thats why i am searching by the name
then no
couldn't you just get the offline player and check the hasPlayedBefore() variable on them?
it would still compute the OfflinePlayer object
which if it doesn't exist it will lag your server for some unspoken reason
getOfflinePlayer(name) will always return an Object
iirc it does some mojang request but not too sure about it
yeah i'd have to migrate to paper for this one sadly
what are you trying to do?
why do you need it only if cached?
im using NATS for messaging so i need to be sure a player is there
you can but i don't think you can determine whether it's cached without risking network io if it isn't
a player can have played before and not be cached
i am making kick commands from the party and the player use names, not uuids
also some players may have never played a gamemode so they never joined that server
how would a player get into the party if they are not cached?
presumably parties are network wide
exactly
surely they have to be added by a server they are on
via Nats, it sends a packet across the shared network and if there is a match in any of the server then its constructed
either way i dont think ifCached helps here since you will want the command to also work for players who have never joined a backend
this honestly sounds like a command that should execute on the proxy
exactly
yeah i know but sadly it has been requested to make it NOT run on the proxy
would have been much simpler
yeah a proxy command would be perfect for it
the only way i see this working is online mode and calling the mojang api if the cache doesn't have the name
is the requester also fine with this
yeah the only thing the server is also cracked so no luck on that
like i could do the trick of getting the UUID by doing "OfflinePlayer:" + nameOfPlayer and get the bytes
but sadly i can't because they use a plugin for premium login so some UUID's cannot be computed normally
:/
Why cracked though
that'll break with certain fastlogin/namechange support systems they probably also have
yeah they use some of that fastlogin premium access
you are a wheelchair
if you pay the game no need for auth, if you don't you need a password
idk, im still getting paid so i don't mind it
this problem comes in two parts pretty much
the first is to have some centralized database for name -> uuid; this would be their fastlogin database presumably on the proxy
the second is to get the backend to call that database
the only way i see it is to forward the command trough NATS to find a matching name then actually run the logic on the server the player is on which will take some millis but i think there is a better way
no need for database honestly
database as in a repository for that information
package it.alessandrocalista.parties.network;
import java.io.Serializable;
import java.util.UUID;
public interface Packet extends Serializable {
record CreatePacket(UUID owner) implements Packet {
}
record MemberJoinPacket(
UUID partyUUID,
UUID member
) implements Packet {
}
record MemberLeavePacket(
UUID partyUUID,
UUID member
) implements Packet {
}
record PromotePacket(
UUID partyUUID,
UUID member
) implements Packet {
}
record DisbandPacket(UUID partyUUID) implements Packet {
}
record PartyInvitePacket(
UUID partyUUID,
UUID sender,
UUID target
) implements Packet {
}
record PartyInviteExpiredPacket(
UUID partyUUID,
UUID sender,
UUID target
) implements Packet {
}
}
could be flatfile, could be mysql
currently this is the packet structure
but to resolve names you need a mapping from name to uuid
every server is synced (waste of memory because if it had been proxy it would have not even needed NATS)
(and replication, because yes, every server has the exact same map copied)
is the name -> uuid mapping also synchronized across backends?
there is no mapping currently
there must be
otherwise their fastlogin setup wouldn't work
the mapping is most likely on the proxy managed by fastlogin
oh you mean if there exists a database with some data
you need to figure out a way to query it
What if the player is already is a party?
validation
either by making a direct request to the db if they use mysql, or through plugin messaging to the proxy that fires your code there that calls the fastlogin api
WAIT
YOU ARE A GENIUS
WAIT
i remember there was a bungee channel to query user data
wait
unless it's specifically managed by fastlogin it isn't going to help you
or are we restricting this to players who are currently online on the network?
Hello, how can I get the vector of the direction the player is looking at ?
getEyeLocation
okay that's not that the problem then
humm
I'm trying to "launch" an armor stand
and he has a gravity using velocity etc.
but he suddenly stops orienting in the direction of the player, and keep to Z+
the sword in his hand should always be in the same direction of the player (except when it rotates)
set its direction to the players direction
idk how to explain it correctly
that's what I've done already
clearly not
but then it just set to another position
at the beginning, it is
and then with velocity it just... idk
here's my code if you want to check
https://paste.md-5.net/ifatinoxer.java
I assume you're counter-rotating the armorstand's hand towards -yaw
which cancels out the rotation of yaw
making it always face z?
nvm I'm completely off
the hand doesn't make the orientation of the stand ig
Hm? Why are you changing the rotation in the runnable rather than on spawn
I just to make the hand move
Also do modify the entity the spawn methods consumer
like it's a throw
well, I'm on spigot 1.8
it doesn't exist in this version
also (just a minor thing) getLocation() already returns a clone so unless you want to use it multiple times you don;t need to clone again
okay thanks
That doesn't explain it
Why do you want it to follow the players direction
So if I move my head the axe rotates
no, it keeps the same direction
That's not what your code does
I get the direction one time ?
Wait that was a runLATER
🤦♂️ My bad
okay the hand is the problem
So no telekinetic axes?
Well sort of
If you move within 2 ticks :)
Well it's more like it will be in the wrong rotation and then correct itself
What did you change?
Trying to add a blacklist system is not going to work, I need help getting it to work. I tried to create a GUI. I had one row working with the max of 5 in the 9 row. Now I broke it with no possible fix. SUPER ANNOYING.
Code of the error: https://paste.md-5.net/ovotutocip.cs (34: getVoidList)
The error: https://paste.md-5.net/pewiradulu.cs
Got the first row fixed
Ignore that, I cannot tell you what I did
Try >= instead of > in the size check
I got it fixed but thanks
I removed it
and now I try to make the item in the hand follow same trend as the armor stand
Here's my code if you wanna check : https://paste.md-5.net/uyedimepez.java
but for now I'll go get some rest, see ya!
After that book trip to https://en.wikipedia.org/wiki/Kotlin_Island
Where do you think the name came from lol
i dont know tbh
no idea why they picked the most bland island possible
Java (the place) is actually beautiful and makes sense that something would be named afrer it.
Kotlin Island looks like a place where I'd construct a gulag
i really dont know bro sorry...
Maybe this helps....
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
instructions unclear, im illiterate
how come these recipes don't work? i tried a test recipe with some different materials and it worked fine, but these just don't function
the GetHeart method:
public static ItemStack GetHeart(int amt) {
ItemStack stack = new ItemStack(Material.NETHER_STAR);
stack.setAmount(amt);
ItemMeta meta = stack.getItemMeta();
meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', NovinitysLifesteal.HeartName));
meta.setLore(new ArrayList<>() {{
add(ChatColor.GRAY + "A small chunk of life force.");
}});
stack.setItemMeta(meta);
return stack;
}
ive done something very similar to this in past plugins and it's worked completely fine
aight so, im real new to plugin dev, anyways, i want to pass an instance of my config file to a class when the server is enabled, and idk how i can do that
?paste
okay to be specific, i want to write some things to a yaml file when the server is first started up
like this? effectgen.itemgen(this.getConfig());
what's itemgen?
How can I take a timestamp when someone make the command test and check if the differenze from the timestamp to another timestamp is less or equal to 24 hours?
right i mean like what does it do
you used the method in that code snippet but i dont know if it's "right" because i have no idea what you're trying to do
store 2 timestamps somewhere and check to see if the difference between the two is less than or equal to 24 hours?
not sure what you're asking
public class effectgen{
public static void itemgen(FileConfiguration config){
System.out.print("started");
List<String> plants = config.getStringList("Alchemy.Plants");
for(int i = 0; i>=plants.size(); i++){
List<Integer> effects = Listgen.effect(i);
for(int x = 0;3>x; x++){
config.set("Alchemy.Plants."+plants.get(i), effects.get(x));
}
}
System.out.print(plants);
}
}
to be clear, it doesnt even get to the "Started"
when are you calling that
Yes to store I know how to do it the problem is how can I get a timestamps and how can I check the difference of time
public class Start extends JavaPlugin {
private static Start plugin;
@Override
public void onEnable() {
plugin = this;
getLogger().info("onEnable is called!");
getServer().getPluginManager().registerEvents(new BrewListen(), this);
getLogger().info("Big brother be watching");
effectgen.itemgen(this.getConfig());
}
@Override
public void onDisable() {
getLogger().info("onDisable is called!");
}
public static Start getplugin(){
return plugin;
}
}
also naming conventions 😟
i will start naming them in emojis
easiest would be to store the timestamp as UNIX with System.currentTimeMillis() (iirc)
any errors?
yes
what are they
Oh okay Ty so much
[00:50:35 INFO]: [Ablution] Enabling Ablution v0.1
[00:50:35 INFO]: [Ablution] onEnable is called!
[00:50:35 INFO]: [Ablution] Big brother be watching
[00:50:35 ERROR]: Error occurred while enabling Ablution v0.1 (Is it up to date?)
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Unknown Source) ~[?:?]
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Unknown Source) ~[?:?]
at java.base/jdk.internal.util.Preconditions.checkIndex(Unknown Source) ~[?:?]
at java.base/java.util.Objects.checkIndex(Unknown Source) ~[?:?]
at java.base/java.util.ArrayList.get(Unknown Source) ~[?:?]
at AA-1.0-SNAPSHOT.jar/AbyssalAblution.example.IngredientGen.effectgen.itemgen(effectgen.java:16) ~[AA-1.0-SNAPSHOT.jar:?]
at AA-1.0-SNAPSHOT.jar/AbyssalAblution.example.Start.onEnable(Start.java:19) ~[AA-1.0-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:280) ~[paper-api-1.21.4-R0.1-SNAPSHOT.jar:?]
at
io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202) ~[paper-1.21.4.jar:1.21.4-187-1d5e5a5]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[paper-1.21.4.jar:1.21.4-187-1d5e5a5]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:520) ~[paper-api-1.21.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:657) ~[paper-1.21.4.jar:1.21.4-187-1d5e5a5]
at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:606) ~[paper-1.21.4.jar:1.21.4-187-1d5e5a5]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:743) ~[paper-1.21.4.jar:1.21.4-187-1d5e5a5]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:488) ~[paper-1.21.4.jar:1.21.4-187-1d5e5a5]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:322) ~[paper-1.21.4.jar:1.21.4-187-1d5e5a5]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.21.4.jar:1.21.4-187-1d5e5a5]
at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:310) ~[paper-1.21.4.jar:1.21.4-187-1d5e5a5]
your for loop is wrong
for (int i = 0; i < plants.size(); i++) { ... }
and it also looks like Alchemy.Plants is an empty list
yup, commenting that out fixed that
so, now need to do some yaml nonsense
Alchemy:
Plants:
Dandelion:
Poppy:
Blue_Orchid:
oh yeah after looking at the code again idk what that loop was even supposed to do
basically, that method is supposed to give each of these plants 4 effects
just for future reference that isn't a string list
ik,
tbh, i thought the issue was passing the file, now ik that none of my system message were getting sent, i realize im where i expected to be, figuring out how to edit this yaml file properly
Well my goal is to cut off generation at y=63, among other things, but that's the first part. I want to alater the default generation rather than generate it myself. Is that possible with these methods? I don't quite understand them. Are block populators not intended for additional things like adding stuff like loot to generation?
not really, blockpopulator should be fine
Ah okay. Thank you. :D.
Hopefully this will work better than using the ChunkLoad event xD
Why can't i find the Material class using Spigot API 1.21.4-R0.1-SNAPSHOT?
update intellij
sorry, i have to use v2022 because newer versions of IntelliJ don't let me compile plugins
the fill button is not clickable
fill button?
And the generated methods onEnable() and onDisable() tell me "no usages"
I update now IntelliJ and i'll show you
That's a warning that can be safely ignored
You're just gonna have to find fixes to those issues, updating IJ is the only way of fixing the dependency issue
What build system are you using ?
Maven
ye, so you'd build your plugin with mvn package or some command, don't remember
not with some weird button
15 minutes to update 😭 i wait
I try it later
I still wanna know what you mean with your "fill button" tho
I'm sorry for my keyboard, i mean "compilation"
Well you just need to properly set it up, probably not setup correctly upon updating
I have to say though that i have never seen such fast support anywhere, impressive
Ok, now it works
Ty from 🇮🇹
yo man sorry for disturbing you, i saw that you are a JDA user i'm trying to get when someone leave the discord i aready done a slash command that work fine but in my event listener
public class DiscordListener extends ListenerAdapter { @Override public void onSlashCommandInteraction(SlashCommandInteractionEvent event) { } public void GuildLeaveEvent(GuildLeaveEvent event) {} }
the guild leave event doesn't work and the name doesn't become blue how the onSlashCommandInteraction does, sorry another time for disturbing
i tried putting @Override to the GuildLeaveEvent too but it get me this error Method does not override method from its superclass
if you Override a method it must exist in teh parent class
is there anyway to prevent plugins from registering commands you want the server default?
You can /minecraft:vanilla_command
before it gets overwritten not after
you could remove their command from teh command map
hrm i thought you couldnt do that?
you can but it requires reflection
or
You could register yoru own command last which calls the vanilla command
hmm
last to register gets priority
or
use the tab complete event and the command preprocess event
to re-route to the vanilla command
there is a method like Bukkit.tabComplete or similar
or it was on the player I forgor
anyways you can use that
and then Player#perform to call the command
mhm
It has some issues that are going to be addressed, but I was told it's the smoothest in terms of combat
what
Why is having your plugin instance stored in a static field considered bad
static fields persist across reloads
if not properly updated you could accidentally hold the previous instance
-# don't think I ever had an issue with this but
Don't use /reload
That
Reloading plugins is fine as long as the plugin is written with reloads in mind
Static fields persist for only as long as the plugin classloader does, which, if you cleanup correctly on unload, won't outlive the next gc cycle
Generally you just set your static instance to null onDisable
You don't need to but you can if you like to
If someone is leaking references to your plugin classes you have bigger problems than your static plugin field
generally just dont use reload in production
full server reloads for sure, but if you know a plugin supports being reloaded, it's fine to reload it
in many of my plugins i forgo an internal /myplugin reload command entirely in favor of just supporting reloads with a plugin manager
dependency chains make it difficult to support and those plugins usually don't or can't support it
but for a standalone plugin? i'd argue it's actually considerably cleaner than internal reload logic
Iirc you can not delete old classes from memory, so doing /reload often will just make the server run out of memory
So dedicated reload command per plugin is still best
i'm not sure how /reload works, but plugin managers cause the classes to be re-loaded under a new classloader
yo so should i not make a /reload option for my plugin loader
which means the old classloader, and any classes loaded by it, can be garbage collected
/reload does the same
as long as nobody is holding references to any instances of those classes (this is why doing it with dependency chains is hard)
Can classes be garbage collected ?
I don't know much about Java internals
Assuming yk, nothing keeps it from being cleaned
no if im writing smth like bukkit, is there a safe way to implement reload
with just bukkit, though, bukkit usually does its own cleanup on unload
e.g. listeners and tasks get unregistered and cancelled
so unless you're really going out of your way to get your classes referenced after your plugin is disabled, you're probably fine
the other side effect of this is that all statics are uninitialized again, so you start from a completely clean slate
Yes but there is pretty much no guarantee, you’d just remove all hard references to it and hope the garbage collector sweeps it up
the classloader needs to be GCd for its classes to be GCd
I also need to be GCd 
except for hidden classes, hidden classes may be GCd without having to GC the CL, depending on how the hidden class was created
greatly cared, yes
and the classloader can't be gc'd as long as any of its classes can't be gcd, which is as long as any of their instances are still reachable on the heap
so having e.g. some worldguard flag in the wg registry is going to keep all of your classes and statics in memory
easy to get wrong, but usually not an issue if you're consistent and careful with where you pass your objects
generally it isn't something you should care about at all tbh
Today I learned
what are you doing
over 64KB
I have a http response that had 181k characters
Wanted to store it somewhere so I can easily test my code and not request this each time :D
Specific version please
ItemFlags should still work I believe
it's itemflags across all the versions but some of them don't work in .4 any longer
iirc hide_attributes
Mojank keeps on changing how the tooltip hiding works and I get confused.
i think .4 might actually be in an awkward spot where there is no set of flags that hides everything because that's added in .5, and attributes got removed in .4
Don't attributes have it per-attribute in that version ?
there's like a new component that hides the lore bits from specific components
yep
but it's not per-attribute as I was thinking
i've resolved myself to not think about it until .5
I'd hope the API just sets this flag with the ItemFlags
Removed the show_in_tooltip field, replaced by tooltip_display component
yeah that got removed in .5 again
🤡
tooltip_display component
This component allows the tooltips provided specifically by any given item component to be surpressed.
This replaces the previous show_in_tooltip fields, hide_additional_tooltip and hide_tooltip components.
Format: object with fields:
hide_tooltip - boolean (default: false).
If true, the item will have no tooltip when hovered.
hidden_components - list of item component ids (default: []).
The tooltips provided by any component in this list will be hidden.
If that component provides no tooltip, it will have no effect.
this seems like the better solution to me however
hopefully they don't keep changing it back and forth any more after .5
Ah, ofc
I don't think you can hide the default ones
So just copy the default ones (There's a method to get them in Material) and then you can hide them I guess
You're using Paper
That's a behaviour difference
On Spigot just setting the flag will work
Yeah you already found the fix
You need to add an attribute
ask on the paper discord
kek
there is a way to get on all the player the one with the most mined block?
among online or all players?
all players
iirc paper lets you access offlineplayer statistics
but i don't think there is a "break any block" statistic; there's an individual one for each block type
declaration: package: org.bukkit, interface: OfflinePlayer
neat it's on spigot
declaration: package: org.bukkit, enum: Statistic
ye but how can i check all the players and like every 5 min get the one with the most mined block and do something
i don't think you can use that without an associated Material, though
now all you have to do is query your offlineplayer cache/directory and gather the stats for each player you have
like i'm pretty sure the game just doesn't store the aggregate
once you have all the stats, recommended to put it in a DB
and then from then on, you would track the stats when they are online
how can i do a task every 5 min? i never done that
declaration: package: org.bukkit.event.player, class: PlayerStatisticIncrementEvent
don't need a task to check once you have all the stats in a DB
just need this event
i suppose you could loop over all materials but that's going to take a while
So I'm essentially doing
var inv = player.getInventory().getContents();
.. logout sequence
.. login sequence
player.getInventory().setContents(inv);
and it doesn't restore the inventory. Does this make sense?
itemstacks are liable to be mutable
Ah that's what it is, I just went further in the debugger
ugh I hate mutable software, a clone on each ItemStack will suffice, yeah?
''preciate it, will test
bruh, do I need to include anything else?
why the proguard plugin not found?
might need to add a different repo
ProGuard is a command-line tool that reduces app size by shrinking bytecode
Repositories: Central, Kyligence Public
should be on maven central
do you have maven central declared in your repo list?
you have very conveniently omitted the list of places it searched from in your screenshot
it's empty
xd
declare maven in youre repositories list
this exact link, right?
didn't quite
work
Seriously confused how the game wants it both ways.
[17:30:02 INFO]: SchoolTests lost connection: Disconnected
[17:30:02 INFO]: [PTCombat] [STDOUT] DIAMOND_SWORD x1
boolean keepInventory = plugin.config().keepInventory.get();
ItemStack[] playerInventory = player.getInventory().getContents();
for (ItemStack item : playerInventory) {
if (item == null) continue;
if (item.getAmount() == 0) continue;
System.out.println(item.getType() + " x" + item.getAmount()); # DIAMOND_SWORD x1
}
for (int i = 0; i < playerInventory.length; i++) {
if (playerInventory[i] == null) continue;
if (playerInventory[i].getAmount() == 0) continue;
playerInventory[i] = playerInventory[i].clone();
}
Log log = new Log(
System.currentTimeMillis(),
player.getLocation(),
playerInventory,
!keepInventory,
combatService.remainingCombatDuration(player),
npc
);
if (!keepInventory)
player.getInventory().setContents(new ItemStack[0]);
players.put(playerId, log); # BREAKPOINT
is it supposed to be declared a plugin?
considering how its a bytecode obfuscator, almost surely yes
but it looks like that plugin might not be the same i linked
is there supposed to be a change to settings.gradle?
try changing it to com.guardsquare.proguard-gradle
also, why does my intellij hallucinate 3 tasks on each reload
the most upper one exists
the other 2 don't
Yeah idk
https://www.guardsquare.com/manual/setup/gradle this has it as a dependency
i can't find a com.guardsquare.proguard under the guardsquare group, only proguard-gradle
maybe the artifact name was changed since someone last looked at the build script?
Hey, seems like #clone() isn't actually preventing it from being lost? https://pastes.dev/fdNSLQFu13
Very annoyed. Debugger just can't track that information I guess because it is being cloned properly in memory.
player.getInventory().setContents(log.inventory); I believe that Inventory#setContents is the culprit. Not sure why.
Have you tried delaying the setContents by a tick
I'm doing that now but by 30 😂
yep that worked. that's ridiculous?
it's definitely operating sync and the inventory should be loaded by the time PlayerLoginEvent is fired, no?
What is the best way to save #Blocks in a list and then reset them to the natural state? I want to make a minigame where they can build and I want to reset it
I mean the most optimized, practical and lag-free way.
You could take an alternate approach and start the world fresh on startup. Just in your server's startup script, copy/paste world files from a clean directory
Unless you want to do this all in the same instance. In which case just a List of some object that holds a type holding the block's x/y/z position and BlockData
Or BlockState if you need to maintain the state of block entities like chests or whatnot
I would like it to be this way because it is made for a survival world too, I mean I can't handle the world, what do i do after saving them?
I mean, when the minigame ends, what would be the best way to restart it?
public void resetArenaAsync() {
List<Map.Entry<Location, BlockData>> entries = new ArrayList<>(arenaBackup.entrySet());
new BukkitRunnable() {
int index = 0;
final int batchSize = 20;
@Override
public void run() {
for (int i = 0; i < batchSize && index < entries.size(); i++, index++) {
Map.Entry<Location, BlockData> entry = entries.get(index);
entry.getKey().getBlock().setBlockData(entry.getValue(), false);
}
if (index >= entries.size()) {
arenaBackup.clear();
cancel();
}
}
}.runTaskTimer(plugin, 0, 1);
}
Something like this?
Run through the list of blocks and restore. I'm not sure I understand what your road block is 🤔
private record FormerBlockState(int x, int y, int z, BlockData blockData) {
private FormerBlockState(Block block) {
this(block.getX(), block.getY(), block.getZ(), block.getBlockData());
}
public void restore(World world) {
world.setBlockData(x, y, z, blockData);
}
}
private final List<FormerBlockState> states = new ArrayList<>(256); // Give it an initial size to avoid resizing
@EventHandler
private void onBlockBreak(BlockBreakEvent event) {
this.states.add(new FormerBlockState(event.getBlock());
}
public void restore(World world) {
Iterator<FormerBlockState> iterator = states.iterator();
while (iterator.hasNext()) {
iterator.next().restore(world);
iterator.remove();
}
}
Something like that maybe. Though it should be noted that there's more than just block placements that mutate the world
PlayerLoginEvent or PlayerJoinEvent?
You'd have to handle things like explosions, block placements, maybe fluid handling as well
I disabled explosions and block placements to save myself work kekw
Then what I sent would probably work. How you choose to call the restore() method is up to you if you want to do it in a task or whatever
We should make BlockFromToEvent fire for every block change
Can pass false to the physics parameter too, which I didn't do
A true BlockFromToEvent
I wanted to make sure I didn't crash the server at the event
I think you'll be okay. You're not doing anything too crazy. Depending on how many blocks are in your list, you might want to spread out your block placements over time, but you need to be in like the tens of thousands of blocks territory before that even becomes beneficial
something like 1k-2k blocks maybe
That's probably fine
For comparison's sake (and maybe not an amazing comparison because this is Hypixel hardware lol), we set between 10,000 - 20,000 blocks every 5 seconds or so in the Disasters mode for a flood without a crazy amount of batching
In fact the batching was worse performing on the server
"we set between 10,000 - 20,000 blocks" you work there?
Yes
That’s impressive for a bunch of intel atom processors running in Simon’s basement
so i do it without batching?
Yeah. You should only need batching if you try it and realize "Oh shit I need batching" lmao
At which point you can throw it into a task and do like 500 blocks every 5 ticks or so
Make it dynamic by measuring the time you have left in a tick
Oh wait there isn’t really a way to calculate that :(
paper got an event for that iirc but spigot sadly not
I feel like the overhead for that wouldn't be worth it anyway
In my experience it's around 20-25k blocks per remaining time per tick usually (if there are not any other heavy tasks running)
not just an event but also a getter for a rolling average of mspt for the past 1,5,10 minutes or something along those lines
for bigger operations, say replacing entire chunks, that overhead can save seconds
(ofc that isnt really a normal thing to do but at that scale it sure makes a difference)
i tend to batch my block setting operations per chunk anyway for getChunkAtAsync
i mean the main goal is to not trigger sync loads and to keep the logic simple (not having to load and wait for an entire set of chunks to be loaded before proceeding) but it also doubles as work distribution since the work usually is spread over several chunks
single workloads in a deque for example to replace a single block, each being really minimal and taking no time alone. Then, when the tick operations finished as many of these queued workloads are done before the next tick begins
thats true, actually a really good idea too
Hi, what's the best way to compare versions to check if the server runs on newer/older than 1.x.x ?
TLDR use Bukkit.getServer().getBukkitVersion() if you want to detect old versions
I want a syntax like serverVersion.newerThan(1, 20) or smth like serverVersion.newerThan(1, 20, 2)
is there a lib that do that pretty well ?
hm? do you need a lib? it's like 20 lines of code
this isn't js we don't just have nice things as libraries
Anyone knows how I can change a players skin in my code?
Well I do it then, thanks anyway 😄
I mean technically there are libraries for that
should i do that async right?
You can’t change blocks async
I'm surprised that a server can modify so many blocks in sync
You'd be surprised how well the server operates in the grand scheme of things
good damn
Once you sit for a minute and realize what all the server has to process 👀 It's crazy it can still do it in like < 5ms/tick
well it's only like a few levels of indirection and a few addition/division/multiplication instructions and a write to some long array somewhere
If the game was made in another language would it be more faster?
Entity AI, block entities, world generation, etc.
it gets more expensive with every additional level of complexity mojang adds in the stack but it's still relatively simple
it's less about the language and more about the code
To a degree though, lower level languages are objectively faster because it has less to process
But yes, you can still write some well optimized Java code :p
well... the jit is pretty magical
Cough hypixel
i did benchmark C style palettedcontainers where the magic multiply division operations were compiled with individual coefficients for each palette size
it was pretty much 1:1 to warmed up and fully jit'd java palettedcontainer
What do you do for work, vcs?
i'm a farmer
I tell you what, I'd believe that
Yeah java is surprisingly big amongst HFT firms
After all, it runs on like 6 billion devices!
What do you farm
mostly wheat
surely not on their actual trading software?
other years rye and such
Damn
i take care of people dogs
last year i had beets
What colour you drive
i have a few valmets and fords
Dayummm
only other color I have is a john deere combine
Any animals or just crop
Farmer/programmer is an interesting mix lol
As a note, you talking on #help-development . I telling you this as this is should be taken to #general .
It really doesn't matter
look at mr mini mod here
welcome to spigot discord
just crops, animals haven't been profitable since we joined the eu
Kek
used to have pigs
Just making sure you know
I asked only because any time I see you answer a question, you seem knowledgeable and explain yourself well. Rare from an unverified user (that I was going to say joined recently, but you've been here since very early lmao)
I been here for a minute like when 1.19.3 was a thing. But I don't think there is support for that version
i've been lurking for a while
Not sure how accurate this is, but i do know a lot of embedded devices do lol



I using 1.21 but that version is when I started making my own plugins
But if someone for ever reason is stuck on 1.19.3, ViaVersion will help you
To an extent
people really underestimate how fast java can be
Well it doesnt help when the vast majority of their java experience is MC and plugins that have pretty terrible code lmao
yeahh lol
i think it's probably more like people underestimate how fast computers are these days
People should be happy they are not working with java 1 or 1.1. with memory leaks galore on top of it sucking up all the resources
I used to be one of these people because when I use I forgot what IRC Bot I used years ago but it was slow. Then when I converted that to NodeJS, performance really showed. So its easy to underestimate
nah people underestimate how fast java can be, they really think you have to use C to get all the juice out of a computer when that's just not true lol
like, it ain't python 💀
hotspot ❤️
oh yes, even just since java 8 which is prehistoric for current plugin developers, performance has improved considerably
Other than JVM overhead, I'm still a firm believer that java is the best all-rounder language out there
Ironically many stuff is converted to native calls under the hood in the jvm where possible as well.
to a remarkable extent, too, e.g. since j9, for loops accessing arrays doing simple arithmetic operations are automagically replaced with simd instructions where applicable
well, on some hardware, unless you do something the jit doesn't expect (like unroll it manually); it's still quite fragile
Yeah i dont miss the early java days or some of the older versions where some stuff was just in code
and it's difficult to make well-informed a assumptions about what is actually going to happen at runtime
still remarkable for what it is
I wonder if its possible to run the server on NodeJS. I know I can use exec("java.exe") but I talking about the server fully written on NodeJS
what sort of server
spigot serveR?
Any server. Spigot or Paper
well it wouldn't really be spigot or paper if it was written in another lang
but its definitely possible, just a massive project
Or these other servers owned by Paper such as waterfall
Believe there was an implementation some time ago of mc in node. But i dont really see the novelty of node.
or if you mean api abstractions in another lang, thats been done
there's probably an impl for every language there is
Probably
There's flying-squid but its quite dead although there's a more active typescript rewrite
writing a minecraft server in x is to languages kind of like "does it run doom" is to hardware
We have c, c#, c++, php, python, haskell from when someone ran it on a mainframe
Yeah i did like the c++ one even though it was short lived
Maybe i will do another one at some point.
If it was written in NodeJS, we won't have to compile our plugins
Compiling isnt really a big deal
I don't mind it, I just saying
Scripting languages can be compiled just fyi.
Should I create a task for every 500 blocks or a single task that handles all the blocks little by little, in 500
we won't have to list up on server lists either because the server will crash and burn at 5 players when it's running in any sort of interpreter
Python is an example of an interpreted language that can be compiled even if not required
Not that hard to make a quick plugin loader that loads .java files if that's what you really want
You could technically do runtime compiling too
You can call the compiler on the file and then load that in to memory
Yep
Not that much code either
Like I said, I don't mind it. But it be useful
usefulness would mostly be limited to dev
but we have hotswapping and other ide magic for that
im using it like this:
java doesn't really lend itself well to being a scripting language i don't think
was that iterator on an arraylist
because if it was each of those remove()'s is going to shift the entire underlying array left by 1
yo vcs2 how big is your farmland
yes?
val regen: MutableList<FormerBlockState> = mutableListOf()
also do u play farming simulator
no i do enough sitting in a tractor irl to not have to sit in a virtual tractor
i also don't play euro truck simulator
i gotta get enough money asap and buy farmlands b4 all lands get occupied
don't bother, it's probably the least rewarding profession ever
What you dont want to simulate the work you already do? Lmao
nahh im going to college this yr
you run the numbers and you might as well invest in stocks for similar returns and less risk and no work
it could be a good investment no?
only makes sense if you inherit the equipment and a bunch of land
wym
Only if you can afford to have other people do the work
yeah makes sense
they say land never loses value but if farming is run-down by regulation or other economic concerns, land becomes next to worthless as well
removing from an arraylist shifts every subsequent element left to fill the "hole" left behind by the removal
can it not be used for housing? or is irrigation damage too much
How did I do it is wrong then?
it can, but housing only pops up near existing population centers
It probably should be noted arrays dont get smaller either unless recreated in memory
val regen: MutableList<FormerBlockState> = mutableListOf()
@EventHandler
fun onBlockPlace(event: BlockPlaceEvent) {
val player = event.player
if(challenger.equals(player) || opponent.equals(player)) {
if(status != ArenaStatus.WAITING) return
if(!flags.contains(ArenaFlags.NO_BUILD)) return
val block = event.block
regen.add(FormerBlockState(block.x, block.y, block.z, block.blockData.clone()))
}
}
fun restore(world: World) {
object : BukkitRunnable() {
var iterator: MutableIterator<FormerBlockState?> = regen.iterator()
val batchSize: Int = 500
override fun run() {
val startTime = System.nanoTime()
var i = 0
while (i < batchSize && iterator.hasNext()) {
iterator.next()!!.restore(world)
iterator.remove()
if (System.nanoTime() - startTime > 50000000) {
break
}
i++
}
if (!iterator.hasNext()) {
cancel()
}
}
}.runTaskTimer(UltimateDuels.get, 0, 5)
}
Be careful letting people do the work for you. Because they can throw code in there and send a take down request, that is one of the reasons my code is not going to github
thats all of it
and the land prices for such areas are sky high precisely because of the opportunity to wait 20-30 years and be able to sell it for construction
Yeah land overtakes gold sometimes if you wait long enough
and if you get it in the right place
This is mostly untrue
And if soneone needs help, you might cannot help them as you did not write the code
for farming, though, you'd be looking for land in the middle of nowhere
It happened to spigot, that is why we have buildtools
i mean it will still work as it would but it's grotesquely inefficient
you'll have turned your O(n) list iteration into O(n^2)
bro spigot distributed mojang code 💀
im sure no one here is doing that
It happened to bukkit and the reason it went through was because mojang took no action on it and every bukkit dev that could respond to it were leaving bukkit
So dont spread misinformation on stuff you are not familiar with
I was a bukkit dev staff member around the time all this went down so i am quite aware of the facts
oh i should use LinkedList then
you could use that well but i'm not sure why you're removing from the iterator in the first place
Just write your own code then?
yea just modified
fun restore(world: World) {
object : BukkitRunnable() {
val batchSize = 500
override fun run() {
val startTime = System.nanoTime()
var i = 0
while (i < batchSize && regen.isNotEmpty()) {
regen.pollFirst()?.restore(world)
if (System.nanoTime() - startTime > 50_000_000) break
i++
}
if (regen.isEmpty()) cancel()
}
}.runTaskTimer(UltimateDuels.get, 0, 5)
}
I don't know. I just know that buildtools was there because the DMCA request. I worry alot so I would like to not get attacked
I been writing my code
Then dont speak on subjects you are not familiar with
You getting dmca is very very very slim
That is how misinformation gets spread around
Since github did not receive a anything to challenge the dmca github had no choice but to move forward with the request
Almost everyone here has a github and uses it a lot, and getting a dmca is very low chance
i have a different github account for every project i'm involved in
Your also allowed to challenge the dmca too in which case github does nothing unless some court order comes in. But if you dont challenge it, github is forced to follow the rules and assume the request is valid
This is what happened with bukkit on github no one challenged it officially
that sounds like a headache
Well, we don't exact to know everything. I also not showing the code because people here. I would sometimes surprised when someone helps me. Like I had this hopper filter system issue and still a issue today. I just managed to stabilize it until I get help with it
This has no bearing on what i said except support what i said. Dont tell people something if you are not familiar with the facts or the topic
@slim wigeon what is the password for u website
it is asking username and password 💀
also what is your credit card number
No, not open
I locked it because I still working on it, leave it alone
alrrr i will leave it alone
If you want to look at it when its open, I can tell you. Otherwise, I don't need anyone there
is there any event for or way to tell when an autocrafter is used to craft an item?
declaration: package: org.bukkit.event.block, class: CrafterCraftEvent
thank you
hello am going crazy again. I have a gitlab project and I've verified I have an uploaded package because
C:\Users\Dominick>curl -H "Private-Token: REMOVED" https://gitlab.com/api/v4/projects/REMOVED/packages/maven/groupid/artifactid/maven-metadata.xml
return proper metadata, but maven is refusing to find it on install...
my pom.xml, abridged: https://pastes.dev/hIcAtahWOt
my settings.xml, redacted: https://pastes.dev/lgNcxa90Ti
Oh, and this warning:
[WARNING] Failed to download REMOVED-2.0.2.jar [https://gitlab.com/api/v4/projects/REMOVED/packages/maven/]
I've never seen http headers used with maven, presume you took it from somewhere?
Make sure maven is up to date
GitLab does. Though that configuration looks fine to me
I remember there being a setting somewhere in GitLab that like... disables the ability to pull artifacts from a specific repository or something. It's per-project and I think defaults to excluding a project from Maven artifacting. I don't remember what it is
Stupidest fucking setting ever, but I remember that being a pain point when I worked with Visionary
Wait, maven downloads from the internet?
I mean yea repositories
Does it cache these?
maven caches to your local repo
well yeah thats kinda like the whole point
I not against it, does it cache its files or does it redownload them?
it caches them
in your local repo
like elgar said
unless you run with the -U flag
which tells maven to redownload them regardless
Just checking. I got unlimited data on my hotspot so I don't care either way but when I connect to my mom's internet service, that is where it needs to use the cache files first or my mom would get a call due to high usage. Just saying
Data caps are annoying
would be pretty silly if it redownloaded them everytime
who needs caching anyway
^
if you aren’t exactly writing your own api‘s then you will almost never have to use the -U flag
i mean just version stuff
or if the author of the api you are using doesn’t understand the concept of versioning
true but if im working on small bug fixxes i wont change the version every time i compile xd
just use modules and depend on other modules
Don't mind me, I just thinking if the ISP sees I go over 4 TB (Monthly cap). These files are super small. I can use double or triple on my hotspot
depends on what you’re making lol
you see i don't really care
youd have to compile ur stuff about 266.666 times to reach that
with -U flag
assuming you got about 15mb of depedencies
which is decent
You right. That is why I ended it. If I really worried about it, I might just try to find jars. Wish I can use that method still but long as I get to program my plugins, I don't care
find jars? of the depedencies? thats literally what maven does lol. It saves the jars to your local maven repo
and unless you force update them it will keep using them
well
or you change the version
im which case it will try to download the new version obviously
you downloading the jar has roughly the same impact as maven downloading the jar
it literally tells you how to set it up in the readme....
and no, this will not be of any use since plugins get applied before the buildscript is evaluated
you need it in your buildscript repos
I am blind
Can it then be declared as a plugin?
no
how come these recipes don't work? i tried a test recipe with some different materials in the same place and it worked fine, but these just don't function
the log statements are also working fine
also no errors
WHy hasnt this updated? Ive put 3 updates since my original release
Like whys it still say version 2024? Ive made 3 resource updates since, 1 was today
I don't really know how spigot update system works but something tells me that this is the original release date. If I wrong, please tell me
did you update the version when you posted the update? show your updates tab
What event and how I can freeze this after smelting until the new item enters for smelting?
I think they mean versions tab
but that version 2024 etc is a version you assign
yep
when you post an update there is a pulldown/edit box you can update teh version
I guess you are just doing the title and not the version
If you don;t change the version string it defaults to your current
Holy shit, congrats on the success my guy. What plugin is this?
small numbers. Used to be millions 😉
Waiting for a answer...
Please describe yourself better
"freeze this"
You mean the lit_time_remaining ?
Yes, that
For starters, you can listen to https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/FurnaceSmeltEvent.html
Check if there is any item in the input slot, if not then... do something to freeze it
No idea what as of yet
No, I want to freeze it when its not smelting anything
Yes, if the input slot is empty
That's what I said
I just got this public void onFurnaceSmelt(FurnaceSmeltEvent event) { ItemStack item = event.getResult(); item.setAmount( item.getAmount()*2 ); }
Don't mind the doubling, its unrelated
My only idea is to have a ticking task with a list of Locations of furnaces
give the furnaces a PDC with the value of lit time remaining they should hold
And then just keep on setting it back to that ?
Or something like this.
I doubt there is a way to freeze it properly.
bump
If there is not a easier way, its ok. I will see how Songoda does it, I was thinking you should know
That is not something I should nor care about knowing
But I am curious :D What plugin of theirs are you copying ?
Is that a question directed towards me? If it is, I not trying to copy anything. If anything, I asked for a paid plugin jar I don't remember when, that plugin is JetsHoppers, it has features of EpicHoppers but without BlockBreak. So I would not recommend trying to say I copying stuff
As a note, I can use any Songoda plugins but before, there was bugs and I was annoyed so I started working on the plugins
What are you trying to do?
I want to freeze the time remaining when its not smelting anything