Mecblader
Members-
Posts
225 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Mecblader
-
Hello, I am making a mod that adds a block that attracts mobs to it by putting items in its inventory. I need to know of a way to make mobs come to the block. I has an idea of just teleporting the mob to the block, by small increments, but before I do that I just want to know if there is a better way to do that. All help is appreciated, Thank You!
-
So, I have made a gui that is similar to the creative mode gui, appearance wise, but it had many flaws and it was quite complex and it was difficult to remember how all of it worked. So I want to start over. I was wondering if anyone else had made an gui that was similar to the creative mode gui, in terms of the tabs and the scroll bar and that it stored actual items, could they please give me advise and summarize, how they accomplished this, and even if you have not, could you give me ideas, of how you would handle something like this. All Advise and Help is Appreciated, Thank You.
-
Could someone please help?
-
Sorry, I should have explained more clearly. I have a custom gui, it is basically supposed to be a bank. I need to be able to store values higher than an int can handle and it need to be able to hold items that are not stackable in one slot.
-
Hello, I have a custom gui that I have made and I need it to be able to store more than 127 items in a stack, I need it to be able to to store a number somewhere in the billions. Given that ItemStacks save the stack size as bytes, this serves as a problem for me. I was thinking that I could make my own ItemStack class and use longs, but It seems like a lot of unnecessary work, so I was wondering if anyone know of a better way to accomplish this. Side Question This is a question I want to ask other modders, when they come across an issue with something in their mod. Say that you want to add something to your mod, but it just does not seem to work and you can't figure out why and I you have tried to fix this for at least 1 month, would you start over, or would you continue to look for the problems in your coding. All help is appreciated, Thank You!
-
Just look at the minecraft furnace code or just google a tutorial on how to make a furnace and pick and choose the things you want.
-
Overview Problem Bank Container Bank Inventory Bank Gui Extended Player Properties Extra Info
-
Hello, I have a gui that is separate for each player, so when a player right clicks a block it opens a new instance and recycles that instance for that player only, until the server is restarted. Bassically I need to load items into the Inv from nbt that is stored in an Extended Properties Class. I have the class and code made, but it does not work. Currently I have tried to set an ItemStack into a slot, but it does not show up in the inv, when I load the world. My question is , "Do I need to send packets to sync the Server and the Client side Inv?".
-
Hello, I have a problem with loading Items from NBT. I have worked with and loaded NBT data before because it is fairly easy to use, but I have a special case. I don't think that my NBT Loading Code is wrong, but I'll post it anyway. So basically I have a special Inventory that is Individualized for each Player like the crafting table. Essentially I made a bank that has around 4212 slots, and no that number is not a random number. I use a tab system and a scroll bar to navigate and I have a special slot numbering system. I am telling you this because if you look through the code you might be confused. So basically i have all of the slot in the Inv get loaded into an Extended Properties Class Linked to the player. From there, when the player logs out, I save the ItemStacks to the players Extended NBT.(I think that this part works fine too) When I go to load this NBT data when the player logs in, I get a message saying that says, "Successfully Loaded ItemStack: Blah to Slot #: Blah", because i have a println in my code. This told me that it is at least saving and loading correctly, but when I set the Item Stacks to the slots, The inv is completely empty and when I log off It says that is saved the Item that I put in the Inventory originally. My thoughts are that I may need to sync, the server and the client, but how would I do that easily? Is there a method that can sync Invs easily or will I need to send a packet with a bunch of little info such as ItemID, StackSize, MetaData, ect. I will only post my Extended Properties Class for now because that is where everything is basically happering. Also sorry that my code might be messy, I have been try ideas to solve this problem and frankly I have been too lazy to clean it up.
-
So I have a gui that I made and I have it setup similar in appearance to how the creative gui looks. It is not similar in code because I cannot understand the code in the class because many methods and fields are name with fuction_XXXXXXX and field _XXXXXXX. What I need is a way to add a scroll bar to my gui because I have 55 slot on the gui in a single tab and I need 468 in each tab. I already have the tab system working, but I don't really know how to add a scroll bar and I need to add one. So, if anyone has done this before and have example code to reference or know of an open source mod that adds this sort of thing in one of their guis and their code is relatively easy to read and figure out what is going on, or at least easier to read and comprehend than the Minecraft creative gui. All help is appreciated, Thank You!
-
Hello, I am making mod where each player has a bank, to store their items in. I have the gui made and I have the button I needed placed, but I was wondering if I need to send packets for something that I will now explain. I have two right and left arrow buttons that switch between each tab, there are nine tabs in total. The player can also select each tab by clicking on it , similar to creative tabs. When the player switches the tab it increments and decrements a variable that keeps track of what tab the player is currently selecting. Right now I have buttons directly increments and decrements this variable, but I have experienced a bug with it. when I put something in a slot, lets just use the first slot as a an example, then I switch to tab 2, every thing look OK because the item in slot one disappears because it is stored in a different ItemStack array, then I try to put something in slot 1 of the second tab and it puts the item in, but also gives me a copy of the item in the first tab in the first slot. I am not sure if this has to do with not sending packets and the variable not being synchronized in the server, or it is due to my incompetence to write code and I have made some error in my code. If you believe that it is due to my incompetence to write code, lol, then please just ask for my code, then I will gladly share it. Also is there a limit for how many packets you can send per mod, or is there some sort of contribution to lag caused by sending too many packets. All help is appreciated, Thank You!
-
Hello, I am making a mod and I need to detect when a player successfully hit and damages an entity. In my mod I have a level system and one of the many lvls that are monitored are the player attack lvl. I am using the AttackEntityEvent to detect when the player hits the entity and I use this method to damage the entity by setting the players base damage attribute according to what lvl they are and what tool they are using. The player then get awarded xp when the player hits the entity. My problem is that I noticed that forge calls this method every time the player clicks the entity. This may be good in some cases, but that is breaking my system by giving the player xp even when they have not successfully damaged the entity because of the cool down. So I need a way to detect when the player success damages the entity, so I can have it reward the player with exp according to how much damage the player has done to the entity out of how much health the entity has. All help is appreciated, Thank You!
-
I edited my original post, the code should be there.
-
Hello, I am sending a packet and it is returning with an error. I don't really know what is causing it or were to start because the stack trace is leading to forge code resulting in a NullPointerException. Basically I need to send a boolean value along with three other integers to all the player in the server when an event is triggered. So I had setup a LAN world and when the person hosting the LAN world triggered the event, the packet would send and would the tile entity render, this is what I need to syn with the packet, and it would update and sync fine, but when another player triggers the event the player crashes, and they would not crash before I added the packet sending code. I add a try-catch and had it print the stack trace and the packet gets sent and it sync every player, but the stack trace is returning a NullPointerException. I will post my code and the stack trace bellow, but if anyone needs any more code, just ask. All help is appreciated, Thank You! My Code Stack-Trace Edit: BlockLogFire Class Packet Code
-
Hello, I have a custom rendered block that I have made, it is a campfire thing, and when the player right clicks it with a flint and steel in hand it ignites. I have it working fine but the other players around do not get info that the log has been lit. I am assuming that I need to send packets to sync them and I thought of sending a boolean, but then I thought that once I send the packet it does not know what log has been ignited. So I thought that I should send a String instead ans have the coords in the String and parse the string to get the tile entity, but then I soon realized that you cannot send strings using packets. (As far as I know) So now I am stuck, Does anyone have any suggestions? All help is appreciated, Thank You!
-
Hello I have made a tick handler with the PlayerTickEvent and I have every thing setup, but when I went to test it I found out that the event is not being initialized. I use this: MinecraftForge.EVENT_BUS.register(new RCTickHandler()); to initialize it and this is my method : The method doesn't print anything out. Also I believe that I am initializing it in the right place because all of my other event stuff works fine.
-
Hello, I have a mod and I want to implement a quest system. I am going to have well over 200 quests, but the issue is that I need a way to keep track of the items the player has acquired or the task that he/she has done far, so the first thing I thought of was NBT. Then I realized that one it may be a bit chaotic keeping track of it when the player dies and two I heard that having too may NBT tags loaded on every player may cause a lot of lag and very large file sizes. So I need suggestions on how I could make a system in which I could store a ton of data on quest.
-
isn't there another mod that already did that call Project Red, It re-implemented a lot of the thing is RedPower. As far as help, sorry I have 3 in development mods that I am working on, 2 in my signature and 1 secret one.
-
[1.7.2]Easier Tutorial for Netty Packet Handling
Mecblader replied to Mecblader's topic in Modder Support
Thank you I will check out those tutorials. I need to send packets because I have a custom lvl system, eg. WoodCuttingLvl, MiningLvl, AttackLvl, I think its about 24 lvl or something around that. -
Hello, I need to setup a Netty Packet Handling system. I originally had a packet handling system for my mod, but that broke in the update. So I need to start from scratch. I came across this tutorial http://www.minecraftforge.net/wiki/Netty_Packet_Handling, but I really don't understand it because it just gives you the class setup, without explaining much. I was wondering if there was an easier tutorial to follow. All help is appreciated, Thank You.
-
[1.7.2] Updating to 1.7.2 - All sorts of Questions
Mecblader replied to Mecblader's topic in Modder Support
Thank You -
[1.7.2][Solved]How to render things to player screen?
Mecblader replied to Nimbleguy's topic in Modder Support
Use this: http://www.minecraftforge.net/wiki/Gui_Overlay It is for 1.5.2, but I'm sure you'll manage. -
Hello I am updating my mod to 1.7.2 and my mod is not do to well right now. I have a few question about things that have been changed in forge and minecraft in general. Basically I would like references or tutorials or even brief explanation of these questions Please put what number and the section you are answering about because this may be useful to others updating All Help is Appreciated, Thank You