Jump to content

Recommended Posts

Posted

Hey guys,

 

After much help in the last thread I've managed to get my packet system working. My ATM will now dispense money depending on if the player has enough in their account, so it's almost ready for a release :)

 

However, I do have 3 minor bugs.

 

The first is with my PIN verification. The PIN features aren't complete yet anyway, but I'm trying to set it up so after 3 incorrect tries, it confiscates the debit card. I've got everything working, except a graphical issue with the client where there's a ghost card left behind.

When right-clicking the floor (or anything else) with the card, it vanishes - but if I try and right-click the ATM itself with the ghost card, I crash. Upon restarting, it has vanished, but crashes aren't good.

 

I figure an easy fix for this would be some sort of "force update" for the client inventory, which I could run after removing the card. Is there such a thing?

 

 

The second issue is to do with how my GUI system works. I've set up a number of "stages", which are altered by button presses. However, it seems that sometimes the buttons "double-click".

For example, say on stage 1 a button progresses to stage 2, and on stage 2 the same button progresses to stage 3 - if I click the button on stage 1, it skips straight to stage 3.

Is there some way of me preventing this? Maybe putting a brief hold on how often the player can click a button?

 

 

The final issue isn't as much related to the ATM - but I have a mob. Everything works fine in single player, but on servers the spawn egg doesn't seem to work. I figure this is due to my EntityRegistry, which adds the spawn egg, being in the client proxy - but that's the only way I know how to do it. Does anyone know how I can fix this issue?

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Posted

Sounds like you're deleting the card on the server and not sending the change to the client or vice versa.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Sounds like you're deleting the card on the server and not sending the change to the client or vice versa.

 

But then we're back to the age-old issue. I'm sending it from my GUI which has no player instance in the method, so I can't send a packet to the client (not to mention that it's already client-side...)

Currently the packet is being sent to the server. Any ideas how I could get it client-side without Player?

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Posted

player.inventory.onInventoryChanged() ?

 

You can override mouse events in gui, but...i don't think buttons "double click" that often. Are you sure you are only changing "stage" once ?

 

Entity, Item, Block, all should be registered on both sides. They are not client side only.

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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