Giter Club home page Giter Club logo

calio's People

Contributors

apace100 avatar edwinmindcraft avatar merchantpug avatar slapjd avatar

Watchers

 avatar

calio's Issues

ClientHelper.isServerContext returns false in singleplayer worlds

Version

Confirmed on 1.19.x/forge aece46e, buildscript 1.19.x/forge e4f58032
Not yet confirmed Does not occur on 1.20.x/forge.

Problem

When in singleplayer, the RegistryAccess used by the internal server appears to be obtained from RegistryAccess.BUILTIN. The code in ClientHelper.isServerContext assumes that this is not the case, and thus always returns false. This can cause datapack reloads in singleplayer to unexpectedly fail as the server will attempt to send the client's registries to the client.

Potential Solutions

Aside from one instance in origins-architectury:PartialOrigin.Builder.powers, the access argument is always null. As such, it may be possible to remove the comparison to RegistryAccess.BUILTIN and just use the null check. This may have some regressions, and I suspect that a better solution exists.

Server-to-client packets are too big

Log

MC Version: 1.19.2
Forge Version: 43.1.47
Calio Forge Version: 1.6.0.3
Origin Forge Version: 1.5.0.6

Server-to-client packets are too big:
Payload may not be larger than 1048576 bytes

Simultaneous modification of CalioDynamicRegistryManager.registries during packet processing

Version

Confirmed on 1.19.x/forge aece46e, buildscript 1.19.x/forge e4f58032
Although the structure of the code in HolderCodec is different, this bug also seems to apply to 1.20.x/forge.

Problem

When the client receives multiple S2CDynamicRegistryPackets for the same registry, it will decode and handle them concurrently. However, the call(s) to access.get in HolderCodec.decode may happen concurrently with the call to CalioDynamicRegistryManager.reset in S2CDynamicRegistryPacket.handle. If this occurs, the call to access.get may fail with IllegalArgumentException.

Potential Solutions

I was able to fix the problem on a local copy by placing locks around accesses to CalioDynamicRegistryManager.registries. However, this came with a performance penalty. A better solution may be to remove the call to registries.remove in CalioDynamicRegistryManager.reset, but I am unsure of the potential regressions of that change.

Other Mods

In order to force the packets to be split, I used Origins++. However, this could occur with any sufficiently large datapack.

Related Bugs

I suspect this to be the cause of EdwinMindcraft/origins-architectury#405 and its duplicates.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.