Jump to content

Recommended Posts

Posted

This is not a tutorial on how to use the debugger. Google will help you.

The debugger just allows you to modify code in real time. I don't really understand how that would help me determine if the packets are received.

 

While hotswapping is possible via a debugger, the thing what diesieben probably wants you to do is have a breakpoint in the method that is supposed to be called in the client side, from context I assume onMessage. You check that the values are correct, and if they are not, fix your code until they are.

 

But doesn't a breakpoint just skip a part of code? How would that help?

 

Nope. What a breakpoint does is that it tells your debugger to stop on the line marked by the debugger. Thereafter you can do things such as single-step through your code and inspect variables and their values.

 

A quick google search on your part would have saved me the effort of having to explain breakpoints.

If my post helped you, please press that "Thank You"-button to show your appreciation.

 

Also if you don't know Java, I would suggest you read the official tutorials by Oracle to get an idea of how to do this. Thanks, and good modding!

 

Also if you haven't, set up a Git repo for your mod not only for convinience but also to make it easier to help you.

  • Replies 68
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

A breakpoint stops execution at that point and let's you inspect the values of local variables and fields while the code is paused.

 

 

I don't understand how to examine the variables from here. I can't find any proper tutorial

Posted

A breakpoint stops execution at that point and let's you inspect the values of local variables and fields while the code is paused.

 

 

I don't understand how to examine the variables from here. I can't find any proper tutorial

 

Which line did you put your breakpoint at.

If my post helped you, please press that "Thank You"-button to show your appreciation.

 

Also if you don't know Java, I would suggest you read the official tutorials by Oracle to get an idea of how to do this. Thanks, and good modding!

 

Also if you haven't, set up a Git repo for your mod not only for convinience but also to make it easier to help you.

Posted

* Grabs a rope *

 

Remember that statement about "you are too lazy to learn this shit" - yeah, kinda comes together. Just google java tutorial (official) go step by step with code examples, then go to eclipse usage tutorials (including debugger) and learn that shit - only then - start modding.

 

Aside from that - you can just print to console (System.out) to check if onMessage is being called.

 

Seriously - this is like first thing you learn in java. Just because you "had a  little pascal" or other shit in school doesn't mean you are remotely close to being modder. You need EXTENSIVE java knowledge to write anything beyond basic. Right now you are questioning us on totally basic logical concepts on (spoiler alert) MODDER SUPPORT - which you are not.

 

I am surprised you haven't been burned to death yet :)

 

For you own good (and our sake) please - do some few-days course on java and working in IDEs. >.<

 

Question like that (longest thread in weeks about basic stuff) won't stop if you won't actually learn something.

1.7.10 is no longer supported by forge, you are on your own.

Posted

* Grabs a rope *

 

Remember that statement about "you are too lazy to learn this shit" - yeah, kinda comes together. Just google java tutorial (official) go step by step with code examples, then go to eclipse usage tutorials (including debugger) and learn that shit - only then - start modding.

 

Aside from that - you can just print to console (System.out) to check if onMessage is being called.

 

Seriously - this is like first thing you learn in java. Just because you "had a  little pascal" or other shit in school doesn't mean you are remotely close to being modder. You need EXTENSIVE java knowledge to write anything beyond basic. Right now you are questioning us on totally basic logical concepts on (spoiler alert) MODDER SUPPORT - which you are not.

 

I am surprised you haven't been burned to death yet :)

 

For you own good (and our sake) please - do some few-days course on java and working in IDEs. >.<

 

Question like that (longest thread in weeks about basic stuff) won't stop if you won't actually learn something.

 

Hey don't rage. When this thing with the GUI will be solved I will (probably/hopefully) not show my face around here again

Posted

* Grabs a rope *

 

Remember that statement about "you are too lazy to learn this shit" - yeah, kinda comes together. Just google java tutorial (official) go step by step with code examples, then go to eclipse usage tutorials (including debugger) and learn that shit - only then - start modding.

 

Aside from that - you can just print to console (System.out) to check if onMessage is being called.

 

Seriously - this is like first thing you learn in java. Just because you "had a  little pascal" or other shit in school doesn't mean you are remotely close to being modder. You need EXTENSIVE java knowledge to write anything beyond basic. Right now you are questioning us on totally basic logical concepts on (spoiler alert) MODDER SUPPORT - which you are not.

 

I am surprised you haven't been burned to death yet :)

 

For you own good (and our sake) please - do some few-days course on java and working in IDEs. >.<

 

Question like that (longest thread in weeks about basic stuff) won't stop if you won't actually learn something.

 

Hey don't rage. When this thing with the GUI will be solved I will (probably/hopefully) not show my face around here again

 

The fact that you cannot even Google for some of these things properly kind of tells that you are not ready to mod.

 

You know what, Go through this, and then try modding again. It will teach you the absolute basics about java, and the most basic things you need in modding. That plus learning to Google should be your next objective if you want to continue this exercise. We would not want to be mean to you, but you are not exactly helping with that.

