Add recipes for reader/writer, change security manager recipe, formatting

This commit is contained in:
raoulvdberge
2017-01-28 21:53:21 +01:00
parent 605e4f4ec6
commit b147bb5b11
4 changed files with 39 additions and 4 deletions

View File

@@ -39,6 +39,7 @@ public class StorageItemCyclops extends StorageItemExternal {
InventoryTileEntityBase inv = cyclopsInv.get(); InventoryTileEntityBase inv = cyclopsInv.get();
if (inv != null) { if (inv != null) {
int inventoryHash = inv.getInventoryHash(); int inventoryHash = inv.getInventoryHash();
if (inventoryHash != oldInventoryHash) { if (inventoryHash != oldInventoryHash) {
super.detectChanges(network); super.detectChanges(network);
oldInventoryHash = inventoryHash; oldInventoryHash = inventoryHash;

View File

@@ -3,32 +3,40 @@ package com.raoulvdberge.refinedstorage.integration.cyclopscore;
import com.raoulvdberge.refinedstorage.api.util.IComparer; import com.raoulvdberge.refinedstorage.api.util.IComparer;
import org.cyclops.commoncapabilities.api.capability.itemhandler.ItemMatch; import org.cyclops.commoncapabilities.api.capability.itemhandler.ItemMatch;
public class CyclopsComparer { public final class CyclopsComparer {
public static int comparerFlagsToItemMatch(int flags) { public static int comparerFlagsToItemMatch(int flags) {
int itemMatch = 0; int itemMatch = 0;
if ((flags & IComparer.COMPARE_DAMAGE) == IComparer.COMPARE_DAMAGE) { if ((flags & IComparer.COMPARE_DAMAGE) == IComparer.COMPARE_DAMAGE) {
itemMatch |= ItemMatch.DAMAGE; itemMatch |= ItemMatch.DAMAGE;
} }
if ((flags & IComparer.COMPARE_NBT) == IComparer.COMPARE_NBT) { if ((flags & IComparer.COMPARE_NBT) == IComparer.COMPARE_NBT) {
itemMatch |= ItemMatch.NBT; itemMatch |= ItemMatch.NBT;
} }
if ((flags & IComparer.COMPARE_QUANTITY) == IComparer.COMPARE_QUANTITY) { if ((flags & IComparer.COMPARE_QUANTITY) == IComparer.COMPARE_QUANTITY) {
itemMatch |= ItemMatch.STACKSIZE; itemMatch |= ItemMatch.STACKSIZE;
} }
return itemMatch; return itemMatch;
} }
public static int itemMatchToComparerFlags(int itemMatch) { public static int itemMatchToComparerFlags(int itemMatch) {
int flags = 0; int flags = 0;
if ((itemMatch & ItemMatch.DAMAGE) == ItemMatch.DAMAGE) { if ((itemMatch & ItemMatch.DAMAGE) == ItemMatch.DAMAGE) {
flags |= IComparer.COMPARE_DAMAGE; flags |= IComparer.COMPARE_DAMAGE;
} }
if ((itemMatch & ItemMatch.NBT) == ItemMatch.NBT) { if ((itemMatch & ItemMatch.NBT) == ItemMatch.NBT) {
flags |= IComparer.COMPARE_NBT; flags |= IComparer.COMPARE_NBT;
} }
if ((itemMatch & ItemMatch.STACKSIZE) == ItemMatch.STACKSIZE) { if ((itemMatch & ItemMatch.STACKSIZE) == ItemMatch.STACKSIZE) {
flags |= IComparer.COMPARE_QUANTITY; flags |= IComparer.COMPARE_QUANTITY;
} }
return flags; return flags;
} }
} }

View File

@@ -19,6 +19,7 @@ public class ImportingBehaviorCyclops implements IImportingBehavior {
if (IFilterable.isEmpty(itemFilters)) { if (IFilterable.isEmpty(itemFilters)) {
if (ticks % upgrades.getSpeed() == 0) { if (ticks % upgrades.getSpeed() == 0) {
ItemStack result = SlotlessItemHandlerHelper.extractItem(entity, facing, upgrades.getItemInteractCount(), true); ItemStack result = SlotlessItemHandlerHelper.extractItem(entity, facing, upgrades.getItemInteractCount(), true);
if (result != null && !result.isEmpty() && network.insertItem(result, result.getCount(), true) == null) { if (result != null && !result.isEmpty() && network.insertItem(result, result.getCount(), true) == null) {
network.insertItem(result, result.getCount(), false); network.insertItem(result, result.getCount(), false);
SlotlessItemHandlerHelper.extractItem(entity, facing, result.copy(), upgrades.getItemInteractCount(), false); SlotlessItemHandlerHelper.extractItem(entity, facing, result.copy(), upgrades.getItemInteractCount(), false);

View File

@@ -389,6 +389,30 @@ public class ProxyCommon {
'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED) 'A', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED)
); );
// Writer
GameRegistry.addShapedRecipe(new ItemStack(RSBlocks.WRITER),
"ECE",
"RMR",
"EIE",
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
'C', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
'R', new ItemStack(Items.REDSTONE),
'M', new ItemStack(RSBlocks.CABLE),
'I', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED)
);
// Reader
GameRegistry.addShapedRecipe(new ItemStack(RSBlocks.READER),
"EDE",
"RMR",
"EIE",
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
'D', new ItemStack(RSItems.CORE, 1, ItemCore.TYPE_DESTRUCTION),
'R', new ItemStack(Items.REDSTONE),
'M', new ItemStack(RSBlocks.CABLE),
'I', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED)
);
// Crafter // Crafter
GameRegistry.addRecipe(new ItemStack(RSBlocks.CRAFTER), GameRegistry.addRecipe(new ItemStack(RSBlocks.CRAFTER),
"ECE", "ECE",
@@ -754,12 +778,13 @@ public class ProxyCommon {
// Security Manager // Security Manager
GameRegistry.addShapedRecipe(new ItemStack(RSBlocks.SECURITY_MANAGER), GameRegistry.addShapedRecipe(new ItemStack(RSBlocks.SECURITY_MANAGER),
"ECE", "ECE",
"CMC", "SMS",
"ECE", "ESE",
'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON), 'E', new ItemStack(RSItems.QUARTZ_ENRICHED_IRON),
'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED), 'P', new ItemStack(RSItems.PROCESSOR, 1, ItemProcessor.TYPE_ADVANCED),
'M', new ItemStack(RSBlocks.MACHINE_CASING), 'M', new ItemStack(RSBlocks.MACHINE_CASING),
'C', new ItemStack(RSItems.NETWORK_CARD) 'S', new ItemStack(RSItems.SECURITY_CARD),
'C', new ItemStack(Blocks.CHEST)
); );
// Security Card // Security Card