use of logisticspipes.asm.ModDependentMethod in project LogisticsPipes by RS485.
the class PipeTransportLogistics method injectItem.
/**
* Accept items from BC
*/
@ModDependentMethod(modId = "BuildCraft|Transport")
public void injectItem(TravelingItem item, ForgeDirection inputOrientation) {
if (MainProxy.isServer(getWorld())) {
if (item instanceof LPRoutedBCTravelingItem) {
ItemRoutingInformation info = ((LPRoutedBCTravelingItem) item).getRoutingInformation();
info.setItem(ItemIdentifierStack.getFromStack(item.getItemStack()));
LPTravelingItemServer lpItem = new LPTravelingItemServer(info);
lpItem.setSpeed(item.getSpeed());
this.injectItem(lpItem, inputOrientation);
} else {
ItemRoutingInformation info = LPRoutedBCTravelingItem.restoreFromExtraNBTData(item);
if (info != null) {
info.setItem(ItemIdentifierStack.getFromStack(item.getItemStack()));
LPTravelingItemServer lpItem = new LPTravelingItemServer(info);
lpItem.setSpeed(item.getSpeed());
this.injectItem(lpItem, inputOrientation);
} else {
LPTravelingItemServer lpItem = SimpleServiceLocator.routedItemHelper.createNewTravelItem(item.getItemStack());
lpItem.setSpeed(item.getSpeed());
this.injectItem(lpItem, inputOrientation);
}
}
}
}
use of logisticspipes.asm.ModDependentMethod in project LogisticsPipes by RS485.
the class LogisticsBaseGuiScreen method handleDragNDrop.
@Override
@ModDependentMethod(modId = LPConstants.neiModID)
public boolean handleDragNDrop(GuiContainer gui, int mouseX, int mouseY, @Nonnull ItemStack stack, int button) {
if (gui instanceof LogisticsBaseGuiScreen && gui.inventorySlots instanceof DummyContainer && !stack.isEmpty()) {
Slot result = null;
int pos = -1;
for (int k = 0; k < inventorySlots.inventorySlots.size(); ++k) {
Slot slot = inventorySlots.inventorySlots.get(k);
if (isMouseOverSlot(slot, mouseX, mouseY)) {
result = slot;
pos = k;
break;
}
}
if (result != null) {
if (result instanceof DummySlot || result instanceof ColorSlot || result instanceof FluidSlot) {
((DummyContainer) gui.inventorySlots).handleDummyClick(result, pos, stack, button, ClickType.PICKUP, mc.player);
MainProxy.sendPacketToServer(PacketHandler.getPacket(DummyContainerSlotClick.class).setSlotId(pos).setStack(stack).setButton(button));
return true;
}
}
}
return false;
}
use of logisticspipes.asm.ModDependentMethod in project LogisticsPipes by RS485.
the class LogisticsSolidTileEntity method invoke.
@Override
@ModDependentMethod(modId = LPConstants.openComputersModID)
public Object[] invoke(String s, Context context, Arguments arguments) {
BaseWrapperClass object = (BaseWrapperClass) CCObjectWrapper.getWrappedObject(this, BaseWrapperClass.WRAPPER);
object.isDirectCall = true;
return CCObjectWrapper.createArray(object);
}
use of logisticspipes.asm.ModDependentMethod in project LogisticsPipes by RS485.
the class CoreRoutedPipe method getPipeForUUID.
@CCCommand(description = "Returns the access to the pipe of the given router UUID")
@ModDependentMethod(modId = LPConstants.computerCraftModID)
@CCDirectCall
public Object getPipeForUUID(String sUuid) throws PermissionException {
if (!getUpgradeManager().hasCCRemoteControlUpgrade()) {
throw new PermissionException();
}
UUID uuid = UUID.fromString(sUuid);
int id = SimpleServiceLocator.routerManager.getIDforUUID(uuid);
IRouter router = SimpleServiceLocator.routerManager.getRouter(id);
if (router == null) {
return null;
}
return router.getPipe();
}
use of logisticspipes.asm.ModDependentMethod in project LogisticsPipes by RS485.
the class LogisticsTileGenericPipe method invoke.
@Override
@ModDependentMethod(modId = LPConstants.openComputersModID)
public Object[] invoke(String s, Context context, Arguments arguments) {
BaseWrapperClass object = (BaseWrapperClass) Objects.requireNonNull(CCObjectWrapper.getWrappedObject(pipe, BaseWrapperClass.WRAPPER), "wrapped object returned null in " + toString());
object.isDirectCall = true;
return CCObjectWrapper.createArray(object);
}
Aggregations