Open Mugiwaxar opened 2 months ago
What is the script you are using to add functions so I can test it?
files.zip Here 3 files:
According to the computer's output, the Electric Motor is still identified as 'electric_motor' instead of 'multiperipheral'.
I changed the code to
ComputerCraftEvents.peripheral(event => {
event.registerPeripheral("test", "createaddition:electric_motor")
.mainThreadMethod("aTestFunction", (container) => {
return "hi!!!"
})
})
and even kept the "test" part the original, and it was not changing to "multiperipheral" as it should be
I’ve tried several methods and searched through the source code. Apparently, CC: Tweaked prioritizes classes with the IPeripheral interface from mods, and if it doesn’t find anything, it looks at those provided by the API. I had to create a mod and use Mixins to add my own functions to already created peripherals.
Mod Version KJSCC-2002-1.0.2 for forge 1.20.1
Describe the bug
Hello,
I am trying to add functions to an existing peripheral. Following the tutorial, I attempted to extend the Electric Motor from the "Create Crafts & Additions" mod.
However, it seems that my custom peripheral is being overwritten by the mod's own peripheral. You can see the mod's code on this page:
https://github.com/mrh0/createaddition/blob/1.20.1/src/main/java/com/mrh0/createaddition/compat/computercraft/ElectricMotorPeripheral.java
How can I resolve this issue?
Thank you for your assistance!
To Reproduce Steps to reproduce the behavior: 1: Add a peripheral and functions 2: Load the game 3: Check with CC:Tweaked computer 4: Peripheral type is still the mod one, no functions added 5: Go to GitHub and post the issus