Jump to content

[SOLVED] GUI not updating values


Melonslise

Recommended Posts

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.

Link to comment
Share on other sites

  • Replies 68
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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.

Link to comment
Share on other sites

* 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.

Link to comment
Share on other sites

* 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

Link to comment
Share on other sites

* 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.

Link to comment
Share on other sites

 

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.

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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




  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • OLXTOTO: Platform Maxwin dan Gacor Terbesar Sepanjang Masa OLXTOTO telah menetapkan standar baru dalam dunia perjudian dengan menjadi platform terbesar untuk pengalaman gaming yang penuh kemenangan dan kegacoran, sepanjang masa. Dengan fokus yang kuat pada menyediakan permainan yang menghadirkan kesenangan tanpa batas dan peluang kemenangan besar, OLXTOTO telah menjadi pilihan utama bagi para pencinta judi berani di Indonesia. Maxwin: Mengejar Kemenangan Terbesar Maxwin bukan sekadar kata-kata kosong di OLXTOTO. Ini adalah konsep yang ditanamkan dalam setiap aspek permainan yang mereka tawarkan. Dari permainan slot yang menghadirkan jackpot besar hingga berbagai opsi permainan togel dengan hadiah fantastis, para pemain dapat memperoleh peluang nyata untuk mencapai kemenangan terbesar dalam setiap taruhan yang mereka lakukan. OLXTOTO tidak hanya menawarkan kesempatan untuk menang, tetapi juga menjadi wadah bagi para pemain untuk meraih impian mereka dalam perjudian yang berani. Gacor: Keberuntungan yang Tak Tertandingi Keberuntungan seringkali menjadi faktor penting dalam perjudian, dan OLXTOTO memahami betul akan hal ini. Dengan berbagai strategi dan analisis yang disediakan, pemain dapat menemukan peluang gacor yang tidak tertandingi dalam setiap taruhan. Dari hasil togel yang tepat hingga putaran slot yang menguntungkan, OLXTOTO memastikan bahwa setiap taruhan memiliki potensi untuk menjadi momen yang mengubah hidup. Inovasi dan Kualitas Tanpa Batas Tidak puas dengan prestasi masa lalu, OLXTOTO terus berinovasi untuk memberikan pengalaman gaming terbaik kepada para pengguna. Dengan menggabungkan teknologi terbaru dengan desain yang ramah pengguna, platform ini menyajikan antarmuka yang mudah digunakan tanpa mengorbankan kualitas. Setiap pembaruan dan peningkatan dilakukan dengan tujuan tunggal: memberikan pengalaman gaming yang tanpa kompromi kepada setiap pengguna. Komitmen Terhadap Kepuasan Pelanggan Di balik kesuksesan OLXTOTO adalah komitmen mereka terhadap kepuasan pelanggan. Tim dukungan pelanggan yang profesional siap membantu para pemain dalam setiap langkah perjalanan gaming mereka. Dari pertanyaan teknis hingga bantuan dengan transaksi keuangan, OLXTOTO selalu siap memberikan pelayanan terbaik kepada para pengguna mereka. Penutup: Mengukir Sejarah dalam Dunia Perjudian Daring OLXTOTO bukan sekadar platform perjudian berani biasa. Ini adalah ikon dalam dunia perjudian daring Indonesia, sebuah destinasi yang menyatukan kemenangan dan keberuntungan dalam satu tempat yang mengasyikkan. Dengan komitmen mereka terhadap kualitas, inovasi, dan kepuasan pelanggan, OLXTOTO terus mengukir sejarah dalam perjudian dunia berani, menjadi nama yang tak terpisahkan dari pengalaman gaming terbaik. Bersiaplah untuk mengalami sensasi kemenangan terbesar dan keberuntungan tak terduga di OLXTOTO - platform maxwin dan gacor terbesar sepanjang masa.
    • OLXTOTO - Bandar Togel Online Dan Slot Terbesar Di Indonesia OLXTOTO telah lama dikenal sebagai salah satu bandar online terkemuka di Indonesia, terutama dalam pasar togel dan slot. Dengan reputasi yang solid dan pengalaman bertahun-tahun, OLXTOTO menawarkan platform yang aman dan andal bagi para penggemar perjudian daring. DAFTAR OLXTOTO DISINI DAFTAR OLXTOTO DISINI DAFTAR OLXTOTO DISINI Beragam Permainan Togel Sebagai bandar online terbesar di Indonesia, OLXTOTO menawarkan berbagai macam permainan togel. Mulai dari togel Singapura, togel Hongkong, hingga togel Sidney, pemain memiliki banyak pilihan untuk mencoba keberuntungan mereka. Dengan sistem yang transparan dan hasil yang adil, OLXTOTO memastikan bahwa setiap taruhan diproses dengan cepat dan tanpa keadaan. Slot Online Berkualitas Selain togel, OLXTOTO juga menawarkan berbagai permainan slot online yang menarik. Dari slot klasik hingga slot video modern, pemain dapat menemukan berbagai opsi permainan yang sesuai dengan preferensi mereka. Dengan grafis yang memukau dan fitur bonus yang menggiurkan, pengalaman bermain slot di OLXTOTO tidak akan pernah membosankan. Keamanan dan Kepuasan Pelanggan Terjamin Keamanan dan kepuasan pelanggan merupakan prioritas utama di OLXTOTO. Mereka menggunakan teknologi enkripsi terbaru untuk melindungi data pribadi dan keuangan para pemain. Tim dukungan pelanggan yang ramah dan responsif siap membantu pemain dengan setiap pertanyaan atau masalah yang mereka hadapi. Promosi dan Bonus Menarik OLXTOTO sering menawarkan promosi dan bonus menarik kepada para pemainnya. Mulai dari bonus selamat datang hingga bonus deposit, pemain memiliki kesempatan untuk meningkatkan kemenangan mereka dengan memanfaatkan berbagai penawaran yang tersedia. Penutup Dengan reputasi yang solid, beragam permainan berkualitas, dan komitmen terhadap keamanan dan kepuasan pelanggan, OLXTOTO tetap menjadi salah satu pilihan utama bagi para pecinta judi online di Indonesia. Jika Anda mencari pengalaman berjudi yang menyenangkan dan terpercaya, OLXTOTO layak dipertimbangkan.
    • I have been having a problem with minecraft forge. Any version. Everytime I try to launch it it always comes back with error code 1. I have tried launching from curseforge, from the minecraft launcher. I have also tried resetting my computer to see if that would help. It works on my other computer but that one is too old to run it properly. I have tried with and without mods aswell. Fabric works, optifine works, and MultiMC works aswell but i want to use forge. If you can help with this issue please DM on discord my # is Haole_Dawg#6676
    • Add the latest.log (logs-folder) with sites like https://paste.ee/ and paste the link to it here  
    • I have no idea how a UI mod crashed a whole world but HUGE props to you man, just saved me +2 months of progress!  
  • Topics

×
×
  • Create New...

Important Information

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