
FLUFFY2
Forge Modder-
Posts
424 -
Joined
-
Last visited
Everything posted by FLUFFY2
-
Lol, okey. So than how can i notice other players to render the item if its in my hotbar slot? Send a packet to all players or what? Thanks!
-
That looks so awesome! Many thanks to you. I don't want to be rude or anything, but you forget the actual pathfinding to the door. Your code will work but mobs will not find the door so they not start to interact with it. I found it that the PathFinder holds the info for the actual door path, especially func_82565_a() in it. The wooden_door is also hardcoded there. Again i don't want to be rude, just to know its there.
-
Right now im using: if(player.inventory.mainInventory[8] != null && player.inventory.mainInventory[8].getItem() == Amnesia.LanternOn) But thats client only. So how can i make so that other players know that an item is in a hotbar slot? I need a method that works both side and still can detect a specified inventory slot. Thanks!
-
The MCP team started the work to update their code once that is done Forge team starts to update. I would predict 2-2.5 mounth till a stable release!
-
[1.7.10]Getting the block the player is looking at problem
FLUFFY2 replied to FLUFFY2's topic in Modder Support
Thank you so much! The fix is to add the player eye height to the yCoord and BOOM. Its working!!! -
Thank you so much! I hope this will get added.
-
[1.7.10]Getting the block the player is looking at problem
FLUFFY2 replied to FLUFFY2's topic in Modder Support
Hi there So my code is supposed to create the light without pakets to not raise the network usage! So the light is crated client side. Even if another player is emitting the light its created by your client. And that realy helps to raise the performance of the dynamic lighting. And i have to use that anyway because in 1.7.10 you cannot create light server side anymore. Im using PlayerTickHander and i need ExtendedPlayerProperties because all player is getting the data from the same PlayerTickHander class and if i store data there it becomes realy messed up. So i need diferent values for each player. I tracked down whats the problem and its that line in my getRayTrace methods: MovingObjectPosition mop = player.worldObj.rayTraceBlocks(pos, addedlook); if(mop != null && mop.typeOfHit == MovingObjectType.BLOCK) return mop.blockXYZ; Without that other do see he light correctly but than the light can be in a block because i don't check for block hit. For some reason the code above only gets data for the client. I do some printLn debug and this is what i get: Client side , no other player: Correct pos! Client side, with other player: Correct and bad pos at the same time! Server side: Always bad pos! I will play around with it a bit more, but if you have any idea please tell me! Thanks! -
[1.7.10]Getting the block the player is looking at problem
FLUFFY2 replied to FLUFFY2's topic in Modder Support
This is my last bug, please help me if you can. Thanks! -
[1.7.10]Getting the block the player is looking at problem
FLUFFY2 replied to FLUFFY2's topic in Modder Support
Nope, thats just a pastebind derp. Thanks anyway! -
I have a dynamic light system that not requires pakets(thanks to diesieben07), but there is something wrong with it. I have two types of light: "Under the player" and "Where the player is looking at". The underplayer one works like a charm, but the otherone not so well. The problem is in client side its OK, but on server side other player see the light under me and not where im looking at. The player who is crating the light always see the light in a correct pos. Only others not. The problem occourns when the player raytrace is hitting a block. When its not others see the light correctly. I read it a problem with raytrace that its only client sided, but then i read there is another method via look vectors for both side. So i made the following: THIS CODE IS ONLY FOR TESTING LightHandler(PlayerTickHandler): http://pastebin.com/QcCUzykc ExtendedPlayerProperties(Only the raytrace part): http://pastebin.com/uanxRjQB Thanks for helping me!
-
Right now its hard coded that mobs only search and destroy vanilla wooder doors. It would be realy cool that you can add custom doors to mobs door break AI and for the pathdfinding, because right now you can't, unless you change the whole pathfinding system. Thanks for reading that!
-
This is my 3rd post about that so im going to be straight. 1. Mobs not update their path fast enought to track the player motion. (Walk in circles around the mob to see) 2. If they are walk down one block the do a spin and sometimes they spin untill we hit them. 3. Sometimes if a mob hits you he freezes down for 1-4 sec. 4. Sometimes they just going in the wrong direction and about 1-3 sec they updates their path. 5. The path update problem gets worse if we raise the movement seed. All of the above is for mobs thats extending EntityMob.class only(hostile)! So it includes custom mobs too! Im using the latest Forge. Thanks for reading that!
-
-.- I just put it there, because if i don't then others will ask for it. But okey i will try to present it again.
-
Hi, Why ALL and my custom doing that? My AI task are from the EntityZombie class. So it should be some kind of bug. http://youtu.be/JZHMXSgLJmI EntityGrunt: public class EntityGrunt extends EntityMob{ public boolean entered = false; public EntityGrunt(World par1World) { super(par1World); this.getNavigator().setBreakDoors(true); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, true)); this.tasks.addTask(3, new AmnesiaEntityAIBreakDoor(this)); this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D)); this.tasks.addTask(5, new EntityAIWander(this, 0.6D)); this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F)); this.tasks.addTask(7, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); } @Override public void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(80.0D); this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(20.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D); this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1.0D); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(5.0D); } @Override public boolean isAIEnabled() { return true; } @Override public void onUpdate() { super.onUpdate(); if(!entered){ entered = true; this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "amnesia:grunt.Enabled", 2.0F, 1.0F); } } @Override protected String getLivingSound() { return "amnesia:grunt.Idle"; } @Override protected String getHurtSound() { return "amnesia:grunt.Hurt"; } @Override protected String getDeathSound() { return "amnesia:grunt.Dead"; } @Override protected void func_145780_a(int x, int y, int z, Block block) { this.playSound("amnesia:grunt.Step", 0.6F, 1.0F); } } I don't know what messed up the mobs AI but its realy annoying. Lex please don't put this to modder support. It has nothing to do with my code, because all hostile mobs doing that. Thanks!
-
SLOVED[1.7.10]Make custom door breakable for mobs
FLUFFY2 replied to FLUFFY2's topic in Modder Support
Sloved it on my own. I just needed a custom AI. -
SLOVED[1.7.10]Make custom door breakable for mobs
FLUFFY2 replied to FLUFFY2's topic in Modder Support
Its my last bug of my mod. I realy can't find anything related to my problem. -
SLOVED[1.7.10]Make custom door breakable for mobs
FLUFFY2 replied to FLUFFY2's topic in Modder Support
Anyone has any idea? -
SLOVED[1.7.10]Make custom door breakable for mobs
FLUFFY2 replied to FLUFFY2's topic in Modder Support
I have a custom mob that extends EntityMob so it has no connection to zombies. I just set it to break doors but its only break wooden doors. So my door material is wood and its extending BlockDoor. Still not working. And i can't find the code related to "patfind to door". Thanks for helping me! -
Hi, I made a custom door, but for some reason zombies not see it as a door. They not start to break it. i look everywhere but there is no code for make my door visible for other mobs. My door extends a custom BlockDoor, but i tryed it with the vanilla BlockDoor too and its still not working. How can i make my door breakable for other mobs? Thanks!
-
And congrat for the 1500.
-
Oh i alway tought it just a regular packet. Thanks!
-
What about if i send a packet from the server to the player and open a gui there? If that is a stupid idea, can you tell me a bit about where should i start with my custom packet?
-
No there is no .isRemote in that part of the code at all. Here take a look: @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int par1, float par2, float par3, float par4) { int i1 = this.func_150012_g(world, x, y, z); int j1 = i1 & 7; int k1 = i1 & 7; j1 ^= 4; TileEntityDoor TEDoor = ((TileEntityDoor)world.getTileEntity(x, y, z)); boolean isLocked = TEDoor.isLocked; boolean hasLock = TEDoor.hasLock; String doorName = TEDoor.doorName; if(entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().getItem() == Amnesia.Key){ if(hasLock){ if(entityplayer.getCurrentEquippedItem().getDisplayName().equals(doorName)){ if(!isLocked){ if(!world.isRemote){ if ((i1 & == 0) { ((TileEntityDoor)world.getTileEntity(x, y, z)).isLocked = true; ((TileEntityDoor)world.getTileEntity(x, y+1, z)).isLocked = true; world.playSoundEffect(x, y, z, "amnesia:door.UnlockDoor", 0.8F, 1.0F); }else{ ((TileEntityDoor)world.getTileEntity(x, y, z)).isLocked = true; ((TileEntityDoor)world.getTileEntity(x, y-1, z)).isLocked = true; world.playSoundEffect(x, y, z, "amnesia:door.UnlockDoor", 0.8F, 1.0F); } } }else{ if(!world.isRemote){ if ((i1 & == 0) { ((TileEntityDoor)world.getTileEntity(x, y, z)).isLocked = false; ((TileEntityDoor)world.getTileEntity(x, y+1, z)).isLocked = false; world.playSoundEffect(x, y, z, "amnesia:door.UnlockDoor", 0.8F, 1.0F); }else{ ((TileEntityDoor)world.getTileEntity(x, y, z)).isLocked = false; ((TileEntityDoor)world.getTileEntity(x, y-1, z)).isLocked = false; world.playSoundEffect(x, y, z, "amnesia:door.UnlockDoor", 0.8F, 1.0F); } } if(Key.getConsume(entityplayer.getCurrentEquippedItem())){ entityplayer.inventory.consumeInventoryItem(entityplayer.inventory.getCurrentItem().getItem()); } } }else{ if(!world.isRemote) entityplayer.addChatComponentMessage(new ChatComponentText("The key isn't for this door!")); } }else{ Amnesia.proxy.openKeyGui(entityplayer, x, y, z, i1); //This is opening part } return true; } if(hasLock){ if(!isLocked){ if(!world.isRemote){ if ((i1 & == 0){ world.setBlockMetadataWithNotify(x, y, z, j1, 2); world.markBlockRangeForRenderUpdate(x, y, z, x, y, z); } else { world.setBlockMetadataWithNotify(x, y - 1, z, j1, 2); world.markBlockRangeForRenderUpdate(x, y - 1, z, x, y, z); } world.playSoundEffect(x, y, z, "amnesia:door.WoodenDoor1", 0.5F, 1.0F); } }else{ if(!world.isRemote) entityplayer.addChatComponentMessage(new ChatComponentText("Door is locked!")); world.playSoundEffect(x, y, z, "amnesia:door.WoodenDoorLocked", 0.5F, 1.0F); } return true; }else{ if(!world.isRemote){ if ((i1 & == 0){ world.setBlockMetadataWithNotify(x, y, z, j1, 2); world.markBlockRangeForRenderUpdate(x, y, z, x, y, z); } else { world.setBlockMetadataWithNotify(x, y - 1, z, j1, 2); world.markBlockRangeForRenderUpdate(x, y - 1, z, x, y, z); } world.playSoundEffect(x, y, z, "amnesia:door.WoodenDoor1", 0.5F, 1.0F); } return true; } }
-
Yes im calling it in my OnBlockActivated method, but its not working for some reason. And i don't checking for any side. I checked out with .pirntLn and it runs both side. But when im on a server the method in my ClientProxy never gets called trough my ServerProxy.
-
[1.7.10] Running two Forge Instances from Eclipse
FLUFFY2 replied to jamioflan's topic in Modder Support
You have to login with two original account if you want to test out the lan stuff. Just to know if you open up a dedicated server and two client you can test stuff out there. If its working there it will work on LAN too. Mostly....