
Knux14
Members-
Posts
51 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
Knux14's Achievements

Stone Miner (3/8)
0
Reputation
-
mmh actually I'm not that done.. I am doing pretty much the same thing, once the player has set it server-side, I send another packet to sync the ExtandedProperties: public IMessage handleClientMessage(final EntityPlayer player, final UpdateClientMessage message, MessageContext ctx) { final Minecraft mc = Minecraft.getMinecraft(); mc.addScheduledTask(new Runnable() { @Override public void run() { System.out.println("Tries to get it"); PlayerProps pp = PlayerProps.get(player); System.out.println("Got it: " + pp.toString()); pp.setName(message.fName, message.lName); pp.setMoney(message.money); } }); return null; } Then I get it at each connect. It works the first time when I set my name, but then as soon as I connect it does nothing. When I take out the task, it kicks me out and the log says that "NullPointerException" on PlayerProps.get I have no clue how to register it since I already do this: @SubscribeEvent public void onEntityConstructing(EntityConstructing evt) { if (evt.entity instanceof EntityPlayer && PlayerProps.get((EntityPlayer)evt.entity) == null) { PlayerProps.register((EntityPlayer)evt.entity); } } NOTE that it does work without problems singleplayer EDIT: Actually, it works some times, and some other it doesn't.. I can't find how to reproduce working / non working. By "Some time" I mean, when I connect, and that it doesn't work, I disconnect and reconnect, untill it works. Tough when I disconnect and reconnect it is not mandatory that it works...
-
This is working indeed, Thank you I haven't modded for a while those thinks looks kinda new to me..
-
Hello, So, recently I started my mod, which is designed to be played multiplayer without any other mod. In this mod, the server send a "OpenGui" Message/Packet, and the client need to open a GUI in which he will put a first name and a last name. Then the client need to send back a "SetName" Message/Packet. Right now I implemented this as is: - PlayerLoggedInEvent detect a player connection. After checking that the world !isRemote, I send a OpenGuiMessage(Login) to the player - When the client receive "OpenGuiMessage(Int)" it opens the Gui "Int" with a simple "mc.displayGuiScreen" The problem is that actually, the Gui pops up just before Minecraft load the render, so a few ms after the screen shows, it closes to have currentScreen == null & GuiIngame. It is not even visible, though my PC got laggy during the connection so I had time to see the GuiScreen poping up then closes.. How can I wait the render has been done to open the Gui (Or opening it directly without showing the Game first) Thanks in advance
-
Yes I know, I already used it, but I don't understand how the packet is supposed to say "THAT entity", how to select MY entity, Because I won't be able to include a whole entity in the packet and I don't think I can have "Update name of Entity at X/Y/Z" Here's my sourcecode: https://github.com/Knux14/Stuffies/tree/master/fr/Knux14/Stuffies
-
Okai so it's now pretty much working. All I do is add if (!w.isRemote) In the interact of the Entity. Now I need to get the name from the server, Am I forced to use packet ? Is there any other ways?
-
ow that would explain everything... I'm gonna try something, I'll let you know
-
Hello everyone, Today I tried to make a boat but I am in front of a problem. Data doesn't works. In the rightclic method I have the username correctly working but if I print the username in the interact method I get "null" Here's my codes: ItemFlycar: https://gist.github.com/Knux14/8887545 EntityFlycar: https://gist.github.com/Knux14/8887547 RenderFlycar: https://gist.github.com/Knux14/8887556 I've tried several different way but nothing is working. Here's what I currently get for ONE right clic: http://screencloud.net/v/52oT I don't understand why the function is triggered twice and why does the first time everything is set to null and not the second... Thanks in advance
-
Okay I found the bug. I was posting the events in the "updateEntity" and "invalidate" methods of the TileEntity. I moved them in the "onBlockAdded" and "breakBlock" events and now it works fine. Thank you
-
I've didn't found where to post EnergyNet has a remove tile entity method that you need to use when the block is broken. It seems that it doesn't contain it, here's my IEnergyNet class: https://gist.github.com/anonymous/8189898 I've found this on google which seems to have it but it also seems to be a bit old: http://atomicstrykers-minecraft-mods.googlecode.com/hg-history/853343e5b365415ccfc8583059ca7bf3d87ba538/PowerConverters/common/ic2/api/EnergyNet.java I have an event which is supposed to do the same as EnergyNet.removeTileEntity() => EnergyTileUnloadEvent but it doesn't work. It is said in the comment that it should do the same as the method but the method doesn't exists anymore: * Every energy tile which wants to get disconnected from the IC2 Energy * Network has to either post this event or alternatively call * EnergyNet.removeTileEntity(). Edit2: If I post the event in breakBlock I have this error when I destroy then replace the block 2013-12-31 00:32:40 [Avertissement] [iC2] EnergyNet.removeTileEntity: fr.Knux14.Electools.TileEntity.TileEntityTeleportBlock@24ed3cfa (fr.Knux14.Electools.TileEntity.TileEntityTeleportBlock@24ed3cfa) wasn't found (added), skipping 2013-12-31 00:32:55 [Avertissement] [iC2] EnergyNet.addTileEntity: fr.Knux14.Electools.TileEntity.TileEntityTeleportBlock@69217a9c (fr.Knux14.Electools.TileEntity.TileEntityTeleportBlock@69217a9c) is conflicting with fr.Knux14.Electools.TileEntity.TileEntityTeleportBlock@24ed3cfa using the same position (already added, prev. te not removed, overlapping), aborting
-
Hello I am making a mod which using the IC2 api bug I got a problem. The tile entity seems not to be removing. Here's my code: https://gist.github.com/anonymous/8188707 I've already tried by using "world.removeBlockTileEntity(x, y, z)" but it's still giving me the same error... When I place the block (Or any IC2 blocks) where I destroyed one of mine, i get this error in the logs: 2013-12-30 22:37:38 [Avertissement] [iC2] EnergyNet.addTileEntity: fr.Knux14.Electools.TileEntity.TileEntityTeleportBlock@85fc923 (fr.Knux14.Electools.TileEntity.TileEntityTeleportBlock@85fc923) is conflicting with fr.Knux14.Electools.TileEntity.TileEntityTeleportBlock@48cdb24 using the same position (already added, prev. te not removed, overlapping), aborting If there is a cable next to this block, even if I break mine, the cable still seems to be connected. Anybody can help me ? Thanks in advance
-
Thanks, it works perfectly!
-
Okay thanks, i've already tried with IConnectionHandler but it does not seems to work serverside (The connect is only clientside) I'll try it right now
-
Hello everyone, I'm searching a way to detect when a player is connecting and when is deconnecting. I've looked in the events but the only one i've found is "playerJoinWorldEvent" which is triggered every time a player is changing dimension ... I didn't managed to find a way to get what i want. Did anybody knows how could I do it ? Thanks in advance
-
Mmh sorry for the doublepost but, I have the world name but I need the Folder... I can't get it by this way and I can't just use the function "makeUsableName" because if the player has renamed the world it won't be the same folder ...
-
By using a coremod: http://www.minecraftforum.net/topic/1854988-tutorial-162-changing-vanilla-without-editing-base-classes-coremods-and-events-very-advanced/ or http://www.minecraftforge.net/wiki/Using_Access_Transformers or By using reflexion: http://tutorials.jenkov.com/java-reflection/index.html Coremod is the way to do because it's Forge based. But reflexion works too.