Everything posted by Frag
-
[Solved][1.7.10] Stepping sound question
YES THAT WAS IT!!!! Thank you so much Jabelar! Very good answer, as usual
-
[Solved][1.7.10] Stepping sound question
As funny as it sounds, I did not find anything up to the entity class for that. I really wonder where that sound comes from.
-
[1.7.10] RotationYaw drives me nut
And ... does my rotationyaw formula make sense?
-
[Solved][1.7.10] Stepping sound question
Simple question for you guys. I am developing a fish mob and I noticed that it does a dirt stepping sound while moving around in shallow water. How can I silence this, it is really annoying when there are a lot of fish. I found sound for death and living ...but nothing about the stepping sound. Any idea?
-
[1.7.10] RotationYaw drives me nut
I was under the impression that the server and client where always in synch as far as the basic rendering parameters (pitch, yaw, position). Am I wrong? Any of you guys are doing manual synching for those rendering parameters?
-
[1.7.10] RotationYaw drives me nut
Hi guys, I have a new water mob which is a fish. I have no issue moving it around in the water. BUT the rotation yaw gives me headaches. It always seems that the mob moves sideways or backward before adjusting the yaw correctly. It does work at some point, but the fish always travel some distance before having the correct yaw. I would like it to point in the correct direction BEFORE starting to move. What am I doing wrong? Is it because the client side get the yaw value too late, after the server start to send new positions? This is how I calculate my yaw (look in bold) during the updateaitask while starting to move ... I took it from the ghast class in forge. I tested few methods, all with similar results. And this is what I have in the model class:
-
[1.7.10] Simple updateAITasks question for entity
Thanks Jabelar, very good answer here. I will just check the distance from the players. As you said, I doubt that it will kill the CPU. I will try both and do some perfmon measurement. So I will sleep better Thanks for the help!
-
[1.7.10] Simple updateAITasks question for entity
Yeah I thought about that, but I was just wondering if searching for player proximity at every tick for every entity would eat to much CPU instead of just executing the AI ... I could this this, but I wanted to know from the guys who do a lot of creature in their mod (like mo's creature or something) how they handled this. I wanted to make sure I was not missing a standard way to turn of the AI ...
-
[1.7.10] Simple updateAITasks question for entity
Is it the standard way to stop far entities to execute the AI?
-
[1.7.10] Simple updateAITasks question for entity
Hi guys, is there any way to make sure that this call is not made on the entities when they are out of sight of the player ... or at a certain distance of any players. It is just about saving CPU ... Is there a check I can make inside that call to filter it out if my entity is far from any player?
-
Confused about GL11.Rotatef ...
Could you elaborate ... what do you mean by the GL11 are not always the same? Any examples? I mean, that it would be "rotated" already. Since GL11 rotation applies for current axis, the result is dependent on the axis. Ok so what you are saying is that if ...lets say a fish jump twice ... the first time it will rotate to 90 degrees ...and the second time it will rotate 90 more degrees? That would explain the random feel rotation I experience. It does make sense. Can I use a call to reset the rotation? As you noticed I have a IF that detect if the fish is out of the water. So in the else part, I could reset the rotation. Any call I could use? OpenGL is really new to me.
-
Confused about GL11.Rotatef ...
Could you elaborate ... what do you mean by the GL11 are not always the same? Any examples?
-
Confused about GL11.Rotatef ...
Hi guys, I am rendering a simple fish ... no issue so far. But if I want him to jump in the air, over the water, I want to rotate it so it will jump face up (head pointing to the sky). I added this to the code and I see that the fish rotate, but it will never rotate the same way twice in a row. Sometime they will jump head first ...sometime they will jump tail first ...or simply side first. I am really confused. Someone could help me out? protected void func_82430_a(EntitySalmon par1, float par2, float par3, float par4) { if (par1.worldObj.isAirBlock((int)par1.posX, (int)par1.posY, (int)par1.posZ)) { GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); } GL11.glTranslatef(0.0F, (float)(-par1.GetRenderValueFromSize()), 0.0F); super.rotateCorpse((EntityLivingBase)par1, par2, par3, par6); } I tried other options like: GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); Nothing really works ...the fishes rotate, but never heads up. Simply, I just want my fish to be rendered head pointing to the sky when its location is an air block. Someone can explain? Thanks in advance...
-
[1.7.10] entitySpawned event question
No one has an idea how to differentiate a spawn coming from the vanilla spawning system and a user using an egg. I am really desperate guys ... I really need to know. Any workaround?
-
[1.7.10] entitySpawned event question
Hi guys, I wrote a small method but I would need to know if the entity was spawned by the player with an egg ... or its the vanilla spawning engine that spawned it. Is there a property I can check? @SubscribeEvent public void entitySpawned (EntityJoinWorldEvent event) { if (!event.world.isRemote) { //Spawning is controlled server side. if (?** entity was spawned by the spawning engine ?**) //not spawned by an egg. { SmartSpawnerControl.ProcessSpawn(event.entity); } } }
-
[1.7.10] getNavigator.tryMoveToXYZ and watermob ...
Anyone knows if there is a Library that would be like the getNavigator somewhere, but for the water mob. I can use it with no issue on ground ... but anything in water will just drop to the ocean floor. It feels like it was not tought at all for water mob ...
-
How to make a water mob swimming on place (perfectly still, no gravity)
Briefly I just want to know what is the motionY value formula I need to put something so the mob will not go up or down... Was not able to find the perfect value yet. aWaterMob.motionY = ?
-
How to make a water mob swimming on place (perfectly still, no gravity)
Hi guys, this thing drives me nuts. I can have a watermob swim anywhere I want, but I can't figure out how to make it swims on place perfectly still (like there was no gravity). I tried almost everything but I am pretty sure one of you guys made it works. I tried calling a method of that type in updateAITasks. But the mobs always jump up and down. I just want it to stay still ... that simple. I am looking for a way to disable the gravity on it. if ((!aWaterMob.isDead) && (aWaterMob!=null)) { aWaterMob.motionY = 0.01F; }
-
RandomPositionGenerator.findRandomTargetBlockAwayFrom method ...powerful, but ..
Hi guys, I would really like to use this method: _vec3 = RandomPositionGenerator.findRandomTargetBlockAwayFrom((EntityCreature)this.closestEntity, 8, 4, Vec3.createVectorHelper(this.closestEntity.posX, this.closestEntity.posY, this.closestEntity.posZ)); In my code, this.closestentity is the player ... and minecraft hate this with the following error. I would really like to use that method, but how come it cannot be use with an entity. Am I missing something ... ? java.lang.ClassCastException: net.minecraft.entity.player.EntityPlayerMP cannot be cast to net.minecraft.entity.EntityCreature What I am trying to do is for a water mob to flee away from the player when they get too close. Someone knows another method I could use?
-
[1.7.10] Another FishingRod and FishingHook question, but I guess a simple one.
I was able to generate my own rod and hook by extending those from the vanilla classes, but it limits me a lot. I would still like to understand why I cannot spawn that custom fishing hook like explained in the first post
-
[1.7.10] Another FishingRod and FishingHook question, but I guess a simple one.
It also seems that we have more control over the spawn (refresh ... distance seen ... etc). Ok I will make more testing tonight to see if I can fix my issue by playing around with this.
-
[1.7.10] Another FishingRod and FishingHook question, but I guess a simple one.
Hi SanAndreasP, thanks for the answer. I tried that one and the result was the same. But someone could explain me what is the difference between registerModEntity and RegisterGlobalEntity? A lot of mods use both, but I did not figure out what is the difference yet.
-
[1.7.10] Another FishingRod and FishingHook question, but I guess a simple one.
Hi guys, I have created my own fishing rod and fish hook classes, that are in fact dumb copy of the vanilla classes. I do not want to extend from the vanilla classes for many reasons which I will not bother you with. Here it is: ItemReinforcedFishingRod, which is a copy of ItemFishingRod (vanilla) EntityReinforcedFishingHook, which is a copy of EntityFishHook (vanilla) And I also created my renderer, which is a copy of RenderFish RenderReinforcedFishingHook, which is a copy of RenderFish (vanilla) I registered the item: I registered the Entity: I registered the render: So everything works fine from the client side perspective. When I right click on my fishing rod, my new ReinforcedFishingHook entity spawned and the fishing line appears. But I noticed that if I try to spawn the ReinforcedFishingHook server side, the hook do not spawn. I am pretty sure this is something about registering the entity server side. I miss something but I can't figure out what. Briefly, in the following code, if I want to spawn server side by adding the bold part ... server refuse to spawn it (or it is spawned but I do not see it client side). Any idea what the heck I am missing here?
-
1.7.10 Need help with simple custom door. Want to extend from blockDoor.
Hi guys, I want to make a simple custom door with new textures. I want it to be like the vanilla one. I would like to extend from the blockDoor but I was not successful. Anyone could point me out to an example somewhere. I found some but 1.6.4 but it seems it does not fit 1.7.10. I also noticed that the blockDoor constructor is protected ... Thanks guys!
IPS spam blocked by CleanTalk.