If my post helped you, please press that "Thank You"-button to show your appreciation.

 

Also if you don't know Java, I would suggest you read the official tutorials by Oracle to get an idea of how to do this. Thanks, and good modding!

 

Also if you haven't, set up a Git repo for your mod not only for convinience but also to make it easier to help you.

Posted

 

The fact that you cannot even Google for some of these things properly kind of tells that you are not ready to mod.

 

You know what, Go through this, and then try modding again. It will teach you the absolute basics about java, and the most basic things you need in modding. That plus learning to Google should be your next objective if you want to continue this exercise. We would not want to be mean to you, but you are not exactly helping with that.

 

Will do, but let's just finish what we started.

 

Seriously?

First result on google for "eclipse debugger tutorial": http://www.vogella.com/tutorials/EclipseDebugging/article.html

 

 

It seems that the packet is being received because the value of 'amount' is 30.

Posted

And is the value still there in the GUI?

 

Well it certainly draws "30/30"

 

I updated the GUI and added two ints.

	int currentMana = props.getCurrentMana();
	int maxMana = props.getMaxMana();

	mc.fontRenderer.drawStringWithShadow("§1" + currentMana + "/" + maxMana, 2, 2, 1)

 

and here's the debug:

 

 

It seems that they are still there

 

Posted

I went through your Github repository, and nowhere do I see any mana consumption in any of your items.

If my post helped you, please press that "Thank You"-button to show your appreciation.

 

Also if you don't know Java, I would suggest you read the official tutorials by Oracle to get an idea of how to do this. Thanks, and good modding!

 

Also if you haven't, set up a Git repo for your mod not only for convinience but also to make it easier to help you.

Posted

And you are sure the values are updated on the server? And the server sends packets with the updated values?

I'm sure that they are updated on the server since I set up prints like this in the item:

			ManaProperties props = ManaProperties.get(player);

			if (props.consumeMana(15))
			{
				System.out.println("Player had enough mana. Do something awesome!");
			}
			else
			{
				System.out.println("Player ran out of mana. Sad face.");
				props.replenishMana();
			}

 

and they are displayed correctly.

 

And as you can see in the repo all mana modifying methods have syncMana which sends packets. I have no idea why the GUI is not updated

 

I went through your Github repository, and nowhere do I see any mana consumption in any of your items.

 

ItemScrollFirebolt

Posted

And while answering to diesieb above, answer me this. Why do you sync max mana and current mana in different packets. Why not just use one packet.

If my post helped you, please press that "Thank You"-button to show your appreciation.

 

Also if you don't know Java, I would suggest you read the official tutorials by Oracle to get an idea of how to do this. Thanks, and good modding!

 

Also if you haven't, set up a Git repo for your mod not only for convinience but also to make it easier to help you.

Posted

You did not answer either of my questions.

Not sure if that's what you meant, but I set up a print in the IEEP under the cosumeMana()

public boolean consumeMana(int amount)
{
	if(this.currentMana >= amount)
	{
		this.setCurrentMana(this.currentMana - amount);
		System.out.println(currentMana);
		return true;
	}
	else
	{
		return false;
	}
}

 

seems to be working correctly

 

(I'm not updating the repo rn)

Posted

And then the packet with the updated value arrives on the client?

 

Well obviously because I have already debugged that.

 

EDIT: Actually I didn't debug the updated value. I'll check that tomorrow (don't have time right now)

Posted

I have 2 packets because I don't know how  to store 2 variables in one packet (I know I am retarded).

 

Holy fuck.  It's exactly like sending a packet with one variable, except there are two variables.

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

And then the packet with the updated value arrives on the client?

Aright, I set up this print in the handler for the message:

@Override
public IMessage onMessage(CurrentManaMessage message, MessageContext ctx) 
{
	EntityPlayer player = RunicInscription.proxy.getClientPlayer();

	int amount = message.getCurrentMana();

	System.out.println(amount);

	ManaProperties props = ManaProperties.get((EntityPlayer) player);

	props.get(player).setCurrentMana(amount);


	return null;
}

 

It seems that the correct values are coming through. I still don't understand why the GUI is not picking up the values.

Posted

Just to end this thread I can help you via TeamViewer - debugging from github/source is kinda pointless (something is being missed here).

If you want that help send connection info here or on Skype: ernio333

 

Seriously, this thread will otherwise continue for next 4 pages and it alredy took exponentially more time (mine and others) than time needed to just do it myself.

1.7.10 is no longer supported by forge, you are on your own.

Posted

Follow-up:

 

Main reason was he fucked up getCurrentMana() which returned this.maxMana.

Other than that - a lot of global mistakes and conventional miss-doings - everything fixed.

 

Shit... should have done it yesterday.

 

I guess solved.

1.7.10 is no longer supported by forge, you are on your own.

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.