Jump to content

horsewithnoname

Members
  • Posts

    54
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    Programming experience included!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

horsewithnoname's Achievements

Stone Miner

Stone Miner (3/8)

3

Reputation

  1. Thank you very much for fixing this issue!
  2. I resolved the problem. It turned out that I removed one line from the mod which preload Metamorph mod before Blockbuster mod. So stupid, I know.
  3. It's from my Metamorph mod, and it's provided to Forge along side with my crashing mod: UC metamorph{1.1.2} [Metamorph] (metamorph-1.1.2-1.11.2.jar) It's just so random, it just crashes...
  4. Hello there! I encountered a really weird bug that corrupts my mod jar. This issue is exactly the same as described here. After I build my mod, I get this crash. It runs fine in Eclipse. No errors, but when I build it and run in Minecraft, it crashes, saying that it cannot find EntityActor class, but it's THERE (I checked in JD-GUI and in my code)! I tried reverting back to last stable commit, it works fine. I tried cleaning both binaries (build and bin folders, and ./gradlew clean) and eclipse, no success. I tried to move proxies into different package, also crash. I don't understand why it crashes. I checked the difference between commits, but there's nothing suspicious I could see. Does somebody can help me resolve that issue? Thank you for attention!
  5. Okay, so I have a mod which allows to record player actions and playback them using entities. I want to record breaking block animation and its progress, since my current code allows people to break blocks like in creative mode. Currently, I record all actions using event listener for multiple events, but this way, I'm quite limited of what I want to record. That's why I want to intersect incoming client packets and outgoing server packets. Well, I'm not really worry about hackiness, since I've got already few places where I use quite hacky reflection code for accessing some vanilla stuff Thanks for your time and reply! I really appreciate this!
  6. Hello there! I want to add in my mod an ability to record breaking block animation. I tried looking up, if there is such event (of course there's not, it's of too narrow use) or an event that allows reading vanilla packets on server side, but no success. I'm not sure whether it's possible without coremod, but if it possible, how to intercept a vanilla packet on both side (like the CPacketClickWindow or SPacketBlockBreakAnim)? I'm sure it somehow related to Netty and injecting some kind of decoder, or something, but I don't know where to start. Could you give me directions? Thank you for attention!
  7. Hello there! I've got few questions about implementing my own Forge events for making public API for my mods. How do you control cancel-able events? Do you simply post an event and check if post(Event event) method of EventBus returns true, then it was canceled? if (MinecraftForge.EVENT_BUS.post(event)) { return false; } /* Event wasn't canceled */ Do I understand it right? Second question is should I use MinecraftForge.EVENT_BUS or create a new event bus for my own mod and post it there? I don't know about penalties of posting my events on EVENT_BUS, however I do know that his bus is responsible for a lot of things like tick events and many much more. Just to clarify, my events aren't something that fire frequently, but depending on how frequent users will be using the features, it might turn out to be quite frequent. Thanks for attention!
  8. Oh, I get it now, thanks Of course I think I'll rewrite in the next update to the option 1.
  9. Thanks for the answer TGG, by the way, you have really nice tutorials from which I learned a lot Well, for now, yes, I'm aiming for machinima rendering. With machinima rendering, it's actually pretty good, I haven't noticed any frame desynchronization since Minema does the synchronzation work for me, but for live stuff I'm not sure about it. In the future, I would like to expand this recording/playback code to make cinematic stuff like where there are NPC's that do some pre-recorded stuff like in Borderlands 2 or Skyrim (just from the top of my head). I do not aim at multiplayer servers, though. Your offer seems a little bit less expensive than option 1, and probably will have some issues during the lag (probably, although lag is the problem itself). You're correct. Depending on the network latency it may drastically affect the playback. I tested everything only in single-player. By the way, I'm not aiming my mod toward public servers. Ok, I'll try different ways in the future, thank you P.S.: What does stress test means?
  10. Hello there! I'm working on a mod that allows recording player movement and some actions (like block interaction, dropping items, etc.). In previous versions, the record and playback of player movement and actions, was pretty primitive, it simply recorded position, rotation, etc. in separate thread and played back those actions also in separate thread. For the next release, I wanted to update recording code to the next level (so it would be very smooth and Minema compatible). I did implemented smooth recording, but I experience tick desynchroinzation issues sometime. Right now, the recording code works following way (source code if somebody needs more than an explanation): 1. Player notifies server that he wants to record himself (via command or interacting with actor mob) 2. Server starts recording and sends a message to the client that recording has started 3. Server records actions (pushed via event handler on the server-side) and client records position, rotation, motion, fall distance and some booleans (onGround, isSneaking, etc.) 4. When player asks the server to stop recording (via command or interacting with actor mob), server asks player for the recorded frames, and puts recorded actions on hold until client frames will arrive 5. When client frames are arrived, server adjusts the length of the action list and saves frames and actions to the file There are no issues with recording, but with playback, I experience tick desynchronization issue. I don't know why it happens, but sometimes, client update loop can't keep up with server loop, I guess, and in this case it makes playback look really awful (especially while flying elytra). Playback code works similar to recording code, but it's more complicated: 1. When actor is starting playing back (requested by player), actor being played from recorded record on the server 2. On the client, however, recording might not exist, so the server will send actor tracking clients record, if they don't have it, while giving an actor empty playback which will just run ticks (in order to keep up with the server) 3. When the record is finally arrived on the client, it being injected into the empty playback which will then start played back on the client every tick 4. When playback is finished, server notifies the players that an actor stopped playing 5. Clients will simply remove the playback from the actor and next time, they would be able to use the same record for playback tl;dr. Yes, it's a pretty complicated system, but I'm not asking to rewrite it for me. I described how it works, if you needed that info, to answer my question/help me with my problem. So now is the question time. How can I resolve this issue with tick desynchronization? I see only two options: 1. Rewrite playback code so it will be played only on server (i.e. every tick server going to send packets with position, rotation, motion, etc.) 2. Every N ticks, send to the client the number of ticks server has I implemented currently 2. as a workaround, but I feel that with slow connection the arrived tick will probably be outdated by the time it arrived. But with 1., I fear it will create really dense server load when there are lots of players and lots of actors being played back. What will be the optimal solution? Thanks for attention! (sorry for the wall of text)
  11. /* In your proxy on pre initialization (FMLPreInitializationEvent) or * initialization (FMLInitializationEvent): */ GuiEventHandler handler = new GuiEventHandler(); MinecraftForge.EVENT_BUS.register(handler); /* The class itself */ public class GuiEventHandler { @SubscribeEvent public void onGuiInit(InitGuiEvent.Pre event) { if (event.getGui() instanceof GuiIngameMenu) { /* Add button to top-left corner of the screen */ event.getButtonList().add(new GuiButton(42, 10, 10, ...)); } } @SubscribeEvent public void onGuiActionPerformed(ActionPerformedEvent event) { if (event.getGui() instanceof GuiIngameMenu && event.getButton().id == 42) { /* Do something... */ } } } My code doesn't really differ from SenpaiSuburaki's code, but there are few important features added/changed. Check for GuiIngameMenu – it is really important since without this check you may accidentally add your button to every GUI in the game. ActionPerformed event listener was added – where the comment "Do something..." you should write your custom code that should happen after your added button was clicked (i.e. open other GUI, Minecraft.getMinecraft().displayGuiScreen(...)). Moved registration of event handler outside of the class. Why? Because it's bad, in my opinion, since it will hardcode (add hard dependency, coupling) MinecraftForge.EVENT_BUS to this class. The code provided above is untested, but I believe it should work with minor adjustments (i.e. add imports and change some parameters to desired values).
  12. If I get you correctly (stupid autocorrect? ), you'll need to calculate the button position yourself (to put your button under other buttons). Or you could just place your button in the corner. By the way, you'll probably need to subscribe to ActionPerformedEvent also to add a callback when the button was clicked in GuiIngameMenu.
  13. Or... you can just create your event handler and listen to GuiScreenEvent.InitGuiEvent.Pre, check whether given GUI is instance of GuiIngameMenu, and then add additional buttons to the button list via event.getButtonList() (which is a List<GuiButton>).
  14. There are some: NoSleepingTest mod My Metamorph mod My capabilities example mod I also have written a tutorial on PMC about capabilities.
×
×
  • Create New...

Important Information

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