1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-26 15:32:17 +00:00

2341 Commits

Author SHA1 Message Date
Toad-Dev
d9777a8d2f Bump version for next alpha. v1.18.1-1.99.2-alpha1-ccr 2021-12-17 10:49:29 -08:00
Toad-Dev
ca37dbb591 Stamp out restiched 2021-12-17 10:49:09 -08:00
Toad-Dev
93b45bffed Don't use apache commons-codec to encode NBT Hex.
Causes NoClassDefFoundError on dedicated server.

I did test this to make sure it output the same format as old
implementation (hex with lowercase alphas).
2021-12-17 10:39:16 -08:00
Toad-Dev
482ed6f6b5 Add key collision resolution strategy to MixinLanguage
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*.
2021-12-17 10:12:53 -08:00
Jonathan Coates
fe3c42ce22
Mark 1.17 (and 1.18) as stable 2021-12-17 16:44:29 +00:00
Jonathan Coates
cbe3cb8b3e
Fix several deprecation warnings
- 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.
2021-12-17 11:57:07 +00:00
Toad-Dev
7b3537761b Fix finding inventories below y=0.
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.
v1.18.1-1.99.1-alpha-ccr
2021-12-16 18:52:22 -08:00
Toad-Dev
6ad2cdaf62 Remove MixinLevel
This mixin isn't needed since 1.17 changes to BlockEntities, and doesn't
do anything in its current state.
2021-12-16 17:40:51 -08:00
ToadDev
e6edee4c58 Make SoundEngine#play mixin cancellable.
No reason to call channel.play() twice.
2021-12-16 01:56:36 -08:00
ToadDev
6754c7bb69 Merge remote-tracking branch 'CC-Tweaked/mc-1.18.x' into mc-1.18.x/dev 2021-12-16 00:49:53 -08:00
Toad-Dev
4914ad0040 Fix NPE when pistons extend. 2021-12-15 19:49:35 -08:00
Toad-Dev
27102e6381 Remove a todo I left in after fixing the problem :) 2021-12-15 19:45:19 -08:00
Toad-Dev
9083e4f97b Ensure that static inits in Registry happen at a defined time.
There must be a better way to do this, but at least I understand why
this code existed before.
2021-12-15 19:42:11 -08:00
Toad-Dev
f74a386312 Change how we access tags to be compatible with dedicated server.
Another oversight in the merge.
2021-12-15 19:42:11 -08:00
Toad-Dev
ad0080ef32 Don't use ModelResourceLocation class on dedicated server.
Missed this during the merge.
2021-12-15 19:42:11 -08:00
Merith
a549400776
Merge pull request #33 from DrummerMC/mc-1.18.x/fixTurtleSuckCommand
fix TurtleSuckCommand
2021-12-15 18:31:20 -08:00
Toad-Dev
d2405ee3c3 Merge tag 'v1.18.1-1.99.1' into mc-1.18.x/dev 2021-12-15 14:26:38 -08:00
DrummerMC
2145d0fe14 fix TurtleSuckCommand 2021-12-15 18:14:35 +01:00
Jonathan Coates
f6fcba7a39
Merge branch 'mc-1.17.x' into mc-1.18.x 2021-12-14 20:13:53 +00:00
Jonathan Coates
82a7edee12
Merge branch 'mc-1.16.x' into mc-1.17.x 2021-12-14 20:07:48 +00:00
Toad-Dev
687352572d Target MC 1.18.1 2021-12-13 23:46:08 -08:00
Jonathan Coates
b048b6666d
Add arbitrary audio support to speakers (#982)
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!
2021-12-13 22:56:59 +00:00
Jonathan Coates
e16f66e128
Some bits of rednet cleanup
- 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.
2021-12-13 14:30:13 +00:00
Jonathan Coates
1cfad31a0d
Separate breaking progress for wired modems
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.
2021-12-13 13:30:43 +00:00
Jonathan Coates
7c373c6e06
Merge branch 'mc-1.17.x' into mc-1.18.x v1.18.1-1.99.1 2021-12-11 07:50:18 +00:00
Jonathan Coates
6196aae488
Merge branch 'mc-1.16.x' into mc-1.17.x v1.17.1-1.99.1 2021-12-11 07:49:33 +00:00
Jonathan Coates
92a0ef2b75
Bump CC:T version v1.16.5-1.99.1 2021-12-11 07:37:10 +00:00
Jonathan Coates
57c5d19f95
Update to Forge 1.18.1 2021-12-11 07:31:41 +00:00
Jonathan Coates
1f6e0f287d
Ensure the origin monitor is valid too
Blurh, still not sure if this is Correct or anything, but have no clue
what's causing this. Fixes #985. Hopefully.
2021-12-10 13:13:31 +00:00
Jonathan Coates
0e4b7a5a75
Prevent terminal buttons stealing focus
I have shutdown my computer by accident far too many times now.
2021-12-08 23:16:53 +00:00
Jonathan Coates
47ad7a35dc
Fix NPE when pulling an event with no type
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!
2021-12-08 22:47:21 +00:00
Toad-Dev
147f396d28 Bump version number -> 1.99.0 2021-12-07 20:13:38 -08:00
Toad-Dev
35d642b516 Fix _HOST variable showing incorrect MC version. 2021-12-07 20:04:13 -08:00
Toad-Dev
dc20050547 Fix computers and turtles breaking without particles.
This is a very jarring bug in creative mode.
2021-12-07 19:08:50 -08:00
Toad-Dev
f5c8afa566 Fix turtle tools not wanting to break blocks.
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.
2021-12-07 19:08:50 -08:00
Toad-Dev
6c73eb7df1 Implement MonitorWatcher functionality.
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...
2021-12-07 19:07:31 -08:00
Toad-Dev
745b732e87 Fix BlockEntity syncing.
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...
2021-12-07 18:57:23 -08:00
Toad-Dev
6c519aef63 Merge remote-tracking branch 'CC-Tweaked/mc-1.18.x' into mc-1.18.x/dev 2021-12-07 18:54:05 -08:00
Toad-Dev
f880396286 Merge as much code from CC-Tweaked/mc-1.18.x into CC:R as possible.
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.
2021-12-07 18:53:43 -08:00
Jonathan Coates
3eab2a9b57
Add support for a zero-copy Lua table
The API is entirely designed for the needs of the speaker right now, so
doesn't do much else.
2021-12-07 18:27:29 +00:00
Toad-Dev
34760d3de4 Update to MC 1.18
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.
2021-12-05 12:28:11 -08:00
Jonathan Coates
c4024a4c4c
Use an admonition instead 2021-12-02 22:41:58 +00:00
Jonathan Coates
f5fb82cd7d
Merge pull request #977 from MCJack123/patch-9
Add package.searchpath
2021-12-02 12:34:07 +00:00
Jonathan Coates
23c17075be
save -> saveAdditional
Also add in a janky workabround for handleUpdateTag not being called.
Being an early porter is always fun :D:.
v1.18-1.99.0
2021-12-02 09:20:06 +00:00
MCJack123
e18ba8a2c2
Add package.searchpath 2021-12-01 18:55:24 -05:00
Jonathan Coates
87988a705b
Exclude Jetbrains annotations from testModExtra
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 :)
2021-12-01 20:40:46 +00:00
Jonathan Coates
422bfdb60d
Add 1.18 and remove 1.15 from the issue template
No, we're not pushing it to Curse yet, but while I remember.
2021-12-01 20:24:37 +00:00
Jonathan Coates
1851ed31cd
Release keys when opening the offhand pocket computer screen
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.
2021-12-01 20:09:38 +00:00
Jonathan Coates
179da1d8cf
Update to MC 1.18
- 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!
2021-11-30 22:48:38 +00:00
Jonathan Coates
92fd93c0e0
Merge branch 'mc-1.16.x' into mc-1.17.x 2021-11-30 22:37:07 +00:00