mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge pull request #2426 from KellenHurrey/master
Add a oc function to set the custom map of redstone over radio torches
This commit is contained in:
commit
463d020dad
@ -17,6 +17,8 @@ import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
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);
|
||||
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