#help-development
1 messages Β· Page 1031 of 1
daily life of being a programmer
uh
I tried BukkitScheduler.runTask(plugin, p.openInventory(gui)); and it didnt work
idk what to do
im too dumb to figure stuff out
is there a tutorial on this somewhere?
nvm found answer
Hey, is there any way to check whether a command is formatted correctly and will run without actually dispatching it? (also sorry if i dont get back to this quick, I am just about to leave my house)
A plugin command? Or a vanilla one?
it's like I'm eating crazy pills, I keep getting recommended videos by youtube saying that either AI is a fad that will never have any use or that it doesn't have a use yet meanwhile I've had it doing support (and even content creation) for my plugins with an accuracy that is honestly better than the random people from my community that chime in to try to do support
plus it's not exactly great for programming but it's really good at finding general approaches that you might not have been aware of to solving a problem that you otherwise just didn't know about, though it's not yet so good that it can come up with sane implementations for those solutions for most non-trivial cases
Being better than random people on the internet isnβt exactly a high bar
sure but random people on the internet amounts to most advice you can get on doing most things on the internet
its like google but easier to narrow it down to what you are looking for
until you get to the details then it falls apart
the one thing they're currently really bad at is realizing that some unknown knowledge they have can't be inferred, and I'm not 100% sure this will have a direct fix tbh
google somewhat tried fixing this by adding a second pass for fact checking but the results are questionable at best
its just a very smart person on drugs essentially
I'd say it's more like someone who memorized an entire wikipedia article about something but they did that 3 years ago and never though about it again, so they might just be making shit up
oh yeah thats a better one
"Oh yeah I definitely remember playing warcraft 2 when I was a kid, you want to know what happens in the game? Yeah so..."
and is also pressured by their boss to always give an answer and to never say 'no'
You wouldn't say no right? π π«
Certainly! 'Counter Strike Ultra 5 Deluxe' is a video game released by Valve in 2024...
Whatever you say boss
when did the US get conquered by atlantis?
Who is the current cabinet administrator of the department of defense of Georgia, the US state?
Me
i dont think theres a public facing elected official over the GA dept of defense
Hello How are? If I have a question about the JetMinions plugin, could you help me?
Probably best to ask in their discord
Thanks!
sorry,Which is it?
Hey so I am looking to see if their is any alternatives too
https://www.spigotmc.org/resources/api-glowapi.19422/ & https://www.spigotmc.org/resources/api-packetlistenerapi.2930/
As I have came back after some time of being out the developing community world for minecraft
and im coming back and trying to use one of my old plugins in the new update but these two API are no
longer supported.
So was wondering if anyone had an alterative I could use ?
Vanilla command
How would you make a chunk generator that raises the world by 30 blocks?
I have a generator that randomly gens chunks at different heights, but can not figure out how to get the the same height
?paste
https://paste.md-5.net/afawicejin.java
I am trying to save the player-data.yml file but it won't save at all. It gets wiped on a server reseter / plugin reload (using plugman)
So you dont want it to randomly be at different heights?
I am not sure how you are doing the chunk generation. But ideally you would use block populator and from there you should be able to check the height at which the blocks are going to be placed.
here is my structure
Can probably use this as reference to see if there is anything you are doing differently
This class i have is designed to be loaded and reference maintained to it. In regards to yours not entirely sure from a glance what it is you are doing wrong but your load method or your method to return the yamlconfig can be done better by checking that the value isnt null and if it is set it
It was on line 70
ew
I know my config thing is terrible but its also like years since i touched that code base lmao
I have taken a look and I personally don't see anything different but I could be wrong
I am just not sure why it won't save
Would it change if I made it a json and not yml
Actually i do see a difference in what you are doing vs what i do
Try using a similar if condition like mine that is outside of the try
Also, setup line 70 to load the config as well as a return
Or at least have it check its not null. My config class is ultimately setup as a singleton that loads if there isnt a reference to said class before
Here is what I've done. I've taken your loadplayerdata and put it in my plugin gonna see if it works but highly doubt it will change
If anything probably have to wait till i get home and am on pc or someone else here spots the issue lol. Currently at work using phone 
All good. It would be helpful to get it working XD
I have been looking at documentation and such but no luck...
I'm having ChatGPT write commands, need to verify if they'd work
Test them...
I am not sure if I am doing something wrong but it won't input any data into the file.
I need to guarentee that a set of multiple commands are all valid before I run any of them
No, I'm dispatching the commands using a plugin. I'm not the one typing it
It worked. File is saved no matter what!
Does anyone here know how to implement 1.20.5+ food properties on items?
I've been looking through the documentation and can only find 'FoodComponent'. Which I can't seem to find a way to use it directly without overriding the class initializer.
Here is an example item using the new 'food' component:
/give @p black_dye[custom_name='{"text":"Banana"}',custom_model_data=10,food={nutrition:5,saturation:5,is_meat:false,can_always_eat:false,eat_seconds:1.5,effects:[{effect:{id:"minecraft:jump_boost",amplifier:3,duration:60,show_particles:0b,show_icon:0b},probability:0.3}]}] 1
I want to apply the same properties to an ItemStack. This includes all the basic food properties (nutrition, saturation, etc) and the effects when eaten.
I appreciate anyone's help!
Was it changing around that if condition what made it work?
Nice. Glad that was what fixed it for you and glad i was able to spot the problem. 
Hey guys, I'm creating a cooking plugin
and I really dunno how to manage if the key is multiple.
I have to share the CookingRoomInventory instance with those keys UUID,CookingPotType,Integer
is there any better way to do this?
Below is example code.
private static CookingRoomInventoryManager instance;
private final Map<UUID, Map<CookingPotType, Map<Integer, CookingRoomInventory>>> optimizedInventoryMap = new ConcurrentHashMap<>();
public static CookingRoomInventoryManager getInstance() {
if (instance == null) {
instance = new CookingRoomInventoryManager();
}
return instance;
}
private CookingRoomInventoryManager() {
}
public CookingRoomInventory getInventory(UUID uuid, CookingPotType potType, int identifier) {
return Optional.ofNullable(optimizedInventoryMap.get(uuid))
.map(potMap -> potMap.get(potType))
.map(idMap -> idMap.get(identifier))
.orElse(null);
}
public boolean isExist(UUID uuid, CookingPotType potType, int identifier) {
return Optional.ofNullable(optimizedInventoryMap.get(uuid))
.map(potMap -> potMap.get(potType))
.map(idMap -> idMap.containsKey(identifier))
.orElse(false);
}
public void open(Player player, CookingPotType potType, int identifier) {
UUID uuid = player.getUniqueId();
optimizedInventoryMap.computeIfAbsent(uuid, k -> new ConcurrentHashMap<>())
.computeIfAbsent(potType, k -> new ConcurrentHashMap<>())
.computeIfAbsent(identifier, k -> new CookingRoomInventory(potType, identifier))
.open(player);
}
DONT MENTION BOUT MAP OF MAP OF MAP
haha, I was about to mention it
lol is there any better way?
make a custom object to be the key instead
Map<Integer, CookingRoomInventory>
Are you loading a set of inventories for each player?
Yep, you can make a pojo
wdym pojo?
but that key object instance doens't share though
not sure what you mean it doesn't share
Plain old java object example:
public class EmployeePojo {
public String firstName;
public String lastName;
private LocalDate startDate;
public EmployeePojo(String firstName, String lastName, LocalDate startDate) {
this.firstName = firstName;
this.lastName = lastName;
this.startDate = startDate;
}
public String name() {
return this.firstName + " " + this.lastName;
}
public LocalDate getStart() {
return this.startDate;
}
}
then how can I use it on key of map?
like when I tried to put, remove, get
I would use it for the values
List instead
private static final Map<String, String> map = new HashMap<>();
public static void main(String[] args) {
map.put(getKey("he", "llo"), "hi there");
System.out.println(map.get(getKey("he", "llo")));
}
public static String getKey(String name, String latestName) {
return name + ":" + latestName;
}
like this? this just for example
extra useless checks
let me read again, just entered π
the key would be the object, not the contents of the object
I guess you could set it up so it could be that way too
right? thank you
ideally though you should try to make it so its a single key, you could I guess go with a generic map that doesn't take in a specific type for a key in which case you could assign the same value object for those keys
but would probably get messy from there lmao
so what is the best way?
probably look at the issue differently. Most times its an organization problem
then how to solve that problem in organization?
well, that isn't something we can really solve for you. It is something you are going to have to learn to do. Maybe it might help if you used some brainstorming techniques so you can better understand the data you are wanting to reference. At the moment I am not entirely sure why you need multiple keys in the same map that are not the same type pointing to the same values
in most cases that is a bit redundant, so its best to find where then are these types share similar data and then make the references from there
'cause the object needs 3 keys so if the 3 conditions correct, the value's gonna return to share that object's instance
that still doesn't make sense. So each key has 3 conditions that need to be met first?
why it still doesn't make sense? isn't it what it is ?
is there any way to fit 3 conditions without multiple map?
ok, then what you need is two maps for this. The first map needs to be UUID and your custom object. Custom object holds the data for the conditions and the method necessary to get the value if said condition is met.
probably don't even need two maps for this
could probably just need a custom object for the value
'cause as you know the map doesn't allow the same key. and innner UUID map is required Map<CookingPotType, Map<Integer, CookingRoomInventory>> this map, and if the CookingPotType is in the key, then search in Map<Integer, CookingRoomInventory> this map, and finally CookingRoomInventory can get with the integer(That is roomNumber)
why can't all three of those things exist in a custom object?
why does each one need to have a map
hmm so if those things gonna in one object , then how can I check the key?
if those keys are in one object It's gonna looks like this right?
private final Map<KeyObject, CookingRoomInventory> map = new HashMap<>();
kind of but not necessarily
you mean that KeyObject is unnecessary?
I think you just might not be understanding how you can structure your classes differently so that when you create a custom object, that object contains all the elements you need it to have, and then all you need is just a list or map to store this object in
for instance, inheritance may solve some of this problem
and maybe some interfaces
should I make new class for the key?
import lombok.AllArgsConstructor;
import java.util.Objects;
import java.util.UUID;
@AllArgsConstructor
public class KeyObject {
private final UUID uuid;
private final CookingPotType potType;
private final int identifier;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
KeyObject key = (KeyObject) o;
return identifier == key.identifier &&
uuid.equals(key.uuid) &&
potType == key.potType;
}
@Override
public int hashCode() {
return Objects.hash(uuid, potType, identifier);
}
}
How do you think this code?
I think, you really need to learn how to brain storm and organize your idea in a way so that you can structure this differently. I also suspect this is also due to a lack of knowledge and understanding of java in regards what exactly is at your disposal instead of limiting yourself to simply maps and lists to solve this problem. From what I have gathered so far this isn't a problem that can easily be solved by someone just giving you a simple spoonfed answer.
Don't get me wrong, I showed you in differents ways to solve this problem, but why you always said the same thing? I don't wanna spoonfed answer neiter.
so the two objects for example you gave above, CookingRoomInventory and CookingPotType. You can easily have interfaces for these and use inheritance with the interfaces and then implement appropriately. Then the object should contain all the data, but inheritance also lets you easily swap or compare between stuff. Like using isntanceof for example.
wdym use inheritance?
something you probably should go research if you don't know what it is
it may prove useful for you
while I am pretty confident that it will, I don't bet on anything unless its a sure bet π
for all I know, they could see it as something that gets in the way or something lmao
If you knew how to solve it, then you're gonna tell me how to solve it.
but you don't know how to solve that neither. So that is why you said the same things
but he did in fact tell you how to solve it.
I don't spoonfeed answers. I do know how to solve it, but I am not going to sit here and tell you verbatim how to structure everything when you as a developer that is your job to learn how to do and not for us to tell you how to do.
I will point you in the right direction
which I have done
it is up to you whether or not you want to follow that path and do some research and learning
but as you said earlier if you know different ways to solve it, not sure why you are even here then as it sounds like it is a non-issue π
who's hell gonna say that I don't know
You don't have any spoonfed answers. Just YOU DONT KNOW HOW TO SOLVE THIS PROBLEM RIGHT? π
AND ALL I WANTED JUST THE BETTER WAY π
WHEN?
and aperantly refuse to do research about it π
and you are right I don't have spoonfed answers because I don't spoonfeed people answers here or rarely do anyways
I've been asking that I research about it
if I don't know how to solve a problem, generally I don't say anything or I actually specify if I am not entirely certain. Please stop assuming you know me here π
I don't give a shit about you lol I think you don't know how to solve a problem then why you said like you know that?
your comment here indicates you don't know what inheritance is, therefore you should go research that
even if I wanted to spoonfeed an answer I wouldn't be able to anyways simply because the concept I would tell you is something you don't understand
I KNOW What inheritance do not talk like that
all you said just research, It's up to you So you seems like dunno how to solve this problem
Isn't it what you mean?
public interface InventoryItem {
void open(Player player);
void updateInventory(UUID owner, boolean isComplete);
UUID getOwner();
CookingPotType getPotType();
int getIdentifier();
}
then why were you confused when I mentioned using it to better organize your objects and data? This is one of the fundumental ways of showing relation between objects and the data of said objects without using a bunch of maps and lists
I am not confused about inheritance, I just confused what is the best way. where's your eyes?
well not all problems here are simple answers either
which again seems to be what you keep looking for
YEAH I've been looking for what is the best way ?
I wanna heard your recommandation
the problem you presented is not. Oh hey I have an NPE and don't know why. Your problem is more about organizational and structure of your project to the extent that it may involve utilizing a different concept. The one I proposed was making use of inheritance to combine your data so that when you create the object said object should have everything you are needing. Or at minimum possibly two objects but are now easily related to each other. There is no best way to solve your problem because it is dependent on you. All of us here would go about this problem differently and all the various ways you could do it are all valid and acceptable for the most part. The only time that isn't, is if there is more constraints or you are running into some other kind of problem you have not specified
Are you fk A.I. ? I already have the classes are strcutured but Should I make new sctrutured classes again to solve that problem?
π€
right! there's no one right answer in programming π
I have been told on a few occasions that I may just very well be and other times I have been accused of being AI itself
now that is out of the way, I don't think you understand the whole concept of brainstorming? Your problem again isn't just a simple here do this. If that is what you are looking for, then you are in the wrong place and should just go look on SO or something
what we do here for such questions like yours is try to show and introduce different things you could do by telling you concepts or some other info and then letting you loose to conduct your own research and trials
because that is how you learn
WHy you Think it's not a simple problem?
I've been asking to here to avoid this multiple map
private final Map<UUID, Map<CookingPotType, Map<Integer, InventoryItem>>> inventoryMap = new ConcurrentHashMap<>();
I admire your ability to stay calm frostalf. I wouldve burned this boat by now. π₯ 
Same here xD
right, to avoid this multiple map you would need to leverage inheritance and some abstraction
and therefore your problem is not one that has a simple answer
other then the answer I gave of course
I already have these interface classes
CookingRoom , CookingRoomIdentifier, PotTypeCookingRoom UserCookingRoom
and because you already have those that means that is all you need or it doesn't require revising?
do you make things perfect on the first try?
Seems you are finally getting into what development really is about
I showed you my first try
there is really no best way to do anything
usually you just take an approach thats reasonable for the requirements you think you have
and then change it later as the requirements change
that is not a good enough answer for them, it needs to be more specific almost like spoonfeeding and holding their hand and walking through them that they may very well need to revise the structure of their project lol
CookingRoom Have to be searched by theese things PotTypeCookingRoom , CookingRoomIdentifier, UUID
well I was talking about this yesterday and I still dont even know what the room identifier means or why its better than just keeping a list of cooking rooms
CookingRoomIdentifier is just for CookingRoom's index
yeah
I could see how it could come in handy, but depending on the design it could also be a useless element too
lists have indices too
And why have a UUID and a CookingRoomIdentifier? Seems to me they both serve the same purpose to identify the CookingRoom?
the uuid is the player using it
Ah okay never mind then sorry
you're right
they way they pitched it to me looked like it could be solved with a Map<UUID, List<CookingRoom>>
might not be the most java way
all those things above you listed could easily be combined into a single object if inheritance is used. For example, if there is a cookingroomidentifier, that means cookingroom object shouldn't be able to be created without having this identifier part of it. cookingroom, could implement pottype, with pottype having its own inheritances for the variety of different pots or whatever.
but its good enough for almost any case
probably, but they have asked here how to avoid multiple maps
I mean I guess but as some point you will need either a list of a map to store multiple things
I know that listed have index too, but that CookingRoom have index each other. like, 1,2,3,4,5,6
so it's couldn't be a simple list
of what?
Well sure, I even stated this, however instead of of multiple maps you would just have a single one in theory of course since I don't know exactly what is all required just know what they have specified and so far to avoid the usage of multiple maps based on what info they gave it will require them to restructure or reorganize their project to make use of inheritance and abstraction more then what they are doing right now.
of the system
If you have many objects and often search a room via the players UUID or something like that its a valid way to do that. Otherwise I wouldn't do it that way, you have too keep both values in sync (Inside the OBJ and the Key) wich seems like unnessasary overhead if its only a small amount of cooking rooms ^^
like, CookingRoom?
well yes
and anything surrounding it
like why the index is needed for example
or just like anything else we need to make a decision about what the structure could be
I showed my code yesterday,
public interface CookingRoom extends ConfigurationSerializable {
ItemStack[][] getRecipeItems();
void setRecipeItems(ItemStack[][] items);
ItemStack getResultItem();
void setResultItem(ItemStack item);
}
public interface CookingRoomIdentifier extends ConfigurationSerializable {
int getIdentifier();
void setIdentifier(int identifier);
CookingRoom getCookingRoom();
void setCookingRoom(CookingRoom cookingRoom);
}
public interface CookingRoomIdentifier extends ConfigurationSerializable {
int getIdentifier();
void setIdentifier(int identifier);
CookingRoom getCookingRoom();
void setCookingRoom(CookingRoom cookingRoom);
}
public interface UserCookingRoom extends ConfigurationSerializable {
UUID getOwner();
PotTypeCookingRoom getDefaultTypeCookingRoom();
PotTypeCookingRoom getPremiumTypeCookingRoom();
PotTypeCookingRoom getCookingRoomByType(CookingPotType potType, int identifier);
}
its not about the code
^
its about why you wrote the code in that way
whats the idea behind it
what is the reason why you wrote it like this
I tried stating this earlier maybe I just wasn't clear enough
if we dont know then we cant do anything other than iterate on this code
could I send a image on here?
told them, they may need to learn how to brainstorm their idea using brainstorming techniques. IE, maybe create a spider web thingy
this image tells me nothing
this is just a gui that can be solved in a billion ways
oh it speaks volumes, I am surprised it doesn't just jump out at you π
based on this I just have a list of rooms inside of some manager
is there only 2 pot types?
a cooking room is one of those colored squares?
yeah, and 8 rooom which have specific index inner EACH POT TYPE
so....why not use a 2d array
two dimensinoal array?
there is only 2 pots, each pot has 8 rooms
yeah
so a 2x8 array
and each room has ITEMS
seems to me like you just want to make a pot gui and then add the rooms to that
so you just have a class for a pot and that has a list of rooms
or a map
whatever you want
YEAH
and then each pot type inherits pot
the items in array with rooms, contains itemstacks.... so far not seeing the issue. and so far we are not using multiple maps just have a 2d array right now
see, seems you were just going about this problem in the wrong way
and just needed to look at it differently
And The Room Inventory's instance have to shared to each structured classes
So I created a manager, And I Created a map but <--- here's the problem 'cause I hate the multiple map
public class CookingRoomInventoryManager {
private static CookingRoomInventoryManager instance;
private final Map<UUID, Map<CookingPotType, Map<Integer, InventoryItem>>> inventoryMap = new ConcurrentHashMap<>();
public static CookingRoomInventoryManager getInstance() {
if (instance == null) {
instance = new CookingRoomInventoryManager();
}
return instance;
}
private CookingRoomInventoryManager() {
}
public void openInventory(Player player, CookingPotType potType, int identifier) {
InventoryItem inventory = getOrCreateInventory(player.getUniqueId(), potType, identifier);
inventory.open(player);
}
public InventoryItem getOrCreateInventory(UUID uuid, CookingPotType potType, int identifier) {
return inventoryMap.computeIfAbsent(uuid, k -> new ConcurrentHashMap<>())
.computeIfAbsent(potType, k -> new ConcurrentHashMap<>())
.computeIfAbsent(identifier, k -> new CookingRoomInventory(uuid, potType, identifier));
}
public boolean exist(UUID uuid, CookingPotType potType, int identifier) {
return Optional.ofNullable(inventoryMap.get(uuid))
.map(potMap -> potMap.get(potType))
.map(idMap -> idMap.containsKey(identifier))
.orElse(false);
}
}
you only need one map
YEAh yeah yeah yeah
not sure how you are getting through to them, but this was stated also earlier
who is emote spamming
they are
sorry.
lol
oh it was you this time >>
if you want to say something use your words xD
anyways, I guess I will leave it to you steaf
seems your words are piercing the veil that covers their eyes
im kinda getting sick of this xD
you almost getting it
i keep telling the way I would do it but then its not how you want and then we go back to the ideal solution that just happens to be a few maps
so the few maps must be necessarily right?
like I still havent found a good reason as to why a map of player uuid and cooking room lists is not a good idea
you can use the index in the array as the room index
a list is not gonna shuffle itself by accident
well you know me, I just answer peoples questions disregarding if its a good idea or not etc
unless you accidently use a shuffled list
Why the cookingRoom should be in a list?
because the rooms have numbers
because you have multiple of them
and lists have numbers
yeah
just like this?
a set could work too but you want the indices
private final Map<UUID, Map<CookingPotType, List<CookingRoom>>> inventoryMap
but It has a problem, if the room number is 8, but that list size is 1 so I can't get with the room number in the list
NOTHING HAPPENDED
in general the reason to choose between a map or list is you choose a map if you want to use something other than int for index or you don't care about the (insertion) order or thats very big and you wanna look for something
a list if if you want to keep stuff in order
thats about it
(insertion) order?
lets try to not get too technical and confuse them again
Aren't you trying to retrieve the desired CookingRoom from the Room Index in <Integer, CookingRoom>? That's how I understood it
Are you genius?
lol
I mean he is right though
why would you only have 1 room but want its index to be 8
what else is the room number based on
'cause the Room Number is already defined as 8
do you need that number for anything other than telling the rooms apart
So basically you want to have the functionality of a Map without using a map? I think i have bad news for you...
the way you would retrieve room 8 from a list that has 8 rooms is
int roomNumber = 0;
List<Rooms> roomList = new ArrayList<>();
if(roomNumber != 0) {
--roomNumber
roomList[roomNumber]
)
some sudo code in how it would basically work. Ideally all the rooms would be in the list at all times, unless there is a reason why rooms should be missing.
if its always 8 you just need an array
wouldn't it be necessary when saving?
hmm..
if they want the room numbers to match the indice number, they would need to have indice 0 just be null and they need to remember to avoid using it
or just dont use roomnumbers as they seem to be useless in the first place
I think that's right. I hadn't thought of that
otherwise the sudo code above I provided is how you would match the room numbers to the indice
I think I thought wrong sry
idk, I am just going off whatever is they are wanting lmao
yeah thats been the problem all this time
we dont know what they want
im just guessing until they say its what they want
But it's quite funny to read to be honest xD
just tell them its the best way π
and if we all agree, then we can go back to whatever it was we were doing I guess
this one?
.
its sudo code to just illustrate how you would match rooms to indices
who's them?
why i get this error - org.spigotmc:spigotπ«remapped-mojang:1.12-R0.1-SNAPSHOT was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigotmc-repo has elapsed or updates are forced
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
Actually at work right now but maybe i didn't do much the last half hour bc i was to amused by this conversation xD
Don't let my boss know π
who's them?
many of us here, kind of live here
and some others are regulars
well just so you know, I am apparently AI
I have achieved my compliment for the day it seems
Yeah i read so, amazed how far AI has come xD
for negative AI lol
it was mean for negative "AI"
pretty sure any AI is still smarter then your average person
even if its negative
so I take it as a compliment regardless π
Now a days? for sure
yes you so smart π³
no, the "AI" wasn't mean that you're smart. I can feel in your accent
no you don't have a lovely accent
Learn how to talk
Love it xD
what i should change
you are missing the the jar
you need to generate the remap using buildtools
in that link somewhere it should tell you how to get it
i genarated
ah, then you need to install it into your local maven repo
your IDE should be able to do that with dependencies
is this the remapped jar?
because the remapped jar is appended with remapped in its name
does someone have a link to alex's guide on this?
yeah, need to have your ide install it into your local repo or if you have maven installed use the maven command to do it
but I donβt understand why this is so. I checked the box to generate remapped jar in gui
yes it generated the jar
and should be in the buildtools directory
however, your IDE and maven don't look at buildtools directory when building
so you need to put that jar where they do look for it
I wish I had alex's guide link
Is it legal to share spigot repository data on the Internet?
@tender shard we need your link
I can't answer the legalities you would need to consult with your local legal counsel on that
isnt it open source?
is open source but not ofical for minecraft
the patches are yes and craftbukkit 1.7
i see
it isn't because of mojang
well then your answer seems pretty clear
But it depends on the license, it defines the way you are allowed to use and share that work (tbh, i don't know the license of Spigot is it MIT?) But generaly if you don't add something to the work (Or edit it in any way) you shouldn't reshare it (Why would you anyway?)
i dont want use boild tools this long for me)
i want get correct repos
from iternet
just by downloading
build tools is gonna be the fastest way to build spigot
spigot is gpl, because cb is gpl, however the sharing of the server jar is generally prohibited because one mojang technically would prefer you not distribute mc server code that way albeit they are pretty relaxed, two there is the whole DMCA thingy and why we have buildtools and patches
Its such a funny cyclic fuckery with the spigot DMCA, I love it
gpl is shit
fast then downloading?
XD
Yes
because you don't have a legal way to download mojang source code
not legal to download
personally I don't care about the DMCA and don't acknowledge it, however obviously I can't speak for others in how they should treat it lol.
now i see
and what was the reason paper has downloads?
Well, it is such a weird move to DMCA a repo because not your own code, but other code in the repo was mislicenced and could not be emitted as source code and that breaks GPL and that means your code is mislicenced
paper patches on the fly
paper builds at runtime
do they just not give a damn or is it a loophole
that's why they ignored me when I asked to send me a repository for nms lol
it wasn't because of other code was mislicensed. Rather they used the claim that because it used propritary code and mojang was not willing to open source said code, the project that chose to use said code violated their rights
Yea
anyways im glad we even get to use spigot at all
and so because of that reason I choose to not acknowledge the DMCA
and
I mean, patches solve the whole issue Β―_(γ)_/Β―
π¬
also there is more to it and all, considering I was there for the whole thing >>
this is a smoking free zone
the old owner allowed his game to be stolen, so they didn't stop and created a bukkit api
heh
smoking free enterance zone
I guess that is my one claim for glory as being a prior Bukkit Dev staff member
that I was there for the show
I just wished I had recorded it or whatever lmao
is there a site i can upload text and change it whenever i want without its url getting changed? i need it for my plugin's update checker
or use git
its probably just about reading most recent version of the text and comparing it to the plugin
I like https://pastes.dev/ but I rarely get to use it
like if their plugin updated?
yeah
because you know there is an API for that
yeah
you can even fetch other plugins with it too
long live the dependency warzone
can i update the pasted text?
i literally did
you said upload text
oh didn't see the change part
dw
well you will probably need to look at some hosting thing
but
how about clarifying why you even need this though?
like git π
update checker?
to check what?
im not posting plugin on spigot thats why im not using spigots api
But is your plugin uploaded to spigots ressources?
if new version of plugin released or not?
could you not look at the site where its posted to fetch the updated version?
Or do you use a automated build server or something like that?
yeah probably the best bet. Buildtools uses git for this purpose ironically
its where the rest of you plugin is anyways (presumably)
well in buildtools case its just where the data is at
yeah sure
that it needs
same thing
i already did
it requires ultimate plan
to do what?
raw gist url
u mean github?
just get some free webhosting space

