@@ -0,0 +1,1423 @@
+package org.squiddev.plethora.integration.ic2;%0A%0Aimport dan200.computercraft.api.lua.LuaException;%0Aimport ic2.api.reactor.IReactor;%0Aimport ic2.api.reactor.IReactorChamber;%0Aimport ic2.core.IC2;%0Aimport net.minecraft.tileentity.TileEntity;%0Aimport org.squiddev.plethora.api.method.BasicObjectMethod;%0Aimport org.squiddev.plethora.api.method.IContext;%0Aimport org.squiddev.plethora.api.reference.DynamicReference;%0A%0Aimport javax.annotation.Nonnull;%0A%0Apublic class MethodsReactor %7B%0A%09private static class ReactorReference extends DynamicReference%3CIReactor%3E %7B%0A%09%09private final IReactor core;%0A%09%09private final TileEntity expected;%0A%0A%09%09ReactorReference(IReactor core) %7B%0A%09%09%09this.core = core;%0A%09%09%09this.expected = core.getCoreTe();%0A%09%09%7D%0A%0A%09%09@Nonnull%0A%09%09@Override%0A%09%09public IReactor get() throws LuaException %7B%0A%09%09%09if (core.getCoreTe() != expected) %7B%0A%09%09%09%09throw new LuaException(%22The reactor has changed%22);%0A%09%09%09%7D%0A%0A%09%09%09return core;%0A%09%09%7D%0A%0A%09%09@Nonnull%0A%09%09@Override%0A%09%09public IReactor safeGet() throws LuaException %7B%0A%09%09%09return core;%0A%09%09%7D%0A%09%7D%0A%0A%09@BasicObjectMethod.Inject(%0A%09%09%09value = IReactorChamber.class, worldThread = true, modId = IC2.MODID,%0A%09%09%09doc = %22function():table -- Get a reference to the reactor's core%22%0A%09)%0A%09public static Object%5B%5D getReactorCore(IContext%3CIReactorChamber%3E context, Object%5B%5D args) %7B%0A%09%09IReactor core = context.getTarget().getReactorInstance();%0A%09%09return new Object%5B%5D %7B context.makeChild(core, new ReactorReference(core)).getObject() %7D;%0A%09%7D%0A%0A%7D%0A

Add method to get IC2 reactor core from chamber