Add the player-use peripheral for CC:Tweaked #9

Merged
BlakeRain merged 3 commits from BlakeRain/utamacraft:cc-playerish-peripheral into main 2023-11-27 16:16:56 +00:00
Owner

In reference to #8, this PR adds the ability to create peripherals for CC:Tweaked turtles. It also includes a peripheral that emulates a player, and adds a use() method that will attempt to use the block in-front of the turtle (up to four blocks away).

Crating the Upgrade

The upgrade can be crafted by combining four gold ingots, four redstone and an eye of ender.

The upgrade can be combined with a normal or advanced turtle in the usual way of throwing them into a crating interface to combine them. Currently the upgrade will sit in the left socket. It might be possible to use the Lua turtle API to mount the peripheral on the right.

Using the Upgrade

Once the upgrade is added to a turtle, the peripheral can be wrapped in the usual way using the peripheral API. This peripheral yields a single method, called use, which takes no arguments and performs the use operation. The method will return either nil if used incorrectly or a string representation of the InteractionResult enumeration (e.g. "CONSUME" or "SUCCESS"). I don't know what all the enumerators mean.

In reference to #8, this PR adds the ability to create peripherals for CC:Tweaked turtles. It also includes a peripheral that emulates a player, and adds a `use()` method that will attempt to use the block in-front of the turtle (up to four blocks away). # Crating the Upgrade The upgrade can be crafted by combining four gold ingots, four redstone and an eye of ender. The upgrade can be combined with a normal or advanced turtle in the usual way of throwing them into a crating interface to combine them. Currently the upgrade will sit in the left socket. It might be possible to use the Lua `turtle` API to mount the peripheral on the right. # Using the Upgrade Once the upgrade is added to a turtle, the peripheral can be wrapped in the usual way using the `peripheral` API. This peripheral yields a single method, called `use`, which takes no arguments and performs the use operation. The method will return either `nil` if used incorrectly or a string representation of the [`InteractionResult`](https://nekoyue.github.io/ForgeJavaDocs-NG/javadoc/1.19.3/net/minecraft/world/InteractionResult.html) enumeration (e.g. `"CONSUME"` or `"SUCCESS"`). I don't know what all the enumerators mean.
BlakeRain added this to the v0.1.0 milestone 2023-11-27 16:13:16 +00:00
BlakeRain added the
Kind/Feature
label 2023-11-27 16:13:16 +00:00
BlakeRain self-assigned this 2023-11-27 16:13:16 +00:00
BlakeRain added 3 commits 2023-11-27 16:13:16 +00:00
BlakeRain merged commit 8fd9137af3 into main 2023-11-27 16:16:56 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: bans-minecraft/utamacraft#9
No description provided.