1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-27 07:52:18 +00:00

2277 Commits

Author SHA1 Message Date
Merith
73e3e237ad apply squiddev mojmap patches, temporarily disable checkstyle 2021-11-27 04:16:29 +00:00
Jonathan Coates
7b7527ec80
Rewrite turtle upgrade registration to be more data driven (#967)
The feature nobody asked for, but we're getting anyway.

Old way to register a turtle/pocket computer upgrade:

    ComputerCraftAPI.registerTurtleUpgrade(new MyUpgrade(new ResourceLocation("my_mod", "my_upgrade")));

New way to register a turtle/pocket computer upgrade:

First, define a serialiser for your turtle upgrade type:

    static final DeferredRegister<TurtleUpgradeSerialiser<?>> SERIALISERS = DeferredRegister.create( TurtleUpgradeSerialiser.TYPE, "my_mod" );
    public static final RegistryObject<TurtleUpgradeSerialiser<MyUpgrade>> MY_UPGRADE =
        SERIALISERS.register( "my_upgrade", () -> TurtleUpgradeSerialiser.simple( MyUpgrade::new ) );
    SERIALISERS.register(bus); // Call in your mod constructor.

Now either create a JSON string or use a data generator to register your upgrades:

    class TurtleDataGenerator extends TurtleUpgradeDataProvider {
        @Override
        protected void addUpgrades( @Nonnull Consumer<Upgrade<TurtleUpgradeSerialiser<?>>> addUpgrade )
            simple(new ResourceLocation("my_mod", my_upgrade"), MY_UPGRADE.get()).add(addUpgrade);
        }
    }

See much better! In all seriousness, this does offer some benefits,
namely that it's now possible to overwrite or create upgrades via
datapacks.

Actual changes:
 - Remove ComputerCraftAPI.register{Turtle,Pocket}Upgrade functions.

 - Instead add {Turtle,Pocket}UpgradeSerialiser classes, which are used
   to load upgrades from JSON files in datapacks, and then read/write
   them to network packets (much like recipe serialisers).

 - The upgrade registries now subscribe to datapack reload events. They
   find all JSON files in the
   data/$mod_id/computercraft/{turtle,pocket}_upgrades directories,
   parse them, and then register them as upgrades.

   Once datapacks have fully reloaded, these upgrades are then sent over
   the network to the client.

 - Add data generators for turtle and pocket computer upgrades, to make
   the creation of JSON files a bit easier.

 - Port all of CC:T's upgrades over to use the new system.
2021-11-26 23:36:02 +00:00
Lupus590
8ffd45c66e
"cc.pretty".pretty_print shortcut function (#965) 2021-11-26 21:13:15 +00:00
Jonathan Coates
e247bd823e
Bump Gradle and Kotlin versions
I think we need this for 1.18
2021-11-26 21:12:20 +00:00
Jonathan Coates
276956eed8
Fix command block config not being read 2021-11-26 20:58:58 +00:00
Merith
dbbbe96df2 attempt to use mojmap
currently does not compile
2021-11-26 20:54:21 +00:00
Merith
bae502e8ea
fix gitpod link in readme 2021-11-26 12:39:07 -08:00
Jonathan Coates
a4c5ecf8df
Don't specify the version number in mods.toml 2021-11-25 14:54:32 +00:00
Jonathan Coates
99de00e16e
Remove craft tweaker integration 2021-11-25 13:36:33 +00:00
Jonathan Coates
600227e481
Merge branch 'mc-1.16.x' into mc-1.17.x 2021-11-25 13:34:19 +00:00
Jonathan Coates
18d66bd727
Add dimension parameter to commands.getBlockInfo{,s}
Closes #130. Worth noting it doesn't add an additional argument to
getBlockPosition - want to leave that off for now.
2021-11-24 19:31:54 +00:00
Jonathan Coates
d3563a3854
Cleanup resource mount reloading
- Subscribe to the "on add reload listener" event, otherwise we don't
   get reloads beyond the first one! This means we no longer need to
   cast the resource manager to a reloadable one.
 - Change the mount cache so it's keyed on path, rather than "path ✕
   manager".
 - Update the reload listener just to use the mount cache, rather than
   having its own separate list. I really don't understand what I was
   thinking before.
2021-11-24 19:07:12 +00:00
Jonathan Coates
c2dc8bf675
Rewrite monitor resizing
- Some improvements to validation of monitors. This rejects monitors
   with invalid dimensions, specifically those with a width or height
   of 0. Should fix #922.

 - Simplify monitor collapsing a little. This now just attempts to
   resize the four "corner" monitors (where present) and then expands
   them if needed. Fixes #913.

 - Rewrite monitor expansion so that it's no longer recursive. Instead
   we track the "origin" monitor and replace it whenever we resize to
   the left or upwards.

   Also add a upper bound on the loop count, which should prevent things
   like #922 happening again. Though as mentioned above, validation
   should prevent this anyway.

 - Some small bits of cleanup to general monitor code.

I have absolutely no confidence that this code is any better behaved
than the previous version. Let's find out I guess!
2021-11-24 13:35:57 +00:00
Jonathan Coates
603119e1e6
Replace magic values with Forge constants
Gonna have to replace these in 1.17 as Minecraft exposes these by
default!
2021-11-23 21:17:34 +00:00
Jonathan Coates
d9b3f17b52
Add a debug overlay for monitors and turtles
Monitors is probably the more useful thing here (well, for me at
least). It is a _debug_ overlay after all :p.
2021-11-23 21:14:06 +00:00
Jonathan Coates
993bccc51f
Resort language files
Slightly annoying that weblate keeps getting this wrong. I don't think
any of the addons allow me to enforce an ordering either.
2021-11-23 19:48:47 +00:00
Weblate
96d3b27064 Translations for Korean
Co-authored-by: E. Kim <mindy15963@naver.com>
2021-11-23 19:43:15 +00:00
Jonathan Coates
f33f57ea35
Allow generic peripherals to specify a custom source
- Add a new GenericPeripheral interface. We don't strictly speaking
   need this - could put this on GenericSource - but the separation
   seems cleaner.

 - GenericPeripheral.getType() returns a new PeripheralType class, which
   can either be untyped() or specify a type name. This is a little
   over-engineered (could just be a nullable string), but I'm planning
   to allow multiple types in the future, so want some level of
   future-proofing.

 - Thread this PeripheralType through the method gathering code and
   expose it to the GenericPeripheralProvider, which then chooses an
   appropriate name.

   This is a little ugly (we're leaking information about peripherals
   everywhere), but I think is fine for now. It's all private internals
   after all!

Closes #830
2021-11-22 18:05:13 +00:00
Jonathan Coates
070479d901
Make executeMainThreadTask a default method
- Move TaskCallback into the API and make it package private. This
   effectively means it's not an API class, just exists there for
   convenience reasons.
 - Replace any usage of TaskCallback.make with
   ILuaContext.executeMainThreadTask.
 - Some minor formatting/checkstyle changes to bring us inline with
   IntelliJ config.
2021-11-21 11:19:02 +00:00
Jonathan Coates
2fe40f669d
Don't send packets when the server is stopping
Fixes #956
2021-11-20 23:20:27 +00:00
Jonathan Coates
1b39c9f470
Bump various package versions 2021-11-20 23:20:12 +00:00
Merith
ed9e823f3f
update version number for new release v1.97.2 2021-11-17 13:19:25 -08:00
Weblate
814d5cbcd1 Translations for Italian
Co-authored-by: Alessandro <ale.proto00@gmail.com>
2021-11-17 14:24:23 +00:00
Anavrins
4d8862c78e
Optimize peripheral calls in rednet.run (#954) 2021-11-14 06:57:47 +00:00
Weblate
6cc2f035db Translations for Japanese (ja_jp)
Co-authored-by: MORIMORI0317 <morimori.0317@outlook.jp>
2021-11-13 06:24:20 +00:00
Merith
2b8fea5b35
Merge pull request #20 from Wiggles1305/Wiggles1305-patch-1
Recipe parity with CC: Tweaked
2021-11-11 18:30:31 -08:00
Zachbutwithak
b3e6b4c29a
Recipe parity with CC: Tweaked 2021-11-11 18:08:09 -08:00
Merith
c94ff68e7f
Merge pull request #19 from Wiggles1305/1.17.1
Fix en_us.json
2021-11-11 17:19:22 -08:00
Wiggles1305
3fb96a3438
Added to en_us.json
Added "upgrade.minecraft.netherite_pickaxe.adjective": "Netherite Mining", because apparently there is a netherite pickaxe mining turtle
2021-11-11 14:53:17 -08:00
Jonathan Coates
cf3f1d3d48
Add correct tool to CC computers
Also rerun data generators, forgot to do it as part of the previous
commit.

Fixes #953
2021-11-03 09:40:30 +00:00
Jonathan Coates
bca964629a
Merge branch 'mc-1.16.x' into mc-1.17.x 2021-11-03 09:34:21 +00:00
Merith
7a2b7c0701
Merge pull request #13 from 3prm3/1.17.1
Added links to ever instance of Fabric.
2021-10-31 12:47:28 -07:00
Merith
fa7a731ad1
Merge pull request #14 from joecharamut/1.17.1
Fix drag-and-drop file uploading
2021-10-31 12:45:18 -07:00
Joseph Charamut
8be48ebcf0 Fix drag-and-drop file uploading 2021-10-31 10:55:50 -04:00
ƐqɿmƐ
123f3abcaa
Added links to ever instance of Fabric.
Also capitalized the word "Forge".
2021-10-30 11:21:58 -07:00
Merith
9f2e43f00a
Merge pull request #9 from joecharamut/1.17.1
Force Jitpack to actually use Java 16 instead of Java 8
2021-10-28 10:22:25 -07:00
Merith
9fb35b2799
Merge pull request #11 from ga2mer/1.17.1
Wired Modem/Cable breaking and creative picking of sided modem and cable
2021-10-28 10:10:36 -07:00
Nikita Savyolov
272572dbf2
fix: creative picking sided modem/cable 2021-10-28 01:10:47 +03:00
Nikita Savyolov
702e4fc787
fix: correct (maybe) modem properties
something changed in 1.17 and the modem now slowly breaks with hand or pickaxe, so we set this manually
2021-10-28 01:08:31 +03:00
Jonathan Coates
ea7a218f4a
Make turtle breaking a little more data driven
- Allow any tool to break an "instabreak" block (saplings, plants,
   TNT). Oddly this doesn't include bamboo or bamboo sapings (they're
   marked as instabreak, only to have their strength overridden again!),
   so we also provide a tag for additional blocks to allow.

 - Hoes and shovels now allow breaking any block for which this tool is
   effective.

 - Use block tags to drive any other block breaking capabilities. For
   instance, hoes can break pumpkins and cactuses despite not being
   effective.

This should get a little nicer in 1.17, as we can just use block tags
for everything.
2021-10-27 19:32:58 +01:00
Merith
511327effe
Merge pull request #10 from 3prm3/1.17.1
Fixed grammar errors like your/you're added a link.
2021-10-27 08:44:12 -07:00
ƐqɿmƐ
940e35caea
Fixed grammar errors like your/you're added a link. 2021-10-26 19:14:04 -07:00
Joseph Charamut
fca01693dd
Update jitpack.yml 2021-10-26 21:21:31 -04:00
Joseph Charamut
8846a3f36f
Create jitpack.yml 2021-10-26 21:19:36 -04:00
Merith
8002c9e932
Merge pull request #2 from ga2mer/1.17.1
Mainly WiredModem/Cable fixes
2021-10-26 13:29:33 -07:00
Jonathan Coates
544bcaa599
Clear the entity drop list as well as cancelling
Fixes #940
2021-10-24 19:11:21 +01:00
Nikita Savyolov
6fd8331e94
fix: BlockCable removedByPlayer 2021-10-18 21:47:43 +03:00
Nikita Savyolov
7a667b9028
fix: correct cable with wired modem highlight
The right thing would be to fix Mixin, just like it is done in Forge, but I think that's enough for now
2021-10-18 21:45:33 +03:00
Nikita Savyolov
67b7cd7a14
fix: wired modem direction 2021-10-17 21:10:10 +03:00
Nikita Savyolov
960d79803d
fix: MixinWorld more correct height check
I think this Mixin need to be revisiting
2021-10-17 21:08:48 +03:00