-
Posts
2638 -
Joined
-
Last visited
-
Days Won
4
Everything posted by Ernio
-
One packet = one handler. This is best practice. It is possible to have bipolar packets. Simply register same packet and same handler (or different) to proper sides (Side.CLIENT and Side.SERVER). (CLIENT) ItemStack use -> send packet 1 -> (SERVER) receive packet 1 -> handle packet 1 (using assigned Side.SERVER handler) -> within handler send packet to client -> send packet 2 -> (CLIENT) receive packet 2 -> handle packet 2 (using assigned Side.CLIENT handler) -> end. Now - as of 1.8.9, quote: Basically - don't return response packet, just send it like you normally would. If you don't get it yet - http://greyminecraftcoder.blogspot.com.au/2015/01/thread-safety-with-network-messages.html WHATEVER you do, you always do it from MC threads - that includes response packets. EDIT So direct answer for your questions: 1. One handler = one action. You can have one packet for server->client and client->server, but in this case you will always need 2 handlers or one handler with if statements (each for one side). 2. Yes - packet handler is the one that will be changing data on proper side. You can modify currently opened gui, some static fields, really anything, as long as you can access it somehow. Note: Do everything from Runnable() posted to MC thread.
-
To make mod Server only you: * Add: "serverSideOnly = true" in @Mod - mod will be only loaded by Dedicated server. * Mark all (I think you can even mark @Mod, but idk) your classes with @SideOnly(Side.SERVER) - classes will be present only on dedicated server. Note: Both those things are not needed, but are rather a good practice. Now what is needed: * You need to make server allows un-modded clients. To do that: * Add "acceptableRemoteVersions = "*"" to @Mod OR * Add method with @NetworkCheckHandler annotation in your @Mod class. How to is described in docs. As to how to do things to entities: @SubscribeEvent to WorldTickEvent (unless you want other trigger like cmd), pick event.phase (event is fired twice per tick). You will probably want some iterative integer counter and execute actual code once per e.g: if (counter % 10000 == 0). Note: counter needs to be per-world. You can use world's local time (every world has timer). The actual code will need to acces: event.world.loadedEntityList. You can iterate over them, check instances and remove what you like. Do NOT remove them from list. Use entity.setDead(). Note: Everything I mentioned and didn't explain can be found on google (e.g: usage of events etc.) Some names/methods may vary on version.
-
Yes it is possible to use Java 8. I am only using it to get those sweeeet default methods in interfaces. Very nice for APIs. I have no clue what you are after regarding efficiency of Java 8 - are you asking about only lambda/stream? I woudln't say they are any faster than any other design choice (depends, they are often slower) - because that's what the are - design choice. Should you use them? If you design requires it, sure, why not. Is there a reason for using Java 8? Well - MC is targeting 6, anything above will require ppl who run your mod to have proper Java. Some ppl are lazy (to update), but that is their loss... P.S: To compile against 1.8 add this to build.gradle: sourceCompatibility = 1.8 targetCompatibility = 1.8
-
[1.9][BUG][FIXED] EntityJoinWorldEvent not always called!
Ernio replied to Ernio's topic in Support & Bug Reports
Sorry for whining (I know it takes time for devs), but I got to ask - does anyone care about this enough to make fix in near future? This is seriously a matter of putting additional statement inside WorldServer#loadEntities if statement. I'd do it myself if I knew how to make patches. Thanks to this someone -
When will people learn to look into vanilla. Enough of my whining: VertexBuffer For examples lookup Gui.class
-
Are you calling this on server? (!world.isRemote)
-
Since this is client side mod - the world on your client (Minecraft#theWorld) is only part of world you see. It will only ever "contain" entities (including players) that you actually see (in view range). This list is available in World#getLoadedEntityList(). Only those entity instances exist on clients. For players there is exception - you don't have their instances, but you hold their profiles. We are talking about "tab" player list. Lookup GuiPlayerTabOverlay.
-
I am very interested in "glow" keyword. Do you mean: * Produce light like torch * Brighter texture * "Actually" glow, something like: I am now looking for a way to make my crystals "really" glow with effect kinda like on this image. Should probably post new thread, but - is it possible without TESR?
-
[1.9][BUG][FIXED] EntityJoinWorldEvent not always called!
Ernio replied to Ernio's topic in Support & Bug Reports
I think that I tracked down the problem: World#loadEntities is calling EntityJoinWorldEvent. WorldServer#loadEntities is not (override) - Unless I am missing something - this is the change in 1.9. EDIT https://github.com/MinecraftForge/MinecraftForge/issues/2685 -
Anything beyond 64 will cause a lot of bugs. Literally everywhere. You would need coremod with many changes to base classes to override it.
-
This issue is based on problems described in http://www.minecraftforge.net/forum/index.php/topic,37869.0.html Note: Reading thread is not really neccesary (I'll cover it here). So I've analised problem deeper with test mod and cleanest launch possible and in result I can present you with instructions on how to replicate problem and why is it "that" bad for (probably) not just my mod. 1. This is NEW issue. As described in 1st link it DID NOT occur in past using same code. 2. Problem is in fact that when some (described later) prerequisites are fulfilled - game starts to act DIFFERENTLY. If this is not a bug, then I don't know what is. 3. How to replicate: Prerequisites: * Clean server launch (no world) * Use this source: (comments) @Mod(modid = "Test", name = "Test", version = "1") public class Test { @Instance("Test") public static Test INSTANCE; @EventHandler protected void preInit(FMLPreInitializationEvent event) { MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent public void onEntityAttachCapabilities(AttachCapabilitiesEvent.Entity event) { // check for "not-player" is needed. This event is called from constructor where player.toString() is not possible // entity.toString() is possible and will return proper entityName and entityId (rest, as in coords, is equal to 0) if (event.getEntity() instanceof EntityLivingBase && !(event.getEntity() instanceof EntityPlayer)) { System.out.println(event.getEntity() + " ATTACH"); } } @SubscribeEvent public void onEntityJoinWorld(EntityJoinWorldEvent event) { if (event.getEntity() instanceof EntityLivingBase) { System.out.println(event.getEntity() + " JOINED"); } } @SubscribeEvent public void onPlayerStartTracking(PlayerEvent.StartTracking event) { if (event.getTarget() instanceof EntityLivingBase) { System.out.println(event.getTarget() + " TRACKING"); } } } How this code ALWAYS worked in past: ATTACH -> JOINED -> TRACKING As of "some" (unknown to me) change this is no longer a case in ALL situations. Replicating: 1. Launch your clean server once, wait until you get "Done" print: [server thread/INFO]: Done (3,412s)! For help, type "help" or "?" Notice: * During clean server startup you should get prints: [server thread/INFO] [FML/]: Loading dimension 0 (world) (net.minecraft.server.dedicated.DedicatedServer@ff2f633) [server thread/INFO] [FML/]: Loading dimension 1 (world) (net.minecraft.server.dedicated.DedicatedServer@ff2f633) [server thread/INFO] [FML/]: Loading dimension -1 (world) (net.minecraft.server.dedicated.DedicatedServer@ff2f633) [server thread/INFO] [sTDOUT/]: [Test:onEntityAttachCapabilities:31]: EntitySheep['Sheep'/0, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT/]: [Test:onEntityJoinWorld:40]: EntitySheep['Sheep'/0, l='world', x=-144,50, y=63,00, z=405,50] JOINED [server thread/INFO] [sTDOUT/]: [Test:onEntityAttachCapabilities:31]: EntityChicken['Chicken'/1, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT/]: [Test:onEntityJoinWorld:40]: EntityChicken['Chicken'/1, l='world', x=-85,50, y=63,00, z=332,50] JOINED [server thread/INFO] [sTDOUT/]: [Test:onEntityAttachCapabilities:31]: EntityChicken['Chicken'/2, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT/]: [Test:onEntityJoinWorld:40]: EntityChicken['Chicken'/2, l='world', x=-82,50, y=63,00, z=336,50] JOINED [server thread/INFO] [sTDOUT/]: [Test:onEntityAttachCapabilities:31]: EntityCow['Cow'/3, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT/]: [Test:onEntityJoinWorld:40]: EntityCow['Cow'/3, l='world', x=-83,50, y=64,00, z=381,50] JOINED [server thread/INFO] [sTDOUT/]: [Test:onEntityAttachCapabilities:31]: EntityCow['Cow'/4, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT/]: [Test:onEntityJoinWorld:40]: EntityCow['Cow'/4, l='world', x=-82,50, y=64,00, z=381,50] JOINED [server thread/INFO] [sTDOUT/]: [Test:onEntityAttachCapabilities:31]: EntityCow['Cow'/5, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT/]: [Test:onEntityJoinWorld:40]: EntityCow['Cow'/5, l='world', x=-86,50, y=64,00, z=382,50] JOINED [server thread/INFO] [sTDOUT/]: [Test:onEntityAttachCapabilities:31]: EntityCow['Cow'/6, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT/]: [Test:onEntityJoinWorld:40]: EntityCow['Cow'/6, l='world', x=-78,50, y=66,00, z=386,50] JOINED [server thread/INFO] [sTDOUT/]: [Test:onEntityAttachCapabilities:31]: EntityCow['Cow'/7, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT/]: [Test:onEntityJoinWorld:40]: EntityCow['Cow'/7, l='world', x=-75,50, y=66,00, z=383,50] JOINED [server thread/INFO] [sTDOUT/]: [Test:onEntityAttachCapabilities:31]: EntityCow['Cow'/8, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT/]: [Test:onEntityJoinWorld:40]: EntityCow['Cow'/8, l='world', x=-75,50, y=66,00, z=381,50] JOINED [server thread/INFO] [sTDOUT/]: [Test:onEntityAttachCapabilities:31]: EntityCow['Cow'/9, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT/]: [Test:onEntityJoinWorld:40]: EntityCow['Cow'/9, l='world', x=-76,50, y=66,00, z=385,50] JOINED // Until DONE print. * As you can see - entities are constructing and then joining world. Like it was in past. 2. Stop the server. 3. Launch server again. As of now - launch is not clean and the world will be loading. Notice: * You will get prints more like this: [server thread/INFO] [FML]: Loading dimension 0 (world) (net.minecraft.server.dedicated.DedicatedServer@2d08c71) [server thread/INFO] [FML]: Loading dimension 1 (world) (net.minecraft.server.dedicated.DedicatedServer@2d08c71) [server thread/INFO] [FML]: Loading dimension -1 (world) (net.minecraft.server.dedicated.DedicatedServer@2d08c71) [server thread/INFO]: Preparing start region for level 0 [server thread/INFO] [sTDOUT]: [Test:onEntityAttachCapabilities:32]: EntitySheep['Sheep'/0, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT]: [Test:onEntityAttachCapabilities:32]: EntityChicken['Chicken'/1, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT]: [Test:onEntityAttachCapabilities:32]: EntityChicken['Chicken'/2, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT]: [Test:onEntityAttachCapabilities:32]: EntityCow['Cow'/3, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT]: [Test:onEntityAttachCapabilities:32]: EntityCow['Cow'/4, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT]: [Test:onEntityAttachCapabilities:32]: EntityCow['Cow'/5, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT]: [Test:onEntityAttachCapabilities:32]: EntityCow['Cow'/6, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT]: [Test:onEntityAttachCapabilities:32]: EntitySquid['Squid'/7, l='world', x=0,00, y=0,00, z=0,00] ATTACH [server thread/INFO] [sTDOUT]: [Test:onEntityAttachCapabilities:32]: EntitySquid['Squid'/8, l='world', x=0,00, y=0,00, z=0,00] ATTACH // This goes on and on until "Done" - not SINGLE entity ever joins world. * On contrary to clean start - entities are now only constructed. They never join world (never = we are talking about server loading phase, meaning "Done" message = end). EDIT: They do JOIN the world. It is just that EntityJoinWorldEvent is not called! 4. While still having server on (the 2nd launch one), launch client. - Login on localhost. - Look into console. The prints will be something like this (after "Done"): [server thread/INFO]: Done (4,946s)! For help, type "help" or "?" [user Authenticator #1/INFO]: UUID of player Ernio is *** [Netty Server IO #1/INFO] [FML]: Client protocol version 2 [Netty Server IO #1/INFO] [FML]: Client attempting to join with 4 mods : [email protected],Test@1,[email protected],[email protected] [server thread/INFO] [FML]: [server thread] Server side modded connection established [server thread/INFO]: Ernio[***] logged in with entity id 221 at (34.5, 62.0, 250.5) [server thread/INFO]: Ernio joined the game [server thread/INFO] [sTDOUT]: [Test:onEntityJoinWorld:41]: EntityPlayerMP['Ernio'/221, l='world', x=34,50, y=62,00, z=250,50] JOINED [server thread/INFO] [sTDOUT]: [Test:onPlayerStartTracking:50]: EntitySpider['Spider'/69, l='world', x=31,50, y=42,00, z=270,50] TRACKING [server thread/INFO] [sTDOUT]: [Test:onPlayerStartTracking:50]: EntityChicken['Chicken'/70, l='world', x=16,88, y=64,00, z=263,53] TRACKING [server thread/INFO] [sTDOUT]: [Test:onPlayerStartTracking:50]: EntityCreeper['Creeper'/88, l='world', x=44,53, y=36,00, z=227,20] TRACKING [server thread/INFO] [sTDOUT]: [Test:onPlayerStartTracking:50]: EntityBat['Bat'/89, l='world', x=37,98, y=40,10, z=233,75] TRACKING [server thread/INFO] [sTDOUT]: [Test:onPlayerStartTracking:50]: EntityBat['Bat'/68, l='world', x=28,78, y=37,10, z=234,33] TRACKING [server thread/INFO] [sTDOUT]: [Test:onPlayerStartTracking:50]: EntityChicken['Chicken'/98, l='world', x=54,60, y=65,00, z=248,11] TRACKING [server thread/INFO] [sTDOUT]: [Test:onPlayerStartTracking:50]: EntityChicken['Chicken'/99, l='world', x=62,17, y=65,00, z=242,51] TRACKING * As you will see - EntityJoinWorldEvent was never called for entities loaded from NBT. Conclusion; EntityJoinWorldEvent is NOT always called! This all leads to non-stable game event ordering. Thank you for reading and I am hoping for fix EDIT (Post updated)
-
Do you actually understand that copied vanilla code? This is exacly why noone should just copy code from anywhere. Now the real question is (still) - did you check if this is sync or logic mistake? Try printing ingridient slots after you craft item. Sync = ItemStacks on client are different than on server (client has them with stackSize = 0 and server nullified them) Logic = Both sides have itemStacks with size = 0. Now - I alredy told you - ItemStacks allow their size to go below 1. Whenever you decrement stack.stackSize you NEED to check if size < 1. If it is - you need to nullify slot containing stack. I am like 99% sure no nullifying is your problem, which I alredy told you in prev thread. Did you actually check that?
-
[1.9] [Solved] Rendering issue when rendering using ModelRenderer
Ernio replied to Wurmatron's topic in Modder Support
GuiInventory.drawEntityOnScreen(...) I'll just leave this here -
Noone? :C I am lost here guys. What amazes me is actually how entity can be started to be tracked if it never joined world. Its either that: * JoinWorld is not called for few entities (wtf?) and they are spawned without calling event. * They are NOT actually spawned (and thats why JoinWorld is not called), but mistakenly put into EntityTracker's Player mapping where they are not supposed to be (since they are not in world). I am starting to think someone messed up and this might be a bug. When I get back in few h I will make cleaner test mod (tho my current tests are quite clean since I am just printing stuff from event call).
-
We are talking about: * PlayerEvent.StartTracking * EntityJoinWorldEvent Some part of my mod are pretty old (but well written), and they are working for months now. About month (I think) ago I upped to 1.8.9 and everything also seemed (I wasn't coding much, maybe I missed bug there) fine. Anyway, I soon decided to go to 1.9. Currently I am on latest (while ago 1812 -> 1816 now) build and I am getting unexpected errors (as in - they are concerning my very old code). Okay, so problem: Till now system worked like this: 1. Construction attaches props. 2. Maps are constructed and filled with "holders" for attributes. 3. EntityJoinWorldEvent calls props.maps.load() - this is done because entity can be constructed, but not be in world, so I decided to load attributes to map after they join. Also - world (and coords/weather/etc) affects loaded attributes so that is pretty much design requirement. 4. PlayerEvent.StartTracking catches every entity player starts tracking, iterates over all holders in entity's props.maps and send them to client. Till now - this all happened smooth. As of (I think) 1.9 update it seems that expected order of events is not longer kept. BIG NOTE! While tracking is called on server only - joinWorld is called on both. I just need to say - this and anything with threads is not my problem, we are right now talking about server only side. In past when player logged in, all entities near his pos were: constructed -> loaded -> tracked Note: server (even without players) sometimes constructs entities without making them join world. As of now: As expected those things happen in this order but only after 10-20 entities load. [05:01:37] common.entity.player.ExtendedPlayer:deserializeNBT:183]: LOADING: {C:[]} [05:01:37] server.event.ServerForgeEvents:onEntityJoinWorld:116]: EntityPlayerMP['Ernio'/236, l='world', x=-84,50, y=71,00, z=241,50] JOIN [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntitySheep['Sheep'/35, l='world', x=-146,50, y=69,00, z=259,50] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntitySheep['Sheep'/35, l='world', x=-146,50, y=69,00, z=259,50] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntitySheep['Sheep'/37, l='world', x=-158,49, y=67,00, z=272,70] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntitySheep['Sheep'/37, l='world', x=-158,49, y=67,00, z=272,70] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntitySheep['Sheep'/42, l='world', x=-133,76, y=73,00, z=245,57] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntitySheep['Sheep'/42, l='world', x=-133,76, y=73,00, z=245,57] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntitySheep['Sheep'/36, l='world', x=-143,80, y=74,00, z=264,45] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntitySheep['Sheep'/36, l='world', x=-143,80, y=74,00, z=264,45] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntityCow['Cow'/44, l='world', x=-113,48, y=84,00, z=182,78] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntityCow['Cow'/44, l='world', x=-113,48, y=84,00, z=182,78] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntityCow['Cow'/45, l='world', x=-115,46, y=76,00, z=205,75] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntityCow['Cow'/45, l='world', x=-115,46, y=76,00, z=205,75] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntityCow['Cow'/46, l='world', x=-120,18, y=85,00, z=194,48] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntityCow['Cow'/46, l='world', x=-120,18, y=85,00, z=194,48] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntitySheep['Sheep'/65, l='world', x=-64,80, y=70,00, z=246,40] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntitySheep['Sheep'/65, l='world', x=-64,80, y=70,00, z=246,40] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntitySheep['Sheep'/66, l='world', x=-65,81, y=70,00, z=249,17] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntitySheep['Sheep'/66, l='world', x=-65,81, y=70,00, z=249,17] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntitySheep['Sheep'/67, l='world', x=-69,50, y=70,00, z=240,50] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntitySheep['Sheep'/67, l='world', x=-69,50, y=70,00, z=240,50] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntitySheep['Sheep'/68, l='world', x=-64,27, y=70,00, z=264,49] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntitySheep['Sheep'/68, l='world', x=-64,27, y=70,00, z=264,49] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntitySheep['Sheep'/75, l='world', x=-63,76, y=70,00, z=232,81] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntitySheep['Sheep'/75, l='world', x=-63,76, y=70,00, z=232,81] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntitySheep['Sheep'/76, l='world', x=-52,50, y=68,00, z=270,50] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntitySheep['Sheep'/76, l='world', x=-52,50, y=68,00, z=270,50] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntitySheep['Sheep'/77, l='world', x=-55,50, y=70,00, z=266,50] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntitySheep['Sheep'/77, l='world', x=-55,50, y=70,00, z=266,50] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntityItem['item.tile.mushroom'/74, l='world', x=-48,75, y=32,00, z=222,82] TRACK // item are not synced, only living ents are [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntitySheep['Sheep'/84, l='world', x=-41,95, y=69,00, z=265,52] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntitySheep['Sheep'/84, l='world', x=-41,95, y=69,00, z=265,52] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntityItem['item.tile.mushroom'/83, l='world', x=-44,97, y=34,00, z=223,78] TRACK [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntityCow['Cow'/97, l='world', x=-32,55, y=66,75, z=218,51] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntityCow['Cow'/97, l='world', x=-32,55, y=66,75, z=218,51] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntityCow['Cow'/64, l='world', x=-67,04, y=66,00, z=180,35] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntityCow['Cow'/64, l='world', x=-67,04, y=66,00, z=180,35] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntityCow['Cow'/57, l='world', x=-110,55, y=81,00, z=182,58] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntityCow['Cow'/57, l='world', x=-110,55, y=81,00, z=182,58] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntityCow['Cow'/72, l='world', x=-50,54, y=66,00, z=185,72] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntityCow['Cow'/72, l='world', x=-50,54, y=66,00, z=185,72] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntityCow['Cow'/73, l='world', x=-54,51, y=64,00, z=176,23] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntityCow['Cow'/73, l='world', x=-54,51, y=64,00, z=176,23] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntityCow['Cow'/98, l='world', x=-18,22, y=64,00, z=221,49] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntityCow['Cow'/98, l='world', x=-18,22, y=64,00, z=221,49] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntityCow['Cow'/99, l='world', x=-19,60, y=64,00, z=215,53] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntityCow['Cow'/99, l='world', x=-19,60, y=64,00, z=215,53] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntityCow['Cow'/96, l='world', x=-19,59, y=64,00, z=207,81] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntityCow['Cow'/96, l='world', x=-19,59, y=64,00, z=207,81] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntityCow['Cow'/56, l='world', x=-110,50, y=80,00, z=164,20] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntityCow['Cow'/56, l='world', x=-110,50, y=80,00, z=164,20] null [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntityCow['Cow'/71, l='world', x=-54,95, y=63,00, z=173,29] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntityCow['Cow'/71, l='world', x=-54,95, y=63,00, z=173,29] null [05:01:37] server.event.ServerForgeEvents:onEntityJoinWorld:116]: EntityBat['Bat'/276, l='world', x=-39,50, y=54,00, z=241,50] JOIN // FINALLY 1st JOIN [05:01:37] common.entity.BaseStats:load:195]: EntityBat['Bat'/276, l='world', x=-39,50, y=54,00, z=241,50] LOAD // and his LOAD (called from JOIN) [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntityBat['Bat'/276, l='world', x=-39,50, y=54,00, z=241,50] TRACK // and his corresponding TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntityBat['Bat'/276, l='world', x=-39,50, y=54,00, z=241,50] B10.0 // and STATS are detected [05:01:37] server.event.ServerForgeEvents:onEntityJoinWorld:116]: EntitySkeleton['Skeleton'/286, l='world', x=-70,50, y=29,00, z=224,50] JOIN [05:01:37] common.entity.BaseStats:load:195]: EntitySkeleton['Skeleton'/286, l='world', x=-70,50, y=29,00, z=224,50] LOAD [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntitySkeleton['Skeleton'/286, l='world', x=-70,50, y=29,00, z=224,50] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntitySkeleton['Skeleton'/286, l='world', x=-70,50, y=29,00, z=224,50] B10.0 [05:01:37] server.event.ServerForgeEvents:onEntityJoinWorld:116]: EntityBat['Bat'/302, l='world', x=-74,50, y=33,00, z=273,50] JOIN [05:01:37] common.entity.BaseStats:load:195]: EntityBat['Bat'/302, l='world', x=-74,50, y=33,00, z=273,50] LOAD [05:01:37] server.event.ServerForgeEvents:onPlayerStartTracking:71]: EntityBat['Bat'/302, l='world', x=-74,50, y=33,00, z=273,50] TRACK [05:01:37] common.entity.EntityStats:synchronizeStatsTo:77]: EntityBat['Bat'/302, l='world', x=-74,50, y=33,00, z=273,50] B10.0 // AND SO ON As you can se - we get: TRACK -> null at 1st, but then everything is back to normal: JOIN (LOAD) -> TRACK -> stats sent (this B10.0 thing). Question: Could someone help me find what exacly changed in callbacks? Something must have! Addition: Yeah I can make null check but that would mean that those 20 entities would not get synced on player join - that would be very bad for client display (in my case).
-
I mean, why do you care? WorldRenderer is just a wrapper for FEW GL methods. If you want anything fancy you need to use GL directly (google is really your friend).
-
1st of all - you can't save shared "healcooldown" like that. If Item is one healing - you need to assign ItemStack's NBT. If player should have CD - use IExtendedEntityProperties or Capabilites on 1.8+. 2nd: Health manipulation (like any other regarding data) can only happen on server side. Use if (!entity.worldObj.isRemote) to sun code on server. 3rd: "healcooldown = healcooldown - 1;" - how about "--healcooldown;" 4th: TickEvents have Phase - pick one, otherwise code is ran twice (if (event.phase == Plase.END)).
-
If you are changing texture based on anything that is not Metadata (Tile, surroundings, etc.) - you are not really using metadata of block. When you (internals) actually ask BlockState for metadata - this methods is called. It is supposed to parse any Properties into one of values from 0 to 15. You can even have 1000 properties, you just can't save them all into 16-valued metadata.
-
Client physical side (.jar) is not really interanlly adapted to saving stuff. That doesn't mean it can't. You can use ClientTickEvent and setup some ticking counter. Since client only ever has ONE World (Minecraft#theWorld) which you are currently in you can simply save data you need to IO every some ticks. I suggest using CompressedStreamTools that will save data to your /root/server-Ip/world-name.dat using NBT system. (for integrated you could use "localhost" for server-Ip, but note that no matter what you do - there is a slight chance that there WILL be collisions (especially on integrated/LAN servers or dedicated ones on your own computer). And no - worlds don't have UUID or such. (On server they can be implemented, but never on client). Most things can be gotten from: Minecraft.getMinecraft().getCurrentServerData() And for world name you just use Minecraft#theWorld. Note: TickEvents have 2 phases (use one, preferably Phase.END) and note that ClientTickEvent is ran always (even in MainMenu) - you need to check if Minecraft#theWorld is not null and if you are actually connected to server.
-
I alredy updated to 1.9 (some changes), but: 1. Use @Override - always! Saves you from trying to override wrong method. Note: You can set Eclipse to add it for you. (Preferences) 2. @Override public int getMetaFromState(IBlockState state) { return state.getValue(FACING).getIndex(); } You need to actually return things.
-
Not sure info: If the library is not minecraft thingy (meaning it has no reference to any MC/forge code, eg: some Math library or DB), I belive you can just throw it into Mod.jar after you compile your mod. (library just needs to be added to build path on compilation). If that is not enough (throwin it in is not) OR the library actually references MC/forge code and needs to be obfuscated within compilation then: Sure info: Use shadowJar - its a gradle option that will pack lib src with your mod. On how to use it - google. Note: I belive there was something on forge docs on this, BUT - docs have been wiped a while ago and it seems shadowing is no longer there. EDIT I found it (different docs): https://forgegradle.readthedocs.org/en/latest/cookbook/#shading I forgot forgegradle != mcforge EDIT 2 Managed to find actual example: https://github.com/shadowfacts/DiscordChat/blob/1.8.9/build.gradle
-
You have: toReturn.setTagInfo(Refs.MODID, SaveAsNBT()); Then: @Override public NBTTagCompound SaveAsNBT() { NBTTagCompound toReturn = new NBTTagCompound(); toReturn.setString("name", name); toReturn.setString("coreType", coreType.toString()); toReturn.setTag("partMap", partMap.SaveAsNBT()); return toReturn; } What is this? toReturn.setTag("partMap", partMap.SaveAsNBT()); EDIT Btw. WHY ON EARTH are you NOT using Java conventions? jesus christ... Also: Consider using INBTSerializable<T>
-
If you simply want to use library (.jar) in your project - you do it like you did (if you did it right). Throw library.jar anywhere (that is not /mods/) and add it to build path in eclipse. Then you can use its methods. Note that if you want to use other mod as lib - you need dev release (deobfuscated), if you want to make direct references. As to compiling - do you want to pack library within your mod or just compile your mod and add dependency (is that ilbrary a @Mod?)
-
Since 1 sec = 20 tick and drawScreen() is not called on tick, but on frame (fps), you don't want to use it (ticks). You need to utilize partialTicks passed in drawScreen() method. They give you power of fps. Lookup (almost) any vanilla stuff.
-
Umm, read GuiAchievements code, reimplement it to your needs? There is LITERALLy no other way.