mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Add radio method
This commit is contained in:
parent
966206dbf5
commit
f6c74ce98e
@ -17,6 +17,8 @@ import net.minecraft.network.NetworkManager;
|
|||||||
import net.minecraft.network.Packet;
|
import net.minecraft.network.Packet;
|
||||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||||
public class TileEntityRadioTorchBase extends TileEntityLoadedBase implements IControlReceiver, SimpleComponent, CompatHandler.OCComponent {
|
public class TileEntityRadioTorchBase extends TileEntityLoadedBase implements IControlReceiver, SimpleComponent, CompatHandler.OCComponent {
|
||||||
|
|
||||||
@ -137,4 +139,18 @@ public class TileEntityRadioTorchBase extends TileEntityLoadedBase implements IC
|
|||||||
customMap = args.checkBoolean(0);
|
customMap = args.checkBoolean(0);
|
||||||
return new Object[] {};
|
return new Object[] {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true, limit = 4, doc = "setCustomMapValues(value: table) -- Sets the custom signal mapping values with a table with indices corresponding to the redstone value (1-16)")
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] setCustomMapValues(Context context, Arguments args){
|
||||||
|
Map values = args.checkTable(0);
|
||||||
|
|
||||||
|
for (int i = 1; i <= 16; i++){
|
||||||
|
if (values.containsKey(i) && values.get(i) instanceof String){
|
||||||
|
this.mapping[i - 1] = (String) values.get(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Object[] {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user