Everything posted by RafaMv
-
Rendering multiple models
Hey guys, I would like to render a mob that will have different modelbases. Just imagine a robot that can change its arms. However, I don't know how to render the models separately (and properly). Does anyone have a good idea how to do that? I tried this:
-
Removing block using GUI. Sync issue
I think I got it working, although I have a question. It just works if I don't return anything in the onMessage() method. If I return the "massage", it says that an integer is (obviously) bigger than a byte, and the game crashes. Should I leave it null?
-
Removing block using GUI. Sync issue
Hey guys, I'm wondering how can I sync to the server-side a block that was removed on the client-side using a GUI?
-
3D Model with semitransparent texture not rendering all faces
I think you missed the blend function. Try adding something like "GL11.glBlendFunc(sourceFactor, destintationFactor)" after glEnable blend, it should work I guess.
-
Mob following behavior
Now I got it working. I don't know why, but my mobs were stopping after moving to the last player position. I think it was priority. Anyway, my AI list is now:
-
Mob following behavior
Hey guys, recently I realized that vanilla mobs have a little delay when they are following a player to attack. It is easy to see if you just walk on circles around the mob. I created a new hostile mob and it seems that this delay is very big, something like a wolf, which would stare at you for some seconds before attacking. Does anyone know where I can fix this behavior by reducing this delay?
-
Server or client?
Actually its working, but its always good to check if I am doing it right, specially because I haven't worked too much with entities yet. I obviously missed this method when I was looking into the EntityAgeable class. D:
-
Server or client?
I created a new class similar to the EntityAgeable class, but with more growth stages. Therefore, to adjust the bounding box I am calling the super.setSize() every time that the mob reach a certain age (I'm using the "ticksExisted" from the Entity class to check this).
-
Server or client?
Hello guys! I am wondering, the super.setSize() in the entity class should run in server or client? I did some tests before and I think it should run in client only, is that true? Thanks!
-
Blending textures
Thanks for all your responses guys, but I have to rethink what is my goal. Actually, what I would like to make is: a mob that can change colors depending on a float value of the entity class. therefore, I would get this value and change the color of the secondary texture using glColor4f, but i would keep the primary texture unchanged. Just imagine a dog that have spots, for instance. To be honestly, I could do lots of different textures for each mob, but it would be a pain...
-
Blending textures
Hey guys, I was wondering is there a way to use 2 textures on the rendering? Let's say that I have a mob and I would like to use one texture for the body and another texture for the head. I tried everything, but the first texture is always replaced by the other one...
-
GUI Screen issues
Found my mistake. I was trying to check the id after checking the tileentity at position (x, y, z) which is obviously null. Ops! However I am having trouble with the getValues from the entity class. For some reason the values that I'm getting is from the server side, which are not updated (different values compared to the client). Only the getHealth() and getSpeed() are correct. Note: I'm using DataWatcher in one of these variables and it doesn't work either. My common proxy: My client proxy: My main class:
-
GUI Screen issues
Hey guys, I am trying to create a GUI that opens when I click on my custom entity. This is a basic GUI, which will show some information about the entity. This is what I've done so far: Gui Class: How I am trying to open this guiscreen: Gui Handler: Am I missing some thing? Btw, any idea how can I have access to the entity?
-
Changing the mob hitbox
I found my mistake! I was using the client side of the onUpdate() method to run the super.setSize(). I should have called it on the server side of the living update, just like vanilla!
-
Changing the mob hitbox
I don't know why, but the boundingBox doesn't change... Do I need something like a datawatcher for this?
-
Changing the mob hitbox
Hey guys, I'm having some trouble to update my mob hit box. I created a custom growth system (which is working fine), so I can't use the vanilla class. I tried using the setSize() method, but it doesn't seem to work: How can I change/update the hitbox of a mob?
-
[1.7.2] Sync model. Optimization issue.
I've already synchronized the id and stage. I am just trying to avoid the search in the hashmaps (or array) every rendering cycle. That's why I want to send a packet with the ModelBase only when the stage changes. But, to be honest I am very happy with the result that I've got so far.
-
[1.7.2] Sync model. Optimization issue.
I like this array idea. I didn't use it before because not all id's have the same number of stages. But, let's say that I would like to use arrays, how can I send a packet with the ModelBase to the render class. I really have no clue how to do that.
-
[1.7.2] Sync model. Optimization issue.
Hey guys, I'm having a bad time trying to optimize my tileentity rendering. What I'm trying to do is rendering another ModelBase inside a machine, depending on two value in the Tileentity class (ID and stage of rendering). I was able to achieve this but I really don't think that what I've done is the best way, because it is too expensive (I guess). Basically, I created a database by using a hashMap inside of another hashMap (hashmap<byte, hashmap<byte, ModelBase>>), then I just synced two byte values of the tileentity (the ID and Stage, which change every 300 ticks or so) and it worked perfectly. But, I think that's very expensive to access the database every rendering cicle. So, my first question is: Is that really expensive? (My hashMap would be 10 hashmaps of 5-10 models, for instance). If it is, how can I sync a ModelBase?
-
[1.7.2] Problem with Inventory in custom GUI
Your gui is fairly large. Items popping out from your gui may be caused by a wrong xSize, or ySize. Make sure that you got these values right in the GUI class.
-
[Solved]NPE on Custom Block Model setRotation
No problem! Looking at the crash report you can see: So, I believe that you must have to define each rotation point, since you got a null pointer exception. I thought these rotations were (0,0,0) by default, but there aren't... That's good to know, haha.
-
[Solved]NPE on Custom Block Model setRotation
I see this twice: Not sure if it would crash though.
-
Changing mob attributes
Wow, for some reason it didn't work before. Now, it's working... weird.
-
Changing mob attributes
Hey guys, I was wondering how can I change the mob attribute, such as health or speed, after it has already been defined? I tried setBaseValue(), but it can only be call once, so i can't change any value by using this method. I tried setAttribute() as well, but it didn't work: "The method setAttribute(double) is undefined for the type IAttributeInstance".
-
How to send packets properly?
Thanks diesieben, it worked perfectly!
IPS spam blocked by CleanTalk.