Posted November 6, 201312 yr The mod will be changing the player's sleep behavior and I can do most magic using Forge. There's however code in the EntityPlayer.onUpdate() that needs to be disabled. Now hacking away in the pre-tick I can change the World.skylightSubtracted to force isDaytime() to return false and restore it in the post-tick. I just don't know enough about MineCraft to go and do something like that. Are there multiple threads that might want to access the World.skylightSubtracted? I'm pretty sure there would be, or at least there should be. I've read before that minecraft it's not multi-threaded which should make the skylightSubtracted 'hack' safe. Any input welcome before I break something. if (!this.worldObj.isRemote) { if (!this.isInBed()) { this.wakeUpPlayer(true, true, false); } // else if (this.worldObj.isDaytime()) <---- this code // { // this.wakeUpPlayer(false, true, true); // } I'm back playing!
November 6, 201312 yr Hi You might find these links interesting http://greyminecraftcoder.blogspot.com.au/2013/10/the-most-important-minecraft-classes.html http://greyminecraftcoder.blogspot.com.au/2013/10/client-side-class-linkage-map.html http://greyminecraftcoder.blogspot.com.au/2013/10/server-side-class-linkage-map.html http://greyminecraftcoder.blogspot.com.au/2013/10/client-server-communication-using.html -TGG
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.