Remove Hollow Wide Cover recipes and item. Implicitly convert HOLLOW to HOLLOW_WIDE if needed.
This commit is contained in:
@@ -23,5 +23,4 @@ public final class RSItems {
|
|||||||
public static final ItemCuttingTool CUTTING_TOOL = new ItemCuttingTool();
|
public static final ItemCuttingTool CUTTING_TOOL = new ItemCuttingTool();
|
||||||
public static final ItemCover COVER = new ItemCover();
|
public static final ItemCover COVER = new ItemCover();
|
||||||
public static final ItemHollowCover HOLLOW_COVER = new ItemHollowCover();
|
public static final ItemHollowCover HOLLOW_COVER = new ItemHollowCover();
|
||||||
public static final ItemHollowWideCover HOLLOW_WIDE_COVER = new ItemHollowWideCover();
|
|
||||||
}
|
}
|
||||||
|
@@ -79,9 +79,10 @@ public class CoverManager {
|
|||||||
case NONE_ON_FACE:
|
case NONE_ON_FACE:
|
||||||
return false;
|
return false;
|
||||||
case HOLLOW_WIDE_ON_FACE:
|
case HOLLOW_WIDE_ON_FACE:
|
||||||
if (cover.getType() != CoverType.HOLLOW_WIDE) {
|
if (!cover.getType().isHollow()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
cover = new Cover(cover.getStack(), CoverType.HOLLOW_WIDE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,6 +13,6 @@ public enum CoverType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack createStack() {
|
public ItemStack createStack() {
|
||||||
return new ItemStack(this == NORMAL ? RSItems.COVER : (this == HOLLOW ? RSItems.HOLLOW_COVER : RSItems.HOLLOW_WIDE_COVER));
|
return new ItemStack(this == NORMAL ? RSItems.COVER : RSItems.HOLLOW_COVER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,7 +21,6 @@ public class RSJEIPlugin implements IModPlugin {
|
|||||||
|
|
||||||
registry.addRecipeRegistryPlugin(new RecipeRegistryPluginCover());
|
registry.addRecipeRegistryPlugin(new RecipeRegistryPluginCover());
|
||||||
registry.addRecipeRegistryPlugin(new RecipeRegistryPluginHollowCover());
|
registry.addRecipeRegistryPlugin(new RecipeRegistryPluginHollowCover());
|
||||||
registry.addRecipeRegistryPlugin(new RecipeRegistryPluginHollowWideCover());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -1,63 +0,0 @@
|
|||||||
package com.raoulvdberge.refinedstorage.integration.jei;
|
|
||||||
|
|
||||||
import com.raoulvdberge.refinedstorage.RSItems;
|
|
||||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.cover.CoverManager;
|
|
||||||
import com.raoulvdberge.refinedstorage.item.ItemCover;
|
|
||||||
import mezz.jei.api.recipe.*;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class RecipeRegistryPluginHollowWideCover implements IRecipeRegistryPlugin {
|
|
||||||
@Override
|
|
||||||
public <V> List<String> getRecipeCategoryUids(IFocus<V> focus) {
|
|
||||||
if (focus.getValue() instanceof ItemStack) {
|
|
||||||
ItemStack stack = (ItemStack) focus.getValue();
|
|
||||||
|
|
||||||
if (focus.getMode() == IFocus.Mode.INPUT) {
|
|
||||||
if (stack.getItem() == RSItems.COVER && CoverManager.isValidCover(ItemCover.getItem(stack))) {
|
|
||||||
return Collections.singletonList(VanillaRecipeCategoryUid.CRAFTING);
|
|
||||||
}
|
|
||||||
} else if (focus.getMode() == IFocus.Mode.OUTPUT) {
|
|
||||||
if (stack.getItem() == RSItems.HOLLOW_WIDE_COVER) {
|
|
||||||
return Collections.singletonList(VanillaRecipeCategoryUid.CRAFTING);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public <T extends IRecipeWrapper, V> List<T> getRecipeWrappers(IRecipeCategory<T> recipeCategory, IFocus<V> focus) {
|
|
||||||
if (focus.getValue() instanceof ItemStack) {
|
|
||||||
ItemStack stack = (ItemStack) focus.getValue();
|
|
||||||
|
|
||||||
if (focus.getMode() == IFocus.Mode.INPUT) {
|
|
||||||
if (stack.getItem() == RSItems.COVER && CoverManager.isValidCover(ItemCover.getItem(stack))) {
|
|
||||||
ItemStack hollowWideCover = new ItemStack(RSItems.HOLLOW_WIDE_COVER);
|
|
||||||
|
|
||||||
ItemCover.setItem(hollowWideCover, ItemCover.getItem(stack));
|
|
||||||
|
|
||||||
return Collections.singletonList((T) new RecipeWrapperHollowWideCover(stack, hollowWideCover));
|
|
||||||
}
|
|
||||||
} else if (focus.getMode() == IFocus.Mode.OUTPUT) {
|
|
||||||
if (stack.getItem() == RSItems.HOLLOW_WIDE_COVER) {
|
|
||||||
ItemStack cover = new ItemStack(RSItems.COVER);
|
|
||||||
|
|
||||||
ItemCover.setItem(cover, ItemCover.getItem(stack));
|
|
||||||
|
|
||||||
return Collections.singletonList((T) new RecipeWrapperHollowWideCover(cover, stack));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public <T extends IRecipeWrapper> List<T> getRecipeWrappers(IRecipeCategory<T> recipeCategory) {
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
}
|
|
@@ -2,13 +2,10 @@ package com.raoulvdberge.refinedstorage.integration.jei;
|
|||||||
|
|
||||||
import mezz.jei.api.ingredients.IIngredients;
|
import mezz.jei.api.ingredients.IIngredients;
|
||||||
import mezz.jei.api.recipe.wrapper.IShapedCraftingRecipeWrapper;
|
import mezz.jei.api.recipe.wrapper.IShapedCraftingRecipeWrapper;
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.items.ItemHandlerHelper;
|
import net.minecraftforge.items.ItemHandlerHelper;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class RecipeWrapperHollowCover implements IShapedCraftingRecipeWrapper {
|
public class RecipeWrapperHollowCover implements IShapedCraftingRecipeWrapper {
|
||||||
@@ -22,23 +19,17 @@ public class RecipeWrapperHollowCover implements IShapedCraftingRecipeWrapper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getIngredients(IIngredients ingredients) {
|
public void getIngredients(IIngredients ingredients) {
|
||||||
List<List<ItemStack>> inputs = new ArrayList<>();
|
List<ItemStack> inputs = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 0; i < 9; ++i) {
|
for (int i = 0; i < 9; ++i) {
|
||||||
if (i == 4) {
|
if (i == 4) {
|
||||||
List<ItemStack> wool = new ArrayList<>();
|
inputs.add(ItemStack.EMPTY);
|
||||||
|
|
||||||
for (int j = 0; j < 16; ++j) {
|
|
||||||
wool.add(new ItemStack(Item.getItemFromBlock(Blocks.WOOL), 1, j));
|
|
||||||
}
|
|
||||||
|
|
||||||
inputs.add(wool);
|
|
||||||
} else {
|
} else {
|
||||||
inputs.add(Collections.singletonList(cover));
|
inputs.add(cover);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ingredients.setInputLists(ItemStack.class, inputs);
|
ingredients.setInputs(ItemStack.class, inputs);
|
||||||
ingredients.setOutput(ItemStack.class, hollowCover);
|
ingredients.setOutput(ItemStack.class, hollowCover);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,41 +0,0 @@
|
|||||||
package com.raoulvdberge.refinedstorage.integration.jei;
|
|
||||||
|
|
||||||
import mezz.jei.api.ingredients.IIngredients;
|
|
||||||
import mezz.jei.api.recipe.wrapper.IShapedCraftingRecipeWrapper;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraftforge.items.ItemHandlerHelper;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class RecipeWrapperHollowWideCover implements IShapedCraftingRecipeWrapper {
|
|
||||||
private ItemStack cover;
|
|
||||||
private ItemStack hollowWideCover;
|
|
||||||
|
|
||||||
public RecipeWrapperHollowWideCover(ItemStack cover, ItemStack hollowWideCover) {
|
|
||||||
this.cover = ItemHandlerHelper.copyStackWithSize(cover, 1);
|
|
||||||
this.hollowWideCover = ItemHandlerHelper.copyStackWithSize(hollowWideCover, 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void getIngredients(IIngredients ingredients) {
|
|
||||||
List<ItemStack> inputs = new ArrayList<>();
|
|
||||||
|
|
||||||
for (int i = 0; i < 9; ++i) {
|
|
||||||
inputs.add(i == 4 ? ItemStack.EMPTY : cover);
|
|
||||||
}
|
|
||||||
|
|
||||||
ingredients.setInputs(ItemStack.class, inputs);
|
|
||||||
ingredients.setOutput(ItemStack.class, hollowWideCover);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getWidth() {
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getHeight() {
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,16 +0,0 @@
|
|||||||
package com.raoulvdberge.refinedstorage.item;
|
|
||||||
|
|
||||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.cover.Cover;
|
|
||||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.cover.CoverType;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
public class ItemHollowWideCover extends ItemCover {
|
|
||||||
public ItemHollowWideCover() {
|
|
||||||
super("hollow_wide_cover");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Cover createCover(ItemStack stack) {
|
|
||||||
return new Cover(stack, CoverType.HOLLOW_WIDE);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -220,7 +220,6 @@ public class ProxyClient extends ProxyCommon {
|
|||||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE_MONITOR), 0, new ModelResourceLocation("refinedstorage:storage_monitor", "connected=false,direction=north"));
|
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE_MONITOR), 0, new ModelResourceLocation("refinedstorage:storage_monitor", "connected=false,direction=north"));
|
||||||
ModelLoader.setCustomModelResourceLocation(RSItems.COVER, 0, new ModelResourceLocation("refinedstorage:cover", "inventory"));
|
ModelLoader.setCustomModelResourceLocation(RSItems.COVER, 0, new ModelResourceLocation("refinedstorage:cover", "inventory"));
|
||||||
ModelLoader.setCustomModelResourceLocation(RSItems.HOLLOW_COVER, 0, new ModelResourceLocation("refinedstorage:hollow_cover", "inventory"));
|
ModelLoader.setCustomModelResourceLocation(RSItems.HOLLOW_COVER, 0, new ModelResourceLocation("refinedstorage:hollow_cover", "inventory"));
|
||||||
ModelLoader.setCustomModelResourceLocation(RSItems.HOLLOW_WIDE_COVER, 0, new ModelResourceLocation("refinedstorage:hollow_wide_cover", "inventory"));
|
|
||||||
|
|
||||||
ModelLoaderRegistry.registerLoader(new CustomModelLoaderDefault(new ResourceLocation(RS.ID, "disk_drive"), ModelDiskDrive::new));
|
ModelLoaderRegistry.registerLoader(new CustomModelLoaderDefault(new ResourceLocation(RS.ID, "disk_drive"), ModelDiskDrive::new));
|
||||||
ModelLoaderRegistry.registerLoader(new CustomModelLoaderDefault(new ResourceLocation(RS.ID, "disk_manipulator"), ModelDiskManipulator::new));
|
ModelLoaderRegistry.registerLoader(new CustomModelLoaderDefault(new ResourceLocation(RS.ID, "disk_manipulator"), ModelDiskManipulator::new));
|
||||||
|
@@ -45,7 +45,6 @@ import com.raoulvdberge.refinedstorage.item.ItemProcessor;
|
|||||||
import com.raoulvdberge.refinedstorage.network.*;
|
import com.raoulvdberge.refinedstorage.network.*;
|
||||||
import com.raoulvdberge.refinedstorage.recipe.RecipeCover;
|
import com.raoulvdberge.refinedstorage.recipe.RecipeCover;
|
||||||
import com.raoulvdberge.refinedstorage.recipe.RecipeHollowCover;
|
import com.raoulvdberge.refinedstorage.recipe.RecipeHollowCover;
|
||||||
import com.raoulvdberge.refinedstorage.recipe.RecipeHollowWideCover;
|
|
||||||
import com.raoulvdberge.refinedstorage.tile.TileBase;
|
import com.raoulvdberge.refinedstorage.tile.TileBase;
|
||||||
import com.raoulvdberge.refinedstorage.tile.TileNode;
|
import com.raoulvdberge.refinedstorage.tile.TileNode;
|
||||||
import com.raoulvdberge.refinedstorage.tile.data.TileDataManager;
|
import com.raoulvdberge.refinedstorage.tile.data.TileDataManager;
|
||||||
@@ -237,7 +236,6 @@ public class ProxyCommon {
|
|||||||
registerItem(RSItems.SECURITY_CARD);
|
registerItem(RSItems.SECURITY_CARD);
|
||||||
registerItem(RSItems.COVER);
|
registerItem(RSItems.COVER);
|
||||||
registerItem(RSItems.HOLLOW_COVER);
|
registerItem(RSItems.HOLLOW_COVER);
|
||||||
registerItem(RSItems.HOLLOW_WIDE_COVER);
|
|
||||||
|
|
||||||
IntegrationInventorySorter.register();
|
IntegrationInventorySorter.register();
|
||||||
}
|
}
|
||||||
@@ -286,7 +284,6 @@ public class ProxyCommon {
|
|||||||
public void registerRecipes(RegistryEvent.Register<IRecipe> e) {
|
public void registerRecipes(RegistryEvent.Register<IRecipe> e) {
|
||||||
e.getRegistry().register(new RecipeCover().setRegistryName(new ResourceLocation(RS.ID, "cover")));
|
e.getRegistry().register(new RecipeCover().setRegistryName(new ResourceLocation(RS.ID, "cover")));
|
||||||
e.getRegistry().register(new RecipeHollowCover().setRegistryName(new ResourceLocation(RS.ID, "hollow_cover")));
|
e.getRegistry().register(new RecipeHollowCover().setRegistryName(new ResourceLocation(RS.ID, "hollow_cover")));
|
||||||
e.getRegistry().register(new RecipeHollowWideCover().setRegistryName(new ResourceLocation(RS.ID, "hollow_wide_cover")));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
@@ -3,10 +3,8 @@ package com.raoulvdberge.refinedstorage.recipe;
|
|||||||
import com.raoulvdberge.refinedstorage.RSItems;
|
import com.raoulvdberge.refinedstorage.RSItems;
|
||||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.cover.CoverManager;
|
import com.raoulvdberge.refinedstorage.apiimpl.network.node.cover.CoverManager;
|
||||||
import com.raoulvdberge.refinedstorage.item.ItemCover;
|
import com.raoulvdberge.refinedstorage.item.ItemCover;
|
||||||
import com.raoulvdberge.refinedstorage.item.ItemHollowWideCover;
|
import com.raoulvdberge.refinedstorage.item.ItemHollowCover;
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.inventory.InventoryCrafting;
|
import net.minecraft.inventory.InventoryCrafting;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.IRecipe;
|
import net.minecraft.item.crafting.IRecipe;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
@@ -39,7 +37,7 @@ public class RecipeHollowCover extends IForgeRegistryEntry.Impl<IRecipe> impleme
|
|||||||
ItemStack slot = inv.getStackInSlot(i);
|
ItemStack slot = inv.getStackInSlot(i);
|
||||||
|
|
||||||
if (i == 4) {
|
if (i == 4) {
|
||||||
if (slot.getItem() != Item.getItemFromBlock(Blocks.WOOL)) {
|
if (!slot.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -58,7 +56,7 @@ public class RecipeHollowCover extends IForgeRegistryEntry.Impl<IRecipe> impleme
|
|||||||
public ItemStack getCraftingResult(InventoryCrafting inv) {
|
public ItemStack getCraftingResult(InventoryCrafting inv) {
|
||||||
ItemStack stack = new ItemStack(RSItems.HOLLOW_COVER, 8);
|
ItemStack stack = new ItemStack(RSItems.HOLLOW_COVER, 8);
|
||||||
|
|
||||||
ItemHollowWideCover.setItem(stack, ItemCover.getItem(inv.getStackInSlot(0)));
|
ItemHollowCover.setItem(stack, ItemCover.getItem(inv.getStackInSlot(0)));
|
||||||
|
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
@@ -1,42 +0,0 @@
|
|||||||
package com.raoulvdberge.refinedstorage.recipe;
|
|
||||||
|
|
||||||
import com.raoulvdberge.refinedstorage.RSItems;
|
|
||||||
import com.raoulvdberge.refinedstorage.item.ItemCover;
|
|
||||||
import com.raoulvdberge.refinedstorage.item.ItemHollowWideCover;
|
|
||||||
import net.minecraft.inventory.InventoryCrafting;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class RecipeHollowWideCover extends RecipeHollowCover {
|
|
||||||
@Override
|
|
||||||
public boolean matches(InventoryCrafting inv, World worldIn) {
|
|
||||||
ItemStack previousValidSlot = null;
|
|
||||||
|
|
||||||
for (int i = 0; i < 9; ++i) {
|
|
||||||
ItemStack slot = inv.getStackInSlot(i);
|
|
||||||
|
|
||||||
if (i == 4) {
|
|
||||||
if (!slot.isEmpty()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (isValid(slot, previousValidSlot)) {
|
|
||||||
previousValidSlot = slot;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getCraftingResult(InventoryCrafting inv) {
|
|
||||||
ItemStack stack = new ItemStack(RSItems.HOLLOW_WIDE_COVER, 8);
|
|
||||||
|
|
||||||
ItemHollowWideCover.setItem(stack, ItemCover.getItem(inv.getStackInSlot(0)));
|
|
||||||
|
|
||||||
return stack;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -28,8 +28,6 @@ public class CustomModelLoaderCover implements ICustomModelLoader {
|
|||||||
return CoverType.NORMAL;
|
return CoverType.NORMAL;
|
||||||
case "hollow_cover":
|
case "hollow_cover":
|
||||||
return CoverType.HOLLOW;
|
return CoverType.HOLLOW;
|
||||||
case "hollow_wide_cover":
|
|
||||||
return CoverType.HOLLOW_WIDE;
|
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"forge_marker": 1,
|
|
||||||
"defaults": {
|
|
||||||
"textures": {
|
|
||||||
"cable": "refinedstorage:blocks/cable"
|
|
||||||
},
|
|
||||||
"model": "refinedstorage:cable_core",
|
|
||||||
"uvlock": true
|
|
||||||
},
|
|
||||||
"variants": {
|
|
||||||
"inventory": [
|
|
||||||
{
|
|
||||||
"model": "refinedstorage:cable_core",
|
|
||||||
"transform": "forge:default-block"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
@@ -293,7 +293,6 @@ item.refinedstorage:security_card.owner=Bound to: %s
|
|||||||
item.refinedstorage:cutting_tool.name=Cutting Tool
|
item.refinedstorage:cutting_tool.name=Cutting Tool
|
||||||
item.refinedstorage:cover.name=Cover
|
item.refinedstorage:cover.name=Cover
|
||||||
item.refinedstorage:hollow_cover.name=Hollow Cover
|
item.refinedstorage:hollow_cover.name=Hollow Cover
|
||||||
item.refinedstorage:hollow_wide_cover.name=Hollow Wide Cover
|
|
||||||
|
|
||||||
commands.refinedstorage.createdisk.usage=/createdisk <player> <item> <metadata> <id>
|
commands.refinedstorage.createdisk.usage=/createdisk <player> <item> <metadata> <id>
|
||||||
commands.refinedstorage.createdisk.error.notADisk=The given disk item is not a disk.
|
commands.refinedstorage.createdisk.error.notADisk=The given disk item is not a disk.
|
||||||
|
Reference in New Issue
Block a user