Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

matthew123

Members
  • Joined

  • Last visited

Everything posted by matthew123

  1. my method isn't being called.
  2. Still waiting on the issue.
  3. Registering in static fields isn't ideal. You have a method that registers your deferred register to the event bus, right? leave your RegistryObject fields as non-final and empty, and set their reference in that method, right after registering the deferred register on the bus.
  4. This is my event: p.s i tried the subclasses. Above this line, I am also registering my GUI event listener with RenderGameOverlay, which works fine.
  5. I am finding the code difficult to read. Can anyone give me an example of a block, similar to sand, that, when placed, turns into and entity, goes up one block, then turns back into a block?
  6. I am analyzing falling blocks, but that will take some time to do. If anyone could provide any input, I would appreciate it.
  7. Better yet, how do I animate them from the server? I know there is some kind of interpolation. How do I use it to animate the blocks in as few packets as possible?
  8. I I was looking for levelArray usages. Didn't notice the levels map. Thanks!
  9. It wasn't a threading issue. The java collection did not allow removing items while iterating trough it.
  10. They are both on the server thread. Why is this happening?
  11. The only way this could have happened is if the method to add a block to the list was called in parallel of the method that is called every server tick. This is weird, I will add some break points to try and extract the thread ids.
  12. I found a private method called getWorldArray on MinecraftServer. Do I use reflection to get it? I could also add my capability objects to a tracking list whenever they are created. Which one should I go for?
  13. How do I get all the worlds in order to get the capability I attached to them?
  14. Ah, I see that world capabilities are per level. That complicates things. I guess I will need capabilities for every level. That actually removes the need to serialize/deserialize the level.
  15. I decided to also implement #2 for learning purposes. How do I serialize the level then get it back at runtime? I know there is something called dimension ID, but I don't know how to use it.
  16. Oh, sorry about that. I didn't quite understand what random ticks were. Using them seems easy enough. Thanks.
  17. Second option then. But #1 is easy to implement. What is the performance impact of a few thousand function calls and integer writes for the tile entities? Is implementing #2 even worth it?
  18. The server is placing many (thousands of) blocks for an ability. I need to remove those blocks after a certain number of ticks. Which would be less resource intensive: • making those blocks tile entities, with an internal counter, and have them remove themselves when the counter reaches the threshold • add the block positions to a persistent world capability, with a HashMap of position and number of ticks, and on every server tick (or every 10, or more, to save performance), iterate trough the hashmap, check every counter, and if it has reached the threshold, remove the block at position, else increment the counter. How do I tell if the block at the block position wasn't replaced? p.s the block in question is dirt. For #1, I would be creating a tile entity with it's texture. Also, the interval does not have to be very accurate (it would be about one minute or so, about 60*20 ticks) Is there an even better way then the ones above?
  19. Is nobody able to help? I am sure it is a very easy to solve issue. I just haven't learned OpenGl to solve it yet.
  20. My client sends a packet to activate an ability which generates a wall in front of it, layer by layer (on the Y axis) every tick. I would like to have the server place blocks every tick without sending updates to the clients, and every client in range to animate a block entity going upwards, then transforming into a block on every tick. How would I go about doing that?
  21. I am not sure I follow. I will only need to get the block position very rarely. How is this a problem?
  22. I am getting this ghost stripe: textureManager.bind(TextureLocations.OVERLAY_CHAKRA_BAR); RenderSystem.enableBlend(); RenderSystem.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); matrix.pushPose(); AbstractGui.blit(matrix, x, y, 0, 0, selectedWidth, 4, TEX_WIDTH, TEX_HEIGHT); AbstractGui.blit(matrix, x - 18, y - 11, 0, 4, 205, 20, TEX_WIDTH, TEX_HEIGHT); if (jutsuData.hasNatures() && jutsuData.hasSelectedJutsu()) { float ratioAfterUse = (chakraData.getCurrentValue() - chakraCost) / (float) chakraData.getMaxValue(); int selectedWidthAfterUse = (int) (width * ratioAfterUse); if (chakraCost <= chakraData.getCurrentValue()) { AbstractGui.blit(matrix, x, y, 0, 23, selectedWidthAfterUse, 4, TEX_WIDTH, TEX_HEIGHT); AbstractGui.drawCenteredString( matrix, hud.getFont(), "after: " + (chakraData.getCurrentValue() - chakraCost), 60, y + 30, 0x00CCFF); } else { AbstractGui.blit(matrix, x, y, 0, 23, width, 4, TEX_WIDTH, TEX_HEIGHT); AbstractGui.drawCenteredString( matrix, hud.getFont(), "insufficient chakra!", 60, y + 30, 0xFF0000); } } AbstractGui.drawCenteredString( matrix, hud.getFont(), chakraData.getCurrentValue() + " / " + chakraData.getMaxValue(), 60, y + 50, 0x00CCFF); matrix.popPose(); RenderSystem.disableBlend(); Here is the texture: this is weird because the red texture was drawn correctly on top of the other one.
  23. How so? A couple of trigonometric functions can't possibly affect performance.
  24. I am doing this so players can't cheat.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.