
Zer0HD2
Members-
Posts
127 -
Joined
-
Last visited
Everything posted by Zer0HD2
-
Basic first version is done. After registering an account you can add new fields and functions to your heart's content. Working on edit/delete functionality now. http://mcforge-reference.com/
-
[1.7.2] ExtendedEntityProperties not saving correctly.
Zer0HD2 replied to Zer0HD2's topic in Modder Support
Yep, that fixed it, thank! Updated to the latest version. -
*cough* already working on that.
-
Heh, I am the same, that's why I said I might do it. But I am not sure if it's not already being worked on, plus I don't want to start yet another project But if you want I can work on it with you, I might do the hosting as well. Contact me via PM if you want. Will do - already started thinking about how to do this and drafting it on my web server I'll PM you about it once I've sorted a couple of things out.
-
Give me a shout if you need a hand with that, I've created similar systems in the past (former web dev). Could make a system where a user searches for a field or function, and if it exists, it'll display all the information stored about that function. Possibly with a user system so certain people can add/edit entries in the database
-
[1.7.2] ExtendedEntityProperties not saving correctly.
Zer0HD2 replied to Zer0HD2's topic in Modder Support
Ah - so it's currently trying to update the values on the client side? That would explain why it gets quite upset when I try to send a packet to the client from that method... I did set Side.SERVER when registering the packet, but I'll try changing the player variable to what you suggested. Edit: Nope. It now throws NPEs on that line in the message handler. Changed it to: EntityPlayer player = ctx.getServerHandler().playerEntity; Error: [01:43:59] [server thread/ERROR] [FML]: There was a critical exception handling a packet on channel mchardcore java.lang.NullPointerException at com.zer0.hardcore.packets.UpgradeStatPacketHandler.onMessage(UpgradeStatPacketHandler.java:18) ~[upgradeStatPacketHandler.class:?] at com.zer0.hardcore.packets.UpgradeStatPacketHandler.onMessage(UpgradeStatPacketHandler.java:1) ~[upgradeStatPacketHandler.class:?] at cpw.mods.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:33) ~[simpleChannelHandlerWrapper.class:?] at cpw.mods.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:13) ~[simpleChannelHandlerWrapper.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[simpleChannelInboundHandler.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[MessageToMessageDecoder.class:?] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) ~[DefaultChannelPipeline.class:?] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:?] at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:80) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:232) [NetworkManager.class:?] at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) [NetworkSystem.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:720) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:608) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:746) [MinecraftServer$2.class:?] Line 18 is the one I pasted above. Line 1 is my package :L -
[1.7.2] ExtendedEntityProperties not saving correctly.
Zer0HD2 replied to Zer0HD2's topic in Modder Support
Does anyone have any more ideas on this problem? I'm pretty stuck on it now. -
[1.7.2] ExtendedEntityProperties not saving correctly.
Zer0HD2 replied to Zer0HD2's topic in Modder Support
So I can't send the property update packet when a player modifies a skill - it gets pretty upset and gives me the "Fatal error, connection terminated" error. Officially stumped. -
[1.7.2] ExtendedEntityProperties not saving correctly.
Zer0HD2 replied to Zer0HD2's topic in Modder Support
Thanks for the tip, I'll do that when I get home. I did have some stuff printing to the console, and the stat values do change, they just don't save. I also send the whole tag in the packet sent in the extended properties class. Perhaps the tag data is being saved before the stat is updated? Sorry for slow replies and stuff, writing this on my phone. -
[1.7.2] ExtendedEntityProperties not saving correctly.
Zer0HD2 replied to Zer0HD2's topic in Modder Support
The only thing I can think of right now is that there's an issue syncing between client and server. An I on the right track? -
[1.7.2] ExtendedEntityProperties not saving correctly.
Zer0HD2 replied to Zer0HD2's topic in Modder Support
My second point was slightly wrong, the skill levels don't reset, but the points do. -
Well, one problem solved creates 2 more, I guess. I've created a levelling system (as some people will know, I've posted enough issues about it on here), where a player gains levels by killing mobs. I decided to add in a system using stats, where the player gets skill points for levelling up, and can spend them on those stats. I have the GUI working, I have the buttons working, and the stats SEEM to update when you click the button, but there are a few issues; 1. When you log out, you get back all the skill points you spent, and all stats reset to 1 2. Same thing happens when you level up 3. (least important) Can't figure out how to remove the buttons (for adding points) when your skill points hit 0. They disappear when you close and re-open the GUI though. Relevant class files: ExtendedProperties (Yes, I know I am still using data watchers, working on a system that doesn't use them): https://gist.github.com/Zer0HD/a71170366ac1ccb29313 GUI: https://gist.github.com/Zer0HD/689cee94b0fcfbe3c613 Packet (sent when adding skill point): https://gist.github.com/Zer0HD/88f580b107bffc8105c3 Handler for said packet: https://gist.github.com/Zer0HD/8f8ce1d753694684b630 If any other code is required, please let me know. Thanks, Zer0
-
Ah, yeah, derp... Forgot about that, thanks!
-
Hi, So I've created a GUI that opens on a keypress. The GUI contains 4 buttons, which send packets to the server. However, upon clicking one of the buttons, it registers ~50 clicks on it. My GuiScreen class: https://gist.github.com/Zer0HD/df2d3302d9bdea90347d Sidenote: My packets are being sent, received and processed correctly, as it is outputting to the console at each step. This is my console upon clicking a button: Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent Packet sent (and an equal number of messages after that saying the packet was received and that the stat had been updated)
-
My advice would be to research how to create a custom furnace and go from there (changing the GUI, recipes, fuel, whatever you need to change). Once you learn how a furnace works, modifying it to make different machines isn't that difficult.
-
Thanks, that's fixed the crash - just getting another person to test whether this is correctly updating the name tags. EDIT: Just got another person to test, the name tags are updating correctly now, thanks!
-
Been working on this for a while, and any server I test it on now crashes with the following error: Line 65 is me registering the sync packet: network.registerMessage(LevelSyncHandlerMP.class, LevelSyncMP.class, 1, Side.CLIENT); Message: https://gist.github.com/Zer0HD/f0e535ca03f5201d1d9b Handler: https://gist.github.com/Zer0HD/60aeb41dac86357dad44
-
Yep, sending button ID as a byte is how I got it working.
-
Take a look at FurnaceRecipes.class. You want to create a similar thing with the recipes you want used in your machine, then reference that file in the canSmelt() method of your tile entity.
-
OH! Christ, I'm dumb sometimes. Also, what sort of issues will the world field cause? I've removed it, I'm just curious.
-
So... are we meant to guess how you're registering this block, or are you going to give some code?
-
Alright, so far my MessageHandler looks like this: public class LevelSyncHandlerMP implements IMessageHandler<LevelSyncMP, IMessage> { private World world = Minecraft.getMinecraft().theWorld; private EntityPlayer player; @Override public IMessage onMessage(LevelSyncMP message, MessageContext ctx) { this.player = (EntityPlayer)world.getEntityByID(message.entityId); ExtendedPlayerProperties properties = ExtendedPlayerProperties.fetchProperties(player); return null; } } Are you saying that I should set the level of the player who's ID I sent in the packet to the value that I sent? Because that seems sort of pointless. If not, sorry, I've been at work all day so I can't brain right now.
-
Yep, I've got the player from the ID, I'm just not sure where to go from here: Packet: public class LevelSyncMP implements IMessage { public int level, entityId; public LevelSyncMP() {} public LevelSyncMP(int level, int entityId) { this.level = level; this.entityId = entityId; } @Override public void fromBytes(ByteBuf buf) { this.level = buf.readInt(); this.entityId = buf.readInt(); } @Override public void toBytes(ByteBuf buf) { buf.writeInt(level); buf.writeInt(entityId); } } MessageHandler: public class LevelSyncHandlerMP implements IMessageHandler<LevelSyncMP, IMessage> { private World world = Minecraft.getMinecraft().theWorld; private int entityId, level; private EntityPlayer player; private String username; @Override public IMessage onMessage(LevelSyncMP message, MessageContext ctx) { this.level = message.level; this.entityId = message.entityId; this.player = (EntityPlayer)world.getEntityByID(this.entityId); this.username = this.player.getCommandSenderName(); return null; } }
-
Alright, so I have a packet which sends the entityId of the player and their level, but what exactly do you mean by updating the player properties? Sorry for all the questions, this is the only thing I don't quite understand ._.
-
So just send a packet with two variables, level and entityId? Seems simple enough. The problem I'm having is that I can't see how to update the user's name tag from this.