why boild tools not generate remapped 1.12 jar
I ticked this box
i have file "spigot-1.12-R0.1-SNAPSHOT-remapped-mojang.jar.lastUpdated"
but not jar
oh wait
wth
i not found remapped jar
this is really not exists
why i have 2 folders
2 folders for what?
what do you mean by 2 folders?
Remapping is only available 1.17+
Compare different mappings with this website: https://mappings.cephx.dev
do you REALLY need nms?
yes i need
then you have your work cut out for you. building/mapping for every release
oh
wdym Every time you update a plugin you need to re-build the plugin
in almost every versions nms changes. You have to code for those changes in every version
well, that's not a problem, it's only for 1.12
Is it possible to use the plugin with remapped in other versions without using modules?
no
so this mean you shuld do this anyway
.
remapped just makes it easier to see/write code that uses nms
nms is always a pain
you still have to rewrite your code for every version
always use teh API over nms if you can
thats why I rely on plugins that do it for me so I can just reap all the benefits and none of the struggles
like packet events
is some 1 here to help my code wont work dont knowhy
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
my scrn shot wont send
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
lol
you added brackets
where
thx
is there a way to do a custom brewing stand recipe
and then instead of blaze powder a other item
hi
hi
can anyone help
with what
i have use znpcs and make survival and creative clone but my member cannot click it
they have no permission
is there a error
its saying you do not have permission to use this command
you have a scrn
never mind
string duper?
you need a site
.
!verify
Usage: !verify <forums username>
dutch
?
I created something like custom block plugin-library lol, is it useful?
which one 16 line?
super(NamespacedKey.minecraft(namespace));
Are you depending on the 1.20.4 API ?
And 17 line of CustomEnchants?
because that constructor does not exist anymore
oh 1s, the server is 1.20.4 but developing for 1.20.1 xd
Yea
so the version
that constructor got yeeted
Still so baffled people are on .1 
ik lol
what is used now?
nothing
man these patch versions donβt really feel like patches all the time
you cannot extend enchantment anymore really
its a proper internal type these days, backed by a registry
Yea, technical changes are crazy in the patch versions
oh really?
You'd have to deep dive into NMS for it
So now using PersistentDataContainer is the way?
Well, or a data pack in 1.21
no thanks
today is crazy
Yea, the plugin worked now
@ivory sleet especially for us xD we still need to push through an upstream update 
Or you can just add lore line, hide enchantments and add something like feather falling or some useless enchant for glint
yea, the PDC route

