Jump to content

Recommended Posts

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.

Posted

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

Posted

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.

Posted

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

Posted

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?

Posted

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

Posted

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

Posted

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.

Posted

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

Posted

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.

Posted

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

Posted

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.

Posted

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?

Posted

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.

Posted

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

×   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

    • Hello all. I'm currently grappling with the updateShape method in a custom class extending Block.  My code currently looks like this: The conditionals in CheckState are there to switch blockstate properties, which is working fine, as it functions correctly every time in getStateForPlacement.  The problem I'm running into is that when I update a state, the blocks seem to call CheckState with the position of the block which was changed updated last.  If I build a wall I can see the same change propagate across. My question thus is this: is updateShape sending its return to the neighbouring block?  Is each block not independently executing the updateShape method, thus inserting its own current position?  The first statement appears to be true, and the second false (each block is not independently executing the method). I have tried to fix this by saving the block's own position to a variable myPos at inception, and then feeding this in as CheckState(myPos) but this causes a worse outcome, where all blocks take the update of the first modified block, rather than just their neighbour.  This raises more questions than it answers, obviously: how is a different instance's variable propagating here?  I also tried changing it so that CheckState did not take a BlockPos, but had myPos built into the body - same problem. I have previously looked at neighbourUpdate and onNeighbourUpdate, but could not find a way to get this to work at all.  One post on here about updatePostPlacement and other methods has proven itself long superceded.  All other sources on the net seem to be out of date. Many thanks in advance for any help you might offer me, it's been several days now of trying to get this work and several weeks of generally trying to get round this roadblock.  - Sandermall
    • sorry, I might be stupid, but how do I open it? because the only options I have are too X out, copy it, which doesn't work and send crash report, which doesn't show it to me, also, sorry for taking so long.
    • Can you reproduce this with version 55.0.21? A whole lot of plant placement issues were just fixed in this PR.
    • Necro'ing that thread to ask if you found a solution ? I'm encountering the same crash on loading the world. I created the world in Creative to test my MP, went into survival to test combat, died, crashed on respawn and since then crash on loading the world. Deactivating Oculus isn't fixing it either, and I don't have Optifine (Twilight forest is incompatible)
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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