Causes NoClassDefFoundError on dedicated server.
I did test this to make sure it output the same format as old
implementation (hex with lowercase alphas).
Clawing this code back from an ill-thought-out Fabric PR. Now our mixin
will load all mod's en_us lang files into the default language instance
and not crash if mods provide different values for the same key. I
don't know if this resolution strategy is good, but it is *something*.
- Switch to the new networking API, just doing sneaky things to make it
the same as the old networking API.
- Use new FabricLoader API
- Don't use the static final game version, as this may change if people
run the mod on newer versions.
Thankfully, the surface level of redstone ready flat worlds is now below
y=0 or, I wouldn't have noticed.
I reformatted some things to keep the diffs down against CC-Tweaked.
It might be nicer to make this return an ItemStorage as most
places we grab the Container and immediately wrap it.
Speakers can now play arbitrary PCM audio, sampled at 48kHz and with a
resolution of 8 bits. Programs can build up buffers of audio locally,
play it using `speaker.playAudio`, where it is encoded to DFPWM, sent
across the network, decoded, and played on the client.
`speaker.playAudio` may return false when a chunk of audio has been
submitted but not yet sent to the client. In this case, the program
should wait for a speaker_audio_empty event and try again, repeating
until it works.
While the API is a little odd, this gives us fantastic flexibility (we
can play arbitrary streams of audio) while still being resilient in the
presence of server lag (either TPS or on the computer thread).
Some other notes:
- There is a significant buffer on both the client and server, which
means that sound take several seconds to finish after playing has
started. One can force it to be stopped playing with the new
`speaker.stop` call.
- This also adds a `cc.audio.dfpwm` module, which allows encoding and
decoding DFPWM1a audio files.
- I spent so long writing the documentation for this. Who knows if it'll
be helpful!
- Remove all the hungrarian notation in variables. Currently leaving
the format of rednet messages for now, while I work out whether this
counts as part of the public API or not.
- Fix the "repeat" program failing with broadcast packets. This was
introduced in #900, but I don't think anybody noticed. Will be more
relevant when #955 is implemented though.
This means that if the current player is breaking a cable/wired modem,
only the part they're looking at has breaking progress. Closes#355.
A mixin is definitely not the cleanest way to do this. There's a couple
of alternatives:
- CodeChickenLib's approach of overriding the BlockRendererDispatcher
instance with a delegating subclasss. One mod doing this is fine,
several is Not Great.o
- Adding a PR to Forge: I started this, and it's definitely the ideal
solution, but any event for this would have a ton of fields and just
ended up looking super ugly.
I assume people have broken coroutine dispatchers - I didn't think it
was possible to queue an actual event with no type.
See cc-tweaked/cc-restitched#31. Will fix it too once merged downstream!
Ideally I would port over the data driven turtle/pocket upgrade system
from CC: Tweaked, but I don't understand it well enough at the moment.
This (should) bring parity to behaviors, but our api for adding upgrades
remains divergent.
Note that I did not hook into ChunkMap in the same place as Forge's
ChunkWatchEvent. In my testing the Forge hook location doesn't *only*
fire when a player begins watching the chunk, instead it fires every
time the chunk is checked against the player's view distance. This
results in the server spamming packets for static terminals as players
move around. Perhaps I'm reading the Forge patch wrong...
Fabric does not have a separate handler for update packets vs load.
Perhaps we should check if the CompoundTag contains an animation value
in TurtleBrain#readDescription but nbt.getInt defaults to 0 and that's
TurtleAnimation.NONE so...
Hopefully this will make tracking changes and merging future CC: Tweaked
development easier! A lot of this is making whitespace and method
ordering even with Tweaked to bring down the diffs, but it also fast
forwards us to CC:T 1.99.0 features.
Fabric api got rid of their BE syncing helper in favor of the vanilla
system. In this commit BE syncing is probably horribly broken and needs
to be looked over. I did the minimum to make it compile and run.
testModExtra must /strictly/ be the set of dependencies which are not
present in implementation - there can't be any duplicates.
Yes, it's stupid, but the whole lazyToken("minecraft_classpath") thing
wasn't really built with this in mind, so not much we can do :)
Opening a screen KeyBinding.releaseAll(), which forces all inputs to be
considered released. However, our init() function then calls
grabMouse(), which calls Keybinding.setAll(), undoing this work.
The fix we're going for here is to call releaseAll() one more time[^1]
after grabbing the mouse. I think if this becomes any more of a problem,
we should roll our own grabMouse which _doesn't_ implement any specific
behaviour.
Fixes#975
[^1]: Obvious problem here is that we do minecraft.screen=xyz rather
than setScreen. We need to - otherwise we'd just hit a stack
overflow - but it's not great.
- Build fails right now due to module issues, so this won't be pushed
to GitHub.
- Monitors render transparently when loaded into the world. I don't
think this is a 1.17 bug, so not sure what's going on here!