A solid 25 commits behind CB 
|| if we just don't do it, does that mean softspoon finally arrived? ||
if the recipe is not valid that event will not fire
you need to listen to the click event and custom tick the stand yourself for fake recipes
?
the BrewingStand event only fires when a stand starts to brew.
did you import BrewingStandEvent?
doesn;t matter
Oh, it's not BrewingStandEvent
he's trying to do custom recipes
oh
BrewingStartEvent not BrewingStandEvent
- I don't think it will work
why
Cause it fires only on start
how i fiks that
Idk
if your reicpe is not valid the event will never fire
is there than a good tt
what about animation of brewing?
can't be done
hah, the same thing as anvil "Too expensive"
is there a way for a custom crafting table
you can create any recipe for crafting you want
never mind
I think he's talking about another crafting table block
like custom block for crafts
Well, you can but it's too much work
what if u would just have an interaction entity and using PlayerInteractEntityEvent open a gui?
how do i make custom mob with texture
is the book sign ui fully client side?
What do you mean?
Like button or what?
well the menu
like idk if there is a way to make it appear for a player for input stuff
and if text is editable
i would guess its all client side
Books are client side yes
okay
so really the only menu I can use for player input string is the anvil
(and chat I guess)
yeah but you can adapt it to 1.20
right but its pointless to create a book
comparing the mappings of 1.16 to now
build tools
get a remapped version of 1.16 and 1.20.4 and compare
Have a look at this
mfw AI art
How pathetic
is it?
nvm
Also very grainy towards the middle, a few fucked non-straight lines throughout
I see steves left arm
yeah
his left arm is uh...
whatever that is
xD
just give this image to an actual artist, and pay them to make something like this
Why did they do the text via ai too
fuck adobe
I agree
that's why I still use CS6
:kekw:
I ain't paying for no creative cloud bs
hi , how helped me with mongodb last time ,-,?
i don't remmber xD
someone told me to secure it
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
I need persistant data container for inventory π
?pdc ?
why
?paste
I created something like plugin-library for custom blocks with custom inventories, so inventories are not binded to block, that's why I need to somehow differ base inventories like from chests or something like that from inventories from custom blocks using another plugin. that's the logic of custom inventories that I have to transfer somehow to another plugins:
https://paste.md-5.net/zibujuhisu.cs
?blockpdc ?
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
I used it
how did you tie inventory to block
array with item stacks in block's pdc
and map with uuid and inventories of players that opened inventories
so what more would you need
for example in other plugin I have event on inventory click
And I want to differ inventory from chest from custom inventory
in this event
why doesn't your library provide some method like "isCustomInventory" if it keeps track of all open custom inventories
because Idk how to transfer tracked inventories to the another class
Like they are kept in the event class
and how to transfer all this data to another class
if you have a map with all custom inventories in one class and you want to move it to another class... just move it to another class and update references
i don't understand your problem
kotlin extension properties β€οΈ
But how
abso-fucking-lutely
just move this somewhere else???????????
Can Block be casted to NoteBlock? I don't see Block as one of the superclasses so I'm not sure.
Wait...
Nah, I didn't understand
maybe blockstate
Ok, I move it to another class
For example
CustomInventories class
Then I should use
CustomInventories abc = new CustomInventories()
...
And I still have to transfer this abc to another plugin
Ah! That seems to make intellij shut up. Thanks!
I'm a bit stupid, may you make an example?
im doing math rn i didn't look thru your entire code snippet so no
maybe smbd else comes in to save the day
can soame help me with custom mob
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
i asked right and what i wanted
no
why not
"can someonehelp me with custom mob" is not a valid question
ask exactly what you want
instead of asking to ask
state your problem, tell what you want to accomplish, what you tried
how do i do that then
send code snippets if necessary
dont know where to start
have you never asked a question in your life
if i respond with "yes" what happens next
you say how i do it
wqsnt there a link earlier today?
yeah so you should ask "please tell me how to make custom mobs" instead of "help me with custom mobs"
isnt that what i sead
??
this is what you said
this question means nothing
what exactly do you wanna accomplish? as in, something more complex like custom pathfinders, or just change health and name?
The server didn't seem to like it though.
?nocode
Itβs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
right whoops
i want a second zombie with name above him and my custom armor and custom sword he trops sword used and 0 to 5 magic powder what i made
what is "magic powder"
Ok, I will reform my question. (To understand better If someone would like to help)
I have a plugin-library to use it for another plugins. In this plugin, I got the list of custom inventories in the event class, for example Map<UUID, CustomInventory> InventoryHolders = new HashMap()<>
And I want to create method to get this list from another plugin.
Here's the logic that I use in my plugin-library
https://paste.md-5.net/zibujuhisu.cs
you are talking in terms that only you know
my custom item
you will not get any help this way
magic powder what i made
so spawn a zombie and give him your custom armor, sword, and item
https://blog.jeff-media.com/use-consumers-when-spawning-custom-entities/
Oh wait I think we both confused BlockState for BlockData.
oh could be
sorry
yeah I need to not be stupid for once
:p
but what i found was make the zombie the custom one
but does it spawn naturly then
if you listen to CreatureSpawnEvent and add your stuff to zombies there then yes
i dont understand the blog where do i put my code
when you want to spawn the mob
if i do a command
sure
if you use the consumer method you can make a separate class or method that can supply these custom mob variants
How can I prevent a noteblock from changing notes/instruments?
Cancel the interact event
I implemented that, but it still seems to update its block state when a block around it changes.
cancel the physics event
^
Hello! I need to pass information between a mod and a plugin I'm working on, so I decided to use plugin channels. However, I want my plugin to work for 1.8-latest spigot, but in 1.8-1.12, channels ban be named as PLUGIN|NAMESPACE wheras in 1.13+ channels must be named plugin:namespace. I think I'll just use version specific adapters to get around this, but that means I need to listen to two channels on the client.
My first question is that are any ways to get around this naming restriction so I only need to listen to one channel on the client, or no. Secondly, in my debugging, I couldn't get the client to receive the message. There were no errors on the server end, but I didn't receive any messages. My server setup that I was testing on was Server -> Bungee -> Client, so perhaps Bungee was doing something/not forwarding the plugin message? Could anyone provide some insight?
Am I doing this right?
@EventHandler
public void onBlockPhysics(BlockPhysicsEvent event) {
Block targetBlock = event.getBlock();
if (targetBlock.getType() == Material.NOTE_BLOCK
&& ((NoteBlock) targetBlock.getBlockData()).getInstrument() == Instrument.PIANO
) {
event.setCancelled(true);
}
}
The instrument still changes from harp to a different one when I place a block under it. (also sorry if it's hella inefficient)
It does trigger the event though. Placing an info log before running event.setCancelled gives this message.
Now what? I'm trying to make custom blocks but I don't think people are supposed to play notes on them or let them change the block type.
How to add plugin other as dependency?
Like... What should I put in repository or something like that
this depends on the plugin you wanna use
Like, I created 1 plugin
usually they explain what precisely you need to write down
and how to add it as dependency in the second plugin?
hmm
idk
what I did for my menu lib was just add the code as a dependency from my local repo I think
I know only that I should export 1 plugin using install, but how to add it as dependency in other plugin Idk
i have to double check
but p sure thats what I did
but in my case the menu lib is not a plugin
just a collection of classes
Hmm
but I think it works in the same way
I'm not sure
like both the plugin and lib are in the same github repo
so when you install the lib it gets put into local maven repo and then it just works if I add it as a dependency in pom of the plugin
For depend in the plugin.yml put the name of the plugin as it is in the other plugins plugin.yml. then add the dependency as provided (maven) or compileOnly (gradle)
but how to add it in pom.xml?
Add the repo for it then
But are you sure that it will work as plugin?
And I would be able to get the information from plugin?
I told you already you're not shading it
as long as you compile it with your main plugin there is no issue
ok
You simply add it in the depends field
thanks
And add the maven repo and dependency
So I should make local repo for this plugin, and add plugin in repo?
If it's your own plugin and it's using maven run maven install then it'll automatically he added to your local maven repository
I used install, and added as dependency
but it still can't find it
It's trying to find it in spigot repository
invalidate cache maybe
But if I used maven install, I don't have to add some kind of repositories here?
no
No maven uses youe local repository automatically
it looks in your local first
Then I don't understand
Might be worth looking at your local manually and ensuring its there
You need a version
You have no version
how do you click a button from a command
int ticksPressed = (block.getType() == Material.STONE_BUTTON) ? 20 : 30;
Powerable data = (Powerable) block.getBlockData();
data.setPowered(!data.isPowered());
block.setBlockData(data);
new BukkitRunnable() {
@Override
public void run() {
data.setPowered(!data.isPowered());
block.setBlockData(data);
}
}.runTaskLater(main, ticksPressed);
I have this right now, but the thing is, its a simulation
and not actual button clicks
as if the player clicked the button
Yeah you can't do that
Don't cast things to things that they are not
What?
?nocode
Itβs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
I used class from the other plugin which I added as dependency I mean..
Yeah I doubt that
where did you use it
In another plugin
You wouldn't get a ClassCastExceptipn you'd get a ClassNotFoundException
show how you use it
Clearly you have a bad cast
public final class TestBHPlugin extends JavaPlugin {
@Override
public void onEnable() {
Bukkit.getPlayer("_Warrio38_").getInventory().addItem(new CustomBlock(100, Material.WOODEN_AXE,2,"Β§fAAA",true).getItem());
}
}
package org.warrio38.mc.wblockhandler;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;
public class CustomBlock {
public CustomBlock(int breakingTime, Material instrumentType, int customModelData, String name, boolean requiresToolForDrop){ ... }
}
what line is the error on
?paste
ah
yeah that wont work
why do you keep a reference to your plugin in there
or like
Wdm?
whats the at customblock:16
Oh...
i cant find a good custom mob tt and if i try 1 my hole code broke so i fiks my code now but i want a custom mob
anyone?
how to what
it depends on why you di the plugin in the first place
people still using bukkitrunnables instead of using the scheduler π
maybe just using JavaPlugin is good enough
extending ItemStack wont work
I just used PDC from the other plugin
wait getItem()
It works
can't believe nobody is using radlib smh
wtf is radlib
runTask(10L) {
println("half a second delay")
}
Nope π ββοΈ
buildText {
append("magic")
font("minecraft:test")
}
i mean it could work
never tried it
then you have your answer
but it doesn't work on spigot :PP
then you have a second answer xD
I mean... In my plugin-library I used pdc to work, so in the other plugin I need my plugin-library to set pdc for work
do you use the plugin library as a standalone plugin
wdm?
well
you are including one plugin into another
can you use that plugin on its own
If anyone knows a lot about world generation & mc loading screens, help is appreciated:
https://www.spigotmc.org/threads/wait-until-players-join-world-completely.650813/
no
yeah
then you should consider changing how you access the pdc from that plugin
like not using a plugin instance because I think it got confused
Is it possible to display a book gui without having an actual book? or is this something that i would need to use packets for?
Ok, So, (Plugin-library: foo): I have CustomBlock class. In that class I'm creating an item with pdc of plugin-library foo, which I use in event classes.
(Plugin: bar): I want to use new CustomBlock() but If I add pdc using the bar plugin, the events in plugin-library foo won't work, cause they don't have access to the pdc from plugin bar
TIL that you cant, unless its a signed book
but idk if you can have it without an actual book
then foo needs to register events using a reference from bar
like CustomBlock(JavaPlugin user)
oh...
or something
It makes sense
Is sending localized/translated messages possible?
I'm trying to send a fake "player has joined" message, but in the correct language for each person
Player#getLocale iirc
you could send a translatable component if you use a resource pack
Can I send a translatable component using a vanilla translatable text as well or only when using a resource pack?
Ahh ok, packets it is
Ahh yeah but that's just getting the language, but can I just like send the translatable component somehow since it's just a vanilla minecraft message?
for an existing translatable, you'd need to find it in the mc assets
It can't because the one thing new CustomBlock() does is creating item with pdc, but the events work independent from CustomBlock()
Well it makes sense
yes you can for sure
you can send any text thats translated in the language files
as a translatable component
So, the one thing the plugin-library will do is just be a simple library with some classes? If I will register all events from plugin-library in the simple plugin?
well yeah I guess
Ok, thanks
well at least it works))
When a player right clicks the note block, it changes the note. How do I stop this from happening and make it run the shift click behavior? (aka place a block if it can be placed)
If you can't directly do that, how would I check if a block can be placed on a surface?
is there a way i can check the users / passwords of mongodb?
i been trying for hours
no kekw
π¦
been trying for hours
The full response is {"ok": 0.0, "errmsg": "Authentication failed.", "code": 18, "codeName": "AuthenticationFailed"}
anyone
Is it possible to make your plugin disable before others? (I'm getting errors because the API i'm using is getting disabled before my plugin)
loadbefore: plugin in your plugin.yml will cause you to load before the API provider, and disable before too. However you should not access it until its loaded
probably update block or block state
They do update the blockdata
however you must note that is only for a proper shutdown. If the API provider is reloaded or shuts down for any other reason you still break
depending on external API's in onDisable is not a good idea
thought there was some kind of update()
is there really no method to click button? even on nms?