mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 02:39:48 -04:00
Change modid from 'OpenComputers' to 'opencomputers'
Camel case doesn't seem to work while all-lowercase does.
This commit is contained in:
parent
2de3169e62
commit
803402c4a9
@ -7,7 +7,7 @@ Making a tile entity available as a component / peripheral
|
|||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
If you simply wish to expose a couple of methods that can be called from a computer if your tile entity's block is 'connected' to the computer, you can use the `SimpleComponent` interface. This interface serves as a marker for OpenComputers to know it has to inject code that converts your tile entity into a component using its class transformer. It is an interface instead of an annotation to allow stripping it, removing any dependencies on OpenComputers. Here is an example implementation:
|
If you simply wish to expose a couple of methods that can be called from a computer if your tile entity's block is 'connected' to the computer, you can use the `SimpleComponent` interface. This interface serves as a marker for OpenComputers to know it has to inject code that converts your tile entity into a component using its class transformer. It is an interface instead of an annotation to allow stripping it, removing any dependencies on OpenComputers. Here is an example implementation:
|
||||||
```java
|
```java
|
||||||
@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")
|
@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")
|
||||||
public class TileEntityMyFancyThing extends TileEntity
|
public class TileEntityMyFancyThing extends TileEntity
|
||||||
implements SimpleComponent
|
implements SimpleComponent
|
||||||
{
|
{
|
||||||
@ -17,7 +17,7 @@ public class TileEntityMyFancyThing extends TileEntity
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Callback
|
@Callback
|
||||||
@Optional.Method(modid = "OpenComputers")
|
@Optional.Method(modid = "opencomputers")
|
||||||
public Object[] greet(Context context, Arguments args) {
|
public Object[] greet(Context context, Arguments args) {
|
||||||
return new Object[]{String.format("Hello, %s!", args.checkString(0))};
|
return new Object[]{String.format("Hello, %s!", args.checkString(0))};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user