use of mcjty.rftoolsdim.dimensions.dimlets.types.IDimletType in project RFToolsDimensions by McJty.
the class DimensionEditorTileEntity method validateInjectableItemStack.
private ItemStack validateInjectableItemStack() {
ItemStack itemStack = inventoryHelper.getStackInSlot(DimensionEditorContainer.SLOT_INJECTINPUT);
if (ItemStackTools.isEmpty(itemStack)) {
stopInjecting();
return ItemStackTools.getEmptyStack();
}
if (isMatterReceiver(itemStack)) {
return itemStack;
}
if (isTNT(itemStack)) {
return canDeleteDimension(itemStack);
}
DimletKey key = KnownDimletConfiguration.getDimletKey(itemStack);
DimletType type = key.getType();
IDimletType itype = type.dimletType;
if (itype.isInjectable()) {
return itemStack;
} else {
return ItemStackTools.getEmptyStack();
}
}
use of mcjty.rftoolsdim.dimensions.dimlets.types.IDimletType in project RFToolsDimensions by McJty.
the class DimensionInformation method injectDimlet.
public void injectDimlet(DimletKey key) {
DimletType type = key.getType();
IDimletType itype = type.dimletType;
if (itype.isInjectable()) {
addToCost(key);
itype.inject(key, this);
}
}
use of mcjty.rftoolsdim.dimensions.dimlets.types.IDimletType in project RFToolsDimensions by McJty.
the class DimletWorkbenchTileEntity method checkDimletCrafting.
private boolean checkDimletCrafting() {
ItemStack stackBase = inventoryHelper.getStackInSlot(DimletWorkbenchContainer.SLOT_BASE);
if (ItemStackTools.isEmpty(stackBase)) {
return false;
}
ItemStack stackController = inventoryHelper.getStackInSlot(DimletWorkbenchContainer.SLOT_CONTROLLER);
if (ItemStackTools.isEmpty(stackController)) {
return false;
}
ItemStack stackTypeController = inventoryHelper.getStackInSlot(DimletWorkbenchContainer.SLOT_TYPE_CONTROLLER);
if (ItemStackTools.isEmpty(stackTypeController)) {
return false;
}
ItemStack stackMemory = inventoryHelper.getStackInSlot(DimletWorkbenchContainer.SLOT_MEMORY);
if (ItemStackTools.isEmpty(stackMemory)) {
return false;
}
ItemStack stackEnergy = inventoryHelper.getStackInSlot(DimletWorkbenchContainer.SLOT_ENERGY);
if (ItemStackTools.isEmpty(stackEnergy)) {
return false;
}
ItemStack stackEssence = inventoryHelper.getStackInSlot(DimletWorkbenchContainer.SLOT_ESSENCE);
if (ItemStackTools.isEmpty(stackEssence)) {
return false;
}
DimletType type = DimletType.values()[stackTypeController.getItemDamage()];
IDimletType itype = type.dimletType;
DimletKey key = itype.attemptDimletCrafting(stackController, stackMemory, stackEnergy, stackEssence);
if (key != null) {
inventoryHelper.setInventorySlotContents(1, DimletWorkbenchContainer.SLOT_OUTPUT, KnownDimletConfiguration.getDimletStack(key));
return true;
}
return false;
}
Aggregations