Jump to content

Frag

Members
  • Posts

    100
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Frag's Achievements

Creeper Killer

Creeper Killer (4/8)

1

Reputation

  1. So would I need a specific Biome o Plenty API for the developers? So you are saying that when Biome O Plenty is installed, the BiomeDictionary should contains instances of BiomeGenBase for every biome contained in Biome O Plenty?
  2. Hi guys, my mod spawn my mobs without any issues, but I want now to support Biome O Plenty and spawn my mobs in those Biome as well. I was not able to pinpoint how to this, but I do not expect it to be really hard to do. Anyone could point me an example or give me some hint how to do it? I found some info on the net, but nothing really helpful and to the point. Thanks guys! Frag
  3. Surprised that I am the only one who has issue with this method ...
  4. How can I know the EnumCreatureType of a specific vanilla mob. This is the vanilla water squid... where can I know which creaturetype was used to spawn it. My guess is that it is EnumCreatureTpe.waterCreature ... but since the call does not seem to work. Maybe I have the wrong one. Still wondering how I can prevent that thing from spawning in specific biomes.
  5. Hi guys, I am wondering if I could miss something. I am playing around with the EntityRegistry.Remove spawn function and I can't get it to work properly. Example: If I am trying to stop the minecraft squids (EntitySquid) from spawning at the beaches, oceans and deep oceans, this is what I call. But it seems that the squid spawn anyway. Missing something? EntityRegistry.removeSpawn(EntitySquid.class, EnumCreatureType.waterCreature, new BiomeGenBase[]{BiomeGenBase.beach,BiomeGenBase.ocean, BiomeGenBase.deepOcean}); By the way I am using the spawn command as well in the same area, with no issue at all.
  6. This is indeed a very good theory ... I will look into it and let you know. Thanks A LOT.
  7. Hi guys, I have few fish mobs that swim gracefully in the ocean, but I noticed that when they are swimming close to the ocean floor, the collision box seems to grind against the floor ...making the movement jerky. It seems that the squid does not have the issue, but I can't pinpoint for the love of god what fixes this. Any hint?
  8. I just realized, while talking about it, that in a multiplayer environment, it will happen a lot that an entity will exist and will have some value set server side BEFORE a new client connects. Question. When a client connect, does ALL variables set server side will be fully synch with the brand new client side when it will connect?
  9. I have no idea what this does. The entity will be null if no entity with that ID exists on the client. Show where you send the packet. Actually I just want to get the worldobj object. Where can I get it from when in an iMessage? That depends. Are you calling that from the server side, or the client side? Thanks for the help TrashCaster. On the client side. I have a simple need, I am trying to get the worldobj from the clientside when the message is received so I can find the entity from its ID. Look at my 2 lines in bold. The first one get me the player, in the second one, I use the player to get the world object to find the entity with it. But I hate that method. I am pretty sure there a more effective way to get the entity from its ID. Tons of people use iMessage, just did not find an example where the Entity is found clientside from its ID. @Override public IMessage onMessage(AIStateMessage message, MessageContext ctx) { if (message!=null) { FantasticDebug.Output("MESSAGE RECEIVED. Entity: "+Integer.toString(message.entityId)+" AI State:"+Integer.toString(message.aiState)); EntityPlayer player = FantasticMod.proxy.getPlayerFromMessage(ctx); if (player!=null) { Entity _ent = player.worldObj.getEntityByID(message.entityId); if (_ent!=null) { ((EntityFantasticFish)_ent).brain.SetCurrentAIState(message.aiState); FantasticDebug.Output("New AIState set to: Entity: "+Integer.toString(message.entityId)+" AIState:"+Integer.toString(message.aiState)); return null; } else { FantasticDebug.Output("Entity IS NULL! ",true); } } else { FantasticDebug.Output("PLAYER IS NULL!"); } } else { FantasticDebug.Output("MESSAGE IS NULL!",true); } return null; }
  10. I have no idea what this does. The entity will be null if no entity with that ID exists on the client. Show where you send the packet. Actually I just want to get the worldobj object. Where can I get it from when in an iMessage?
  11. Hi guys, I was wondering if using EntityPlayer player = FantasticMod.proxy.getPlayerFromMessage(ctx) and Entity _ent = player.worldObj.getEntityByID(message.entityId) is a standard way to get the worldobj in iMessage. Is there any other way "safer"? I am asking because sometimes the Entity returned by my line Entity _ent = player.worldObj.getEntityByID(message.entityId) is null. Any cleaner way to get the entity id? I don't trust that one much... @Override public IMessage onMessage(AIStateMessage message, MessageContext ctx) { if (message!=null) { FantasticDebug.Output("MESSAGE RECEIVED. Entity: "+Integer.toString(message.entityId)+" AI State:"+Integer.toString(message.aiState)); EntityPlayer player = FantasticMod.proxy.getPlayerFromMessage(ctx); if (player!=null) { Entity _ent = player.worldObj.getEntityByID(message.entityId); if (_ent!=null) { ((EntityFantasticFish)_ent).brain.SetCurrentAIState(message.aiState); FantasticDebug.Output("New AIState set to: Entity: "+Integer.toString(message.entityId)+" AIState:"+Integer.toString(message.aiState)); return null; } else { FantasticDebug.Output("Entity IS NULL! ",true); } } else { FantasticDebug.Output("PLAYER IS NULL!"); } } else { FantasticDebug.Output("MESSAGE IS NULL!",true); } return null; } Here is the full message code if you want to see it... package fantastic.network; import io.netty.buffer.ByteBuf; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import cpw.mods.fml.relauncher.Side; import fantastic.FantasticDebug; import fantastic.FantasticMod; import fantastic.entities.EntityFantasticFish; public class AIStateMessage implements IMessage, IMessageHandler<AIStateMessage, IMessage> { private int entityId; private int aiState; public AIStateMessage() { } public AIStateMessage(int anEntityId,int anAIState) { entityId=anEntityId; aiState=anAIState; } @Override public void fromBytes(ByteBuf buf) { entityId = buf.readInt(); aiState = buf.readInt(); } @Override public void toBytes(ByteBuf buf) { buf.writeInt(entityId); buf.writeInt(aiState); } @Override public IMessage onMessage(AIStateMessage message, MessageContext ctx) { if (message!=null) { FantasticDebug.Output("MESSAGE RECEIVED. Entity: "+Integer.toString(message.entityId)+" AI State:"+Integer.toString(message.aiState)); EntityPlayer player = FantasticMod.proxy.getPlayerFromMessage(ctx); if (player!=null) { Entity _ent = player.worldObj.getEntityByID(message.entityId); if (_ent!=null) { ((EntityFantasticFish)_ent).brain.SetCurrentAIState(message.aiState); FantasticDebug.Output("New AIState set to: Entity: "+Integer.toString(message.entityId)+" AIState:"+Integer.toString(message.aiState)); return null; } else { FantasticDebug.Output("Entity IS NULL! ",true); } } else { FantasticDebug.Output("PLAYER IS NULL!"); } } else { FantasticDebug.Output("MESSAGE IS NULL!",true); } return null; } }
  12. Thanks to both of you! I was wondering because I have a small mobs that uses collision box to know if he touched the player and I was wondering how come the collision was not happening. Will try to figure something out...
  13. Hi guys, I just noticed that the player collision box (seen with F3+b) is over its shoulder ... its like it was moved two squares up. What the heck? I did the test with vanilla minecraft 1.7.10. I thought that a mod could do this ...so I tried vanilla. Same thing! Am I missing something?
  14. Hi guys, following CoolAlias good recommendation, I have set this line in my mobs constructor, so its animation will not be in synch with all other mobs of the same type and it worked. But I was wondering. By adding this line in the constructor ... ticksExisted=rand.nextInt(1000); It does mean that the tickExisted value will not be the same on the server and on the client side. Could it cause me some issues somewhere? I am wondering because my IMessage seems to be unstable the first few ticks after the creation of the mob ...some variable does not synch correctly between the server and the client (just for a very short time). I was wondering if it could be related.
  15. This is actually not a bad idea at all! I could reduce it slightly at every tick to avoid major value changes. This is the reason why I posted here, sometimes getting ideas from people outside the project make you think outside the box. This is a VERY good hint. I will look it up and let you guys know!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.