Everything posted by matthew123
-
Event not working
my method isn't being called.
-
Overlay issue
Still waiting on the issue.
-
Registering new block (1.17.1)
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.
-
Event not working
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.
-
Animate blocks
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?
-
Animate blocks
I am analyzing falling blocks, but that will take some time to do. If anyone could provide any input, I would appreciate it.
-
Animate blocks
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?
-
Temporary blocks tile entity or separate handler
I I was looking for levelArray usages. Didn't notice the levels map. Thanks!
-
Temporary blocks tile entity or separate handler
It wasn't a threading issue. The java collection did not allow removing items while iterating trough it.
-
Temporary blocks tile entity or separate handler
They are both on the server thread. Why is this happening?
-
Temporary blocks tile entity or separate handler
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.
-
Temporary blocks tile entity or separate handler
Oh no. I got a race condition!
-
Temporary blocks tile entity or separate handler
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?
-
Temporary blocks tile entity or separate handler
How do I get all the worlds in order to get the capability I attached to them?
-
Temporary blocks tile entity or separate handler
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.
-
Temporary blocks tile entity or separate handler
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.
-
Temporary blocks tile entity or separate handler
Oh, sorry about that. I didn't quite understand what random ticks were. Using them seems easy enough. Thanks.
-
Temporary blocks tile entity or separate handler
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?
-
Temporary blocks tile entity or separate handler
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?
-
Overlay issue
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.
-
Animate blocks
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?
-
Get block the player is looking at
I am not sure I follow. I will only need to get the block position very rarely. How is this a problem?
-
Overlay issue
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.
-
Get block the player is looking at
How so? A couple of trigonometric functions can't possibly affect performance.
-
Get block the player is looking at
I am doing this so players can't cheat.
IPS spam blocked by CleanTalk.