Jump to content

Taigore

Members
  • Posts

    9
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Taigore's Achievements

Tree Puncher

Tree Puncher (2/8)

3

Reputation

  1. Thanks for the reply, but I'm actually using the coremod to modify the rendering of EntityFallingSand. My block is not a standard cube, it's a detailed shape with a non square texture that I plan to make fall, so I'm modifying the renderer to use the actual block rendering for everything that uses a non standard one (even other mod blocks). I could get the same result for my block by duplicating EntityFallingSand and adding a new renderer for it, that uses the block rendering, but it's redundant. Even if you still think is better, I could still use to know what the problem with my mod is, in case I need it for future works.
  2. Hello, I'm Taigore. I'm trying to make my mod turned coremod work again. The coremod part worked fine almost since when I added it. However, the rest of the mod refuses to get back working. I managed to, after a long time, get back working the blocks, items, textures and all mod class events, but I can't get the GUI on again. I spent a lot of time reading FML code and, from what I have seen, I can't find anything else not involving reflection to register the GUI. The usual NetworkRegistry method won't work, and it seems that the InjectedModContainer wrapping my mod (that gets automatically created) isn't registered at all in LoadController.modObjectList. I attach both my IFMLLoadingPlugin implementation and my DummyModContainer extension, if anyone could help me pointing out what FML expects from me to be able to process my mod without resorting to crazy hacks I'd be grateful. Mind that the plugin is correctly identified and called, and the container has its events called, even though it took some effort and much exploration. I likely haven't used the "correct" method to make it work. I followed this guide for the most part, although the change I made is slightly more extensive. InventorySaver (ModContainer) FMLLoadingPlugin (Plugin class) Thanks in advance for the help.
  3. You have to change your main class to net.minecraft.launchwrapper.Launch for the client, and cpw.mods.fml.relauncher.ServerLaunchWrapper for the server launch configurations.
  4. Indeed, haven't thought about that. It may be twisted to work anyway, but that may require a lot of extra infrastructure.
  5. Given that I never wrote anything with the ore dictionary, the first way that comes to my mind would be to register an EntityJoinWorldEvent handler, that checks whenever an EntityItem is spawned. Then, if it contains something that is registered in the OreDictionary as oreLead, it replaces the ItemStack with what you need, or spawn a new EntityItem with the occasional sub-drop, or whatever you want, even creating a nuclear blast or a host of creeper if you feel like so. It was completely off the top of my head, so its not guaranteed to work.
  6. If you want to know when the key binding assigned to move forward/backward/etc. is pressed, you should check (client side) when FMLClientHandler.instance().getClient().gameSettings.keyBindForward.pressed is true. GameSettings holds all the vanilla keybinds, and that way you'll always know when the right key is pressed, even if the player ever changes it. Then you need to relay the info to the server, but it seems to me you already know how to do that.
  7. I actually did this once, while starting to update/revamp Pchan3's Airship mod. You simply get Minecraft.getMinecraft().gameSettings.forwardKeyBinding.pressed to know if whatever key is assigned to the command (in this case forward) is pressed. You can do this in a TickHandler, after all KeyHandlers are a sort of TickHandlers. Mind though that key bindings are not part of the server side (simulation) of the game, so you need to relay the input in some way. I did that with a packet handler that then set some kind of command flag (bit flags) in whatever entity ((EntityPlayer)player).ridingEntity was, as long as it was an EntityAirship. The variable player was supplied by the onPacketReceived method of the packet handler. Finally, the entity processed the command and moved. It worked fine, even though more efficient ways exist for sure. The advantage was that the key used by the player was configurable in the options menu, instead of the original which had it in the config file. The config file allowed also a way to separate each command from the default command, for example separating the Airship Forward from the default Move Forward.
  8. It depends on what you need to display. If the data you need is already synchronized, simulated client-side, or client only, you can simply call it from the appropriate object. If the data you need is server only you need to have the mod also on the server sending packets.
  9. Hello, I'm Taigore and I haven't got on a forum since years, so I may act a bit strange. ^^ Thanks in advance for any help though, even if its more like technical info. I have to synchronize entity data from the server to the client, but while I was writing a packet handler I realized that using a packet handler would have required quite a lot of extra infrastructure for it to work in my intended use. However, using DataWatcher and their auto synchronization on entity world join (example: when a player moves to a place where another player was, and said entity spawns in the client world copy) may save me quite a lot of work, and also assure that the data goes to the right entity. To do this I'm planning to use a formatted string though, since the limit of 30 values may be hit otherwise. What I was hoping is for someone to know quite well how DataWatchers work, since the info around is quite scarce, and most importantly know pro and cons of using them, at least relative to custom packet handling. Thanks again for any reply. ^^ P.S.: Nice spell check, even though I'm quite sure that those who need it will never use it.
×
×
  • Create New...

Important Information

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