Added hollow covers (less wide "Hollow Wide Cover")
This commit is contained in:
@@ -22,5 +22,6 @@ public final class RSItems {
|
|||||||
public static final ItemSecurityCard SECURITY_CARD = new ItemSecurityCard();
|
public static final ItemSecurityCard SECURITY_CARD = new ItemSecurityCard();
|
||||||
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 ItemHollowWideCover HOLLOW_WIDE_COVER = new ItemHollowWideCover();
|
public static final ItemHollowWideCover HOLLOW_WIDE_COVER = new ItemHollowWideCover();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,6 @@ public enum CoverType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack createStack() {
|
public ItemStack createStack() {
|
||||||
return new ItemStack(this == NORMAL ? RSItems.COVER : RSItems.HOLLOW_WIDE_COVER);
|
return new ItemStack(this == NORMAL ? RSItems.COVER : (this == HOLLOW ? RSItems.HOLLOW_COVER : RSItems.HOLLOW_WIDE_COVER));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public class RSJEIPlugin implements IModPlugin {
|
|||||||
registry.addAdvancedGuiHandlers(new AdvancedGuiHandlerGrid());
|
registry.addAdvancedGuiHandlers(new AdvancedGuiHandlerGrid());
|
||||||
|
|
||||||
registry.addRecipeRegistryPlugin(new RecipeRegistryPluginCover());
|
registry.addRecipeRegistryPlugin(new RecipeRegistryPluginCover());
|
||||||
|
registry.addRecipeRegistryPlugin(new RecipeRegistryPluginHollowCover());
|
||||||
registry.addRecipeRegistryPlugin(new RecipeRegistryPluginHollowWideCover());
|
registry.addRecipeRegistryPlugin(new RecipeRegistryPluginHollowWideCover());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
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 RecipeRegistryPluginHollowCover 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_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 hollowCover = new ItemStack(RSItems.HOLLOW_COVER);
|
||||||
|
|
||||||
|
ItemCover.setItem(hollowCover, ItemCover.getItem(stack));
|
||||||
|
|
||||||
|
return Collections.singletonList((T) new RecipeWrapperHollowCover(stack, hollowCover));
|
||||||
|
}
|
||||||
|
} else if (focus.getMode() == IFocus.Mode.OUTPUT) {
|
||||||
|
if (stack.getItem() == RSItems.HOLLOW_COVER) {
|
||||||
|
ItemStack cover = new ItemStack(RSItems.COVER);
|
||||||
|
|
||||||
|
ItemCover.setItem(cover, ItemCover.getItem(stack));
|
||||||
|
|
||||||
|
return Collections.singletonList((T) new RecipeWrapperHollowCover(cover, stack));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T extends IRecipeWrapper> List<T> getRecipeWrappers(IRecipeCategory<T> recipeCategory) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.raoulvdberge.refinedstorage.integration.jei;
|
||||||
|
|
||||||
|
import mezz.jei.api.ingredients.IIngredients;
|
||||||
|
import mezz.jei.api.recipe.wrapper.IShapedCraftingRecipeWrapper;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.items.ItemHandlerHelper;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class RecipeWrapperHollowCover implements IShapedCraftingRecipeWrapper {
|
||||||
|
private ItemStack cover;
|
||||||
|
private ItemStack hollowCover;
|
||||||
|
|
||||||
|
public RecipeWrapperHollowCover(ItemStack cover, ItemStack hollowCover) {
|
||||||
|
this.cover = ItemHandlerHelper.copyStackWithSize(cover, 1);
|
||||||
|
this.hollowCover = ItemHandlerHelper.copyStackWithSize(hollowCover, 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getIngredients(IIngredients ingredients) {
|
||||||
|
List<List<ItemStack>> inputs = new ArrayList<>();
|
||||||
|
|
||||||
|
for (int i = 0; i < 9; ++i) {
|
||||||
|
if (i == 4) {
|
||||||
|
List<ItemStack> wool = new ArrayList<>();
|
||||||
|
|
||||||
|
for (int j = 0; j < 16; ++j) {
|
||||||
|
wool.add(new ItemStack(Item.getItemFromBlock(Blocks.WOOL), 1, j));
|
||||||
|
}
|
||||||
|
|
||||||
|
inputs.add(wool);
|
||||||
|
} else {
|
||||||
|
inputs.add(Collections.singletonList(cover));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ingredients.setInputLists(ItemStack.class, inputs);
|
||||||
|
ingredients.setOutput(ItemStack.class, hollowCover);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getWidth() {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getHeight() {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
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 ItemHollowCover extends ItemCover {
|
||||||
|
public ItemHollowCover() {
|
||||||
|
super("hollow_cover");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Cover createCover(ItemStack stack) {
|
||||||
|
return new Cover(stack, CoverType.HOLLOW);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -231,6 +231,7 @@ public class ProxyClient extends ProxyCommon {
|
|||||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.QUARTZ_ENRICHED_IRON), 0, new ModelResourceLocation("refinedstorage:quartz_enriched_iron_block", "inventory"));
|
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.QUARTZ_ENRICHED_IRON), 0, new ModelResourceLocation("refinedstorage:quartz_enriched_iron_block", "inventory"));
|
||||||
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_WIDE_COVER, 0, new ModelResourceLocation("refinedstorage:hollow_wide_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));
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import com.raoulvdberge.refinedstorage.integration.oc.IntegrationOC;
|
|||||||
import com.raoulvdberge.refinedstorage.item.ItemProcessor;
|
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.RecipeHollowWideCover;
|
import com.raoulvdberge.refinedstorage.recipe.RecipeHollowWideCover;
|
||||||
import com.raoulvdberge.refinedstorage.tile.*;
|
import com.raoulvdberge.refinedstorage.tile.*;
|
||||||
import com.raoulvdberge.refinedstorage.tile.craftingmonitor.TileCraftingMonitor;
|
import com.raoulvdberge.refinedstorage.tile.craftingmonitor.TileCraftingMonitor;
|
||||||
@@ -264,6 +265,7 @@ public class ProxyCommon {
|
|||||||
registerItem(RSItems.NETWORK_CARD);
|
registerItem(RSItems.NETWORK_CARD);
|
||||||
registerItem(RSItems.SECURITY_CARD);
|
registerItem(RSItems.SECURITY_CARD);
|
||||||
registerItem(RSItems.COVER);
|
registerItem(RSItems.COVER);
|
||||||
|
registerItem(RSItems.HOLLOW_COVER);
|
||||||
registerItem(RSItems.HOLLOW_WIDE_COVER);
|
registerItem(RSItems.HOLLOW_WIDE_COVER);
|
||||||
|
|
||||||
IntegrationInventorySorter.register();
|
IntegrationInventorySorter.register();
|
||||||
@@ -312,6 +314,7 @@ public class ProxyCommon {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
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 RecipeHollowWideCover().setRegistryName(new ResourceLocation(RS.ID, "hollow_wide_cover")));
|
e.getRegistry().register(new RecipeHollowWideCover().setRegistryName(new ResourceLocation(RS.ID, "hollow_wide_cover")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package com.raoulvdberge.refinedstorage.recipe;
|
||||||
|
|
||||||
|
import com.raoulvdberge.refinedstorage.RSItems;
|
||||||
|
import com.raoulvdberge.refinedstorage.apiimpl.network.node.cover.CoverManager;
|
||||||
|
import com.raoulvdberge.refinedstorage.item.ItemCover;
|
||||||
|
import com.raoulvdberge.refinedstorage.item.ItemHollowWideCover;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.inventory.InventoryCrafting;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.crafting.IRecipe;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
public class RecipeHollowCover extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||||
|
protected boolean isValid(ItemStack slot, @Nullable ItemStack previousValidSlot) {
|
||||||
|
ItemStack currentCover = ItemCover.getItem(slot);
|
||||||
|
|
||||||
|
if (slot.getItem() == RSItems.COVER && CoverManager.isValidCover(currentCover)) {
|
||||||
|
if (previousValidSlot == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemStack previousCover = ItemCover.getItem(previousValidSlot);
|
||||||
|
|
||||||
|
return previousCover.getItem() == currentCover.getItem() && previousCover.getItemDamage() == currentCover.getItemDamage();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@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.getItem() != Item.getItemFromBlock(Blocks.WOOL)) {
|
||||||
|
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_COVER, 8);
|
||||||
|
|
||||||
|
ItemHollowWideCover.setItem(stack, ItemCover.getItem(inv.getStackInSlot(0)));
|
||||||
|
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canFit(int width, int height) {
|
||||||
|
return width == 3 && height == 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getRecipeOutput() {
|
||||||
|
return ItemStack.EMPTY;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,34 +1,13 @@
|
|||||||
package com.raoulvdberge.refinedstorage.recipe;
|
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.item.ItemCover;
|
import com.raoulvdberge.refinedstorage.item.ItemCover;
|
||||||
import com.raoulvdberge.refinedstorage.item.ItemHollowWideCover;
|
import com.raoulvdberge.refinedstorage.item.ItemHollowWideCover;
|
||||||
import net.minecraft.inventory.InventoryCrafting;
|
import net.minecraft.inventory.InventoryCrafting;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.IRecipe;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
public class RecipeHollowWideCover extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
|
||||||
private boolean isValid(ItemStack slot, @Nullable ItemStack previousValidSlot) {
|
|
||||||
ItemStack currentCover = ItemCover.getItem(slot);
|
|
||||||
|
|
||||||
if (slot.getItem() == RSItems.COVER && CoverManager.isValidCover(currentCover)) {
|
|
||||||
if (previousValidSlot == null) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
ItemStack previousCover = ItemCover.getItem(previousValidSlot);
|
|
||||||
|
|
||||||
return previousCover.getItem() == currentCover.getItem() && previousCover.getItemDamage() == currentCover.getItemDamage();
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public class RecipeHollowWideCover extends RecipeHollowCover {
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(InventoryCrafting inv, World worldIn) {
|
public boolean matches(InventoryCrafting inv, World worldIn) {
|
||||||
ItemStack previousValidSlot = null;
|
ItemStack previousValidSlot = null;
|
||||||
@@ -60,14 +39,4 @@ public class RecipeHollowWideCover extends IForgeRegistryEntry.Impl<IRecipe> imp
|
|||||||
|
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canFit(int width, int height) {
|
|
||||||
return width == 3 && height == 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getRecipeOutput() {
|
|
||||||
return ItemStack.EMPTY;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ public final class ConstantsCable {
|
|||||||
);
|
);
|
||||||
case SOUTH:
|
case SOUTH:
|
||||||
return Pair.of(
|
return Pair.of(
|
||||||
new Vector3f(16, 0, 16),
|
new Vector3f(0, 0, 14),
|
||||||
new Vector3f(0, 16, 14)
|
new Vector3f(16, 16, 16)
|
||||||
);
|
);
|
||||||
case WEST:
|
case WEST:
|
||||||
return Pair.of(
|
return Pair.of(
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ public class BakedModelCableCover implements IBakedModel {
|
|||||||
addNormalCover(quads, sprite, coverSide, hasUp, hasDown, hasEast, hasWest, handle);
|
addNormalCover(quads, sprite, coverSide, hasUp, hasDown, hasEast, hasWest, handle);
|
||||||
break;
|
break;
|
||||||
case HOLLOW:
|
case HOLLOW:
|
||||||
|
addHollowCover(quads, sprite, coverSide, hasUp, hasDown, hasEast, hasWest);
|
||||||
break;
|
break;
|
||||||
case HOLLOW_WIDE:
|
case HOLLOW_WIDE:
|
||||||
addHollowWideCover(quads, sprite, coverSide, hasUp, hasDown, hasEast, hasWest);
|
addHollowWideCover(quads, sprite, coverSide, hasUp, hasDown, hasEast, hasWest);
|
||||||
@@ -95,11 +96,11 @@ public class BakedModelCableCover implements IBakedModel {
|
|||||||
}
|
}
|
||||||
} else if (coverSide == EnumFacing.SOUTH) {
|
} else if (coverSide == EnumFacing.SOUTH) {
|
||||||
if (hasWest) {
|
if (hasWest) {
|
||||||
bounds.getRight().setX(2);
|
bounds.getLeft().setX(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasEast) {
|
if (hasEast) {
|
||||||
bounds.getLeft().setX(14);
|
bounds.getRight().setX(14);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,6 +139,210 @@ public class BakedModelCableCover implements IBakedModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void addHollowCover(List<BakedQuad> quads, TextureAtlasSprite sprite, EnumFacing coverSide, boolean hasUp, boolean hasDown, boolean hasEast, boolean hasWest) {
|
||||||
|
Pair<Vector3f, Vector3f> bounds = ConstantsCable.getCoverBounds(coverSide);
|
||||||
|
|
||||||
|
if (coverSide.getAxis() != EnumFacing.Axis.Y) {
|
||||||
|
if (hasDown) {
|
||||||
|
bounds.getLeft().setY(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasUp) {
|
||||||
|
bounds.getRight().setY(14);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Right
|
||||||
|
if (coverSide == EnumFacing.NORTH) {
|
||||||
|
if (hasWest) {
|
||||||
|
bounds.getLeft().setX(2);
|
||||||
|
} else {
|
||||||
|
bounds.getLeft().setX(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
bounds.getRight().setX(6);
|
||||||
|
} else if (coverSide == EnumFacing.SOUTH) {
|
||||||
|
if (hasEast) {
|
||||||
|
bounds.getRight().setX(14);
|
||||||
|
} else {
|
||||||
|
bounds.getRight().setX(16);
|
||||||
|
}
|
||||||
|
|
||||||
|
bounds.getLeft().setX(10);
|
||||||
|
} else if (coverSide == EnumFacing.EAST) {
|
||||||
|
bounds.getLeft().setZ(0);
|
||||||
|
bounds.getRight().setZ(6);
|
||||||
|
} else if (coverSide == EnumFacing.WEST) {
|
||||||
|
bounds.getLeft().setZ(10);
|
||||||
|
bounds.getRight().setZ(16);
|
||||||
|
} else if (coverSide == EnumFacing.DOWN || coverSide == EnumFacing.UP) {
|
||||||
|
bounds.getLeft().setZ(10);
|
||||||
|
bounds.getRight().setZ(16);
|
||||||
|
}
|
||||||
|
|
||||||
|
quads.addAll(new CubeBuilder()
|
||||||
|
.from(bounds.getLeft().getX(), bounds.getLeft().getY(), bounds.getLeft().getZ())
|
||||||
|
.to(bounds.getRight().getX(), bounds.getRight().getY(), bounds.getRight().getZ())
|
||||||
|
.addFaces(face -> new CubeBuilder.Face(face, sprite))
|
||||||
|
.bake()
|
||||||
|
);
|
||||||
|
|
||||||
|
// Left
|
||||||
|
if (coverSide == EnumFacing.NORTH) {
|
||||||
|
if (hasEast) {
|
||||||
|
bounds.getRight().setX(14);
|
||||||
|
} else {
|
||||||
|
bounds.getRight().setX(16);
|
||||||
|
}
|
||||||
|
|
||||||
|
bounds.getLeft().setX(10);
|
||||||
|
} else if (coverSide == EnumFacing.SOUTH) {
|
||||||
|
if (hasWest) {
|
||||||
|
bounds.getLeft().setX(2);
|
||||||
|
} else {
|
||||||
|
bounds.getLeft().setX(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
bounds.getRight().setX(6);
|
||||||
|
} else if (coverSide == EnumFacing.EAST) {
|
||||||
|
bounds.getRight().setZ(16);
|
||||||
|
bounds.getLeft().setZ(10);
|
||||||
|
} else if (coverSide == EnumFacing.WEST) {
|
||||||
|
bounds.getLeft().setZ(0);
|
||||||
|
bounds.getRight().setZ(6);
|
||||||
|
} else if (coverSide == EnumFacing.DOWN || coverSide == EnumFacing.UP) {
|
||||||
|
bounds.getLeft().setZ(0);
|
||||||
|
bounds.getRight().setZ(6);
|
||||||
|
}
|
||||||
|
|
||||||
|
quads.addAll(new CubeBuilder()
|
||||||
|
.from(bounds.getLeft().getX(), bounds.getLeft().getY(), bounds.getLeft().getZ())
|
||||||
|
.to(bounds.getRight().getX(), bounds.getRight().getY(), bounds.getRight().getZ())
|
||||||
|
.addFaces(face -> new CubeBuilder.Face(face, sprite))
|
||||||
|
.bake()
|
||||||
|
);
|
||||||
|
|
||||||
|
// Bottom
|
||||||
|
if (coverSide == EnumFacing.NORTH) {
|
||||||
|
bounds.getLeft().setX(6);
|
||||||
|
bounds.getRight().setX(10);
|
||||||
|
|
||||||
|
if (hasDown) {
|
||||||
|
bounds.getLeft().setY(2);
|
||||||
|
} else {
|
||||||
|
bounds.getLeft().setY(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
bounds.getRight().setY(6);
|
||||||
|
} else if (coverSide == EnumFacing.SOUTH) {
|
||||||
|
bounds.getLeft().setX(6);
|
||||||
|
bounds.getRight().setX(10);
|
||||||
|
|
||||||
|
if (hasDown) {
|
||||||
|
bounds.getLeft().setY(2);
|
||||||
|
} else {
|
||||||
|
bounds.getLeft().setY(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
bounds.getRight().setY(6);
|
||||||
|
} else if (coverSide == EnumFacing.EAST) {
|
||||||
|
bounds.getLeft().setZ(6);
|
||||||
|
bounds.getRight().setZ(10);
|
||||||
|
|
||||||
|
if (hasDown) {
|
||||||
|
bounds.getLeft().setY(2);
|
||||||
|
} else {
|
||||||
|
bounds.getLeft().setY(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
bounds.getRight().setY(6);
|
||||||
|
} else if (coverSide == EnumFacing.WEST) {
|
||||||
|
bounds.getLeft().setZ(6);
|
||||||
|
bounds.getRight().setZ(10);
|
||||||
|
|
||||||
|
if (hasDown) {
|
||||||
|
bounds.getLeft().setY(2);
|
||||||
|
} else {
|
||||||
|
bounds.getLeft().setY(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
bounds.getRight().setY(6);
|
||||||
|
} else if (coverSide == EnumFacing.DOWN || coverSide == EnumFacing.UP) {
|
||||||
|
bounds.getLeft().setZ(6);
|
||||||
|
bounds.getRight().setZ(10);
|
||||||
|
|
||||||
|
bounds.getLeft().setX(0);
|
||||||
|
bounds.getRight().setX(6);
|
||||||
|
}
|
||||||
|
|
||||||
|
quads.addAll(new CubeBuilder()
|
||||||
|
.from(bounds.getLeft().getX(), bounds.getLeft().getY(), bounds.getLeft().getZ())
|
||||||
|
.to(bounds.getRight().getX(), bounds.getRight().getY(), bounds.getRight().getZ())
|
||||||
|
.addFaces(face -> new CubeBuilder.Face(face, sprite))
|
||||||
|
.bake()
|
||||||
|
);
|
||||||
|
|
||||||
|
// Up
|
||||||
|
if (coverSide == EnumFacing.NORTH) {
|
||||||
|
bounds.getLeft().setX(6);
|
||||||
|
bounds.getRight().setX(10);
|
||||||
|
|
||||||
|
if (hasUp) {
|
||||||
|
bounds.getRight().setY(14);
|
||||||
|
} else {
|
||||||
|
bounds.getRight().setY(16);
|
||||||
|
}
|
||||||
|
|
||||||
|
bounds.getLeft().setY(10);
|
||||||
|
} else if (coverSide == EnumFacing.SOUTH) {
|
||||||
|
bounds.getLeft().setX(6);
|
||||||
|
bounds.getRight().setX(10);
|
||||||
|
|
||||||
|
if (hasUp) {
|
||||||
|
bounds.getRight().setY(14);
|
||||||
|
} else {
|
||||||
|
bounds.getRight().setY(16);
|
||||||
|
}
|
||||||
|
|
||||||
|
bounds.getLeft().setY(10);
|
||||||
|
} else if (coverSide == EnumFacing.EAST) {
|
||||||
|
bounds.getLeft().setZ(6);
|
||||||
|
bounds.getRight().setZ(10);
|
||||||
|
|
||||||
|
if (hasUp) {
|
||||||
|
bounds.getRight().setY(14);
|
||||||
|
} else {
|
||||||
|
bounds.getRight().setY(16);
|
||||||
|
}
|
||||||
|
|
||||||
|
bounds.getLeft().setY(10);
|
||||||
|
} else if (coverSide == EnumFacing.WEST) {
|
||||||
|
bounds.getLeft().setZ(6);
|
||||||
|
bounds.getRight().setZ(10);
|
||||||
|
|
||||||
|
if (hasUp) {
|
||||||
|
bounds.getRight().setY(14);
|
||||||
|
} else {
|
||||||
|
bounds.getRight().setY(16);
|
||||||
|
}
|
||||||
|
|
||||||
|
bounds.getLeft().setY(10);
|
||||||
|
} else if (coverSide == EnumFacing.DOWN || coverSide == EnumFacing.UP) {
|
||||||
|
bounds.getLeft().setZ(6);
|
||||||
|
bounds.getRight().setZ(10);
|
||||||
|
|
||||||
|
bounds.getLeft().setX(10);
|
||||||
|
bounds.getRight().setX(16);
|
||||||
|
}
|
||||||
|
|
||||||
|
quads.addAll(new CubeBuilder()
|
||||||
|
.from(bounds.getLeft().getX(), bounds.getLeft().getY(), bounds.getLeft().getZ())
|
||||||
|
.to(bounds.getRight().getX(), bounds.getRight().getY(), bounds.getRight().getZ())
|
||||||
|
.addFaces(face -> new CubeBuilder.Face(face, sprite))
|
||||||
|
.bake()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
private static void addHollowWideCover(List<BakedQuad> quads, TextureAtlasSprite sprite, EnumFacing coverSide, boolean hasUp, boolean hasDown, boolean hasEast, boolean hasWest) {
|
private static void addHollowWideCover(List<BakedQuad> quads, TextureAtlasSprite sprite, EnumFacing coverSide, boolean hasUp, boolean hasDown, boolean hasEast, boolean hasWest) {
|
||||||
Pair<Vector3f, Vector3f> bounds = ConstantsCable.getCoverBounds(coverSide);
|
Pair<Vector3f, Vector3f> bounds = ConstantsCable.getCoverBounds(coverSide);
|
||||||
|
|
||||||
@@ -162,12 +367,12 @@ public class BakedModelCableCover implements IBakedModel {
|
|||||||
bounds.getRight().setX(3);
|
bounds.getRight().setX(3);
|
||||||
} else if (coverSide == EnumFacing.SOUTH) {
|
} else if (coverSide == EnumFacing.SOUTH) {
|
||||||
if (hasEast) {
|
if (hasEast) {
|
||||||
bounds.getLeft().setX(14);
|
bounds.getRight().setX(14);
|
||||||
} else {
|
} else {
|
||||||
bounds.getLeft().setX(16);
|
bounds.getRight().setX(16);
|
||||||
}
|
}
|
||||||
|
|
||||||
bounds.getRight().setX(13);
|
bounds.getLeft().setX(13);
|
||||||
} else if (coverSide == EnumFacing.EAST) {
|
} else if (coverSide == EnumFacing.EAST) {
|
||||||
bounds.getLeft().setZ(0);
|
bounds.getLeft().setZ(0);
|
||||||
bounds.getRight().setZ(3);
|
bounds.getRight().setZ(3);
|
||||||
@@ -197,12 +402,12 @@ public class BakedModelCableCover implements IBakedModel {
|
|||||||
bounds.getLeft().setX(13);
|
bounds.getLeft().setX(13);
|
||||||
} else if (coverSide == EnumFacing.SOUTH) {
|
} else if (coverSide == EnumFacing.SOUTH) {
|
||||||
if (hasWest) {
|
if (hasWest) {
|
||||||
bounds.getRight().setX(2);
|
bounds.getLeft().setX(2);
|
||||||
} else {
|
} else {
|
||||||
bounds.getRight().setX(0);
|
bounds.getLeft().setX(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bounds.getLeft().setX(3);
|
bounds.getRight().setX(3);
|
||||||
} else if (coverSide == EnumFacing.EAST) {
|
} else if (coverSide == EnumFacing.EAST) {
|
||||||
bounds.getRight().setZ(16);
|
bounds.getRight().setZ(16);
|
||||||
bounds.getLeft().setZ(13);
|
bounds.getLeft().setZ(13);
|
||||||
@@ -229,21 +434,21 @@ public class BakedModelCableCover implements IBakedModel {
|
|||||||
if (hasDown) {
|
if (hasDown) {
|
||||||
bounds.getLeft().setY(2);
|
bounds.getLeft().setY(2);
|
||||||
} else {
|
} else {
|
||||||
bounds.getLeft().y = 0;
|
bounds.getLeft().setY(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bounds.getRight().y = 3;
|
bounds.getRight().setY(3);
|
||||||
} else if (coverSide == EnumFacing.SOUTH) {
|
} else if (coverSide == EnumFacing.SOUTH) {
|
||||||
bounds.getRight().setX(3);
|
bounds.getLeft().setX(3);
|
||||||
bounds.getLeft().setX(13);
|
bounds.getRight().setX(13);
|
||||||
|
|
||||||
if (hasDown) {
|
if (hasDown) {
|
||||||
bounds.getLeft().setY(2);
|
bounds.getLeft().setY(2);
|
||||||
} else {
|
} else {
|
||||||
bounds.getLeft().y = 0;
|
bounds.getLeft().setY(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bounds.getRight().y = 3;
|
bounds.getRight().setY(3);
|
||||||
} else if (coverSide == EnumFacing.EAST) {
|
} else if (coverSide == EnumFacing.EAST) {
|
||||||
bounds.getLeft().setZ(3);
|
bounds.getLeft().setZ(3);
|
||||||
bounds.getRight().setZ(13);
|
bounds.getRight().setZ(13);
|
||||||
@@ -251,10 +456,10 @@ public class BakedModelCableCover implements IBakedModel {
|
|||||||
if (hasDown) {
|
if (hasDown) {
|
||||||
bounds.getLeft().setY(2);
|
bounds.getLeft().setY(2);
|
||||||
} else {
|
} else {
|
||||||
bounds.getLeft().y = 0;
|
bounds.getLeft().setY(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bounds.getRight().y = 3;
|
bounds.getRight().setY(3);
|
||||||
} else if (coverSide == EnumFacing.WEST) {
|
} else if (coverSide == EnumFacing.WEST) {
|
||||||
bounds.getLeft().setZ(3);
|
bounds.getLeft().setZ(3);
|
||||||
bounds.getRight().setZ(13);
|
bounds.getRight().setZ(13);
|
||||||
@@ -262,10 +467,10 @@ public class BakedModelCableCover implements IBakedModel {
|
|||||||
if (hasDown) {
|
if (hasDown) {
|
||||||
bounds.getLeft().setY(2);
|
bounds.getLeft().setY(2);
|
||||||
} else {
|
} else {
|
||||||
bounds.getLeft().y = 0;
|
bounds.getLeft().setY(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bounds.getRight().y = 3;
|
bounds.getRight().setY(3);
|
||||||
} else if (coverSide == EnumFacing.DOWN || coverSide == EnumFacing.UP) {
|
} else if (coverSide == EnumFacing.DOWN || coverSide == EnumFacing.UP) {
|
||||||
bounds.getLeft().setZ(3);
|
bounds.getLeft().setZ(3);
|
||||||
bounds.getRight().setZ(13);
|
bounds.getRight().setZ(13);
|
||||||
@@ -289,21 +494,21 @@ public class BakedModelCableCover implements IBakedModel {
|
|||||||
if (hasUp) {
|
if (hasUp) {
|
||||||
bounds.getRight().setY(14);
|
bounds.getRight().setY(14);
|
||||||
} else {
|
} else {
|
||||||
bounds.getRight().y = 16;
|
bounds.getRight().setY(16);
|
||||||
}
|
}
|
||||||
|
|
||||||
bounds.getLeft().y = 13;
|
bounds.getLeft().setY(13);
|
||||||
} else if (coverSide == EnumFacing.SOUTH) {
|
} else if (coverSide == EnumFacing.SOUTH) {
|
||||||
bounds.getRight().setX(3);
|
bounds.getLeft().setX(3);
|
||||||
bounds.getLeft().setX(13);
|
bounds.getRight().setX(13);
|
||||||
|
|
||||||
if (hasUp) {
|
if (hasUp) {
|
||||||
bounds.getRight().setY(14);
|
bounds.getRight().setY(14);
|
||||||
} else {
|
} else {
|
||||||
bounds.getRight().y = 16;
|
bounds.getRight().setY(16);
|
||||||
}
|
}
|
||||||
|
|
||||||
bounds.getLeft().y = 13;
|
bounds.getLeft().setY(13);
|
||||||
} else if (coverSide == EnumFacing.EAST) {
|
} else if (coverSide == EnumFacing.EAST) {
|
||||||
bounds.getLeft().setZ(3);
|
bounds.getLeft().setZ(3);
|
||||||
bounds.getRight().setZ(13);
|
bounds.getRight().setZ(13);
|
||||||
@@ -311,10 +516,10 @@ public class BakedModelCableCover implements IBakedModel {
|
|||||||
if (hasUp) {
|
if (hasUp) {
|
||||||
bounds.getRight().setY(14);
|
bounds.getRight().setY(14);
|
||||||
} else {
|
} else {
|
||||||
bounds.getRight().y = 16;
|
bounds.getRight().setY(16);
|
||||||
}
|
}
|
||||||
|
|
||||||
bounds.getLeft().y = 13;
|
bounds.getLeft().setY(13);
|
||||||
} else if (coverSide == EnumFacing.WEST) {
|
} else if (coverSide == EnumFacing.WEST) {
|
||||||
bounds.getLeft().setZ(3);
|
bounds.getLeft().setZ(3);
|
||||||
bounds.getRight().setZ(13);
|
bounds.getRight().setZ(13);
|
||||||
@@ -322,10 +527,10 @@ public class BakedModelCableCover implements IBakedModel {
|
|||||||
if (hasUp) {
|
if (hasUp) {
|
||||||
bounds.getRight().setY(14);
|
bounds.getRight().setY(14);
|
||||||
} else {
|
} else {
|
||||||
bounds.getRight().y = 16;
|
bounds.getRight().setY(16);
|
||||||
}
|
}
|
||||||
|
|
||||||
bounds.getLeft().y = 13;
|
bounds.getLeft().setY(13);
|
||||||
} else if (coverSide == EnumFacing.DOWN || coverSide == EnumFacing.UP) {
|
} else if (coverSide == EnumFacing.DOWN || coverSide == EnumFacing.UP) {
|
||||||
bounds.getLeft().setZ(3);
|
bounds.getLeft().setZ(3);
|
||||||
bounds.getRight().setZ(13);
|
bounds.getRight().setZ(13);
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ public class CustomModelLoaderCover implements ICustomModelLoader {
|
|||||||
switch (modelLocation.getResourcePath()) {
|
switch (modelLocation.getResourcePath()) {
|
||||||
case "cover":
|
case "cover":
|
||||||
return CoverType.NORMAL;
|
return CoverType.NORMAL;
|
||||||
|
case "hollow_cover":
|
||||||
|
return CoverType.HOLLOW;
|
||||||
case "hollow_wide_cover":
|
case "hollow_wide_cover":
|
||||||
return CoverType.HOLLOW_WIDE;
|
return CoverType.HOLLOW_WIDE;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -292,6 +292,7 @@ item.refinedstorage:security_card.name=Security Card
|
|||||||
item.refinedstorage:security_card.owner=Bound to: %s
|
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_wide_cover.name=Hollow Wide 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>
|
||||||
|
|||||||
Reference in New Issue
Block a user