Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

How would you chat a string of text like "Hay usernamehere your version of AdditionalCrafting is out of date." I have a update checker made but how would I chat that string  to tell them.

playerInstance.sendChatToPlayer(String);

 

platerInstance is the player variable you are using xD

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

  • Author

What would I use for a player varable if I want it to say AdditionalCrafting because I don't have a player varable.

 

Sorry but this is my first time with chat stuff.

Where are you calling it? if it is in a class that extends IConnectionHandler in the playerLoggedIn method you do something like this:

 

if(!MainModConfigOrBaseFile.isLatestVersion) {
    ((EntityPlayerMP) player).sendChatToPlayer("Hay " + ((EntityPlayerMP) player).username + " your version of AdditionalCrafting is out of date.");
}

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

  • Author

That's the problem I have nothing that involves that I only have a mod that can tell in a variable if its in date. Is the a tutorial for this stuff?

Look at my MinePG code. Especially this class:

 

https://github.com/ModderPenguin/MinePG/blob/master/source/minepg/rpg_common/rpg/comm/ConnectionHandler.java

 

and for registering it, chuck this in your @Init method:

NetworkRegistry.instance().registerConnectionHandler(new ConnectionHandler());

 

 

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

I would do it using events:

	@ForgeSubscribe
public void VersionChecker(EntityJoinWorldEvent ev) {
	if (ev.entity instanceof EntityPlayer) {
		if (!VersionCheckerClass.isUpToDate) {
			//Get player and send chat message
		}

	}

}

But that's just my opinion

  • Author

Thank you and just so I don't have to make another thread I tryed to spawn a new thread and it won't work because forge does not seem to be yielding its thread.

uhhhh.... What?

 

^^^ Agreed.... What?

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

  • Author

I tryed to multithreaded my mod by putting the update checker that does the checking in its own class that implients runnable so I can do new thread(UC,"updater").Start; and it would run on a second thread it starts the thread but then it stops before it can check my version off my github Version-1.5.txt file.

You do not need a new thread for that. Just use the one that minecraft is already using. There is no need for a new thread.

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

  • Author

I was going to use a new thread because other wise I would need a tick handler of something of that sort so every hour I would output That it was out of date to a server counsel.

Ohhhhhhh......I though we were talking about the player? There are tutorials regarding TickHandlers out there. Is there a reason why you did not want to go that route?

  • Author

Because I know how to use multithreading and I did no want to have to learn something new when I need to get this version out in 2 days to meet my goal of 1.0.0 of additional crafting.

  • Author

Not really because I am not at my pc right now but I can say it is starting the thread but then stops executing it before it runs once fully.

Then your cutting it off before it can fully operate. A flaw with your code or not I am not sure.... As I cannot see it xD

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.