Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

FLUFFY2

Forge Modder
  • Joined

  • Last visited

Everything posted by FLUFFY2

  1. First of all, thanks for the answer! I keep doing this line by line checking. I can't even say how many times. By not working i mean the .worldObj form the serverHandler() in my packet what is sent to the server is not doing what i expect. I have a dynamiclight system, what works by the folloving(): In my CLIENT tickhandler i get the player x, y, z pos when the right item is held and send that info to the server. If the player moves(chages x, y, z cord) it updates and sends the packet again with the new pos. In the packethandler(SimpleMessageWrapper) i get those positions and creates a light block at the player. By moving it gets updated. This is what i expect it shoud do. My problem is its not doeing anything what has any contact with the world. None of the world.methods are working. The wierd thing is if i get the player by: ctx.getServerHandler.playerEntity its working for both sides. I know this because i have a keyhandler what send packet to server and changes the player item. Tested it on client and server and both of them is working. I expected if i put .worldObj at the and of it it will work the same. But its not. The client don't creates the light and the server kick me out because of some internal error. If you need all my code thats part of this problem just tell me.
  2. -.- I already know i cant use client world for the server. I mentioned that before your post. And if you read what i posted, the link you sent me was aleady there by TGG. And i said its not working! Read, please!
  3. Kwibble: The client isnt crashes! The server crashes if i use: World wolrd = FMLClientHandler.instance().getClient.theWorld. It know why its crashing don`tmexplain it! But if i test it on my client what not crashes i see its working. Diesieben: You are close, but no. I want to send a packet from cliemt tickhandler to the sever(it can be a differen machine). Server recieved the packet and get the server world. Than place down a block to the world. Just to make it simple: Client side|Server side Getting Client world: Work|Crash(Understandable why) Getting Server world: Not work|Server keeps kicking out when the block should be placed.(wierd huh?) I know there is no more single player now in minecraft. It opens an internal server. So if i get the server world and place a block with that it should appear on client. And if i open a server up and send the packet it should apperar for everyone. I DON`T need client world because it crash te server. Hope everyone can understand this. Thanks!
  4. You are lost the line, right? My setLightValue and updateLight code is working i tested it with getting the client world. But client world is crahing the server so i have to use ctx.getServerHandler().playerEntity.worldObj. It should place the block on the server world and appear on my client. The problem is its dosen`t. No worries im confused about this too.
  5. There is no problem with my code trust me. If i get the client world it will work but only for client. Server will obviously crash.
  6. It only sent to the server and my problem is its not working with the server handler. I tryed it out with that first, but its not worked. So it has to work but its not? I spawning the block in server but its not appearing in my client. Im just getting confused right now.
  7. Le me explain it! I have a client tickhandler what creates and send data to the server via pakets(messages). I used Netty in 1.7.2 and it was worked perfectly, but pakets are leaked what causes memory leakings. I heard about SimpleNetworkWrapper so i updated to it. Now its stopped working. The pakets has been sended to the server, but it has no effect on the client. Thats because i can't get the WORLD for both SERVER side and CLIENT side. I can get it for client or server only. .worldObj is working but for server only. I tryed what GreyGhost said, to check for the sides and get the world for client or server. The only problem its not detecting the client side because i sent the paket to the server. I set the reciever side to server. So i can't get it working to detect the client side. Here is my code: Registration(preInit): snw.registerMessage(Light1MessageHandler.class, Light1MessageHandler.class, 3, Side.SERVER); Packet send: Amnesia.snw.sendToServer(new Light1MessageHandler(playerPosX, playerPosY, playerPosZ, lastPlayerX, lastPlayerY, lastPlayerZ)); The message handler: [spoiler] package com.fluffy.amnesia.pakets; import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.World; import com.fluffy.amnesia.Amnesia; import cpw.mods.fml.client.FMLClientHandler; 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; public class Light1MessageHandler implements IMessage, IMessageHandler<Light1MessageHandler, IMessage> { int x; int y; int z; int oldX; int oldY; int oldZ; public Light1MessageHandler() { } public Light1MessageHandler(int x, int y, int z, int oldX, int oldY, int oldZ) { this.x = x; this.y = y; this.z = z; this.oldX = oldX; this.oldY = oldY; this.oldZ = oldZ; } @Override public void toBytes(ByteBuf buf) { buf.writeInt(this.x); buf.writeInt(this.y); buf.writeInt(this.z); buf.writeInt(this.oldX); buf.writeInt(this.oldY); buf.writeInt(this.oldZ); } @Override public void fromBytes(ByteBuf buf) { this.x = buf.readInt(); this.y = buf.readInt(); this.z = buf.readInt(); this.oldX = buf.readInt(); this.oldY = buf.readInt(); this.oldZ = buf.readInt(); } @Override public IMessage onMessage(Light1MessageHandler message, MessageContext ctx) { EntityPlayer player = ctx.getServerHandler().playerEntity; World world; if (ctx.side == Side.CLIENT) { world = FMLClientHandler.instance().getClient().theWorld; } else { world = ctx.getServerHandler().playerEntity.worldObj; } world.setLightValue(EnumSkyBlock.Block, message.x , message.y, message.z, Amnesia.instance.getLanternLightValue()); updateLight(world, message); return null; } public void updateLight(World world, Light1MessageHandler message){ //Middle world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y, message.z); world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y, message.z); world.updateLightByType(EnumSkyBlock.Block, message.x, message.y + 1, message.z); world.updateLightByType(EnumSkyBlock.Block, message.x, message.y - 1, message.z); world.updateLightByType(EnumSkyBlock.Block, message.x, message.y, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x, message.y, message.z - 1); //Side world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y + 1, message.z); world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y - 1, message.z); world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y + 1, message.z); world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y - 1, message.z); world.updateLightByType(EnumSkyBlock.Block, message.x, message.y + 1, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x, message.y - 1, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x, message.y + 1, message.z - 1); world.updateLightByType(EnumSkyBlock.Block, message.x, message.y - 1, message.z - 1); //Corner world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y + 1, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y - 1, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y + 1, message.z - 1); world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y - 1, message.z - 1); world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y + 1, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y - 1, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y + 1, message.z - 1); world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y - 1, message.z - 1); //Middle-Side world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x - 1, message.y, message.z - 1); world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y, message.z + 1); world.updateLightByType(EnumSkyBlock.Block, message.x + 1, message.y, message.z - 1); } } [/spoiler] [code] Thanks for helping!
  8. I just updated to the latest 1.7.10 Forge and there is no such ting as .getHandler()! Lex might want to say get the proper handler and its not a new method.
  9. So i tryed what GrayGhost said and its not working. The problem with that im sending the packet to the SERVER so i cant detect the CLIENT side. For diesieben, if ctx.getServerHandler().playerEntity.worldObj should work for both side, that it why not? It a bug or what? Thanks for helping guys i realy appreciate it!
  10. .wordObj somehow dosen't work on client side! It refuses to do what i want. That wierd because in Netty i can do that and its worked. Minecraft.getMinecraft().theWorld is work, but it will crash the server because its not SERVER side. I try what GreyGhost said!
  11. Its still the same. You just created a harder way of .worldObj.
  12. Hello, I made a working SimpleNetworkWrapper, but the only problem is i can only get the player from MessageContext. I tryed useing .worldObj but thats not work in client. What is understandable. I can't use FMLClientHandler to get the world because it will crash the server, but thats working in client. Can someone help me out? Some info: The packet is created client side and send to server. I also have a keyhandler what sends a packet to the server and changes the player item, what is workning both side. Thanks for helping!
  13. Yeah, i already changed it, but thank you.
  14. Ohhhhh my bad.... This shoud work now. New code: public class ConnectionHandler { @SubscribeEvent public void onClientConnection(ClientConnectedToServerEvent event){ Amnesia.snw.sendToAll(new SettingsMessageHandler()); } } Im just using this for registering: FMLCommonHandler.instance().bus().register(new ConnectionHandler()); Thanks for opening my eyes!
  15. Okey, thanks! So far i made: package com.fluffy.amnesia.handler; import com.fluffy.amnesia.Amnesia; import com.fluffy.amnesia.pakets.SettingsMessageHandler; import net.minecraft.network.INetHandler; import net.minecraft.network.NetworkManager; import net.minecraft.network.play.INetHandlerPlayClient; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.network.FMLNetworkEvent; public class ConnectionHandler extends FMLNetworkEvent { public ConnectionHandler(INetHandler thing, Class type, NetworkManager manager) { super(thing, type, manager); } @SubscribeEvent public void onClientConnection(ClientConnectedToServerEvent event){ Amnesia.snw.sendToAll(new SettingsMessageHandler()); } } There is a problem with the constructer because FMLNetworkEvent(stuffs...) is not visible. Also i can use FMLCommonHandler to register it or there is something special for that? Thanks!
  16. Hello, Looks like IConnectionHandler is dissapeared in 1.7 and i still need something like that. I searched but didn't find anything same like that. Whats the new IConnectonHandler in 1.7.10? How can i register that class? Because NetworkRegistry.instance().registerConnectionHandler is also dissapeared. Thanks!
  17. Looks like i found out the problem. Netty is outdated. I have to use SimpleNetworkWrapper.
  18. I don't remember and i deleted my 1.7.2 forge workspace. But for sure it was an outdated version.
  19. Oh, yeah so why is that: -1.7.2 with 151 mods work great. -1.7.10 with forge only laggs? While modding i tested it i moved my src so there is no mod running and its still crappy. Again thats not happend in 1.7.2. Before anyone saying i have a bad computer: Intel Q9400 overclocked to 3.0GHZ 6GB ram GTX 570 1GB Thats more than enough for minecraft. I want my mod from 1.7.2 to 1.7.10 so im not gonna stay at 1.7.2! I might just wait for a Forge guy to tell me its a bug or not. If its not then whats the problem?
  20. Well, thats new to me. I can't roll back coz 1.7.10 dosen't realy have much versions now(3 only). I saw when i generate a new world my consol spamming me about chunk generation is took around 130ms. Im a modder and just want to update to .10 but looks like have to wait till this gets fixed. Befor anyone say i know forge for .10 is an early build. Im just telling there is something wrong.
  21. Hi, I have a dynamic light mod what gets the info from client tick handler and send a paket to the server to create the light. If the player moves its repeat the process. Now in 1.7.10 i got a serious memory leak with a good amount of lag. In 1.7.2 thats not happend! And the overall FPS is dropping down from ~200 to ~80 while moveing WITHOUT any dynamic light, just vanilla minecraft. Somethings mayebe up with chunk updates? Im reporting it to here since i dont have this problem in .2 and the code don't changed.
  22. I can create my own faceEntity method coz some methods in EntityLiving is private. I don't want to use Acess Transformer. .canEntityBeSeen is just raytraceing between two entity, checking if there is any block. Anyway thanks for trying to help me.
  23. Thats good to know actually, thanks!
  24. What i understand its "override" a method to modify the existing one. If the method is good for you than don't "override" it. The code i posted is good for what Deanford want so he don't have to override the original method. Important tough not use @Override if you don't know what is that. Can't tell you that more simpler, but learning Java is free.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.