
L0raxeo
Members-
Posts
23 -
Joined
-
Last visited
Everything posted by L0raxeo
-
I'm super super sorry for posting a non-supported version of forge on here but I've been researching this for 5 days to no avail! I'm really really desperate and any help is needed. It also took my 7 hours to set up this Forge thing on my computer, and I really don't want to deal with another 7 hours of errors which is why I I'm trying to avoid updating. When I finally got it to work with 1.8.9 I was really happy but I don't want to repeat that hell again. Thanks for the help! ALSO! IT WORKED!!! THANK YOU SO MUCH!!!!! I'VE BEEN TRYING TO DO THIS FOR DAYS NOW. And if you think I'm exaggerating about the 7 hours, I'm not lol... my parents came into my room and said "are you alive"? I was up until 1 AM... I was getting gradle errors, java errors, java vm errors, -Xmx256 errors, environment errors, eclipse errors, and I hadn't even started making the mod yet! It just wasn't setting up correctly.... things just kept going wrong. Anyways, it worked!!! thank you so much for helping me! Also acknowledging your description to your forge profile (I think that's a description or a bio? something like that), the fact that you helped me proves that you aren't a jerk. And people who do call you a jerk are just being ungrateful. Trust me, I know. I am an official "Helper" and an "Expert" on the Java discord server, and some people are just complete asses. I will try to walk them through a problem and then they yell at me and say I'm treating them as morons. and I ESPECIALLY agree with you on the statement "If you do not understand Java, I WILL NOT HELP YOU". There are lots of people who just ping me and ask me to do their assignment for them.
-
How do I reference a subtype of an item (I think that's what it's called)? When doing crafting recipes I do this: new ItemStack(ModItems.fertilizer, 1, 1) However in this case I want to do if (tileEntity.getStackInSlot(0).getItem() == subitem) You would think that you could do if (tileEntity.getStackInSlot(0).getItem() == new ItemStack(ModItems.fertilizer, 1, 1).getItem()) but instead it just gets you the default item (fertilizer with a meta of 0). how would i reference a subtype of an item that I could compare that specific type in an if statement?
-
Thank you for the first part ("correct"). The second response, I understand how to reduce it, but I was wondering if there was a more efficient way to reduce. The way I did it was have 2 variables: growingTime, reductionGear Every update the reductionGear goes up by 1. Every 25 times it increments, the growing time increments. I'm not an idiot (well actually I am since I'm still in 9th grade although I did skip 1 entire grade and got bumped up in CS&E and Spanish class), but I was wondering if there was like an @Override method that did that same thing more efficiently. Such as maybe a @Override changeUpdateInterval(int interval) or something like that.
-
Sorry, but I also don't know how to reduce the time in between each time the update() is called. Any suggestions?
-
oh okay. so this is only something that would happen if the game was extremely slow. but if one was running okay, and another was running really well, they would be called at the rates right?
-
Oh ok, so that was actually my question: if the game is slower, will the update method be called less, and when it's faster, will the update method be called more frequently? If that's the case, how do I solve this? I remember doing something to fix that once in a pure Swing Java program, but I don't know how I would do that in minecraft.
-
Thank you! Yes it is a TileEntity. I'm just using the update method so what I think you are saying is that the update() from ITickable is called a constant rate. Thank you very much
-
I'm using the ITickable#update() method to update the loading progress of my Growing Chamber. However I do want to make sure that the update() method is called in between constant intervals. I couldn't find any confirmation online, and for anyone helping I did research ahead of time. Pestering people on forums is always my last resort. Thank you in advance!
-
It was insane. The gradle versions were off then Eclipse couldn't run the VM or something like that and then my JDK was corrupted and I switched to IntelliJ which had problems with the environment variables and then the JAVA_OPTIONS and JAVA_HOME were causing problems so I had to switch versions and oh man it was honestly a nightmare- but worth it im having a lot of fun coding my poop mod
-
IDE: IntelliJ 2020.2.3 JDK: 1.8.0_291 For every single one of my textures- let me rephrase: for every single file that is inside my resources folder cannot be found. Let me rephrase again: Every single file inside my resources folder invokes a FileNotFoundException when ran on IntelliJ IDE. That's the weird part: it's only invoked when run on IntelliJ. When I build it to a Jar file and then I put it in my mods folder and run it on regular Minecraft Forge, all the textures and names load up perfectly. So far I've been just exporting and running my mod whenever I want to test some sort of code, but it's getting exhausting and it's wasting my time considerably. How come I only get this error when I run it on IntelliJ? Is there some sort of project setting I have to change in order to get it to work?
-
My Background: I'm relatively new to Modding with Forge. I have done it once before when I was new to programming, however now I am attempting it again now that I have sophisticated knowledge on coding. However that does not mean I am extremely familiar with the libraries of Forge, which is most likely the reason for this post Problem: I'm trying to get the inventory of a 1 slot container, however it keeps crashing every time I do so. To do this, I getStackInSlot(0) in order to get the first slot. However for some reason I get a NullPointerException when I invoke that. I isolated the thing that is invoking the error to this line: te.getStackInSlot(0); The problem is not te (short for tile entity) which was concluded during previous debugging. It thinks that the Stack in Slot 0 is null. Currently, TE is declared as the following: TileEntityToilet te = (TileEntityToilet) world.getTileEntity(pos); The odd thing is, the Client outputs null while the server outputs the correct item that is inside the container (btw it's a toilet). In conclusion I figured out that the Client isn't syncing with the Server upon startup. The issue is that I don't know how to fix this. Any suggestions? Thanks in advance
-
Oh that's unfortunate. Sorry to waste your time.
-
Oh wait, sorry. My apologies, I don't think I made my situation clear. I've already added an inventory and everything. I can put items in it and take it out. I just need a way to compare the items in that one slot (that I've already coded), and to do that I need to get the inventory. I also am very new to these libraries (I just started using it a few days ago), so I'm sorry if I don't understand too easily). Here is a link to my code for the Tile Entity Toilet, so that you have a better understanding at where I'm at with coding the toilet. https://hatebin.com/kipucbzybk and in my block class (the one that extends to BlockContainer)currently has the onBlockClicked method. It's there that I want to get the inventory of the container (that I've already coded in), and also compare those contents to a specific item (although I think I know how to do that through the unlocalizedName)
-
Even though I didn't understand what to do with your first answer, it lead me to an even better way of accessing the toilet. I just set it to run the method onBlockClicked()! Sorry, but I'm having trouble understanding what you mean for #2. You say to "use teh capability on the tile entity". What does that even mean? I'm in the TileEntityToilet class. I just created a method: public ItemStack[] getInventory() { return inventory; } // sorry I don't know how to do code notation on here I know how to do it on stackoverflow but not here (this is my first time using curseforge forums) (Just making sure) This refers to the inventory of the container and not the player right? If it does refer to the inventory of the container, how do I access the specific slot? My best guess is that the first slot is 0 right? Well, my container only has one slot anyways, but I would refer to the slot as getInventory[0]? Thanks again Also, the method being ran is onBlockClicked inside the BlockToilet class. Since that is the case, how do I access the method in TileEntityToilet (getInventory())? Should I make it static? However I woulda assume that would break it since there would be multiple instance of the block and not just one toilet. I was thinking there is like a this.getTileEntity() or something like that but I can't seem to find one. Any suggestions?
-
Sorry I do not understand by what you mean when you say "Block#use". I googled it to no avail. Could you elaborate? Thanks for helping
-
My Background: I'm relatively new to Modding with Forge. I have done it once before when I was new to programming, however now I am attempting it again now that I have sophisticated knowledge on coding. However that does not mean I am extremely familiar with the libraries of Forge, which is most likely the reason for this post Goal: Getting the item of a container when shift-right clicked and comparing it to another item Problem(s) 1. Is there an event that is called when I shift right click on a block? 2. How do I get an item from the inventory of my container (1 slot container) It's actually a toilet and the toilet has a container which contains just 1 slot. What I want in the end is for you right click to open the toilet, put an item inside, exit the container, shift-right click to flush: flushing will turn the item inside the toilet into fertilizer